Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293760

Lower weight of classList library to optimize aggregation

$
0
0

Problem/Motivation

Currently, the default aggregation JS output looks like this:

<script src="/sites/default/files/js/js_BKcMdIbOMdbTdLn9dkUq3KCJfIKKo2SvKoQ1AnB8D-g.js"></script>

<!--[if lte IE 9]>
<script src="/sites/default/files/js/js_VhqXmo4azheUjYC30rijnR_Dddo0WjWkF27k5gTL8S4.js"></script>
<![endif]-->
<script src="/sites/default/files/js/js_Cry_2ymPxsxXR0OfM2CVnTbE0pTKEfbYOqTRKtLi0V8.js"></script>

The IE9 specific classList library in the middle results in generating 3 files in total, so browsers have to load 2-3 different files. That's because it has the same weight as other libraries and ends up below/between them.

Proposed resolution

Change the weight to -25, so it is explicitly the first and before all other elements, the result is this:

<!--[if lte IE 9]>
<script src="/sites/default/files/js/js_VhqXmo4azheUjYC30rijnR_Dddo0WjWkF27k5gTL8S4.js"></script>
<![endif]-->
<script src="/sites/default/files/js/js_gp2hn88-lr0GHwFrbN4bRDVoLZa-QiAkYi478GYUreA.js"></script>

Now browsers by default only have to load 1-2 files, we also have to generate/track fewer files in the file system.

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 293760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>