-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Create block: Use Block API version 2 #26098
Conversation
Size Change: 0 B Total Size: 1.2 MB ℹ️ View Unchanged
|
packages/create-block/lib/templates/esnext/src/index.js.mustache
Outdated
Show resolved
Hide resolved
packages/create-block/lib/templates/esnext/src/edit.js.mustache
Outdated
Show resolved
Hide resolved
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.
Can we land it before WordPress 5.6 is out? Is useBlockProps
already part of WordPress core?
We had a similar dilemma with new block categories that we couldn't include before 5.5 was out because it would fail block registration. Here it might fail a block if the Gutenberg plugin isn't installed.
@gziolo |
Based on the date of exposing the API #25642, I don't think it's available as of today for a wider audience when you consider no Gutenberg plugin installed scenario. So my point is, that we need to wait with changes to the tool until WP 5.6 is out. |
Now that we only backport bug fixes to |
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.
We will need readme.txt.mustache
templates to set the minimum version of WordPress to 5.6, plus leave a note in the changelog file to make people aware of this new restriction.
Co-authored-by: Greg Ziółkowski <[email protected]>
5f9a912
to
33c4643
Compare
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.
I applied several changes to have this PR ready to merge just after WordPress 5.6 is out.
@ellatrix, can you double-check if the proposed changes make sense?
apiVersion
is now configurable for 3rd party templates that were added recently.
I tested with:
npx wp-create-block my-esnext-block
npx wp-create-block my-es5-block -t es5
It's time to get it merged 🎉 |
Description
See #25642. Ideally all new blocks should use API version 2.
How has this been tested?
Screenshots
Types of changes
Checklist: