Try a generic block editor module#13088
Merged
youknowriad merged 22 commits intomasterfrom Feb 22, 2019
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Phase2, we'd have to load the block editor in several contexts without a dependency to a post object, this PR experiments splitting the current editor module into two module "block-editor" and "editor":
<BlockEditor value={ blocks } onChange={ onChange } settings={ settings } />Some decisions/notes about this PR
block-editorstores holds all blocks's related state (blocks, order, selection, undo/redo...)onChangecallback is called which ensure we keep track of the blocks in the editor store as well (but without any granularity). An alternative here would be to just calledit( { content: serialize( blocks ) } )instead but I didn't want to serialize on each change.core/block-editorstore directly (instead of the proxies) and should live in theblock-editormodule but I thought I leave this for a separate PR to try to limit the size of the current PR.Todo
Follow-up tasks (issues to create)
core/block-editorinstead ofcore/editor)Overall, I'm feeling optimistic that we can achieve this. I was thinking about how we can split this PR further and land parts of it before, but it seems very hard to do in multiple steps.