-
Notifications
You must be signed in to change notification settings - Fork 52
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
block.json string extraction #210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on it, it looks close to ready. I left some comments so we could decide whether we need to refine the original plan :)
Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>
Thanks for working on it @swissspidy. How can I help to make the tests pass? :) |
@gziolo I first need to get the tests setup properly running again on my machine, then I can debug them. |
Makes it more readable, and also improves message context
@gziolo Tests are passing now, so this should be ready soon 🙂 But I also just learned about WordPress/gutenberg#21490... |
Oh, interesting. It looks like more use cases pop up 😄 I don't think For this PR ✅ 🚢 |
There is now REST API endpoint for block types merged in the Gutenberg repository. It should become a part of WordPress core as part of WordPress 5.5 release. Related PR: I'm not an expert, but it looks like Edit: The schema that REST API uses follows snake_case for field names, while the |
This kind of schema would need to live somewhere outside of WordPress context, where WP-CLI and other tools can easily assess which fields in In any case, I feel like this discussion should be better held in some Gutenberg GH issue or something, and shouldn't necessarily block this PR. |
I landed changes in WordPress core WordPress/wordpress-develop@822ca9e that makes the changes I mentioned lately:
There is a corresponding PR that aligns Gutenberg code and updates RFC for block registration: WordPress/gutenberg#22695. |
@gziolo Awesome! Updated the code here accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for applying changes so quickly, everything is aligned now 🎉
It looks like JSON schema is in works for the purpose of validation in Block Directory: Where would be the best place to keep the common schema? I guess that Block Directory sooner or later would need to add its own flavors :) |
Probably on WordPress.org somewhere |
I opened a ticket in WordPress track to continue the discussion: https://core.trac.wordpress.org/ticket/50615. |
Related Gutenberg issue: WordPress/gutenberg#23636. Related WP-CLI PR: wp-cli/i18n-command#210. Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field. Props swissspidy, ocean90. Fixes #52301. git-svn-id: https://develop.svn.wordpress.org/trunk@49981 602fd350-edb4-49c9-b593-d223f7449a82
Related Gutenberg issue: WordPress/gutenberg#23636. Related WP-CLI PR: wp-cli/i18n-command#210. Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field. Props swissspidy, ocean90. Fixes #52301. git-svn-id: https://develop.svn.wordpress.org/trunk@49981 602fd350-edb4-49c9-b593-d223f7449a82
Related Gutenberg issue: WordPress/gutenberg#23636. Related WP-CLI PR: wp-cli/i18n-command#210. Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field. Props swissspidy, ocean90. Fixes #52301. Built from https://develop.svn.wordpress.org/trunk@49981 git-svn-id: http://core.svn.wordpress.org/trunk@49682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Related Gutenberg issue: WordPress/gutenberg#23636. Related WP-CLI PR: wp-cli/i18n-command#210. Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field. Props swissspidy, ocean90. Fixes #52301. Built from https://develop.svn.wordpress.org/trunk@49981 git-svn-id: https://core.svn.wordpress.org/trunk@49682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes #163.
Todo: