Classic Block: Use onReplace prop for migration actions#78113
Conversation
|
Size Change: -86 B (0%) Total Size: 7.92 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 22371b0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25595364299
|
tyxla
left a comment
There was a problem hiding this comment.
Nice simplification, thanks! 👍
I've also tested undo/redo behavior in addition to the testing instructions; everything works as expected.
🚀
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
A small follow-up to #78090.
Replaces direct
replaceBlocksdispatch inConvertToBlocksButtonandMigrationNoticewith theonReplaceprop already provided to the block edit. Also drops the redundantserialize( createBlock( 'core/freeform', { content } ) )round-trip, freeform's serializer is identity forcontent.Extracted from my ongoing work, it's an atomic change and better handled that way.
Testing Instructions
Testing Instructions for Keyboard
Same.
Use of AI Tools
None.