-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Pattern Overrides: Infer partial syncing supported blocks from the server #73889
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
base: trunk
Are you sure you want to change the base?
Pattern Overrides: Infer partial syncing supported blocks from the server #73889
Conversation
This might be worth revisiting. I haven't managed to create a pattern that includes a Navigation Link block (even with this PR applied) -- I suspect that there are some checks for other criteria that prevent that (maybe it's not possible to create patterns from the Site Editor?) At a practical level, if it's impossible to create a pattern that includes a Nav Link block, the question of whether a Nav Link block's attribute(s) should be overridable by pattern overrides becomes academic. To answer the question more generally, we should try to think of an example where a block should be supported by block bindings but not by pattern overrides. |
|
Size Change: -38 B (0%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 4f0c83e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20105513885
|
What?
Identical to #72391.
In Patterns code, infer the list of blocks supported by pattern overrides from the server (instead of a hardcoded array).
Note that this would open pattern overrides for all block attributes that are supported by block bindings.
Closes #64870.
Why?
This is one of the instances where we were still keeping a separate, hard-coded list of blocks supported by pattern overrides on the client side.
Starting with #71820, we've been using the server side as the source of truth for the list of blocks (and block attributes) supported by block bindings; it is also exposed on the client side via private block context (see #72351).
The previous version of this PR, #72391, was closed since at the time, we concluded that the list of block attributes that should be supported by pattern overrides isn't necessarily congruent with the list of block attributes that are supported by block bindings. Two examples given at the time are the Navigation Link and Navigation Submenu block's
urlattributes.How?
PARTIAL_SYNCING_SUPPORTED_BLOCKSfromisOverridableBlock, and instead check againstObject.keys( select( blockEditorStore ).getSettings()?.__experimentalBlockBindingsSupportedAttributes || {} )from the callsites ofisOverridableBlock.hasOverridableBlocks(as that depended onisOverridableBlockand additionally worked recursively), and also perform the relevant checks inline.Testing Instructions
Verify that pattern overrides still work. For example,
(from #60721)