-
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
Improve DocumentActions performance #51432
Conversation
Size Change: +46 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
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.
This is testing nicely for me:
✅ While editing a page, writing text in a paragraph block does not cause the document actions to rerender
✅ Updating the title does, so it's still reactive to page title updates
2023-06-13.12.53.41.mp4
I noticed that while editing part of a template, that the document actions appear to still re-render while typing. Would that be worth following up on separately?
2023-06-13.12.56.48.mp4
Since that appears unaffected by this PR, this LGTM as an iterative performance improvement! ✨
Just focusing on what I touched in #50857 right now. I didn't realise this happens when editing a template either... I wonder if it's just never a good idea for us to use |
What?
Follows #50857.
Similar to #51319, this updates
DocumentActions
to select the minimal amount of data required. This reduces the number of component remounts and therefore improve typing performance.Why?
How?
Before we used
useEntityRecord
which is convenient but selects the entire record—much more data than we actually need, and it changes whenever the page content is modified. Using the lower level selectors is better for our use case.Testing Instructions
Screenshots or screencast
Before:
Kapture.2023-06-13.at.12.20.42.mp4
After:
Kapture.2023-06-13.at.12.19.43.mp4