Skip to content
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

Editor: Simplify block context to eliminate createInnerBlockList #6943

Closed
aduth opened this issue May 24, 2018 · 0 comments
Closed

Editor: Simplify block context to eliminate createInnerBlockList #6943

aduth opened this issue May 24, 2018 · 0 comments
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Code Quality Issues or PRs that relate to code quality [Type] Performance Related to performance efforts [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@aduth
Copy link
Member

aduth commented May 24, 2018

The createInnerBlockList function was originally added as part of #5228 in a compromise to allow a block (at the time, in blocks) to render a BlockList component via InnerBlocks, avoiding a circular dependency† between blocks and editor by passing the higher-order component through via React context.

Between core blocks being moved to their own directory (#6351) and blocks components being merged into editor (#6521), the dependency hierarchy has changed such that InnerBlocks (now in ./editor) can render a BlockList on its own. It only needs the props which are expected by the component (rootUID, renderBlockMenu). These values are simpler to pass through as context, and avoids the need for createInnerBlockList (and related caching) altogether.


† Where the dependencies would look as:

BlockList (./editor) -> Block (./blocks) -> InnerBlocks (./blocks) -> BlockList (./editor)

@aduth aduth added [Type] Task Issues or PRs that have been broken down into an individual action to take [Type] Performance Related to performance efforts [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Code Quality Issues or PRs that relate to code quality labels May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Code Quality Issues or PRs that relate to code quality [Type] Performance Related to performance efforts [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

1 participant