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 Editing Toolkit #46489

Closed
5 tasks
WunderBart opened this issue Oct 15, 2020 · 7 comments
Closed
5 tasks

Audit experimental features in Editing Toolkit #46489

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

Comments

@WunderBart
Copy link
Member

WunderBart commented Oct 15, 2020

Master tracking issue: #44251

Editing Toolkit 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 changed the title Audit experimental features in Premium Content Audit experimental features in Editing Toolkit Oct 15, 2020
@WunderBart WunderBart added the [Goal] Gutenberg Working towards full integration with Gutenberg label Oct 15, 2020
@WunderBart
Copy link
Member Author

@Automattic/cylon is this something that you could look into?

@noahtallen
Copy link
Contributor

@WunderBart I think we might need to split this across the teams who worked on each area of the codebase since we are really only familiar with dotcom-fse.

/event-countdown-block

cc @mkaz

/global-styles

cc @nosolosw

/premium-content

cc @Automattic/serenity

/wpcom-block-editor-nav-sidebar

cc @p-jackson

@WunderBart
Copy link
Member Author

Thanks for mentioning the right folks, @noahtallen! 🙌

I've split this one into separate issues (see updated description) and created a milestone for the ET. I hope this will help organize this task better.

@oandregal
Copy link
Contributor

👋 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.

@WunderBart
Copy link
Member Author

WunderBart commented Oct 19, 2020

👋 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?

👋 @nosolosw, thanks for your reply. Our goal is to make sure experimental features don't accidentally break the code that depends on them. This means either providing a fallback mechanism (i.e. like this one) or an alternative implementation as you mentioned. I didn't notice the __unstableIsEditorReady to be mentioned in the 5.6 stabilization task so I asked about adding it. Do you think you could own the #46522? I guess it's OK too if we leave it to the Create Focus Maintenance folks. I will copy your comment to #46522.

@oandregal
Copy link
Contributor

I don't think I can own that refactor but can provide support, pointers to where to start, or reviews if that's helpful to folks.

@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

5 participants