Skip to content
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

Move fontSize and lineHeight properties to typography object #1898

Conversation

ryanwelcher
Copy link
Contributor

As of WordPress 5.8, having the lineHeight and fontSize properties in the top-level supports object trigger warnings that they have been moved to supports.typography

Copy link

@mkaz mkaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good. Confirmed change 👍

@ryanwelcher
Copy link
Contributor Author

@madskristensen @fabiankaegy just wanted to get some eyes on this, please :)

@ajlende
Copy link
Contributor

ajlende commented Oct 25, 2021

I wonder if the top level ones should just be marked as deprecated instead of being removed. People using versions of WordPress prior to 5.8 should also be able to use the schema, and removing them will break the schema for them.

EDIT: To clarify, as long as the old properties still work, even if they produce a warning, I think they should still be included. When the properties are removed entirely and there is a breaking change in block.json, then we should make a new schema (a block-v2.json schema or something) that has the properties removed.

@ZebulanStanphill
Copy link

ZebulanStanphill commented Oct 25, 2021

Worth noting that JSON Schema Draft 2019-09 and later has a deprecated keyword.

@fabiankaegy
Copy link
Contributor

@ZebulanStanphill we talked about that here:

#1879 (comment)

@fabiankaegy
Copy link
Contributor

@ryanwelcher I think this is great and the addition looks correct to me. However I agree with @ajlende that we should deprecate the old way and not remove.

Also I used the block editor handbook block supports section and that was where the line height etc info was coming from. So I think we should update that also :)

@ryanwelcher
Copy link
Contributor Author

@fabiankaegy @ajlende I've added the original placements back and changed the description to explicitly say they have been deprecated and moved

@ajlende
Copy link
Contributor

ajlende commented Oct 27, 2021

 ################ Error message
>> compile    | schemas/json/block.json (draft-04)
>> Error: strict mode: unknown keyword: "typography"
##############################

This error was because the nesting was incorrect. typography should be nested under properties.supports.properties instead of properties.supports. And the exception can be removed from schema-validation.json.

(Basically just move the typography block up a line and re-indent it)

@ryanwelcher
Copy link
Contributor Author

This error was because the nesting was incorrect. typography should be nested under properties.supports.properties instead of properties.supports. And the exception can be removed from schema-validation.json.

(Basically just move the typography block up a line and re-indent it)

Thanks @ajlende! I've made the changes.

@madskristensen
Copy link
Contributor

Is this ready to be merged?

@fabiankaegy
Copy link
Contributor

@madskristensen yes 👍

@madskristensen madskristensen merged commit af6ff36 into SchemaStore:master Oct 28, 2021
@madskristensen
Copy link
Contributor

Thanks

@ryanwelcher ryanwelcher deleted the fix/update-moved-block-supports-items branch October 28, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants