Skip to content

perf: fix chat re-render hotspots, drop react-compiler bailouts#29299

Merged
chrisnojima merged 4 commits into
masterfrom
nojima/HOTPOT-msg-fixes
Jun 10, 2026
Merged

perf: fix chat re-render hotspots, drop react-compiler bailouts#29299
chrisnojima merged 4 commits into
masterfrom
nojima/HOTPOT-msg-fixes

Conversation

@chrisnojima

Copy link
Copy Markdown
Contributor

Chat thread rows: split center-context into state/actions contexts so action-only consumers skip highlight re-renders, subscribe to derived isEditing instead of the raw editing ordinal, replace the per-row team-members hook with a context-only role lookup, compute separator orange-line labels only when shown, and merge the duplicated useMessageData hooks.

The react compiler bailed out of 81 components/hooks — notably the markdown component, which re-parsed on every text row render. Move try/catch/finally, ??=, getters, dynamic imports, and render-time require()d hooks out of compiled function bodies; opt vendored zoom-toolkit out via 'use no memo'. Now 0 bailouts repo-wide.

Add yarn lint:bailouts (scripts/react-compiler-bailouts.mts) and yarn lint:all (eslint + bailouts + tsc). eslint cannot report Todo-category bailouts, so the script is the only guard against new ones.

Also fix shared-timers _removeTimer off-by-one that never cleared the first timer.

Chat thread rows: split center-context into state/actions contexts so
action-only consumers skip highlight re-renders, subscribe to derived
isEditing instead of the raw editing ordinal, replace the per-row
team-members hook with a context-only role lookup, compute separator
orange-line labels only when shown, and merge the duplicated
useMessageData hooks.

The react compiler bailed out of 81 components/hooks — notably the
markdown component, which re-parsed on every text row render. Move
try/catch/finally, ??=, getters, dynamic imports, and render-time
require()d hooks out of compiled function bodies; opt vendored
zoom-toolkit out via 'use no memo'. Now 0 bailouts repo-wide.

Add yarn lint:bailouts (scripts/react-compiler-bailouts.mts) and yarn
lint:all (eslint + bailouts + tsc). eslint cannot report Todo-category
bailouts, so the script is the only guard against new ones.

Also fix shared-timers _removeTimer off-by-one that never cleared the
first timer.

This comment was marked as outdated.

- useSafeFocusEffect: run cleanups returned by fn, clean up on blur
- react-compiler-bailouts: fail --check on parse failures, fix message

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 69 out of 69 changed files in this pull request and generated 1 comment.

Comment thread shared/common-adapters/image-icon.tsx
@chrisnojima chrisnojima merged commit 78d1745 into master Jun 10, 2026
2 checks passed
@chrisnojima chrisnojima deleted the nojima/HOTPOT-msg-fixes branch June 10, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants