Skip to content
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

Fix: Styles that are wrapped with editor styles wrapper are not cached #18763

Conversation

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Nov 26, 2019

Fix: #18741

Description

Until now we passed the editor styles content via editor settings. The editor module transformed the CSS rules to wrap them and added them to a newly created style element on the page.
The current approach has two problems:

  • The styles are not cached and they are passed as a set every time the editor loads.
  • If the editor styles are pointing to a http(s) URL the server needs to download the styles on every page load to content before sending the styles to the client.

This PR proposes a different approach: Editor styles are enqueued to the client so they can be cached and the server does not need to download anything, as a setting we just pass the editor style URL's. On the client, we dynamically change the stylesheets to be correctly wrapped.

How has this been tested?

I checked the editor still looks as before.
Using the browser dev tools I checked the stylesheets were transformed as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.