Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Try a generic block editor module #13088
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":
Some decisions/notes about this PR
Follow-up tasks (issues to create)
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.
Dec 24, 2018
This was referenced
Dec 25, 2018
This was referenced
Dec 27, 2018
left a comment
Great work exploring the block editor module
I like that you are trying to offer a new npm package which would contain a version of the editor which could be run standalone
With all those bits moved to their own module (actions, selectors and also components in the future), what is your vision for assuring backward compatibility?
Edit: I finally found the code which proxies all actions and selectors as described in the PR:
Can you think of any downsides of using this approach? We never exposed in docs the names of actions so I assume it's okey to dispatch
These names can't be accessed unless you do some "magic" like our "applyMiddlewares". I don't consider these names or the shape of the actions as APIs (we never did).
So yes, I consider these proxies as a good upgrade path. Ideally we'd find a way to remove them at some point but this should be handled like any other deprecation (we should first discuss the strategy for core deprecations).
The fact that all the tests are passing while I didn't rewrite any of our component is pretty telling that these proxies work well to ensure backward compatibility.
This makes me think whether technically we shouldn't do the opposite and move out all pieces that are specific to the post editor. If you take a look at the list of selectors and actions they all are a post related (plus reusable blocks) after all the changes applied: https://github.com/WordPress/gutenberg/blob/f19c29377545dfdf9e1d35a279fc75a7f0911bcf/docs/designers-developers/developers/data/data-core-editor.md
To make it clear. This would be probably harder to make it backward compatible so it's more on the conceptual level than something I think we should try. It seems like the proposed split is easier in many ways. I just regret we didn't do it earlier as now we will have to live in this new proxy based world :)