Skip to content
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

Come up with a way to extract pattern-override code from the block-editor package #60619

Open
kevin940726 opened this issue Apr 10, 2024 · 0 comments · May be fixed by #60887
Open

Come up with a way to extract pattern-override code from the block-editor package #60619

kevin940726 opened this issue Apr 10, 2024 · 0 comments · May be fixed by #60887
Assignees
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@kevin940726
Copy link
Member

What problem does this address?

Originally reported in #60234 (comment).

Pattern Overrides is a WordPress-only feature. It would be nice to extract the logic and code from the block-editor package to maybe the editor package instead.

What is your proposed solution?

I haven't figured out an elegant way yet but I have some ideas.

Since that we probably shouldn't have multiple menu items with the same label, maybe we can use the label as a key to override the existing ones. For instance, the block-editor package would implement the Rename menu item normally without the overrides warning, and we'll give it a rename key.

When we try to add a new menu item with the same rename key in the editor package, then it would simply override the existing ones. This will allow us to implement the warning message there, without leaking WordPress-specific logic to the block-editor package.

@kevin940726 kevin940726 added [Type] Enhancement A suggestion for improvement. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Apr 10, 2024
@talldan talldan changed the title Come up with a way to extract pattern-overrides from the block-editor package Come up with a way to extract pattern-override code from the block-editor package Apr 16, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant