-
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
RichText: replace deprecated multiline prop with simple multiple instances #54310
Conversation
Size Change: +141 B (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
19141ec
to
9d82981
Compare
9d82981
to
67c320c
Compare
Flaky tests detected in 6adc72b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6125506189
|
I like where this is going. So basically this replaces the There are obviously some major differences here:
That said, there's necessarily changes in behavior here for third-party blocks, I would love to be able to know if people are still using this and test these blocks to know if these blocks are still behaving ok. Do you think we should try to get this in 6.4 or leave a bit more time in the plugin to solidify it? |
@youknowriad The prop is deprecated, with removal scheduled for 6.3, so my goal with this PR is to have a decent fallback instead of just removing it where paragraphs would now be treated at formats, or to fall back to a preview. I wanted something more gentle, so this solution is pretty good, because you can still edit, merge and split paragraphs and so on. But it should absolutely not be seen as a replacement. I want people to move away from this and use inner blocks. I don't want a 1:1 mapping otherwise there's no incentive for people to move away. I suspect the remaining usage of multiline is very low, so I'd love to try it for 6.4. What's the point in waiting? If we get this in now, there's plenty of time for feedback. What do you think? |
I'm all for merging but I just want to ensure that we understand how this is going to impact folks. I'd love if we can somehow get a sense of usage and just test these plugins. Maybe the 6.4 lifecycle is sufficient for this though I don't know. |
I can't find much, I tried here: https://github.com/search?q=org%3Awp-plugins+RichText+multiline&type=code&p=1 There's a small existing test for multiline, but I'll add some more e2e tests for this fallback. |
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 approving this PR.
Ack that it's very hard to know exactly how much this impact folks. It might be that it's non impactful at all. Let's just keep an eye on the next release and WP beta to ensure we address any issues (or revert if needed).
Heads up that I opened the PR wordpress-mobile/gutenberg-mobile#6181 to run the full testing suite of the native mobile version. It will help us to detect any potential breakages to that version. |
Thanks @fluiddot, I'll keep an eye. |
I added some e2e tests for a basic block registering with RichText multiline, testing typing, split and merge. |
Let's merge. I'm pretty confident that we can address issues if people who are still using it find it too rough. In my testing the change is pretty gentle though. |
Mobile tests are also passing. |
That's a really nice simplification! 🚀 |
What?
RichText's deprecated (!) multiline prop is a huge maintenance burden. It makes the rich text value much more complex and prevents us from doing a refactor to improve performance, refactor splitting/merging etc. It also makes the internal logic much more difficult to understand.
But we can't simply remove it and break people's blocks. There need to be some sort of fallback that works decently. The idea: a separate component that is multiple rich text instances with merge/split interop.
Yes, it's not a 1:1 mapping. Some things like paste will work differently, it will now be inline. But we can polish this if needed. This is still a deprecated prop after all, and block authors should be encouraged to move away from it and use InnerBlocks.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast