-
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
[PoC] Explore options for adding partial syncing of blocks with innerBlock content #56132
[PoC] Explore options for adding partial syncing of blocks with innerBlock content #56132
Conversation
…n pattern parent attribs
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
Size Change: +167 B (0%) Total Size: 1.66 MB
ℹ️ View Unchanged
|
Flaky tests detected in 7c24dec. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6872917422
|
There is a problem with this initial PoC for allowing innerBlocks in partial syncing. I am storing the innerBlocks attributes in the parent pattern, which works on the server as we can generate the block content in the editor from this, but for rendering on the frontend we don't have access to the So now looking at other options for saving the innerBlocks changes, including the idea mentioned here. |
Closing for now in favour of #56348 |
What?
Currently a hard-coded PoC to investigate how feasible it is to serialise innerBlock pattern changes into the parent patterns attributes
Why?
Some work has been done already to allow the partial syncing of pattern content by connecting block attributes, and this may form the basis of any MVP for partial syncing of patterns, but we need to investigate in advance if the approach of storing the instance specific content in the parent pattern block attributes scales to also storing changes to innerBlock content to allow partial syncing of columns, groups, galleries, etc.
How?
Stores a serialised representation of the inner blocks in the parent pattern attributes and update the given block innerblocks with these blocks when loaded.
This is very early stage and is currently just hardcoded in the List block edit method and content needs to be manually pasted into parent pattern attributes. The idea is to use the hard coding to better understand how the flows might work and then this can be abstracted out into the likes of the innerBlocksProps so it can be automatically applied across blocks.
Testing Instructions
Not easily tested yet, more details coming soon ...
Testing Instructions for Keyboard
Screenshots or screencast
sync-inner-blocks.mp4