Repository navigation
Removing Reakit Composite implementation - #58620
Conversation
|
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 |
| @@ -28,6 +28,10 @@ | |||
|
|
|||
There was a problem hiding this comment.
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
Compositecomponent group.Why?
We need to remove Reakit from the codebase (#53278).
How?
./legacyimplementationTesting Instructions
Open Storybook, and confirm that there are still two
Compositeentries ("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.