-
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
Edit Post: Register block patterns as separate plugin #20871
Conversation
@@ -16,11 +16,16 @@ import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group'; | |||
import WelcomeGuideMenuItem from './welcome-guide-menu-item'; | |||
import BlockPatterns from './block-patterns'; | |||
|
|||
registerPlugin( 'edit-post-block-patterns', { |
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.
maybe core/edit-post/block-patterns
though I see that the other plugin doesn't respect this convention.
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.
Have you considered keeping it in its own module similar to Block Directory? This way you can prevent enqueueing the script when the experiment is disabled.
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.
That might make sense, if it allows us to keep patterns as a plugin even as we move it away from PluginSidebar
, as long as we use the right kind of Slots to integrate patterns well.
Size Change: +9 B (0%) Total Size: 856 kB
ℹ️ View Unchanged
|
Description
Alternative to #20867.
Block Patterns are at an early stage of development and have so far been built as a sidebar plugin (#20354). This PR seeks to keep Patterns true to this design decision by ensuring they are registered as an independent plugin.
This, in turn, allows Block Patterns to be trivially disabled on any installation via the Plugins API:
This change should not condition planned improvements to Block Patterns that seek to make them an integral part of the editor (e.g. their inclusion in the Inserter).
How has this been tested?
Screenshots
Types of changes
Checklist: