-
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
Removing Reakit Composite
implementation
#58620
Conversation
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.
Left a couple of comments, but overall the changes look good.
Should we also remove reakit
in this PR, or do you prefer to do it in a follow-up?
(also cc @mirka for an extra pair of eyes)
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core SVNIf you're a Core Committer, use this list when committing to
GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Personally I'd rather do it in a follow-up PR, if only to keep this one focused on |
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.
Nice 👍
@@ -28,6 +28,10 @@ | |||
|
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.
Also unrelated, but just spotted that we have 2 "Enhancements" sections.
Adding the Assuming that changes up to reakit removal will be part of the WordPress 6.5 release, and that the promotion of the new
|
Dev noteChanges to the underlying Composite component implementationWordPress 6.5 no longer includes the Reakit package, as it does not support React beyond v16. The What does this mean for consumers?The primary API has not changed, and can still be imported with no changes. For typical usage patterns, there should be no differences, and in most cases no action is required from consumers of the package. However, composite state props must now be generated by the import {
__unstableComposite: Composite,
__unstableCompositeGroup: CompositeGroup,
__unstableCompositeItem: CompositeItem,
__unstableUseCompositeState: useCompositeState
} from '@wordpress/components';
const state = useCompositeState({ ... });
// ✅ This will continue to work
...( <Composite { ...state } /> );
// ⛔️ This will no longer work
...( <Composite { ...state } currentId={ ... } /> ); Consumers can continue to either spread the state, or pass as a single // ✅ Used by spreading the state
...(
<Composite { ...state }>
<CompositeGroup { ...state }>
<CompositeItem { ...state }>
{ ... }
</CompositeItem>
</CompositeGroup>
</Composite>
);
// ✅ Or with a single `state` prop
...(
<Composite state={ state }>
<CompositeGroup state={ state }>
<CompositeItem state={ state }>
{ ... }
</CompositeItem>
</CompositeGroup>
</Composite>
); Because the shape of the returned composite state has changed, consumers can also now no longer destructure specific state props from // ✅ This will continue to work
const state = useCompositeState({ ... });
// ⛔️ This will no longer work
const { groups, items } = useCompositeState({ ... }); What's next?We anticipate a new stable Composite component to be released in WordPress 6.6, along with the deprecation of this unstable version. |
What?
Removes the 'unstable' Reakit implementation of the
Composite
component group.Why?
We need to remove Reakit from the codebase (#53278).
How?
./legacy
implementationTesting Instructions
Open Storybook, and confirm that there are still two
Composite
entries ("Composite" and "Composite (V2)").Note
There are no consumers of the Reakit implementation left in Gutenberg, so we have to trust that test coverage is sufficient that any switch is transparent for consumers.