Skip to content

Let the React Compiler optimize six more modules - #4

Merged
afternoon merged 1 commit into
mainfrom
claude/react-compiler-errors-xvfipx
Aug 31, 2026
Merged

afternoon merged 1 commit into
mainfrom
claude/react-compiler-errors-xvfipx

Conversation

@afternoon

Copy link
Copy Markdown
Owner

The build reported seven React Compiler bailouts across six files — each one a component or hook left unoptimized. This clears all of them. Behaviour is unchanged throughout.

Refs written during render

onChangeRef.current = onChange at the top of Divider, Editor and useAutoFormat. The write moves into an effect. Nothing reads those refs before the commit: they are only touched by pointer and key handlers, CodeMirror's update listener, and debounced work, all of which run later.

try/finally, which the compiler cannot lower at all

  • DocumentsPage's rename and useDocumentSave's write already swallowed the failure in a catch, so the cleanup simply follows the try/catch.
  • useAutoFormat's debounce had no catch, so it gains one — the note above it already says a failed format is a no-op — and its early return becomes the positive branch.
  • useRenderer's render gives up early in five places, so its body moves into a nested function. The returns stay local and the pending flag clears on every path.

A note on the reported build failure

The fatal error in the deploy output was separate and is not a code problem:

Rolldown failed to resolve import "@better-auth/oauth-provider/client" from "src/authClient.ts"

bun.lock pins @better-auth/oauth-provider@1.7.2, which does export ./client, and a clean bun install builds fine. Deleting that package from node_modules reproduces the error exactly — so the local checkout has a stale install from before the package was added. bun install fixes it.

Verification

  • bun run build — clean, no compiler warnings remain
  • bun run check — passes (the one biome info is pre-existing, in src/sanitize.test.ts)
  • bun run test:unit — 422 passed
  • bun run test:e2e — 12 passed

Generated by Claude Code

The compiler skipped seven functions across six files, each for one of two
reasons it reports as a build warning.

Refs written during render — `onChangeRef.current = onChange` at the top of
Divider, Editor and useAutoFormat. The write now happens in an effect. Nothing
reads those refs before the commit: they are only touched by pointer and key
handlers, CodeMirror's update listener, and debounced work, all of which run
later.

`try`/`finally`, which the compiler cannot lower at all. Where the `catch`
already swallowed the failure, the cleanup simply follows the `try`/`catch`
(DocumentsPage's rename, useDocumentSave's write). useAutoFormat's debounce had
no `catch`, so it gains one — the note above it already says a failed format is
a no-op — and the early return becomes the positive branch. useRenderer's render
gives up early in five places, so its body moves into a nested function; the
returns stay local and the pending flag clears on every path.

Behaviour is unchanged throughout.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
htmlcsspdf a417fad Commit Preview URL

Branch Preview URL
Aug 31 2026, 09:05 PM

@afternoon
afternoon marked this pull request as ready for review August 31, 2026 21:07
@afternoon
afternoon merged commit 34a5da3 into main Aug 31, 2026
2 checks passed
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