-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add a document explaining the different block API versions #26277
Conversation
3d67ae4
to
2a5488a
Compare
Size Change: 0 B Total Size: 1.21 MB ℹ️ View Unchanged
|
- 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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. | |
- The generated classnames and styles are no longer added automatically to the saved markup for static blocks. | |
- To render the block element wrapper, the block author must use the `useBlockProps()` hook. | |
- To retrieve the generated classes and styles, the block author must explicitly use `useBlockProps.save()` and add to their block wrapper. |
Rewording a little. I think we could also link or reference a simple block that illustrates the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first point and the last point are the same for me. I think we should put them together because both are about the save
function.
I think we should clarify that the second point is about the edit
function (or the editor representation of the block)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
- To render the block element wrapper for the block's `edit` implementation, the block author must use the `useBlockProps()` hook.
- The generated class names and styles are no longer added automatically to the saved markup for static blocks when `save` is processed. To include them, the block author must explicitly use `useBlockProps.save()` and add to their block wrapper.
- 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
- To render the block element wrapper for the block's `edit` implementation, the block author must use the `useBlockProps()` hook.
- The generated class names and styles are no longer added automatically to the saved markup for static blocks when `save` is processed. To include them, the block author must explicitly use `useBlockProps.save()` and add to their block wrapper.
22f1b82
to
f7ab9dc
Compare
Related to #26100
This PR adds a "changelog" for block API versions.