-
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
iAPI Router: Revert "Handle styles assets on region-based navigation" #69222
iAPI Router: Revert "Handle styles assets on region-based navigation" #69222
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: +472 B (+0.03%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
@Mamaduka, it would be great if we could land this revert in WordPress 6.8. |
@cbravobernal, Gutenberg 20.4 will be part of WP 6.8, so no additional action is required. |
I just cherry-picked this PR to the release/20.3 branch to get it included in the next release: 4b7c573 |
Thanks, Fabian! 🙏 |
What?
Reverts the work done for the style assets management implementation based on
document.adoptedStyleSheets
and constructedCSSStyleSheet
instances. Specifically, the following PRs are being reverted:This feature won't be included in Gutenberg until we find a solid way to update styles between pages using the iAPI's client-side navigation.
Why?
We've found the approach using
document.adoptedStyleSheets
is unreliable, as it doesn't work for linked style sheets whose content is restricted due to CORS policies. In such a case, our current implementation can't re-create the style sheet by reading its content, throwing the following error:Moreover, a
fetch
call trying to get the text content could also fail if the CSS style sheet is served without the appropriateAccess-Control-Allow-Origin
header.For these cases, there's no way to construct a
CSSStyleSheet
instance to be included in theadoptedStyleSheets
property.