-
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
Create Block: Add multi variant #67886
base: trunk
Are you sure you want to change the base?
Conversation
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: 0 B Total Size: 1.83 MB ℹ️ View Unchanged
|
I tested this and when I add a second block with a command like this: One note, and I'm not sure if this is possible, the text domain for the new block will differ from that of the plugin. I don't see an option to specify that in the script either. Worse case, this needs to be pointed out in the documentation, which I would be happy to update if you point me in the right direction :) |
The enhancement for the text domain landed earlier today: It should be available on npm next week. Your comment made me realize that we still might want to include a note in the documentation for external templates. |
@ryanwelcher, what would be the alternative so we don't have to introduce another variant? What problems could we introduce if the multi-variant landed as an enhancement for all plugin templates? I'm fine with a new variant, but I must say it isn't ideal, as it would still scaffold only one block. That's why I thought I check with you how far are we from implementing a built-in support for scaffolding multiple blocks in one go using the interactive mode.` |
What?
Related to #25188.
This PR introduces a new
multi
variant for the create-block package that provides a starting point for building plugins that contain multiple blocks. This replaces #66485Closes #66484
Why?
Creating plugins that register multiple block is common task and this variant provides the scaffolding to do so and includes the performance tools that were released in 6.7
Testing Instructions
node packages/create-block/index.js test-plugin --variant multi
test-plugin
is created and that the block files are insrc/test-plugin