Skip to content
Snippets Groups Projects

Filter irrelevant libraries before building the cache ID.

1 unresolved thread

Closes #3443108

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
229 229 $theme_info = $this->themeManager->getActiveTheme();
230 // Add the theme name to the cache key since themes may implement
231 // hook_library_info_alter(). Additionally add the current language to
232 // support translation of JavaScript files via hook_js_alter().
233 230 $libraries_to_load = $this->getLibrariesToLoad($assets);
234 $cid = 'js:' . $theme_info->getName() . ':' . $language->getId() . ':' . Crypt::hashBase64(serialize($libraries_to_load)) . (int) (count($assets->getSettings()) > 0) . (int) $optimize;
235 231
232 // Collect all libraries that contain JS assets and are in the header.
233 // Also remove any libraries with no JavaScript from the libraries to
234 // load.
235 $header_js_libraries = [];
236 foreach ($libraries_to_load as $key => $library) {
237 [$extension, $name] = explode('/', $library, 2);
238 $definition = $this->libraryDiscovery->getLibraryByName($extension, $name);
239 if (empty($definition['js'])) {
240 unset($libraries_to_load[$key]);
  • catch added 2 commits

    added 2 commits

    • 2bd3b6b0 - Filter irrelevant libraries before building the cache ID.
    • 9162f600 - Optimize CSS case too and improve unit test coverage.

    Compare with previous version

  • catch added 1 commit

    added 1 commit

    • b4fbe760 - Optimize CSS case too and improve unit test coverage.

    Compare with previous version

  • catch added 1 commit

    added 1 commit

    • 099db8ea - Remove unneeded array item from data provider.

    Compare with previous version

  • Please register or sign in to reply
    Loading