Open ryanwelcher opened 2 years ago
core/button
blockI am trying to understand how I can contribute to this, can you provide more details? "Each block needs to have its settings property checked to confirm what properties are actually supported in the block."
Can this be automated? Because of course there will be more changes made to the block properties as the experimental features change.
If not. perhaps there should also be a checkbox in the pull request template, to encourage contributors to update the schema when they commit changes to the block.
Is this the part that needs to be updated? For each block? https://github.com/WordPress/gutenberg/pull/36746/files#diff-65c0d061536e5fa3369aba19faf1f475337c549f26828424fa224908f0bcf137R373-R394
Can this be automated? Because of course there will be more changes made to the block properties as the experimental features change.
If not. perhaps there should also be a checkbox in the pull request template, to encourage contributors to update the schema when they commit changes to the block.
I'm not sure how much we can automate here, some blocks have explicit entries in their supports
object that we can use ( i.e the button block definesborder.radius
) but other settings, such as color, are not as clear to determine if they are supported without setting up a theme.json and seeing what happens.
I have been doing this all manually for now and keeping track of it in gist files for now. This is a large initial effort but once we're done I love the idea of adding a checklist item to update the schema moving forward.
Is this the part that needs to be updated? For each block? https://github.com/WordPress/gutenberg/pull/36746/files#diff-65c0d061536e5fa3369aba19faf1f475337c549f26828424fa224908f0bcf137R373-R394
Yes! That's the example I'd refer to. Sorry it was not made clear in the issue description what needs to be done.
@ajlende it looks like some blocks ( i.e core/archives
) don't support any setting overrides at all.
In that case, I am thinking we should keep the reference to the block but add a description to it to indicate that it doesn't support any overrides.
What do you think of omething like the following? The messaging probably need some workshopping but that's the idea
"settingsBlocksPropertiesComplete": {
"type": "object",
"properties": {
"core/archives": {
"description": "As of WordPress 5.9, this block does not support any settings overrides",
"additionalProperties": false
}
}
}
I don't think it is 100% clear what a "setting override" is. I mean there is filtering the block, and then there is setting true, false or null values in theme.json, and the latter is not overriding, is it? 🤔
I don't think it is 100% clear what a "setting override" is.
Maybeblock-level settings
?
I don't think it is 100% clear what a "setting override" is. I mean there is filtering the block, and then there is setting true, false or null values in theme.json, and the latter is not overriding, is it? 🤔
I guess my thought there was that it was overriding the top-level settings
object setting in theme.json. i.e settings.border.radius
is true but then a block can disabled/override that setting with settings.block.{blockname}.border.radius
being set to false
@carolinan I added the approach above to #37778 so we can iterate there. Thanks for the feedback!
Can this be automated? Because of course there will be more changes made to the block properties as the experimental features change.
...some blocks have explicit entries in their
supports
object that we can use ( i.e the button block defines border.radius ) but other settings, such as color, are not as clear to determine if they are supported without setting up a theme.json and seeing what happens.
@carolinan I think it would be a good idea to generate the entire theme.json from source as much as we can. The tsconfig-reference seems to be the most advanced that I've seen in that aspect, so it can be used as a reference for our own automation. They generate some documentation from source, but they have a tsconfigRules.ts that augments and adds additional context to what can be generated from source.
To @ryanwelcher's point, we could maybe generate the things we can from supports
and add in the rest with a themeJsonRules.js file.
If not. perhaps there should also be a checkbox in the pull request template, to encourage contributors to update the schema when they commit changes to the block.
I would approve a PR that adds that as an easy first step for now.
Created #37780 for the checklist update.
In that case, I am thinking we should keep the reference to the block but add a description to it to indicate that it doesn't support any overrides.
What do you think of something like the following? "As of WordPress 5.9, this block does not support any settings overrides"
I think noting that in the description is better than removing the block entirely. Just a couple suggestions for workshopping the wording.
So maybe "Archive block. Display a monthly archive of your posts. This block has no block-level settings." or something?
So maybe "Archive block. Display a monthly archive of your posts. This block has no block-level settings." or something?
Works for me! I've updated the PR #37778
This issue will track the changes required to address #36630 on a per bock basis.
Each block needs to have its settings property checked to confirm what properties are actually supported in the block. For example, the
core/button
blocksborder
setting only supports theradius
property so only that property should be added to its entry under thesettingsBlocksPropertiesComplete
property - see https://github.com/WordPress/gutenberg/pull/36746/files#diff-65c0d061536e5fa3369aba19faf1f475337c549f26828424fa224908f0bcf137R373-R394Existing Blocks