-
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
Site editor: prevent blocking global styles request #61095
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +47 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
What?
There's a single global styles request that blocks all other loading and requests for the site editor:
The interesting thing is that this data is preloaded, so why is this request made?
Well, it looks like this is requested with
apiFetch
, but with theurl
option, because this is a url coming from the active theme links.gutenberg/packages/core-data/src/resolvers.js
Lines 543 to 553 in a1b07cd
Unfortunately preload data is designed to only work with the path option, and the root url middleware is loaded after preload data, so it would be a pain to fix preload data for url options.
Upon closer inspection, I noticed that this resource is only fetched to get the global styles ID for the active theme. But we already know this ID from the url, so we shouldn't need to make an additional request.
Why?
Slows down site editor load.
How?
See above
Testing Instructions
Check the network tab for the site editor.
Testing Instructions for Keyboard
Screenshots or screencast