Skip to content

Bump oxc-transform-react to 0.158.0 and pin its compiler fixes - #553

Merged
acusti merged 21 commits into
mainfrom
claude/tender-goldberg-w368ch
Nov 12, 2026
Merged

acusti merged 21 commits into
mainfrom
claude/tender-goldberg-w368ch

Conversation

@acusti

@acusti acusti commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Bumps oxc-transform-react from 0.156.0 to 0.158.0 in @acusti/vite-plugin-react-compiler (exact pin). The root and docs devDependency ranges move with it, so bun hoists a single copy.

It skips 0.157.0, whose new bail-outs 0.158.0 removes again (oxc-project/oxc#28820). In Outlyne, those bail-outs would have left components uncompiled in 8 files.

The PR lands as 21 commits on top of main:

  1. the 0.158.0 bump with its changeset, with the 0.157.0 triage in its commit message
  2. 13 pins, one per fix that landed in 0.157.0
  3. an it.fails for an asserted allocation that #27427 misses
  4. two regression guards for 0.157.0's bail-outs, which fail against 0.157.0
  5. an it.fails for the remaining skip, below
  6. a pin for 0.158.0's non-ASCII ref panic fix
  7. an AGENTS.md section documenting how to vet a bindings bump
  8. a README commit describing that vetting to users

Every commit passes the plugin suite against 0.158.0.

Each item below was checked by running identical inputs through the bindings with the plugin's own transform() options (jsx: 'preserve', reactCompiler: {}, plus reportDiagnostics and panicThreshold where noted). Runtime claims come from rendering each input in sequence in React 19 (happy-dom), with clicks where relevant. Each input was rendered four ways: uncompiled, 0.156.0, 0.157.0 or 0.158.0, and babel-plugin-react-compiler@1.0.0 (with @babel/core 7).

What changes for users of 0.11.0 (0.156.0 → 0.158.0)

One new skip that can fail builds (it.fails)

A component or hook is now skipped when all of these hold:

  • it keeps the result of a call it passes a callback to
  • that callback reassigns one of the component's own variables
  • the call sits inside an if, a loop, a switch, a ternary or &&

It was already skipped outside those. The diagnostic is "Cannot reassign variable after render completes", and under panicThreshold: 'critical_errors' or 'all_errors' it fails the build. A discarded result still compiles.

statement (cb is (m) => { warning = m; }) 0.156.0 0.157.0 / 0.158.0 Babel 1.0.0 / experimental
if (touched) valid = validate(value, cb); compiles skipped compiles
valid = touched ? validate(value, cb) : true; compiles skipped compiles
valid = touched && validate(value, cb); compiles skipped compiles
for (const r of rules) valid = validate(r, cb); compiles skipped compiles
switch (touched) { case true: valid = validate(value, cb); } compiles skipped compiles
if (touched) { validate(value, cb); } (result discarded) compiles compiles compiles
valid = validate(value, cb); (unconditional) skipped skipped skipped

The skip comes from oxc-project/oxc#26893's rewrite of the check. The latest experimental React Compiler build (0.0.0-experimental-a1856f3-20260507) compiles these cases too, so as far as a published build shows, this is a divergence from React Compiler. Outlyne's 2,096 files have no instance of it.

An it.fails test asserts that the if case compiles. An upstream report is drafted but not filed yet; its answer decides whether that test stays an it.fails or becomes a plain pin of the skip. The changeset leads with this skip.

0.157.0's bail-outs are gone (regression guards)

0.157.0 skipped two shapes in which a callback reassigns a variable declared in another callback, and failed builds on them under panicThreshold:

  • an async function reassigning such a variable, like let socket; (async () => { socket = await connect(url); })(); in an effect
  • a function returning the result of a callback that reassigns its own local or parameter, like return items.map((item) => { n += 1; … }) or return fetchPage(page).then((next) => { rows = rows.concat(next); … })

0.158.0 includes oxc-project/oxc#28820 (fixing oxc-project/oxc#28401), which limits the check to bindings declared in the component or hook. All six inputs from the earlier review compile again, and so do the 8 Outlyne files 0.157.0 would have skipped.

Two plain tests guard against the regression coming back: LoadAll and the useSocket effect each fail against 0.157.0 and pass against 0.156.0 and 0.158.0.

Runtime miscompiles fixed (landed in 0.157.0)

Every 0.156.0 output below renders differently from the uncompiled component, and every 0.158.0 output matches it.

Fix 0.156.0 behavior Babel 1.0.0
oxc-project/oxc#27420: memo block keyed on an input it reassigns a clamped prop reuses an earlier render's output; quantity 3 after 5, with 3 in stock, still says "Only 3 in stock" same bug
oxc-project/oxc#27421: variable reassigned in a loop inside a memo block not restored when the block is skipped, so the "first error" link becomes # same bug
oxc-project/oxc#27418: value set in a branch next to an early return on a flag cached once per mount, so the status stays "Saving" same bug
oxc-project/oxc#27422: useRef inline in a memoized object (not pinned) only called when the object rebuilds; "Should have a queue" on the next render same bug
oxc-project/oxc#27427: allocation in a useMemo result new Set() shared across dependency changes, so impressions stop tracking same bug
oxc-project/oxc#27426: value only passed to a state setter during render memoization dropped; "Too many re-renders" same bug
oxc-project/oxc#27423: callback reading ref.current when the ref isn't recognized (boxRef ?? ownRef) guard reads ref.current.offsetWidth during render and throws on mount same bug
oxc-project/oxc#27070: property read in a JSX callback guard reads user.id during render and throws once user is null same bug
oxc-project/oxc#27424: nextId.current++ evaluates to the new value, so ids start at 1; a bigint counter throws same bug
oxc-project/oxc#27425: heights[index++ % columns] += h (not pinned) target evaluated twice; heights land in the wrong columns same bug
oxc-project/oxc#27428: { ['__proto__']: label } (not pinned) printed as a plain __proto__ key; the entry vanishes same bug
oxc-project/oxc#26161: BigInt literals printed as undefined; arithmetic throws skips the function
oxc-project/oxc#26519: component inside a factory callback outlined out of the factory's scope: "renderItem is not defined" same bug

Three rows aren't pinned, because nothing in this repo or its 12,712 dependency files has their shapes:

  • #27428: no computed '__proto__' key.
  • #27425: only pure keys, like parts[parts.length - 1] += x, which behave the same on both versions.
  • #27422: the inline hooks that do exist, like ref: React.useCallback(…), don't change output, and no corpus file moves a hook out of a memo block.

Now compiled (pinned)

Non-ASCII ref panic (pinned)

A ref-like name that starts with a non-ASCII letter (élanRef, 한글Ref) panics 0.156.0 and 0.157.0, which aborts the process, a dev server included. 0.158.0 compiles it (oxc-project/oxc#28758), as Babel 1.0.0 does. Against older bindings, the test aborts the Vitest worker.

It's pinned despite having no corpus instance, because a regression would take the process down. The existing unreachable-catch pin is there for the same reason.

Also in 0.158.0

Known gap (it.fails)

#27427 misses an allocation wrapped in a TypeScript assertion. seen: [] as string[] or new Set() as Set<string> is still cached once per mount, as on 0.156.0 and with Babel 1.0.0.

Not pinned

README and AGENTS.md

README: new "Bindings version" section under Usage. It says what each release is checked against:

  • the pinned tests and known gaps
  • a comparison of every JS/TS file in the repo and its dependencies, compiled with the old and new bindings
  • runtime checks against the uncompiled code and Babel 1.0.0

It also says a release is skipped in favor of the next one that fixes it when its regressions outweigh its fixes. Regressions that ship anyway, and changes to what compiles because the new behavior is correct, are called out in the changelog and tracked in the upstream-tracking suite.

README: "Why this exists" no longer says a plain Vite + React app has nothing to gain from the plugin. @vitejs/plugin-react 6.1.2's compiler: true uses oxc-transform-react as an optional peer dependency (^0.152.0) that the app installs and vets itself.

AGENTS.md: new "Bumping oxc-transform-react" section, after "Dependency upgrades". It writes down the procedure behind the README's promises:

  • triaging upstream between the crate tags
  • comparing the repo, node_modules and Outlyne in both modes
  • the runtime comparison
  • what to pin, and how to prove a pin against the old bindings
  • the regressions-versus-fixes decision
  • writing the changeset from the last shipped bindings version

Corpora

Corpus Files 0.156.0 → 0.158.0, default mode compilationMode: 'all'
This repo 119 2 code diffs: MonthCalendar.tsx (#27420; it no longer misses its cache on every render without a title) and useStyles.ts (#27424, same behavior) diffs from #27420 and #27424, plus one newly compiled function (#26893)
Dependencies (every JS/TS file ≤ 2 MB, compiled under a path outside node_modules) 12,712 2 code diffs, both #27420 (Storybook) 250 code diffs, 6 compile-status flips
Outlyne (every tracked JS/TS file, with its own plugin options, which are the defaults) 2,096 15 code diffs; no file changes its diagnostics, compile status or fatal status 57 code diffs, 1 compile-status flip (newly compiled)

The six compile-status flips in the dependency corpus under 'all':

  • 3 newly compiled: superPropBase, semver's makeSafeRegex, react-docgen's getTypeParameters.
  • 3 newly skipped:
    • two copies of yaml's stringifyDocument, by the remaining skip
    • rolldown's replacePlugin, which mutates its own argument in a forEach callback, a real violation

Outlyne on 0.157.0 would have added diagnostics in 8 files and left components uncompiled in at least 2 of them. Six of the 8 were on its async or returned-callback bail-outs: EmbedRenderer, Video, WorkspaceProvider, SectionDialog, media-picker Uploads and useBookingFlow.

Outlyne's 15 code diffs on 0.158.0 come from two changes:

  • Coarser cache guards (#27070): Projects, LayoutButtonEditor, PageHeaderLogoTypeEditor, MenuManager and MessagingAvailability key on project, section, settings, menu and availability in place of property paths read in callbacks.
  • Newly memoized values, mostly ones passed to state setters during render (#27426): BookingTerms, PageLinkEditor, PricingPopover, SubmissionsPopover, VideoPosterEditor, WebsiteSettings, Uploads, useSyncHealth, PromptUsageMeter and utils/media.ts.

media.ts now memoizes a value that reads a module-level cache during render. Its own fetch still updates the value, through mediaURL. The one difference is timing: when another instance caches an entry first, the slot now picks it up only once its own fetch resolves. Separately, that reading turned up a duplicate-request bug in the same hook, fixed in outlyne/outlyne#3056.

No input threw, crashed, or changed fatal status on any version.

Tests

upstream.test.ts gains 16 plain tests and 2 it.fails tests, verified by aliasing oxc-transform-react to older installs:

  • 0.156.0: exactly the 13 pins fail, and so does the remaining-skip it.fails, since 0.156.0 compiles its input.
  • 0.157.0: exactly the 2 regression guards fail.
  • The panic pin: it aborts the worker against both.
  • Existing tests: all 36 pass on every version.

Validated on the rebased head with:

  • bun install --frozen-lockfile
  • bun run build
  • bun run buildall (including the Storybook build)
  • bun run test (729 passed, 2 expected fail)
  • bun run lint
  • bun run tsc
  • bun run format:check
  • the plugin suite at every commit

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch 2 times, most recently from 64dd1f9 to 64bfbfd Compare November 6, 2026 18:17

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review (xhigh)

Verdict: not ready to merge yet. One substantive gap: 0.157.0 has an undocumented new bail-out that also fails builds under panicThreshold. The rest are small wording and test-robustness fixes.

What I verified

  • Ran the plugin suite on the head commit: 49 passed, 2 expected fail. format:check and lint are clean, and CI is green.
  • Aliased oxc-transform-react to a 0.156.0 install and ran upstream.test.ts against it. Exactly the 14 tests the PR names fail (the 13 pins plus the bail-out it.fails) and the 24 existing ones pass. Each failure is on the assertion that pins the fix, not on an incidental one.
  • Probed the new reassignment check with about a dozen inputs on both versions, with reportDiagnostics and with both panicThreshold settings. The results are in the inline comments.

Findings, most important first

  1. A second new bail-out, "Cannot reassign variable in async function", isn't in the changeset, the tests or the PR description (inline on the changeset). An async function that reassigns a variable declared in an enclosing function is now skipped, and the build fails under 'critical_errors'/'all_errors'. That covers an effect storing a connection from an async IIFE for its cleanup, an async loader accumulating into an effect-local, and a handler's counter bumped in an async arrow. That's likely more common than the return fetchPage(…).then(…) shape the PR documents, and it contradicts the "Scope. It's narrower than the message suggests" section and the bump commit's "Common shapes are unaffected". The documented rule also isn't promise-specific: return items.map((item) => { n += 1; … }) in a helper is skipped too.
  2. The upstream fix already exists (inline on the it.fails). oxc-project/oxc#28401 (the async variant, bisected to the #26893 commit) was closed by oxc-project/oxc#28820 on 2026-11-04, a day after 0.157.0 was published. Link both from the test and the PR, and add an it.fails for the async shape so the 0.158.0 bump shows which of the two shapes it fixes. I still think shipping 0.157.0 now is right: under the default panicThreshold, the new skips are safe, and the miscompiles this fixes aren't.
  3. Changeset wording (inline): the oxc#27418 bullet implies the case without an early return was broken. The member-chain sentence hides that chains of 501 to about 4,900 links used to compile and are now skipped.
  4. Test nit (inline): the oxc#27420 regex depends on where let notes; is declared, which isn't the property being pinned.

What's good and should stay as is

  • Splitting the lockfile sync out of the bump.
  • One commit per pin, each message saying what broke, at runtime, on which versions.
  • Being explicit about the three unpinned rows and why.

The pins assert the fixed shape rather than just "compiles", and they fail on 0.156.0 for the right reason. The README needs no change: its caveats paragraph is example-based, and nothing listed there is now wrong. The minor bump is appropriate for a 0.x package with new build-failing diagnostics.


Generated by Claude Code

@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from 64bfbfd to 1971eb4 Compare November 6, 2026 18:56

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at 1971eb4

All five threads from the first review are addressed in the code and in the commit messages. I checked the range-diff against 64bfbfd and re-ran the suite:

  • 0.157.0: 37 passed, 3 expected fail.
  • Aliased to 0.156.0: exactly the 15 new tests fail (the 13 pins and both reassignment it.fails), and the 24 existing ones pass.
  • Loosened oxc#27420 regex: still fails on 0.156.0.
  • format:check and lint are clean.

The new useSocket it.fails and its links to oxc#28401 and oxc#28820 are what I'd hoped for. The two separate tests will show on the next bump whether oxc#28820 covers LoadAll, and your reading of its diff (dropping the inner function's own bindings from child_context_variables) makes that likely.

Still open:

  1. The changeset's lead-in sentence is broader than its two bullets (inline). As written, it describes the cancelled-flag cleanup that still compiles.
  2. The PR description still has the pre-review "Scope" section ("narrower than the message suggests"). It has only the one bail-out, counts "2 it.fails" and "17 commits", and says "the 14 new non-gap tests" fail on 0.156.0, which is now 15. You said that's next. I'll check it with the changeset fix.

Once both are done, I expect to call this ready.


Generated by Claude Code

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from 1971eb4 to 5e92940 Compare November 6, 2026 19:50

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at 5e92940: ready to merge

Both items from the last round are done:

  • Changeset: the lead-in now limits the skip to the two cases. The second bullet says "the function's parameters or locals", which is correct where cubic's "enclosing function's" wouldn't have been.
  • PR description: it now matches the branch: both bail-outs, the upstream fix, 18 commits, 3 it.fails and 15 new tests failing on 0.156.0.

The range-diff against 1971eb4 shows only the bump commit changed. I re-ran the checks at this head:

  • Plugin suite: 49 passed, 3 expected fail.
  • format:check, lint and the package's tsc: all clean.
  • CI: green on both Node versions.

All review threads are resolved. I agree with leaving cubic's regex-span finding as is: the backreference to the copy's temp name is what makes the match specific, and a length bound would bring back the layout dependence.

One thing I'm leaving as is: the bump commit's message keeps "reassigns one of its parameters or locals", where the changeset now says "the function's". The example right after it shows the intended reading, so it isn't worth a force-push.

Nothing else I'd change before merge.


Generated by Claude Code

@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from 5e92940 to c3fa0a5 Compare November 12, 2026 02:03
@acusti acusti changed the title Bump oxc-transform-react to 0.157.0 and pin its compiler fixes Bump oxc-transform-react to 0.158.0 and pin its compiler fixes Nov 12, 2026
@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from c3fa0a5 to e1ed54d Compare November 12, 2026 03:28

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review of the 0.158.0 version (c3fa0a5)

Verdict: not ready to merge yet. The bump itself is right, and moving from 0.157.0 to 0.158.0 is the right call. The remaining work is in how the one new skip is described and tracked, plus two structural recommendations.

What I verified

  • 0.158.0 (this head): the plugin suite gives 51 passed and 1 expected fail.
  • Aliased to 0.156.0: exactly the 13 pins fail.
  • Aliased to 0.157.0: exactly the 2 promoted tests fail, so they now guard against that regression.
  • Checks: format:check, lint, the package tsc and bun install --frozen-lockfile are clean. CI is green.
  • 0.157.0's bail-outs: all the shapes from my earlier review compile again on 0.158.0, matching Babel 1.0.0 and the experimental build.
  • Non-ASCII ref panic: const élanRef = useRef(…) aborts the process on 0.156.0 and 0.157.0 and compiles on 0.158.0, as described.
  • Upstream triage: the only react-compiler commits between the v0.157.0 and v0.158.0 crate releases are oxc-project/oxc#28758 and oxc-project/oxc#28820, both covered.

Findings

  1. The remaining skip is described inaccurately (inline on the changeset). It isn't specific to if blocks: it also fires in ternaries, &&, loops and switch. It also only fires when the call's result is kept: if (touched) { validate(value, cb); } still compiles. A changeset suggestion is inline. The bump commit's message and the PR description need the same fix.

  2. The remaining skip isn't tracked (inline on the tests). The latest experimental React Compiler build compiles all of these cases, as Babel 1.0.0 does. So "0.158.0 is the consistent one" holds within the port, but it's still a divergence from React Compiler main, as far as a published build shows. I'd report it upstream and add an it.fails linking the issue, or a plain pin if upstream says the stricter behavior is intended.

  3. Pin the non-ASCII ref panic fix (oxc-project/oxc#28758). The "no identifier in the corpora has that shape" bar fits the unpinned miscompiles, but a panic kills the process, dev server included. The suite already pins a panic fix with no corpus instance: "compiles a try whose catch can never run" (oxc-project/oxc#28066). The test is ten lines: compile a component that uses élanRef and assert react/compiler-runtime. On a regression, the worker would abort and the run would fail loudly.

  4. Recommended: collapse the 0.157.0 bump into one 0.158.0 bump. Since the plugin will never ship 0.157.0, the history currently has:

    • five commits that pin main to a version with two build-failing bail-outs
    • a 0.157.0 changeset documenting behavior no release will have
    • two it.fails tests flipped to it inside a six-file bump commit, so git blame on those tests points at the bump

    A cleaner sequence would be:

    1. the lockfile sync
    2. the 0.158.0 bump, with its changeset and the 0.157.0 triage folded into its message
    3. the 13 pins (their "since 0.157.0" comments stay accurate)
    4. the two regression guards as plain tests from the start ("was left uncompiled on 0.157.0"), plus the asserted-allocation it.fails

    Each pin was already verified against 0.156.0 and 0.158.0, and the regression guards against 0.157.0. The repo's own commit rules ask for squashing history that adds no blame value, and the 0.157.0 bump adds none once every version-specific line it touched is rewritten.

Fine as is

  • The rewritten changeset drops 0.157.0's bail-outs, which users going from 0.11.0 straight to the 0.158.0 release will never see. That's the right framing.
  • The lockfile sync now matches all six release commits.
  • The promoted tests' comments record what 0.157.0 did.
  • The README needs no change.

Generated by Claude Code

// Compiled again since 0.158.0
// (https://github.com/oxc-project/oxc/issues/28401, fixed by
// https://github.com/oxc-project/oxc/pull/28820)
it('compiles an effect whose async callback reassigns an effect local', async () => {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The remaining skip needs a test, and probably an upstream report. The PR description reasons that "0.158.0 is the consistent one here", so the skip is documented but not tracked. That isn't how React Compiler behaves, though: the latest experimental build (babel-plugin-react-compiler@0.0.0-experimental-a1856f3-20260507) compiles every control-flow variant in the table on the changeset thread, exactly as 1.0.0 does. So this is a divergence from React Compiler main as far as a published build shows. (That build is from May, so main may have moved since. I couldn't check anything newer.)

This suite's README says it "pins both kinds of divergence", and this one also fails builds under panicThreshold. Without a test, a later bump that changes it in either direction would go unnoticed, and the changeset's claim would go stale. I'd suggest:

  • Report it upstream. Tell oxc that the port skips control-flow cases Babel 1.0.0 and the experimental build compile, citing #26893 as the change that introduced it.
  • Add an it.fails linking that issue. It would assert that the if (touched) valid = validate(…) component compiles. If upstream says the stricter behavior is intended, make it a plain pin instead, asserting the skip and its diagnostic the way the exhaustive-deps test does, and keep the comment noting that Babel compiles it.

Either test works as a tripwire. The issue decides which one is right.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Added the it.fails in 527f63a3. It asserts that the if (touched) valid = validate(…) component compiles. It passes against 0.158.0 as an expected fail, and its comment records:

  • the 0.157.0 origin (oxc#26893)
  • the panicThreshold build failure
  • that 0.156.0, Babel 1.0.0 and the experimental build compile it

The upstream issue isn't filed yet. That's outside what this session can post, so the author has a draft to file. Once it's filed, the test's comment gets the link, and the answer decides whether this stays an it.fails or becomes a plain pin of the skip.

The other two findings are done:

  • The non-ASCII ref panic is pinned in 4178cb63. Against 0.156.0 and 0.157.0 it panics and aborts the Vitest worker.
  • The history is collapsed into your proposed sequence:
    • the lockfile sync
    • one 0.158.0 bump carrying the 0.157.0 triage in its message
    • the 13 pins, with messages now saying they pass against 0.157.0 and 0.158.0
    • the asserted-allocation it.fails
    • the two regression guards, as plain tests from the start
    • the new it.fails
    • the panic pin
    • the README commit

The tree differs from the previous head only by the changeset wording and the two new tests. Every commit passes the plugin suite against 0.158.0, which they all pin now.


Generated by Claude Code

@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from e1ed54d to 19f962f Compare November 12, 2026 14:25

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at 19f962f

All four findings from the last round are addressed, and I checked each one:

  • Changeset wording: it now describes the kept-result, control-flow rule.
  • Remaining skip: tracked as an it.fails. Aliased to 0.156.0, it fails as intended.
  • Non-ASCII ref panic: pinned. Against 0.156.0 the worker aborts with the infer_types.rs:240 panic.
  • History: collapsed into the proposed sequence. I ran the plugin suite at each of the 21 commits, and every one passes, with test counts going up one per pin. format:check and lint are clean at the head.

Still open, all on the new README commit plus one changeset paragraph (inline):

  1. The release policy is absolute, and this PR already breaks it. The README says a release that newly skips code it has no reason to reject gets skipped. 0.158.0 does exactly that (the it.fails case), and shipping it is still right. The README should describe the trade-off you actually made: regressions weighed against fixes.
  2. The vetting process isn't in the repo. The corpus comparison and the runtime checks against Babel exist only in this PR's sessions. Either write the procedure down in AGENTS.md (cheap), or describe it as practice rather than a guarantee.
  3. The changeset's new first paragraph tells 0.11.0 users about a 0.157.0 regression they never had. I'd drop it.

Waiting on the upstream issue for the it.fails link is fine as is: the test's comment already explains the gap. Linking the issue once it's filed is enough.


Generated by Claude Code

@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from 19f962f to dd26d1e Compare November 12, 2026 20:46

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at dd26d1e

All three items from the last round are done:

  • README release policy: it now weighs regressions against fixes, in both places.
  • AGENTS.md: the new "Bumping oxc-transform-react" section writes the vetting procedure down. Its gotchas (ids under node_modules are skipped, a panic aborts the process, the uncompiled pass needs reactCompiler: false) are exactly what the next bump would otherwise rediscover. Step 6 turns the dropped changeset paragraph into a rule.
  • Changeset: the 0.157.0 paragraph is gone.

At this head, the plugin suite gives 52 passed and 2 expected fail. format:check, lint and bun install --frozen-lockfile are clean, and CI is green.

One branch change left: rebase onto main and refresh the lockfile sync. Main has moved by three commits, including "Release @acusti/dropdown 1.3.1", another release commit that bumped a workspace version without the lockfile. I rebased locally onto c0eb2db and the rebase is clean, but bun install then rewrites packages/dropdown from 1.3.0 to 1.3.1 in bun.lock.

  • --frozen-lockfile passes either way, so CI won't catch this.
  • The PR's first commit exists to make the lockfile match the workspace versions. Merged as is, it leaves one entry stale, and the next bun install puts that rewrite into some unrelated diff.

Rebase per AGENTS.md (no merge commit), regenerate the lockfile into Sync bun.lock with its workspace versions, and add dropdown 1.3.1 to that commit's message, which currently lists 1.2.1 and 1.3.0.

Two non-blocking notes:

  • The PR description has fallen behind this push. Its "README" section still describes the old absolute policy ("the plugin skips it for the next release that fixes it"), and it lists 21 commits and 8 items with no AGENTS.md commit. That doesn't affect what merges, but it's what a reviewer reads.
  • The upstream issue. Step 5 of the new procedure says a regression that ships gets an it.fails, an upstream issue and a changeset paragraph. This PR has the first and third. Filing the issue before merge would let the link land in the it.fails comment together with the rule. If it has to wait, a follow-up commit adding the link is fine.

Once rebased with the lockfile refreshed, I'd consider this ready to merge.


Generated by Claude Code

Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy. This skips 0.157.0:
its rewrite of the check for variables reassigned after render
(oxc-project/oxc#26893) skipped components and hooks in which a
callback reassigns another callback's variable, in an async function or
in a callback whose result a function returns, and the diagnostics
failed the build under panicThreshold 'critical_errors' or 'all_errors'.
0.158.0 limits the check to bindings declared in the component or hook
(oxc-project/oxc#28820, fixing oxc-project/oxc#28401), so those compile
again, as on 0.156.0 and with babel-plugin-react-compiler@1.0.0.

One skip from that rewrite remains: a component or hook that keeps the
result of a call it passes a callback to, when that callback reassigns
one of the component's own variables, is now left uncompiled inside an
`if`, a loop, a `switch`, a ternary or `&&` too, as it already was
outside them ("Cannot reassign variable after render completes").
0.156.0, Babel 1.0.0 and its latest experimental build compile those,
and a discarded result still compiles. Under panicThreshold the
diagnostic fails the build. The changeset leads with it.

Between 0.156.0 and 0.158.0, the bindings also fix compiled output that
rendered stale values or threw where the uncompiled code doesn't, most
of which babel-plugin-react-compiler@1.0.0 shares (see the pinned tests
that follow), compile code that 0.156.0 and the Babel plugin skip, stop
panicking on a ref-like name that starts with a non-ASCII letter
(`élanRef`, oxc-project/oxc#28758), leave member chains longer than 500
links uncompiled instead of compiling them slowly or overflowing the
stack, and remove an exponential type resolution that made a loop around
a `try` take seconds and gigabytes to compile.

The repo's own output changes in two files with default options:
MonthCalendar.tsx keys its memo block on the `title` prop from before
`title = title ?? …` (oxc-project/oxc#27420), so it no longer misses its
cache on every render without a title, and useStyles.ts lowers
`item.referenceCount++` as an increment (oxc-project/oxc#27424), with
the same behavior for a number. In the dependency corpus (12,712 JS/TS
files), two files change with default options, both from #27420. With
compilationMode 'all', 250 change and six flip compile status, three of
them newly skipped: two copies of yaml's stringifyDocument by the
remaining skip, and rolldown's replacePlugin, which mutates its own
argument in a forEach callback. Source maps change in about 1,240 files
from codegen's deduplicated mappings (oxc-project/oxc#28844,
oxc-project/oxc#26051). No input crashed or changed fatal status. The
public typings add only a `typescript` transform option (enum
inlining), which the plugin doesn't pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A memo block that reassigns one of its own inputs, like a quantity
clamped to the stock in place, stored the input's value after the block
as its cache key through 0.156.0. A later render whose prop equaled the
clamped value reused the earlier output: quantity 3 after quantity 5
(with 3 in stock) still read "Only 3 in stock". A prop defaulted by
reassignment instead missed the cache on every render, as
MonthCalendar's `title = title ?? …` did. As of 0.157.0 the key is a
copy of the input taken before the block (oxc-project/oxc#27420).
babel-plugin-react-compiler@1.0.0 keys it like 0.156.0. Rendered in
sequence, 0.156.0 and Babel 1.0.0 show the stale note and 0.157.0
matches the uncompiled component. The test fails against 0.156.0 and
passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A variable declared before a memo block and reassigned in a loop inside
it wasn't restored from the cache when the block was skipped through
0.156.0, so it kept its initial value from the second render with the
same props on: a "Go to first error" link pointed at "#" instead of the
first invalid field. Restored as of 0.157.0 (oxc-project/oxc#27421).
babel-plugin-react-compiler@1.0.0 renders "#" the same way. The test
fails against 0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A value assigned in a branch on a prop was treated as a constant through
0.156.0 when that branch also returned early on a condition that isn't
reactive, like a feature flag, so the element built from it was cached
once per mount: a save status kept saying "Saving" after saving
finished. Recomputed as of 0.157.0 (oxc-project/oxc#27418).
babel-plugin-react-compiler@1.0.0 caches it the same way as 0.156.0. The
test fails against 0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
An allocation inside a useMemo result that depends on nothing, like
`seen: new Set()` next to the dependency it's keyed on, got a memo block
of its own through 0.156.0 and was cached once per mount, so the result
was rebuilt when its dependencies changed but kept sharing the first
Set: an impressions hook stopped tracking after the page changed.
Recreated with the result as of 0.157.0 (oxc-project/oxc#27427).
babel-plugin-react-compiler@1.0.0 caches it like 0.156.0. The test fails
against 0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A value that is only compared and passed to a state setter during
render, as in the "adjust state when a prop changes" pattern, was judged
not to escape through 0.156.0 and lost its useMemo, so a new object on
every render never equaled the stored one and the component crashed with
"Too many re-renders". Memoized as of 0.157.0 (oxc-project/oxc#27426).
babel-plugin-react-compiler@1.0.0 drops the memoization the same way.
The input starts the stored value at null: passing the memoized value to
useState too already kept it memoized. The test fails against 0.156.0
and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
When the compiler couldn't tell a value was a ref, as with a ref prop
and a fallback (`boxRef ?? ownRef`), a callback reading
`ref.current.offsetWidth` was cached against that whole path through
0.156.0. The cache check reads the ref during render, before it's
attached, so the component threw on its first render. Cached against the
ref as of 0.157.0 (oxc-project/oxc#27423).
babel-plugin-react-compiler@1.0.0 guards and throws the same way. The
test fails against 0.156.0 and passes against 0.157.0 and 0.158.0.

The change stops a dependency path at `.current` for any value a
function reads, so a function called during render that reads `.current`
on a context value mutated outside render is now cached against the
object and goes stale, where 0.156.0 and Babel 1.0.0 recompute it. That
code breaks the Rules of React, so it isn't pinned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A property read inside a callback passed as a JSX prop, like
`onClick={() => onFollow(user!.id)}`, was hoisted into the cache check
through 0.156.0, and that check runs during render, so the component
threw "Cannot read properties of null" once `user` was null, even though
the callback, behind a disabled button, never ran. Cached against `user`
as of 0.157.0 (oxc-project/oxc#27070). babel-plugin-react-compiler@1.0.0
guards on `user.id` and throws the same way. The test fails against
0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
Through 0.156.0, `ref.current++` compiled to
`ref.current = ref.current + 1` followed by a read of the new value, so
an id counter in a ref handed out 1, 2, … instead of 0, 1, …, and a
bigint counter threw ("Cannot mix BigInt and other types"). As of
0.157.0 it reads the property once, increments that, and writes it back
(oxc-project/oxc#27424). babel-plugin-react-compiler@1.0.0 compiles it
like 0.156.0. useStyles.ts's `item.referenceCount++` changes shape the
same way, with the same behavior for a number whose result is unused.
The test fails against 0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
Every BigInt literal in a compiled component or hook was printed as
`undefined` through 0.156.0, so `(nanoseconds + 500000n) / 1000000n`
threw "Cannot mix BigInt and other types" and `useRef(0n)` started out
undefined. Kept as of 0.157.0 (oxc-project/oxc#26161).
babel-plugin-react-compiler@1.0.0 leaves such a function uncompiled
("Handle BigIntLiteral expressions"). In compilationMode 'all', eight
files in this repo's dependencies (from eslint, oxfmt and storybook)
lose BigInt literals on 0.156.0. The test fails against 0.156.0 and
passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
In a component defined inside a factory function
(`createList(getKey, renderItem)` returning a List component), a
callback that only uses the factory's arguments was outlined to a
module-level function through 0.156.0, outside their scope, so the
component threw "renderItem is not defined" on its first render. Kept
inline and cached once per mount as of 0.157.0 (oxc-project/oxc#26519).
babel-plugin-react-compiler@1.0.0 outlines it and throws like 0.156.0.
The test fails against 0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A hook whose memoized callbacks read the same ref in different places,
with one stored as a property of the other, like a debounced callback
with a `cancel` method, was left uncompiled through 0.156.0 ("Ref type
environment did not converge"), since the ref check compared where each
function read the ref and never settled. Compiled as of 0.157.0
(oxc-project/oxc#26181), as babel-plugin-react-compiler@1.0.0 compiles
it. Without the `debounced.cancel = cancel` assignment, 0.156.0 compiled
it too. The test fails against 0.156.0 and passes against 0.157.0 and
0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A component that increments a variable a closure captures, like a count
of selected items that an onClick callback reads, was left uncompiled
through 0.156.0 ("Handle UpdateExpression to variables captured within
lambdas"), and babel-plugin-react-compiler@1.0.0 bails with the same
message. Compiled as of 0.157.0 (oxc-project/oxc#26893); rendered and
clicked, it matches the uncompiled component. The test fails against
0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A callback that passes an item to a handler mutating a global, like
`onClick={() => handleClick(item.id)}` with `window.location.hash = id`
in handleClick, was treated as calling the handler during render, so the
component was left uncompiled through 0.156.0 ("This value cannot be
modified"), and babel-plugin-react-compiler@1.0.0 bails with the same
message. Compiled as of 0.157.0 (oxc-project/oxc#27309). The test fails
against 0.156.0 and passes against 0.157.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
oxc-project/oxc#27427 recreates an allocation in a useMemo result when
its dependencies change, but not one wrapped in a TypeScript assertion
(`seen: [] as string[]`, `new Set() as Set<string>`): 0.157.0 and
0.158.0 still cache it once per mount, so a rebuilt result shares the
first array, and an impressions hook stops tracking after the page
changes, as on 0.156.0 and with babel-plugin-react-compiler@1.0.0.
`new Set<string>()` and `new Array<string>()` are recreated. Tracked as
an it.fails test, so the bump that fixes it turns the test red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A component in which a function returns the result of passing a callback
that reassigns one of the function's parameters or locals, like a loader
that returns
`fetchPage(page).then((next) => { rows = rows.concat(next); … })` or a
helper that returns `items.map((item) => { n += 1; … })`, was left
uncompiled on 0.157.0 ("Cannot reassign variable after render
completes", oxc-project/oxc#26893), and the diagnostic failed the build
under panicThreshold 'critical_errors' or 'all_errors'. Each call has
its own `rows`, so compiling it is safe, and 0.156.0 and
babel-plugin-react-compiler@1.0.0 compile it. Compiled again as of
0.158.0, which limits the check to bindings declared in the component or
hook (oxc-project/oxc#28820, fixing oxc-project/oxc#28401). The test
fails against 0.157.0 and passes against 0.156.0 and 0.158.0, so that
regression can't come back unnoticed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A hook or component in which an async function reassigns a variable
declared in another callback, like an effect that stores a connection
from an async IIFE for its cleanup, was left uncompiled on 0.157.0
("Cannot reassign variable in async function", oxc-project/oxc#26893),
and the diagnostic failed the build under panicThreshold
'critical_errors' or 'all_errors'. An async loader accumulating into an
effect local and a handler's counter bumped in an async arrow were
skipped the same way. The variable belongs to one run of the effect, so
compiling it is safe, and 0.156.0 and babel-plugin-react-compiler@1.0.0
compile it. Compiled again as of 0.158.0 (oxc-project/oxc#28820, fixing
oxc-project/oxc#28401). Reassigning one of the component's own
variables from an async function was already skipped on 0.156.0. The
test fails against 0.157.0 and passes against 0.156.0 and 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
Since 0.157.0 (oxc-project/oxc#26893), a component or hook that keeps
the result of a call it passes a callback to, when that callback
reassigns one of the component's own variables, is left uncompiled
inside an `if`, a loop, a `switch`, a ternary or `&&`, as it already
was outside them ("Cannot reassign variable after render completes").
Under panicThreshold 'critical_errors' or 'all_errors', the diagnostic
fails the build. 0.156.0, babel-plugin-react-compiler@1.0.0 and its
latest experimental build (0.0.0-experimental-a1856f3-20260507) compile
every one of those, so it's a divergence from React Compiler as far as
a published build shows, and 0.158.0 keeps it. A discarded result still
compiles. Tracked as an it.fails test until upstream says whether the
stricter behavior is intended: if it is, the test becomes a plain pin
of the skip; if not, the bump that fixes it turns the test red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
A ref-like name that starts with a non-ASCII letter, like `élanRef`,
made the compiler panic through 0.157.0, because the check for a
ref-like name sliced the identifier's first byte. A panic aborts the
process, a dev server included. Compiled as of 0.158.0
(oxc-project/oxc#28758), as babel-plugin-react-compiler@1.0.0 compiles
it. No identifier in this repo or its dependencies has that shape, but
like the try-whose-catch-can-never-run test, a regression here would
take the whole process down, so it gets a pin. Against 0.156.0 and
0.157.0 the test aborts the Vitest worker; it passes against 0.158.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
The plugin's README now promises that each bindings release is checked
before a plugin release ships it, and skipped when its regressions
outweigh its fixes, but the procedure behind that lived only in the
sessions that did the 0.158.0 bump. A "Bumping oxc-transform-react"
section next to "Dependency upgrades" writes it down:
- triaging the upstream commits between the two crate tags
- comparing the repo, its dependencies and Outlyne compiled with the old
  and new bindings, in default mode and compilationMode 'all', with ids
  outside node_modules and each version in its own process, since a
  panic aborts it
- checking fixes and newly skipped shapes at runtime against the
  uncompiled code and babel-plugin-react-compiler@1.0.0, with
  `reactCompiler: false` for the uncompiled pass
- pinning plausible fixes and every crash, proven against the old
  bindings by aliasing them in a throwaway Vitest config
- weighing regressions against fixes, and tracking any that ship with an
  it.fails, an upstream issue and a changeset paragraph
- writing the changeset from the last shipped bindings version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
The README said the plugin pins the newest oxc-transform-react that
passes this repo's tests, which undersells the reason to depend on it.
0.157.0 passed the suite, fixed 13 miscompiles, and still started
skipping and failing builds on code that compiled before, so the plugin
skips it for 0.158.0, which fixes that. A new Bindings version section
under Usage lists what each release is checked against: the pinned
tests and known gaps, a comparison of every JS/TS file in the repo and
its dependencies compiled with the old and new bindings, and runtime
checks against uncompiled output and babel-plugin-react-compiler@1.0.0.
It also says a release is skipped when its regressions outweigh its
fixes, and that regressions shipped anyway, and changes to what compiles
because the new behavior is correct, are in the changelog and the
upstream-tracking suite. The procedure behind those checks is in
AGENTS.md.

"Why this exists" no longer says a plain Vite + React app has nothing to
gain from the plugin. `@vitejs/plugin-react`'s `compiler: true` leaves
installing and vetting oxc-transform-react to the app (an optional peer
dependency), and the curation is the plugin's second reason to exist.
The Caveats paragraph on the upstream-tracking suite links to the new
section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cito1LcGyM2qjPAVSWgY2q
@acusti
acusti force-pushed the claude/tender-goldberg-w368ch branch from dd26d1e to f46d079 Compare November 12, 2026 22:57

@acusti acusti left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at f46d079: ready to merge

The rebase resolves the last item. Main now carries its own lockfile sync (2585af3, up to dropdown 1.4.0), so the PR rightly drops its sync commit. What I checked:

  • Rebase: the branch sits linearly on 3ad760a, with no merge commits.
  • Lockfile: bun install leaves bun.lock unchanged, and the PR's bun.lock diff against main touches only oxc-transform-react.
  • Content: outside bun.lock, the diff against main is byte-identical to what I reviewed at dd26d1e.
  • Every commit: the plugin suite passes at all 21, with counts rising one per pin (36 → 52 passed, then 2 expected fail).
  • Full validation at the head: bun run build, bun run tsc, bun run lint and format:check are clean, and bun run test gives 729 passed and 2 expected fail. CI is green.
  • PR description: it now matches the branch (21 commits, the AGENTS.md section, the weighed release policy).

Nothing I'd change on the branch before merge. The one follow-up is filing the upstream report for the kept-result skip and adding its link to that it.fails comment, as step 5 of the new AGENTS.md procedure asks. That's a one-line commit whenever the issue exists.


Generated by Claude Code

@acusti
acusti merged commit 24e41b1 into main Nov 12, 2026
7 checks passed
@acusti
acusti deleted the claude/tender-goldberg-w368ch branch November 12, 2026 23:19
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