Skip to content
Snippets Groups Projects

Issue #1587536: JS aggregation should account for "async" and "defer"

Issue #1587536: JS aggregation should account for "async" and "defer"
2 open threads

Closes #1587536

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
854 854 # $settings['migrate_file_public_path'] = '';
855 855 # $settings['migrate_file_private_path'] = '';
856 856
857 /**
858 * JavaScript libraries with these attributes will be aggregated together.
859 */
860 $settings['aggregated_js_attributes'] = ['defer', 'async'];
  • added 1 commit

    • f610c90c - Apply 2 suggestion(s) to 2 file(s)

    Compare with previous version

  • Pierre Rudloff added 1465 commits

    added 1465 commits

    Compare with previous version

  • added 1 commit

    • bde78f55 - clearCachedDefinitions() is deprecated

    Compare with previous version

  • catch @catch started a thread on the diff
  • 33 35 // Help ensure maximum reuse of aggregate files by only grouping
    34 36 // together items that share the same 'group' value.
    35 37 $group_keys = $item['preprocess'] ? [$item['type'], $item['group']] : FALSE;
    38
    39 // Enables aggregation for 'async' or 'defer' attributes.
    40 if ($group_keys && !empty($item['attributes'])) {
    41 foreach (array_keys($item['attributes']) as $attribute_key) {
    42 if (in_array($attribute_key, Settings::get('aggregated_js_attributes', ['async', 'defer']))) {
    43 $group_keys[] = $attribute_key;
    44 }
    45 else {
    46 $group_keys = FALSE;
  • added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading