Remove VERSION from libraries.yml

Created on 14 May 2025, 23 days ago

Problem/Motivation

The version: VERSION lines in libraries.yml are creating a version query string using the Drupal Core version number for the asset files, making these files cached in the browser dependent on the Core version.

See related issue for entity_browser πŸ› Remove VERSION from libraries.yml Fixed for details.

Steps to reproduce

Inspect the loaded slim select assets using the browser's developer tools.
Currently the assets are using the following query strings:
1. slimselect.min.js (library name: slim.select)
Correctly uses the slim select library version, because it is set in code.
2. slim-select.css (library name: slim.css)
Uses asset query string generated by Drupal. This is also correct and it is due to the fact that core ignores the version key set in libraries.yml when adding the query strings for css files. See: CssCollectionRenderer::render()
3. slim-select.js (library name: select)
Incorrectly uses the Drupal core version as asset query string. This binds the asset's caching in the browser to the core version, that can cause issues when the asset is updated, but Drupal core version doesn't change.
See: JsCollectionRenderer::render()

Proposed resolution

The version: VERSION lines should be removed from all 3 libraries defined in slim_select.libraries.yml.

Remaining tasks

Remove the lines.

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium keszthelyi Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024