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

Audit experimental features in ET/global-styles #46522

Closed
1 task
WunderBart opened this issue Oct 16, 2020 · 3 comments
Closed
1 task

Audit experimental features in ET/global-styles #46522

WunderBart opened this issue Oct 16, 2020 · 3 comments
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task

Comments

@WunderBart
Copy link
Member

Master tracking issue: #44251
ET tracking issue: #46489

global-styles is dependant on experimental features without a fallback for a scenario where such a feature is not supported anymore. Below is a list of usages that we need to update in this matter:

@WunderBart WunderBart added the [Goal] Gutenberg Working towards full integration with Gutenberg label Oct 16, 2020
@WunderBart
Copy link
Member Author

cc @nosolosw

@WunderBart
Copy link
Member Author

From #46489 (comment):

👋 I've received the pings and would like to understand how can I help here: is it your goal to audit if an unstable/experimental usage is ok or does it need updating based on WordPress 5.6 stabilization task?

This is what I can say about the code for Global Styles: apparently, __unstableIsEditorReady was introduced as a patch specific for WordPress.com/iframed editor at #40690 It is an API that will remain as it is for the time being, so it's safe to keep using it.

In case the goal was to remove any unstable/experimental API. From what I gathered reading that issue, it looks like the problem was that the stylesheet generated in the client by the Global Styles plugin upon user changes needs to be appended after Gutenberg's own editor styles (which is somehow messed up by the iframed editor). This is what's happening:

  1. GS (server) sends to the block editor some pre-calculated styles via the block_editor_settings, so they are wrapped by the .editor-style-wrapper.
  2. GS (client) adds a new styleshet with new styles if the user made any changes. This needs to be loaded after 1.

A few alternatives that come to mind to get rid of the __unstableIsEditorReady would be:

  • given that user changes can only happen when the sidebar is mounted, etc, is there any other editor event this can be hooked to?
  • change how the styles work for the editor: do not send the existing pre-calculated styles and instead generate them all in the client.

@sirreal
Copy link
Member

sirreal commented Nov 27, 2020

Closing this as of #47712 / p4TIVU-9xW-p2

@sirreal sirreal closed this as completed Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task
Projects
None yet
Development

No branches or pull requests

3 participants