#9354: fix Page Editor lag regression when clicking between mods
What does this PR do?
- Closes #9354
- Modifies
useRegisterDraftModInstanceOnAllFramesto only check for reinjection on sequence number changes- Why? The selected mod component is handled by Formik/Reload Toolbar. The only way for the other mod components to be changed is Redux modifications, which would bump the sequence number
- Refactors
useRegisterDraftModInstanceOnAllFramesto be a thunk. (Avoids calculating selectGetCleanComponentsAndDirtyFormStatesForMod, etc. on every Formik update that's committed)
Discussion
- On beta.1 build on my M1, the click into a large mod was taking 110ms. Preliminary profiling didn't point out any major bottlenecks - it seems like computation just add up
- Not sure at what number of mods shifting to a storage format of
Record<UUID, ModComponentFormState>would make a measurable/noticeable difference
For more information on our expectations for the PR process, see the code review principles doc
Playwright test results
141 passed
3 flaky
2 skipped
Details
Open report ↗︎
146 tests across 47 suites
10 minutes, 50 seconds
5883206
For more information on how to debug and view this report, see our readme
Flaky tests
chrome › tests/modLifecycle.spec.ts › create, run, package, and update mod msedge › tests/pageEditor/brickActions.spec.ts › brick actions panel behavior msedge › tests/runtime/modVariables/variableSync.spec.ts › Mod Variable Sync › session variable cross-tab sync
Skipped tests
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
Codecov Report
Attention: Patch coverage is 88.00000% with 3 lines in your changes missing coverage. Please review.
Project coverage is 75.26%. Comparing base (
8318d74) to head (5883206). Report is 429 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...or/hooks/useRegisterDraftModInstanceOnAllFrames.ts | 87.50% | 3 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #9357 +/- ##
==========================================
+ Coverage 74.24% 75.26% +1.01%
==========================================
Files 1332 1373 +41
Lines 40817 41863 +1046
Branches 7634 7773 +139
==========================================
+ Hits 30306 31509 +1203
+ Misses 10511 10354 -157
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.