The native React Compiler skipped ChatComposer.tsx with 17 bailouts. It now compiles and joins the strict REACT_COMPILED_FILES list: no manual memoization (29 useMemo/useCallback removed), no effects that copy values into state, and no disable comments. REACT_COMPILED_FILES_PENDING_LINT is now empty and has been deleted.
Compile fixes:
- Refs read in render: nine latest-value refs are written in
useLayoutEffect. useRestingComposerControlsLayout reads host directly.
- try/finally:
- The attachment download moved to
downloadAttachmentBlob.
- Attachment import, stash, and add use
.finally().
- The dropped-thread import uses
settlePromise.
Effects became render-time logic:
- The cursor clamp, length error, and provider-input error follow their inputs.
- Menu highlight is stored already resolved.
- The draft/thread switch reset reads from props instead of
promptRef.
- The tasks drawer and stash menu close during render.
- Recalled prompt history carries the draft key it was recalled in.
- The resting-controls measurement is one layout effect that sets state from its resize observer.
- The workspace snapshot refresh lives in
useProviderWorkspaceSnapshotRefresh. It re-checks the TTL when the user types instead of depending on prompt.
Keeping the model picker memoized. Removing the memos alone left 32 values uncached, including every prop of the model picker, so it re-rendered on each keystroke. The compiler can't cache values passed to plain functions across later hook calls. The provider selection, model options, provider state and image groups now come from small hooks marked "use memo", since they call no hooks themselves. Skills and slash commands fall back to stable empty lists.
Measured in the dev app, typing 19 characters:
| Component | Renders |
|---|
ProviderModelPicker | 0 |
ComposerPromptEditor wrapper | 0 |
ChatComposer | 19 |
| Sidebar draft preview | 20 |
Totals: 747 renders across 21 commits.
Tests: the composer helper tests, ChatView.logic and reactCompiledFiles pass. Typecheck and lint are clean.
🤖 Generated with Claude Code (Claude Opus 5.5)
Thread transfer impact#
⚠️ The latest CI run did not produce a thread transfer result for
c75a255.This comment will update automatically after the next completed run.