Resolve #3625091: Build library elements from the asset resolver

Claude Code: opened on behalf of fago. Replaces !202 (closed): same commits, plus one commit adding an interface for the generator. !202 (closed)'s branch lives in the main project and can only be updated by a maintainer.

Issue #3625091

Changes

  • The drupal-library-* elements are built from AssetResolver::getJsAssets(), so files come in Drupal's real load order across all dependencies.
  • Elements carry static drupalSettings only: those declared by libraries or attached to the render array. Request-specific settings stay with the frontend.
  • Elements get the library_info cache tag and the languages:language_interface and theme cache contexts.
  • New DrupalLibraryElementGeneratorInterface, implemented by the generator, so the service can be decorated.

Testing

DrupalLibraryElementTest (kernel), 10 tests.

AI-Generated: Yes (Claude Code wrote the interface commit and this text)

Edited by Wolfgang Ziegler

Merge request reports

Loading
Loading