Skip to content
Snippets Groups Projects
Commit 67bcb08e authored by catch's avatar catch
Browse files

Merge branch '3397713-order-libraries' into '11.x'

Issue #3397713: [Performance regression] Starting with Drupal 10.1, some sites...

See merge request !9363
parents 09613541 48a32df1
No related branches found
No related tags found
No related merge requests found
Pipeline #267649 canceled
Pipeline: drupal

#267652

    ......@@ -190,10 +190,6 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize, ?Langua
    $options['preprocess'] = FALSE;
    }
    // Always add a tiny value to the weight, to conserve the insertion
    // order.
    $options['weight'] += count($css) / 30000;
    // CSS files are being keyed by the full path.
    $css[$options['data']] = $options;
    }
    ......@@ -319,10 +315,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize, ?Languag
    // attributes are set.
    $options['preprocess'] = $options['cache'] && empty($options['attributes']) ? $options['preprocess'] : FALSE;
    // Always add a tiny value to the weight, to conserve the insertion
    // order.
    $options['weight'] += count($javascript) / 30000;
    // Local and external files must keep their name as the associative
    // key so the same JavaScript file is not added twice.
    $javascript[$options['data']] = $options;
    ......@@ -449,7 +441,7 @@ public static function sort(array $a, array $b) {
    return 1;
    }
    else {
    return 0;
    return strcmp($a['data'], $b['data']);
    }
    }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment