-
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
List: avoid useSelect in block render #57077
Conversation
Size Change: -8 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in 27ae6ba. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7213417478
|
@@ -19,71 +19,72 @@ import useOutdentListItem from './use-outdent-list-item'; | |||
|
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.
not sure what you did here but I think I copied this one to button block, so you think it can be improved there too?
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.
That doesn't have a mapping useSelect because there's no outdent/indent
What?
Currently we're adding 3 useSelect store subscriptions for every list item through the indent/outdent hooks. This information is not even needed at render time, except for the controls (which are not rendered unless the block is selected). The other uses are in callbacks. Let's check the store in the callbacks and move subscriptions to the controls.
Why?
First run 16.7%
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast