-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
RichText changes and custom blocks backwards compatibility for WP 5.3 #17405
Comments
Raising the priority as I'd tend to think these backwards compatibility concerns should be double checked in time for the WordPress 5.3 Beta phase, which is in a few weeks. |
@afercia Which props are you talking about? |
I believe this issue can be closed with the merge of #17439. |
@ellatrix et all, thanks for working on this. Unfortunately, seems to me not all the issues are solved. I'm pretty confused by all these changes and by the fix in #17439 and I'm not sure I can follow. I'd also like to kindly invite the team to consider that from a plugin developers perspective, the effort to keep track of this kind of changes on Gutenberg master to try to prevent potential breakages when new versions will be shipped with a WordPress release is really not sustainable. #17439 partially solves the issues on our custom blocks. However, it doesn't fix focus management which is still completely broken. When tabbing or clicking on our custom blocks, focus gets moved between blocks in an infinite loop. See the animated Gif on #17421 (comment) I'm not really sure Our blocks import the RichText that is available on WP 5.2.:
I'm not even sure which RichText is that. Honestly, as plugin developers we shouldn't even care and we expect our blocks to just work as in WordPress 5.2. Of course, we saw the deprecation warning. We'd just like to know what we are supposed to do to make sure our blocks don't break in the Gutenberg plugin and in WordPress 5.3 when it will be released 🙂 Also, how we can do that keeping backwards compatibility with WordPress 5.2., 5.1, and 5.0.
I'm very confused also in this regard. I may be wrong but see Reopening, pending feedback. |
@afercia I'll try to install Yoast SEO, but it would be great if an isolated text case could be provided to reproduce the selection issues. |
I'm trying Yoast SEO + Gutenberg master and it all seems to work fine. I can fill in every field, I can tab through them etc. The only small issue is mentioned in #17439 is that, only on click when the field is empty, the caret is hidden. But the focus is still there and you can type. Of course we should fix this, and I'll look at it asap. But other than that, I don't see any issues. Would be good to have steps to reproduce if that's not all. |
To reproduce:
Animated GIF: Same happens when tabbing through the blocks: animated GIF: Reproduced on:
and also on:
Disabling the Gutenberg plugin makes the Yoast SEO blocks focus management work again. |
Great job testing and finding all the regressions @afercia. This will ensure the next release to be more stable. Let's follow-up with other issues if we notice any other regression. |
Right! I think focus management is possible right now in a very nice way using the selection state (actions and selectors). This needs to be better documented thought. |
Describe the bug
Recent changes related to the
RichText
component (tested in Gutenberg 6.4.0) seem to break backwards compatibility with custom blocks that work on WordPress 5.2 (not sure what the Gutenberg version is there).To reproduce
keepPlaceholderOnFocus={ true }
Expected behavior
The custom blocks to work in the same way they work with the previous Gutenberg version.
Additional context
To my understanding, there are a few potential breaking changes in Gutenberg 6.4.0. Briefly:
The
RichText
is now split in two components:#15212
Also, there are several renamed props marked as “unstable”, for example
isSelected
is now__unstableIsSelected
(besidesunstableOnFocus
).Looks like there's no backwards compatibility with custom blocks that make use of the
RichText
component out of the way Gutenberg uses it. I do realise Yoast SEO implementation is "custom" but that usage ofRichText
used to be legitimate and now it breaks on Gutenberg 6.4.0. There may be other potential breakages with other plugins as well.The Yoast SEO blocks can be explored at https://github.com/Yoast/wordpress-seo/tree/trunk/js/src/structured-data-blocks
Also, the
keepPlaceholderOnFocus
prop was removed. This removal is undocumented so far. See #16733Worth also reminding that
wp.editor.RichText
is now deprecated andwp.blockEditor.RichText
should be used instead. When developers switch towp.blockEditor.RichText
they will get the newRichText
which brings in props with different names. The old props names should be translated to the new names in some way: this specific point was mentioned by @gzioloThis issue was discussed during today's weekly editor meeting on Slack, see https://wordpress.slack.com/archives/C02QB2JS7/p1568208422122500
Agreed with the Gutenberg team to create a new issue to ensure backwards compatibility.
The text was updated successfully, but these errors were encountered: