Popover: write better docs regarding the recent API changes#44195
Merged
Popover: write better docs regarding the recent API changes#44195
Conversation
Contributor
Author
|
@mirka it would be great if you could also take a look at the dev note, as part of the review 🙏 |
This was referenced Sep 15, 2022
mirka
approved these changes
Sep 19, 2022
Member
mirka
left a comment
There was a problem hiding this comment.
I'm not sure what to do with the deprecations.md file — it looks like it hasn't been updated in some time
Yes, I think we can leave it alone at this point 😶
component also affected the
@wordpress/richt-text
Dev note looks good to me! Just one typo in the ☝️ package name here.
| ## 20.0.0 (2022-08-24) | ||
|
|
||
| ### Breaking Changes | ||
| ### Deprecations |
Member
There was a problem hiding this comment.
Thanks for also updating the old ones 🙏
f8fc360 to
9573f35
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Following up from #43691 (comment), this PR:
PopovercomponentBreaking ChangestoDeprecations@mirka I'm not sure what to do with the deprecations.md file — it looks like it hasn't been updated in some time
Dev note
Note: this dev note is a collective dev note for the recent changes to the
Popovercomponent which aimed at addressing a spike of regressions happened recently, mostly tracked in #42770The
Popovercomponent from the@wordpress/componentspackage has been mostly rewritten, in an effort to make it more stable, more reliable and more performant. While doing so, one of the main goals was to avoid introducing breaking changes. Here is the list with the main API changes:placementprop has been introduced. This prop is meant to replace the legacypositionprop (which will be marked as deprecated in the near future)anchorprop has been introduced. This prop is meant to replace all previous anchor-related props (anchorRef,anchorRect,getAnchorRect). These older anchor-related props are now marked as deprecated and are scheduled to be removed in WordPress 6.3__unstableForcePositionprop has been marked as deprecated, in favour of newflipandresizeprops. The__unstableForcePositionis currently scheduled for removal in WordPress 6.3__unstableShiftprop has been marked as deprecated, in favour of theshiftprop. The__unstableShiftis currently scheduled for removal in WordPress 6.3__unstableObserveElementprop has been removed, since it's not necessary anymore after the recent updates to thePopoverFor more details, see the updated component's README and the Storybook examples.
The changes to the
Popovercomponent also affected the@wordpress/rich-text, where a newuseAnchorhook was introduced. The previoususeAnchorRefhook has been marked as deprecated, and is scheduled to be removed in WordPress 6.3.Why?
The recent changes won't cause any breakage (apart from deprecation warnings in dev mode), and therefore should not be flagged as such.
We will flag correctly the breaking changes in future versions of Gutenberg, when we will delete those deprecated props.
How?
Editing the docs