This came up in #2350877: Deprecate/rename drupal_add_feed(), drupal_add_html_head(), drupal_add_html_head_link(), drupal_add_http_header(), and allow to be set declaratively in #attached, resp. #2358727: Figure out what if anything libraries API needs for #attached support
Problem/Motivation
There is currently no way to dynamically register libraries. Libraries API will certainly need to do this in contrib, and there are other use-cases as well.
You could always use hook_library_info_alter()
to also register new ones, but it results in a alter/weight hell.
Proposed resolution
Introduce a
hook_library_info_build()
which will be fired before executing hook_library_info_alter()
Remaining tasks
User interface changes
API changes
https://www.drupal.org/node/2402315
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Update the issue summary | Add the mentioned API additition and add a beta evaluation |
Beta phase evaluation
Issue priority | Critical because this blocks a stable release of Libraries API |
---|---|
Unfrozen changes | Not unfrozen. |
Prioritized changes | The main goal of this issue is to move Drupal 8 closer to a releasable state by unblocking a stable release of Libraries API. |
Disruption | Disruption is minimum because this doesn't replace existing functions. |