Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Splitting this off from #3224261: [PP-2] Front-end performance: concatenate CKEditor 5 JS assets for every unique configuration.
We should enable aggregation for all ckeditor5 assets, this will provide a baseline where we have less HTTP requests but the potential for mostly-duplicated aggregates. #3224261: [PP-2] Front-end performance: concatenate CKEditor 5 JS assets for every unique configuration and/or potentially other issues can then try to improve from there.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#12 | core-cke-aggreg-3264512-12.patch | 9.2 KB | nod_ |
| |||
#5 | core-cke-aggreg-3264512-5.patch | 9.02 KB | nod_ |
| |||
#3 | reroll_diff_3264512_2-3.txt | 6.88 KB | ankithashetty |
#3 | 3264512-3.patch | 7.56 KB | ankithashetty |
#2 | 3264512.patch | 7.56 KB | catch |
Comments
Comment #2
catchExtracting those changes from #3224261: [PP-2] Front-end performance: concatenate CKEditor 5 JS assets for every unique configuration
Comment #3
ankithashettyRerolled the patch in #2, thanks!
Comment #4
Wim LeersManual testing: 🥳
Code review
Are these changes truly necessary? They're implied by their other dependencies?
Comment #5
nod_I left ckeditor-dll.js file unaggregated so that all the ckeditor 5 plugins and translations end up in a separate aggregate from the rest of the JS on the page.
kept the added dependencies to core/ckeditor5 since the plugins need the main library to do anything, they do have a dependency on it. Implicit dependencies are bad #3244855: Regression in Drupal 9.3.x due to jQuery.once deprecation :)
Comment #6
Wim Leers#5: so … diff-wise … you only changed the very first hunk in the file?
Comment #7
nod_That is correct
Comment #8
Wim LeersÜbernit: s/ckeditor5/CKEditor 5/
Übernit: the trailing period here should be removed.
IMHO #5 is fine, and we can take it further in #3224261: [PP-2] Front-end performance: concatenate CKEditor 5 JS assets for every unique configuration.
Comment #9
Wim Leers… by which I meant to do this 🤓
Comment #10
catchckeditor5_js_alter() says it only does this for translations, not for all other assets?
Isn't it just that everything depending on the ckeditor5 library has to be loaded after this file, and because it's not aggregated, that means they get their own aggregate?
I think this is only a docs issue, but it'd be good to be clear what's going on for the next time we try to touch this.
Comment #11
nod_That is correct, in core currently it means that everything between ckeditor5-dll.js and ckeditor.js (the version4) gets it's own aggregate, when ckeditor4 is removed it's an aggregate for everything after ckeditor5-dll.js (so that includes some toolbar, bigpipe and a few others). Still better than nothing.
Comment #12
nod_Fixed the comment, ideally it's a bit more accurate.
Ideally if we could ensure that all the ckeditor 5 libraries are added at the end of the #attached array before it's being processed we could make sure that the aggregation group contains only cke5 files and would make the other aggregate probably more useful. But we don't have a way to alter the position of a library in the #attached array, and i'm not about to add a weight property to the library definition (that would work though), i'd prefer #3232810: [PP-1] Allow setting aggregation groups for js files in library definitions.
Comment #13
catchComment is much better thanks.
Yeah I think #3232810: [PP-1] Allow setting aggregation groups for js files in library definitions is worth a proper look next.
Comment #14
Wim LeersPatch review
s/javascript/JavaScript/
Missing railing period.
Manual test
Looking good, and #12 is indeed better than #4. 👍
Comment #16
catchFixed the two issues with the comment on commit.
I only copied a patch from another issue to here, so I think I'm fine to commit what's here.
Committed/pushed to 10.0.x, cherry-picked to 9.4.x and 9.3.x, thanks!
See everyone on #3232810: [PP-1] Allow setting aggregation groups for js files in library definitions!