Skip to content

Move fontSize and lineHeight properties to typography object#1898

Merged
madskristensen merged 4 commits intoSchemaStore:masterfrom
ryanwelcher:fix/update-moved-block-supports-items
Oct 28, 2021
Merged

Move fontSize and lineHeight properties to typography object#1898
madskristensen merged 4 commits intoSchemaStore:masterfrom
ryanwelcher:fix/update-moved-block-supports-items

Conversation

@ryanwelcher
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
Contributor Author

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

@ajlende
Copy link
Copy Markdown
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
Copy Markdown

ZebulanStanphill commented Oct 25, 2021

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

@fabiankaegy
Copy link
Copy Markdown
Contributor

@ZebulanStanphill we talked about that here:

#1879 (comment)

@fabiankaegy
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Is this ready to be merged?

@fabiankaegy
Copy link
Copy Markdown
Contributor

@madskristensen yes 👍

@madskristensen madskristensen merged commit af6ff36 into SchemaStore:master Oct 28, 2021
@madskristensen
Copy link
Copy Markdown
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