Skip to content

Block Editor: Enable entity-synced inner blocks.#18739

Closed
epiqueras wants to merge 3 commits into
masterfrom
add/entity-synced-inner-blocks-apis
Closed

Block Editor: Enable entity-synced inner blocks.#18739
epiqueras wants to merge 3 commits into
masterfrom
add/entity-synced-inner-blocks-apis

Conversation

@epiqueras
Copy link
Copy Markdown
Contributor

Description

This PR has changes that will be required by any block that needs to sync its serialized inner blocks to one of its entity properties.

E.g. Post Content.

The changes are as follows:

  • Add a controlled props (value/change handlers) mode to InnerBlocks so that we can sync other variables with it.
  • Make the entity save hook save freshly selected values to avoid race conditions when making "function edits". I.e. when we set a property to a function that serializes blocks to avoid serializing on every change. This change will also just make the hook more resilient under any conditions.
  • Export the serialization utility from the editor package so that blocks can use it.

How has this been tested?

These changes were extracted from #17263, where they were verified to work. They also should not break any existing functionality and will facilitate the parallel development of most full site editing blocks like Post Content and Template Part.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@epiqueras epiqueras added this to the Future milestone Nov 26, 2019
@epiqueras epiqueras self-assigned this Nov 26, 2019
@epiqueras epiqueras requested a review from aduth November 26, 2019 02:24
@epiqueras epiqueras force-pushed the add/entity-synced-inner-blocks-apis branch from f723607 to 4644703 Compare December 4, 2019 20:13
@epiqueras
Copy link
Copy Markdown
Contributor Author

This was merged as part of #19203.

@epiqueras epiqueras closed this Jan 20, 2020
@youknowriad youknowriad deleted the add/entity-synced-inner-blocks-apis branch January 21, 2020 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Package] Core data /packages/core-data [Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants