Skip to content

[Due for payment 2026-11-05] [DX] Consolidate on the OXC React Compiler and delete the Babel one #101668

Open

Description

@MelvinBot

Background

Bundle native builds with Re.Pack + OXC transform pipeline moved native app source onto the same OXC loader the web build already uses. Native and web now run the same Rust React Compiler.

Jest is the only consumer of the Babel React Compiler left. jest.config.js:24 routes to babel-jest unless the run is a Reassure perf run, which already uses config/babel/oxcJestTransformer.js.

Problem

Because two compilers are still in play, we maintain a whole layer of tooling whose only job is to reconcile them:

Divergence is not just overhead — it is a live bug class. A divergent file ships unmemoized on one platform.

Solution

Make OXC the only React Compiler, then delete everything that exists to compare the two.

  • Make config/babel/oxcJestTransformer.js the default Jest transform, not just the perf-run transform. Test files may need to stay on babel-jest for jest.mock hoisting — confirm and document which.
  • Drop babel-plugin-react-compiler from babel.config.js and package.json, and delete config/babel/reactCompilerConfig.js.
  • Delete config/reactCompiler/checkBoth.mjs, checkWithBabel.mjs, their .d.mts files, and scripts/check-both-compilers-runner.mjs.
  • Delete scripts/react-compiler-divergence-audit.ts and its react-compiler-divergence-audit npm script.
  • Reduce react-compiler-compliance-check to a single OXC path: keep "new files must compile" and "modified files must not regress", drop the divergence rule and the inline Babel analysis.
  • Point ReactCompilerWorker at checkWithOxc.mjs directly and trim REACT_COMPILER_FINGERPRINT_FILES to the files that still exist.
  • Drop the now-stale buildDependencies entry for reactCompilerConfig.js in config/repack/rspack.config.mjs:89.
  • Update the Memoization section of CLAUDE.md and contributingGuides/REACT_COMPILER.md, which both still describe two compilers.

Expected wins

  • Lint's React Compiler stage stops running a second compiler per file.
  • One less required CI workflow shape: react-compiler-compliance.yml drops a compiler and a rule.
  • Jest stops transforming through Babel, which was measured as roughly half of each Reassure measure job.
  • The memoization-divergence bug class disappears.

Sequencing note

babel.config.js still applies the Babel React Compiler on the BUNDLER=metro fallback path. Once the plugin is gone, a Metro fallback build runs unmemoized. Either land this after Metro is removed, or accept that — Metro is a debug escape hatch, not a shipped path. Whoever picks this up should make that call explicitly.

Verification

Full Jest suite green, Reassure baselines unchanged beyond noise, npm run lint clean, and a native + web build that boots with Memo badges visible in React DevTools.

Related

Requested by elirangoshen as a follow-up on Bundle native builds with Re.Pack + OXC transform pipeline.

Issue OwnerCurrent Issue Owner: @aimane-chnaif

Activity

  1. elirangoshen commented on Sep 23, 2026

    @elirangoshen
    Contributor

    Suggestion: split this into three PRs, since the checklist cannot all land at once. Happy to do it another way if you'd rather.

    The blocker is the sequencing note: HybridApp release builds still bundle through Metro, so babel-plugin-react-compiler is what memoizes them. Delete it before HybridApp moves onto Re.Pack and release builds ship unmemoized.

    1. Consolidate on the OXC React Compiler — #102081 (draft)
    Makes the OXC transform the default for Jest and deletes everything that existed only to reconcile two compilers. The Metro lane is untouched, so this is safe on its own.

    2. Move HybridApp bundling onto Re.Pack (Mobile-Expensify)
    Mobile-Expensify/Android/build.gradle has no cliFile / bundleCommand override and tools/react-native-xcode.sh still points at React Native's CLI, so both default to Metro. Pointing them at Rock is what lets the Babel plugin go.

    3. Remove babel-plugin-react-compiler (App)
    Drops the plugin from babel.config.js and package.json, inlines and deletes config/babel/reactCompilerConfig.js, and removes its buildDependencies entry. Only safe after 2.

    As far as I can tell only 3 depends on 2, and 1 is independent and could merge at any point.

    One correction to the checklist: the buildDependencies entry for reactCompilerConfig.js is not stale today. config/babel/oxcReactCompilerConfig.js requires that file, so the entry is a real dependency until 3 removes both.

  2. elirangoshen commented on Sep 23, 2026

    @elirangoshen
    Contributor

    Suggestion: split this into three PRs, since the checklist cannot all land at once.

    The blocker is the sequencing note: HybridApp release builds still bundle through Metro, so babel-plugin-react-compiler is what memoizes them. Delete it before HybridApp moves onto Re.Pack and release builds ship unmemoized.

    This is the 3 pr's Id suggest to do:

    **1. Consolidate on the OXC React Compiler — #102081 **
    Makes the OXC transform the default for Jest and deletes everything that existed only to reconcile two compilers. The Metro lane is untouched, so this is safe on its own.

    2. Move HybridApp bundling onto Re.Pack (Mobile-Expensify)
    Mobile-Expensify/Android/build.gradle has no cliFile / bundleCommand override and tools/react-native-xcode.sh still points at React Native's CLI, so both default to Metro. Pointing them at Rock is what lets the Babel plugin go.

    3. Remove babel-plugin-react-compiler (App)
    Drops the plugin from babel.config.js and package.json, inlines and deletes config/babel/reactCompilerConfig.js, and removes its buildDependencies entry. Only safe after 2.

    What do you think ? @roryabraham

  3. roryabraham commented on Sep 23, 2026

    @roryabraham
    Contributor

    Sounds good, except I think 1 and 2 can happen in parallel, and I would finish 2 before cleaning up and consolidating React Compiler-related CI/validation scripts and configs:

    • scripts/react-compiler-*
    • config/reactCompiler
    • config/babel
    • scripts/lint/processors/ReactComplier*
  4. melvin-bot commented on Sep 28, 2026

    @melvin-bot

    Triggered auto assignment to @rlinoz, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  5. Julesssss commented on Sep 30, 2026

    @Julesssss
    Contributor

    We think this PR introduced this bug.

  6. elirangoshen commented on Sep 30, 2026

    @elirangoshen
    Contributor

    We think this PR introduced this bug.

    Ill check it tomorrow

  7. 33 remaining items

  8. melvin-bot commented on Oct 20, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  9. changed the title [-][Due for payment 2026-10-07] [DX] Consolidate on the OXC React Compiler and delete the Babel one[/-] [+][DX] Consolidate on the OXC React Compiler and delete the Babel one[/+] on Oct 20, 2026
  10. removed their assignment
    on Oct 21, 2026
  11. mallenexpensify commented on Oct 21, 2026

    @mallenexpensify
    Contributor

    Please comment and tag me if/when payment is due, thx

  12. changed the title [-][DX] Consolidate on the OXC React Compiler and delete the Babel one[/-] [+][Due for payment 2026-11-05] [DX] Consolidate on the OXC React Compiler and delete the Babel one[/+] on Oct 29, 2026
  13. melvin-bot commented on Oct 29, 2026

    @melvin-bot

    @aimane-chnaif

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.24-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-11-05. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions