-
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
Editor: Use hooks instead of HoCs in PostTypeSupportCheck
#53235
Conversation
Size Change: -40 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
Flaky tests detected in fa8046f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5728422964
|
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.
LGTM 👍
What?
Updates
PostTypeSupportCheck
to use theuseSelect
hook rather than thewithSelect
HoC.Why?
A micro-optimization to makes the rendered component tree smaller. With the change we render one less wrapper component. Due to the usage of this component, for the post editor screen, this can add up to 9-10 times for the default core setup, rendering 9-10 fewer wrapper components.
Discovered while working on #53232, #53231, #53229, and #53228.
How?
We're using the
useSelect
hook instead of thewithSelect
HoC.Testing Instructions
Testing Instructions for Keyboard
None
Screenshots or screencast
None