-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perfs : The editor loads a HUGE amount of javascript #47619
Comments
Probably related to #36716. |
cc'ing @youknowriad @tyxla and @jsnajdr , in case this issue can be related to existing issues (or is a duplicate of an existing one) |
This has always been a constant preoccupation for all of us. We did several iterations and improvements over time but features come with a cost. So this is more like an on-going thing. There's no solution to this issue but it's something that all developers should keep in mind. For the next iterations, There are a few things we can try:
|
We could explore having a similar mechanism for loading scripts handling meta boxes only when they are required for the post editor. As of today, we always enqueue gutenberg/lib/client-assets.php Lines 215 to 217 in e5ce4e9
More in #32665. |
Is underscore.min.js even needed? I do not find evidence in the code, but it is still loaded. It may block the media library to be displayed when having CSP without unsafe-eval enabled (it is recommended to not allow unsafe-eval due to security issues). See also: jashkenas/underscore#2995 |
Underscore is still needed for the media library popup in wp-admin, which is part of the editor experience. That's how the UI template is managed. If you're just using |
I see. This means we still have CSP issues as underscore will not fix the insecure approach and media library uses underscore. Does it make sense to create a new issue for this? |
Yes, but not in Gutenberg because the actual underscore usage is in the WP core. Creating a core ticket does make sense. |
What problem does this address?
Currently, opening the editor (with just Twenty Twenty Three, no plugins) loads about 1.3 mB of javascript, which is a lot, with multiple files being over 100 kB in size. I'm wondering why so much javascript is loaded and if there's room for improvements here.
(comparatively, the list of posts has 88 kB of javascript)
Screen.Recording.2023-01-31.at.16.43.12.mov
Here's a list of the scripts and their sizes
What is your proposed solution?
I think auditing all those scripts, looking for redundancy and maybe lazyloading scripts that are not needed immediately could improve loading and rendering performances quite a lot
The text was updated successfully, but these errors were encountered: