Repository navigation
perf: Skip the pre-draw repair on frames without React mounts - #10263
Conversation
React can overwrite an animated value only on frames where a mount ran, so a UIManagerListener records mounts and the repair returns immediately on every other frame instead of walking all running transitions.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds React mount-write tracking to ChangesCSS transition reconciliation
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to The change limits transition repair work to frames where React may have written props, while preserving coverage for synchronous updates. No actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The pre-draw repair re-asserts every running platform transition on every frame, but React can only overwrite an animated value on frames where it wrote props. A
UIManagerListenerrecords mounts and the repair returns immediately on all other frames, so the walk over running transitions happens at write rate rather than at the display refresh rate.That matters most after a transition settles: a persistent hold keeps its entry, so without the gate every later frame the window draws keeps walking the map. Measured on an emulator during a 3s transition, 201 of 240 pre-draw callbacks returned early.
Synchronous updates run their mount item inline (
FabricUIManager.synchronouslyUpdateViewOnUIThread), bypassingMountItemDispatcher, so no listener fires for them even thoughopacityis one of the props they carry. They therefore open the gate explicitly, which makes the invariant true by construction rather than by coincidence. Measured on device, such writes are rare and always landed on a frame where a mount had already opened the gate, so this is insurance rather than an observed fix.Identical in content to #10168, which this replaces. That one was based on the head branch of #10061, and closing #10061 instead of merging it left the base pointing at a branch with no live PR, so merging would not have reached
main. GitHub refuses to change the base of a pull request that belongs to a stack, so recreating it was the only way to targetmain.