This repository aims to explore block hydration patterns with the goal of absorbing as much complexity as possible from the final developers.
It's not a goal to do an in-depth analysis of the patterns, only to experiment with them in a controlled environment to assess their potential and then test them in the Gutenberg repository, where we will see if they are a good fit or not.
Ideally, the Save component should be derived from the View implementation, and developers should be able to share as much code as possible between the Edit and Save/View components.
Blocks are structured using this folders/files:
edit: User code exclusive to theEditcomponent.view: User code exclusive to theViewcomponent. It's also used as theSavecomponent.shared: User code shared betweenEditandViewcomponents.gutenberg-packages: Framework code that should be absorbed by Gutenberg packages.webpack: Bundling configuration that should be absorbed by@wordpress/scripts(doesn't exist yet).
You can follow the ongoing tasks an video updates of the current status on the Tracking issue.
If you want to use this experiments on your blocks, they will need:
- To have a
block.jsonfile. - To be registered on the server-side.
Feel free to clone this repository and inspect the code, open issues, submit PRs, suggest features or ask questions!
And if you are doing any other frontend related work, please leave a comment in this Make Core post.