-
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
Deprecate PanelColor components #10391
Deprecate PanelColor components #10391
Conversation
Need a little direction on the failing unit test. Is there a way to tell the test to expect the deprecation warning? |
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.
Hi @chrisvanpatten thank you for creating a PR with this deprecations. I agree that this component should be deprecated so we are not shipping unused code on 5.0 and we don't have multiple UI's for color picking.
Unfortanelety our new component does not completely replace what the old components offered. I will look into adding the missing functionality to the new component so we can merge this PR 👍
Thank you for your contribution.
Thanks for picking this up @chrisvanpatten! I think to resolve the test failure it'll be something along the lines of adding |
This should pass the failing test now, but I think is likely to miss the 4.0 milestone, so the deprecation version may need to be updated. |
df8cf63
to
be81a62
Compare
Updated the version numbers with the assumption it can land in 4.1. |
1bc69c9
to
a19d510
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 think now that #10457 has been merged, this is good to go. Thanks again for picking this up @chrisvanpatten!
Thanks @talldan! 🚢 |
|
||
### Deprecation | ||
|
||
- `wp.components.PanelColor` has been deprecated in favor of `wp.editor.PanelColorSettings`. |
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.
In the context of packages
, we should avoid references to WordPress-specific globals when possible (at least for changelog). Console messaging is trickier since we can't yet customize for the WordPress context, but it's a hope there we could.
See: #9753
* Deprecate PanelColor components * Update deprecation version numbers * Fix a test broken during the rebase
Fixes #10367.
This PR deprecates
wp.components.PanelColor
andwp.editor.PanelColor
in favour ofwp.editor.PanelColorSettings
, which is a more robust component for the reasons documented in #10367:It also updates the
@wordpress/editor
and@wordpress/components
changelogs to mention the deprecation.One note is that deprecating
wp.components.PanelColor
will mean there's no component to provide a color panel that isn't wrapped insidewithColorContext
. Users who wish to have a panel with a color palette that uses a separate set of colors than what's defined withadd_theme_support('editor-color-palette');
will need to build their own panel component.As such, it may be desired to deprecate
wp.editor.PanelColor
, while keepingwp.components.PanelColor
and simply fixing the visual bug noted in #10367. However, this would be a use-case that Gutenberg itself does not need/use, so it might not be worth continuing to support.I've never done a deprecation like this… I think I got everything but would very much appreciate a close look/review 😄