fix: remove render-phase React hazards - #883
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Several React Compiler diagnostics were suppressing real render-phase hazards: Tooltip mutated a ref-backed holder during render, GitStatusProvider synchronized live refs during render, TeamRuntimePanel read wall-clock time during render, and Source Control used a render-mutated ref cache. Valid clone/ref forwarding, virtualizer, TanStack, and server-rendered test-probe suppressions also lacked enough context to distinguish false positives from bugs.
Solution
Potential risks
Tooltip ref identity changes still follow React callback-ref semantics, but positioning state now ignores only the transient null and updates for a genuinely different DOM node. The runtime clock adds at most one timeout while the panel is mounted and visible; it removes the timer while hidden and during cleanup. The Source Control identity path serializes the same O(n) fields previously derived and compared on every status ping, and only parses/re-derives when the primitive key changes.
Verification
Performance verdict: lifecycle-safe and expected neutral-to-improved. No hidden-page timer remains, Git listener ownership/count is unchanged, Tooltip removes render-phase ref mutation without adding a subscription, and unchanged git-status pings no longer allocate a derived GitFile list before equality comparison.