-
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
Fix popover deprecations #45195
Fix popover deprecations #45195
Conversation
Until today I wasn't aware (and I believe @mirka wasn't either?) that props could not be removed from React components even after marking them as deprecated and giving them a minimum notice period before removal. Specifically for Popover, not being able to delete some of those props will leave the component very bloated and harder to maintain (see the logic regarding all of the anchor-related values). We even published a Dev Note where these props have been marked for removal — does it mean that the dev note is also written incorrectly? Also, related to the whole __experimental debate that happened recently — with these anti-deletion rules in place, we are basically forced to use add (to make this clear — none of what I wrote above is a complaint aimed at you, Dan! You actually happened to notice those policies, which we had missed/misinterpreted). |
The policy definitely presents some real challenges, and as you say why there's so much unstable and experimental code.
We can always update that and say that some aspects of it have been revised, I think that would be ok. |
These changes and @talldan's reasoning look right to me!
To be clear this only applies to APIs that have made it into Core. My understanding is that the Gutenberg deprecation policy is:
And that the current Core depreciation policy is:
That last point is what was being debated in Make/Core. I don't think there's been an "official" decision about it but I suspect we'll soon (already have?) start treating experimental APIs in Core as if they were stable. There's a new |
May be too late to land this for 6.1? |
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.
Code change LGTM, thank you @talldan .
May be too late to land this for 6.1?
Breaking changes a week before the main release sounds a little risky 😅
These should be "safe" breaking changes, as Dan highlighted above:
- the
range
prop didn't have any effect on the component already - the
__unstableShift
prop was introduced after the WordPress6.0
release in this PR, and therefore never made its way to Core
I understand these policies and the reasoning behind them, but at the same time I do think that the forced accumulation of legacy code can really end up encumbering us developers working on Gutenberg daily, and potentially cause more harm to the developers ecosystem than a controlled deprecation / deletion (as said before, see for example the amount of experimental/unstable APIs introduced to circumvent the problem). I wish there was a protocol to safely make this sort of breaking changes when they are needed.
It would be quite problematic if that didn't work with props — show is the best person to talk to, in order make sure they are supported? |
@c4rl0sbr4v0 They're not breaking changes. |
Actually @talldan , do we need to apply the same treatment to the I imagine that it is ok to still mark the
Hey @bph , I made some updates to the Dev note post — could you please take a look? I wasn't sure if/how/where to add a note about the fact that the post has been updated since its initial publication. |
@ciampo To update the Dev Note, you add "Updated: date" and describe briefly the change and point to the section where the update happened. Would that work? |
Yep! I went ahead and updated the post — thank you! |
This this may have missed the boat for 6.1. I think it had to be merged yesterday before RC3 was cut. The unfortunate side effect is that I've labeled this PR now for backport to 6.1.1. @ciampo It may be worth adding to the dev note that the deprecation messages will be updated in 6.1.1. |
Yes, I think the version will have to be removed from that deprecation message. |
Updated the dev note, thank you.
Sure, I will spin up a quick PR to change the deprecation message around |
* Fix popover deprecations * Also remove from docs and types * Update changelog * Update packages/components/CHANGELOG.md Co-authored-by: Marco Ciampini <[email protected]>
* Fix popover deprecations * Also remove from docs and types * Update changelog * Update packages/components/CHANGELOG.md Co-authored-by: Marco Ciampini <[email protected]>
What?
Some popover deprecations were incorrect. This PR should fix them. I've added the backport label as the deprecation messages may be confusing for developers.
The changes are:
range
- this prop seems to have no effect, and has been that way for quite some time. It looks like it was removed in b9871c6, before Gutenberg landed in core, it seems like no functionality would ever have existed in WP core, so I've decided to remove it. It's amazing it has persisted in the codebase!__unstableShift
- this prop has never existed in WordPress core. It has been deprecated in the plugin for several releases (albeit with a confusing version number), but I think it's fine to now remove this.anchorRef
,anchorRect
,getAnchorRect
. These are stable props in WP core, so technically they cannot be removed. The deprecation message was stating they'd be removed in 6.3, so I've changed the deprecation message.Testing Instructions