Skip to content

Commit

Permalink
Add a document explaining the different block API versions
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 19, 2020
1 parent 717a6c4 commit 2a5488a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/designers-developers/developers/block-api/versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Block API Versions

This document lists the changes made between the different API versions.

## Version 2 (>= WordPress 5.6)

- Moves the responsibility to render the block element wrapper in the editor to the block author using the `useBlockProps()` hook.
- Generates classnames and styles are not added automatically to the saved markup for static blocks, block authors are required to explicitely use `useBlockProps.save()` in their `save` functions to retrieve the generated classes and styles to apply on the block wrapper.

## Version 1

Initial version.
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
"markdown_source": "../docs/designers-developers/developers/block-api/block-annotations.md",
"parent": "block-api"
},
{
"title": "Block API Versions",
"slug": "versions",
"markdown_source": "../docs/designers-developers/developers/block-api/versions.md",
"parent": "block-api"
},
{
"title": "Filter Reference",
"slug": "filters",
Expand Down
3 changes: 2 additions & 1 deletion docs/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
{ "docs/designers-developers/developers/block-api/block-transforms.md": [] },
{ "docs/designers-developers/developers/block-api/block-templates.md": [] },
{ "docs/designers-developers/developers/block-api/block-patterns.md": [] },
{ "docs/designers-developers/developers/block-api/block-annotations.md": [] }
{ "docs/designers-developers/developers/block-api/block-annotations.md": [] },
{ "docs/designers-developers/developers/block-api/versions.md": [] }
] },
{ "docs/designers-developers/developers/filters/README.md": [
{ "docs/designers-developers/developers/filters/block-filters.md": [] },
Expand Down

0 comments on commit 2a5488a

Please sign in to comment.