Active
Project:
Drupal core
Version:
main
Component:
asset library system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Feb 2020 at 14:48 UTC
Updated:
3 Aug 2022 at 20:02 UTC
Jump to comment: Most recent
If a library is depending on another library, it might also depend on a specific version of the library. For example, if core updates a library to a new major version, modules and themes depending on that library doesn't get warned about the new major version, even though it might require the module authors attention.
Allow specifying library version when depending on a library. Let's discuss if specifying version constrains should be required always when library depends on another library.
Comments
Comment #2
lauriiiComment #3
wim leersThe asset library system is completely unaware of versions in dependencies. The version information solely exists as metadata, just like for example the license information.
This would be a significant new feature.
Assigning to @nod_ to get his thoughts.
Comment #5
nod_I'm not too found of adding this type of feature, mainly because I haven't seen much of a problem with it. And I'm not sure what is exactly the goal for this: prevent installing/using something before it breaks on the client side? if yes what kind of thing do we have in mind in order to do that? prevent the module installation altogether?
We also discourage loading different version of the same libraries because it's typically not a good practice to do that : potential conflicts of badly written scripts, and performance issues).
If it is only an "information" issue to force people to pay attention I don't feel it's a good enough reason to do it. In the spirit of being explicit and keeping backward compatibility. If a new version is so different it'll beak things I might naively add a new library with a new name, and update all the dependencies with this new library.
Wouldn't mind some horror stories explaining why and how much this type of feature is needed.
At some point it'll start to look like a package manager, without any of the advantages (everything in manual in the libraries.yml)
Comment #10
greg boggsHere's a use case for us to consider:
https://www.drupal.org/project/views_bootstrap/issues/3300620
Different versions of views bootstrap support different versions of bootstrap. However, since Drupal's dependency system isn't version aware, folks who install their updates get a broken site unless they manually choose the correct versions to match their bootstrap version.
I don't know if the answer is improving this system, or using composer to manage libraries.