Docx editor react large performance improvement#497
Conversation
|
@ResiDev is attempting to deploy a commit to the EigenPal Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CLA ✍️ ✅ Posted by the CLA bot. |
|
I have read the CLA Document and I hereby sign the CLA |
|
Hey @ResiDev could you rebase the PR on main? We have 1.x release and things got slightly re-orged in the repo |
|
Rebased this on current main and pushed the updated branch. I made some further changes. It focuses on reducing typing-time rerenders by splitting the heavy formatting rail out of DocxEditorToolbar, preserving selectionFormatting identity when the effective formatting has not changed, memoizing stable toolbar picker work, and stabilizing table action handler identities so callback churn does not force toolbar rerenders. From the local React Profiler typing captures, the main profile went from about 603.5ms total render time across 30 commits (20.1ms avg, 51.3ms max, 14 commits >= 10ms) to 167.6-197.5ms across 26-28 commits (6.0-7.6ms avg, 18.5-33.6ms max, 3-5 commits >= 10ms). So roughly a 67-72% reduction in total render time for this local typing sample. |
|
I did also find a fair amount of playwright failing tests - but from the ones that I checked I think they were failing before this commit too. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Is there anything more that you need me to do on this? |
Summary
Improves DocxEditor typing performance by reducing unnecessary React rerenders, redundant selection overlay updates, and avoidable layout work.
Changes
Verification
bun run typecheckbun run buildbun test packages/react/src/paged-editor/LayoutSelectionGate.test.ts packages/react/src/paged-editor/PagedEditor.tableMeasure.test.tsbun testbun run lint(passes with existing warnings)bun run format:check