-
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
Web page load performance #43054
Comments
This looks to be caused by The site in question is using the wp.org multisite-latest-posts block as best I can tell, thus bringing all the assets to the HTML header. |
@adamwoodnz the block Peter refers to is the one pulling in all those dependencies, for visibly no reason that I can tell. Not sure how that block was designed, but it seems superfluos for it to be rendered client side instead of server side given it seems to have no interactivity affordances. |
Related core Trac ticket: Allow scripts registered via block.json to be enqueued in the footer |
I think this is because the theme is using the You can see that in action when you click on the Download button. The |
Thanks for the feedback all, we'll discuss! |
I see this ticket was closed #17079 and Modal was mentioned as being one of the components that could benefit from a separate package. We also faced this problem trying to use Spinner. Any appetite to reopen now? Modal bundles all the functionality we need so we'd really like to continue using it. For now I'm going to see if we can improve the home page performance by only loading the download modal script on the download page. Hopefully the latest news plugin doesn't also cause the |
Something you could potentially explore would be to limit the Webpack Dependency Extraction plugin to only handle |
I think the "Multisite Latest Posts" block's |
Performance tests have improved since I posted this. Lodash removal is a definite win. We've now removed the modal code from the home page and only load it on /downloads. I'm yet to experiment with deferring scripts or tree shaking. |
@adamwoodnz can this issue be closed? It seems that remaining work is more about optimizations on the wordpress.org website side. |
Yeah I think that's fair. I still think it would be great for the general usability and widespread adoption of |
They are not really designed for frontend use cases, though. |
Description
We've started performance testing of the new wordpress.org home and download pages and we're getting low Page Speed scores due to a couple of Gutenberg related issues. This Chrome DevTools waterfall and coverage report shows them:
1. Scripts loaded in the head causing render blocking
The waterfall shows there are 9 Gutenberg scripts loaded in the head, including some large ones:
react-dom
,lodash
,date
,moment
.Is there a reason for the plugin to load so many scripts in the head or could they be moved to the end of the body like others?
2. Unused Javascript
The coverage report shows that of the 770k for the Gutenberg components script, 74.9% of it is unused.
Is any work in progress to lazy load components as required by the webpage?
Step-by-step reproduction instructions
Visit https://wordpress.org/main-test/ and https://pagespeed.web.dev/report?url=https%3A%2F%2Fwordpress.org%2Fmain-test%2F&form_factor=mobile
Observe Gutenberg scripts being loaded in the head and associated Page Speed diagnostics and opportunities.
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.1-alpha-53840 running WordPress.org Main Block Theme, 2022 theme.
Gutenberg 13.8.0
Google Chrome on MacOS, Google Page Speed
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
N/A
The text was updated successfully, but these errors were encountered: