-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Plugin: Remove replace_editor filter, extend core editor #13569
Conversation
Commented in #5670 (comment) |
27a8cd8
to
4185fc6
Compare
4185fc6
to
e7a7d5e
Compare
a65cf0c
to
b65649e
Compare
e6f47f1
to
44351ed
Compare
225d2f6
to
a9df08f
Compare
Build is green now 🎉 For what it's worth, I was having some issues with intermittent failures for the new tags end-to-end tests introduced in #13129 (cc @jorgefilipecosta). It should have been improved with #14219, so I might think it could have just been some caching problem. |
d9a4482
to
5b77a48
Compare
5b77a48
to
e3a0dd5
Compare
@jorgefilipecosta Can you please review this in mind of rebased refactor of widgets interoperability, per changes of #13511. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a set of tests with legacy widgets (including JavaScript ones), and I did not notice any difference of behavior in this version when compared with the previous one. Thank you for applying these changes that isolate the legacy widget mechanism 👍
I also did some tests with metaboxes and everything worked as before.
I left a comment regarding a dependency removal that I did not understand but other than that the changes look good to me.
@@ -299,7 +299,7 @@ function gutenberg_register_scripts_and_styles() { | |||
gutenberg_override_style( | |||
'wp-block-library', | |||
gutenberg_url( 'build/block-library/style.css' ), | |||
current_theme_supports( 'wp-block-styles' ) ? array( 'wp-block-library-theme' ) : array(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not understanding the reason for this change. I think 'wp-block-styles' should still depend on 'wp-block-library-theme' if the theme supports them.
gutenberg_override_style calls wp_register_style with the new dependencies so even if this dependency was set in core as we are registering it again we still need to pass it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have vague memories that it's done in a different way in Core and this might align both approaches. The thing is, it's not possible to call current_theme_supports
in the script loader in Core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there's a bit more of an explanation in in the extended comment description for 2282ee4 . It still exists, but it's manually enqueued in core's implementation of the block scripts and styles function:
You can confirm this adding the following snippet somewhere in a theme which adds support for wp-block-styles
(e.g. Twentynineteen):
add_action( 'enqueue_block_assets', function() {
var_export( current_theme_supports( 'wp-block-styles' ) );
var_export( wp_style_is( 'wp-block-library-theme', 'enqueued' ) );
exit;
} );
Should display "truetrue" on the editor screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the clarification @youknowriad, and @aduth.
This is handled by core in common blocks style enqueues behavior https://github.com/WordPress/wordpress-develop/blob/e421f26/src/wp-includes/script-loader.php#L2626-L2630
e3a0dd5
to
c31f85d
Compare
I did another force-push since it seemed Travis became stuck again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In think we should merge this soon so we have more time to test. In my tests I did not found any regression and the changes make sense to me (althougth I dont' have deep knowlodge in some of the areas).
Thank you for this changes and improvements 👍
Thanks for the reviews @jorgefilipecosta 👍 |
Related: #11015
This pull request seeks to eliminate Gutenberg's
replace_editor
feature, instead allowing the default core block editor to load, changing Gutenberg's behavior to instead extend the core block editor and replace the core script handles with the Gutenberg latest versions.Tasks separated out:
gutenberg_add_admin_body_class
(Plugin: Deprecate gutenberg_add_admin_body_class #13572)editor-styles.css
to editor settings by filter. (Plugin: Extract block editor styles replacement as filter #13625)_wpLoadGutenbergEditor
,gutenberg
theme supports (Plugin: Remove deprecated_wpLoadGutenbergEditor
,gutenberg
theme supports #14144)Needs confirmation as core aligned:
In fixing Loading a Classic block when visual editor is disabled in user profile #5667, Gutenberg filtersuser_can_richedit
as always true in the context of the block editor. Was this implemented in core?user_can_richedit
filtering #13608 for removal from Gutenberg.Does Gutenberg still need to extend / replace thestyles
property from the block editor settings?Gutenberg's heartbeat-to-hooks proxying must be implemented in coreConfirm whether core implemented the "Screen Options" hiding equivalent to Gutenberg'sscreen_options_show_screen
filtering