Conversation
This adds the schema defintinon to the top of the generated block.json file: "$schema": "https://json.schemastore.org/block.json", This makes it easier to work with the `block.json` file in devleopment, with supported editors it offers tooltips, autocomplete, and schema validation.
|
Size Change: 0 B Total Size: 1.07 MB ℹ️ View Unchanged
|
ajlende
left a comment
There was a problem hiding this comment.
I'm a little hesitant to add a URL that isn't a wordpress.org URL as the default in a generator, but maybe I'm just being overly sensitive about it. The schema can be really helpful and this will help folks find it easier, so 👍 from me.
|
@ajlende I think it is ok since it is "purely sugar" no functionality will break if the URL disappears, and I can't imagine a security scenario if the URL came under malicious control. |
Out of curiosity, how much work it would be to keep the schema in Gutenberg repository, possibly inside I love the idea of having a schema that could be used for validation and I'd be in favor in tighter integration into the existing tooling. One immediate idea for a follow-up for this PR would be to run https://github.com/WordPress/gutenberg/blob/trunk/bin/test-create-block.sh |
Description
This adds the schema defintinon to the top of the generated block.json
file:
This makes it easier to work with the
block.jsonfile in devleopment,with supported editors it offers tooltips, autocomplete, and schema
validation.
How has this been tested?
To test:
Types of changes
Updates the create-block script to add the $schema definition.
No functional change, an improvement for development.