Skip to content

Blocks: Support reusable nested blocks#5010

Closed
aduth wants to merge 5 commits intomasterfrom
fix/nested-reusable-blocks
Closed

Blocks: Support reusable nested blocks#5010
aduth wants to merge 5 commits intomasterfrom
fix/nested-reusable-blocks

Conversation

@aduth
Copy link
Copy Markdown
Member

@aduth aduth commented Feb 12, 2018

In-Progress: Generally complete and working, but needs a close audit of revisions to reusable blocks APIs, as it is possible / likely that redundant data is being tracked.

This pull request seeks to resolves issues with saving a nested block as reusable.

This includes a number of revisions to...

  1. Support innerBlocks in reusable-specific block factory methods, store effects, and reducers
  2. Move context assignment of inner block list from BlockListBlock to BlockEdit, as the latter is the component used in rendering from core/block's edit
    • Downside is a circular dependency from blocks to editor, as BlockEdit requires access to the BlockList component
  3. Update reusable block UI behaviors to not abort editing when the block becomes deselected, as this is incompatible with nested blocks where selection changes to the inner block
  4. Assign custom store key for components connected via the data module's query higher-order component, as this can otherwise conflict with other store-dependant wrappers.
    • The Reusable Block components depend on editor store directly, and while this is generally unadvisable and worth refactoring, we maybe shouldn't assume that multiple stores would not be present in plugin-implemented blocks.

Future Tasks:

We arguably ought to consolidate the block and reusable block object types, as there's a fair bit of redundancy between the two, evidenced by copying of behaviors from the original nested blocks implementation.

Testing instructions:

Verify there are no regressions in the behavior of reusable blocks.

Ensure that you can save a Columns block, including content, as a reusable block.

Ensure unit tests pass:

npm test

Prevents conflicts with connected components competing for shared store
In nested context, block selection changes from reusable block to the inner block being edited, but we want to keep the UI shown
@aduth aduth added [Feature] Blocks Overall functionality of blocks [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Feb 12, 2018
@aduth
Copy link
Copy Markdown
Member Author

aduth commented Feb 23, 2018

Superseded by #5228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Blocks Overall functionality of blocks [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant