Blocks: Set default 'apiVersion' for client-side registration#70750
Blocks: Set default 'apiVersion' for client-side registration#70750
Conversation
d9873af to
55f9a1e
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +10 B (0%) Total Size: 1.89 MB
ℹ️ View Unchanged
|
| const bootstrappedBlockType = select.getBootstrappedBlockType( name ); | ||
|
|
||
| const blockType = { | ||
| apiVersion: 1, |
There was a problem hiding this comment.
Like we see by needing to update a bunch of tests, this might break some tests or any custom extension logic that performs strict checking of block type.
With that in mind, should we potentially document it as a breaking change in the package?
There was a problem hiding this comment.
This is more like internal breaking change, shouldn’t affect most of consumers. But I’ll add changelog entry.
tyxla
left a comment
There was a problem hiding this comment.
LGTM 👍
Good to go after adding a CHANGELOG entry.
|
Thanks for the feedback, @tyxla! |
|
As an aside, I think we're being unreasonably conservative with The The Shouldn't we expect all blocks to be compatible with v3 by now? Each version bump is triggered by exactly one change, a rather minor one for most block authors. Is this what @t-hamano aims for with #70743 and related PRs? |
I wish that were the case. However, there are still many blocks that are incompatible with iframes. We've had to revert push for iframed editors, almost every major release I can recall. Issue #70743 is an attempt to find some common ground and encourage developers to make their blocks compatible. |
It's the same in my memory 😅 Personally, I think it would be ok to change the default api version from 1 to 3 if we publish a dev note. |
…ess#70750) * Blocks: Set default 'apiVersion' for client-side registration * Add changelong entry Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
What?
PR updates block type processing helper function and sets the default -
apiVersion: 1.Why?
apiVersionis always defined during block registration.Testing Instructions
registerBlockTypefunction.apiVersionset -wp.blocks.getBlockType( 'test/block-api-version' );.Example Block
Testing Instructions for Keyboard
Same.