Problem/Motivation

With modules that add many small js files (such as the upcomming ckeditor5) we need to make sure groups are relatively stable to make use of the aggregate generation.

Steps to reproduce

Install the ckeditor 5 module, add a few different toolbar configuration and see what it does to the aggregates.

Proposed resolution

Find an algorithm that makes groups stable enough, taking into account number of groups and size of group.

Describe a few use-cases we want to optimize for, each use-case should define:

  1. Modules installed
  2. Types of users involved
  3. List of pages to visit

Then for each scenario we look at the following measurements before/after:

  1. Number of generated JS files
  2. Total size of the generated JS files
  3. For each page/user role: the number of js files and their sizes
  4. Number of time a group is used (the higher the better)

What we optimize for should be (in order):

  1. Maximum Group reuse (prevent expensive aggregate generation in Drupal)
  2. Minimum number of groups per page (optimize end-user performance by limiting http requests)
  3. Size of the groups (optimize end-user performance by limiting amount of JS sent)

Remaining tasks

Do the thing.

Release notes snippet

Issue fork drupal-3227837

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nod_ created an issue. See original summary.

nod_’s picture

Issue summary: View changes

wim leers’s picture

I sense an interesting asset library dependency graph-powered algorithm 🤓

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.