-
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
Patterns: Pass 'blocks' as inner blocks value #65029
Conversation
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @rdoughbs. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
Size Change: -9 B (0%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
Flaky tests detected in f802f2d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10695530248
|
@talldan, @SantosGuillamot, all e2e tests are green. How's the test coverage of pattern overrides? I think some manual testing also won't hurt in this case. |
f802f2d
to
e843d6d
Compare
Pretty good, mostly thanks to @kevin940726's efforts. I'll give this a manual test too. |
Thank you, @talldan!
Could you share the testing steps afterward? I would like to include them in the PR description for future reference. |
I've done a bit of manual testing, and everything seems to be working as expected. But I'll leave it to @talldan for a final approval. Some things I tested: This issue is solved
Pattern overrides keep working as expected
Blocks with the same name are synced
Undo/Redo still work after clicking reset
|
Thanks, it's also working well for me. I carried out similar steps to @SantosGuillamot who was very thorough! A few other tests I did:
There's one issue I'm seeing with a double block icon when an overridden block is selected, but it's not from this PR (I'll spin up a separate PR for it). |
Thank you both for testing! I've updated the PR description to include details for future reference; feel free to edit it if I missed something. |
@rdoughbs mind sharing your WordPress.org username so I can ensure its included in the 6.7 credits listing? |
What?
Fixes #63909.
Fixes #64514.
PR updates Pattern (Reusable) block to use value for inner blocks provided by the
useEntityBlockEditor
hook. It prevents infinite loops when a child blocks updates attributes inside effects on the mount.Why?
The attribute update will result in a new
innerBlocks
value from the store, triggering an internal block synchronization. This synchronization, in turn, re-mounts child blocks, starting the whole cycle again.The "fresh" client IDs from inner blocks are only need to set block editing mode. See #60721 (comment).
Testing Instructions
See #65029 (comment)
Testing Instructions for Keyboard
Same.