Repository navigation
Create Block: Add multi variant - #67886
ryanwelcher wants to merge 2 commits into
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.` |
|
Implemented in #69446. Thank you for starting the efforts 😄 |
What?
Related to #25188.
This PR introduces a new
multivariant 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 multitest-pluginis created and that the block files are insrc/test-plugin