-
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
Improve PagePanels performance #51319
Conversation
Extract BlockQuickNavigation out of ContentBlocksList and BlockInspectorLockedBlocks so that we're not repeating the same code that outputs a list of block navigation links.
9669ca8
to
8d84d9c
Compare
Size Change: +142 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Flaky tests detected in e0e70c4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5249819257
|
@noisysocks, can you rebase this on top of the trunk now that #51281 is merged 🙇 |
…panels-performance
Done! |
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.
Thanks, @noisysocks!
* DRY up ContentBlocksList and BlockInspectorLockedBlocks Extract BlockQuickNavigation out of ContentBlocksList and BlockInspectorLockedBlocks so that we're not repeating the same code that outputs a list of block navigation links. * Add back check that ensures list items don't appear in list * Remove unnecessary CSS * Reduce amount of rerendering * Update __experimentalGetGlobalBlocksByName * Improve PagePanels performance
What?
Requires #51281.
Updates the
PagePanels
component added in #50857 to select the minimal amount of data required. This reduces the number of component remounts and therefore improve typing performance.Why?
Gotta go fast.
How?
Before we used
useEntityRecord
which is convenient but selects the entire record—much more data than we actually need! Using the lower level selectors is better for our use case.Testing Instructions
Screenshots
Before:
Kapture.2023-06-08.at.16.02.04.mp4
After:
Kapture.2023-06-08.at.16.03.13.mp4