Block API: stabilize light block hook#25642
Conversation
youknowriad
left a comment
There was a problem hiding this comment.
I agree it's stable enough but the other question is whether we'd also rename the "lightBlockWrapper": true as apiVersion: 2 top-level on the settings in order to be able to do similar changes on the future?
|
I like versioning it |
85fd04c to
d2d432d
Compare
|
Size Change: -41 B (0%) Total Size: 1.18 MB
ℹ️ View Unchanged
|
|
The only thing needed before stabilisation is #25644. |
|
I like the idea of an |
b3d24ff to
28c1c86
Compare
5b4697a to
1375643
Compare
youknowriad
left a comment
There was a problem hiding this comment.
This is looking good for me.
I think we'd need some good documentation about this for the release and in the handbook.
8dd382f to
7b23e31
Compare
7b23e31 to
8db8143
Compare
|
|
||
| Undocumented declaration. | ||
|
|
||
| <a name="useBlockProps" href="#useBlockProps">#</a> **useBlockProps** |
There was a problem hiding this comment.
Noting that useBlockProps.save isn't documented. I guess it's too late to expose it under its own name.
There was a problem hiding this comment.
We discussed this and we preferred to use that notation because we'll have the same thing for innerblocks, richtext, and each one of this have a version for edit and for save.
And we plan to document this properly see the PR description here #26100
There was a problem hiding this comment.
Cool, makes sense to follow the same pattern, although it isn't ideal moving forward :)
There was a problem hiding this comment.
What's not ideal moving forward?
There was a problem hiding this comment.
The dot notation that takes advantage of the fact that a function is also an object in JS.
Description
Blocked by #25644.
This is solid and ready to be used by plugins.
Remaining questions:
Rename toYesuseBlockProps? Inner blocks: try hook approach #25633 (comment)Keep theVersionlightBlockWrappersupports key or introduce versioning?After this we should update documentation with the new recommended API, e.g. https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/.
How has this been tested?
Screenshots
Types of changes
Checklist: