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
|
Removing the "In Progress" label. Aside from #14144, I'm considering this as ready for review. I had some trouble with the end-to-end tests, specifically around the animations disabling. I think 44351ed should make this more durable. The review should essentially be verifying that anything we were previously doing is respected still. Most of the additional filtering was extracted to separate pull requests. Most of the removed code should now be represented otherwise as part of the default |
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. |
jorgefilipecosta
left a comment
There was a problem hiding this comment.
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.
| 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.
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.
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.
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.
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. |
jorgefilipecosta
left a comment
There was a problem hiding this comment.
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_editorfeature, 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.cssto editor settings by filter. (Plugin: Extract block editor styles replacement as filter #13625)_wpLoadGutenbergEditor,gutenbergtheme supports (Plugin: Remove deprecated_wpLoadGutenbergEditor,gutenbergtheme 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_richeditas always true in the context of the block editor. Was this implemented in core?user_can_richeditfiltering #13608 for removal from Gutenberg.Does Gutenberg still need to extend / replace thestylesproperty 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_screenfiltering