-
Notifications
You must be signed in to change notification settings - Fork 441
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
Gutenberg Server Registry Specification #1764
Comments
Would love to see some participation and help on the registration API work (there's a lot that got done there already) and the PHP APIs! Have you reviewed recently the register_block_type_from_metadata and related functions around block.json? Any further systematic construction of block attributes would need to account for
Just want to raise that this is not necessary. Client IDs are established in editing sessions but don't need to be persisted. You can see it working just fine in the collaboration prototype at #23129. There is also real-time collaboration implemented in https://asblocks.com/ |
I am ready to contribute; I would need some guidance on Graphql as that I am still new to Graphql. I am currently working on a fork for the https://github.com/wp-graphql/wp-graphql-block-editor repo; I returned the Gutenberg blocks inside a post but still testing on how I could get the block fields and configurations. The fork is available here https://github.com/wp-graphql/wp-graphql-block-editor. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
+1 Up vote! The thought occurred to me, now that ACF is under the WP Engine umbrella, maybe they would have the means to pitch in on this? Seeing as they're already saving a schema to expose to REST and make available to your plugin AND they are all-in on headless, this seems like a topic they could provide valuable insight on from the front lines. |
I wanted to share an update that we now have a living document that tracks all planned tasks related to improving Block API: WordPress/gutenberg#41236. I thought it would be a good idea to discuss what progress have been made since the issue was opened.
All core blocks are registered with PHP. The requirement for the Block Directory is to have the block registered on the server. In fact, I expect all new blocks to use
Registered on the server block types can be discovered through the REST API endpoint: https://developer.wordpress.org/rest-api/reference/block-types/.
I don’t think any block author explicitly mention that a given block supports inner blocks. It’s all based on the
We still don’t run server validation of blocks. The validation on the client is very strict and it's also tied to block deprecation that is JavaScript base. How do you envision it would work on the server?
Blocks are registered globally, but we can use only
That's would be great to bring more structure to
We still don’t store a unique ID in the database along with the block data. It’s something that might also be necessary for interactive blocks on the front end explored in https://github.com/WordPress/block-hydration-experiments. There is also an open proposal for adding A new system for simply and reliably updating HTML attributes to WordPress core that could be good enough for some to the use cases. |
Now that we got stalebot to behave, I'm marking this issue as |
I was discussing this with @jasonbahl last week. Will post a few things on some progress. So currently there are a few different approaches to using blocks in a headless fashion. The main plugins seem to be:
So there is some significant work being done in the space. Currently, I'd say none of these solutions are "correct", but there is a lot to learn from them all. I want to highlight this plugin that I found, useful for updating old blocks: https://github.com/pwkip/bulk-update-blocks |
It seems to me, this can now be done with a filter: https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/#blocks-getsavecontent-extraprops Something like this in JS:
And it seems the same can be done server side with: https://developer.wordpress.org/reference/hooks/render_block/ So the ideal way would be to add |
Problem
Gutenberg (The WordPress Block Editor) doesn't have a proper server registry for blocks. This makes it difficult for decoupled applications to interact with blocks in any meaningful way.
This issue was created to start conversation around what a specification for Server Side Registry for Gutenberg blocks might look like.
Goals
This is a WIP, but some goals off the top of my head:
Prior Art
The text was updated successfully, but these errors were encountered: