Skip to content

[Due for payment 2026-07-23] Replace Webpack + Babel with Rsbuild + OXC for E/App #95833

Closed

Description

@roryabraham

Original proposal: Slack thread

Proposal: Replace Webpack + Babel with Rsbuild + OXC for E/App.

Strategy: Engineering velocity — how fast an engineer can make a change and see it reflected, and how fast CI/CD can turn a PR into mergeable, deployed artifact — impacts how many product improvements we can ship per engineer-hour, which impacts our ability to out-iterate the competition.

Background: New Expensify's web client (App) is built with Webpack 5, configured in config/webpack/. Webpack has been the web bundler since the project's inception: it handles three "production" build variants (production, staging, ad-hoc) and a local dev server (webpack-dev-server). CI additionally triggers a full production build on every relevant PR and deploy.

Storybook, our component-docs site, also builds via its own separate Webpack config.

In 2023, engineers observed webpack-dev-server memory usage growing unboundedly over long-running sessions, and worked around it with start-dev-with-auto-restart.sh (monitors process memory, force-restarts the dev server past a threshold) plus a custom ForceGarbageCollectionPlugin that periodically forces garbage collection. Both are still part of the local web dev setup today.

Every TS/TSX file also runs through babel-loader as part of that Webpack pipeline: React Compiler compilation (babel-plugin-react-compiler), TS/TSX/Flow syntax transforms (@babel/preset-react, @babel/preset-env, @babel/preset-typescript, @babel/preset-flow), and RN-Web mapping (babel-plugin-react-native-web). Babel is a mature, pure-JS, AST-walking toolchain — each file makes several passes through several plugins before it's Webpack-ready.

Current build times:

  • Production/Staging/AdHoc/Dev, cold: ≈301.5s
  • Dev, warm: ≈8.65s
  • Storybook, cold: ≈117.6s
  • Storybook dev, cold: ≈96s
  • Storybook dev, warm: ≈7.8s

Problem: When engineers iterate locally, run AdHoc builds, or CI validates a merge to main, if a web build takes ≈5 mins to run cold, then engineering velocity is slowed, which prevents us from delivering new code as fast as possible.

To ground this at our scale:

  • CI: testBuildOnPush triggers one AdHoc web build for every PR merged into main. 6,283 PRs were merged into Expensify/App in the last 6 months alone — ≈526 hours (≈22 days) of build time in that window.
  • Local + agent builds: a conservative guess of ≈25 cold web builds/dev-server boots per day across all engineers and AI coding agents combined (background agents and MelvinBot automation are especially prone to this, since every new git worktree they spin up starts from a fresh, unprimed cache). 25 builds/day × ≈5 min/build ≈ 125 min/day, or ≈381 hours (≈16 days) over the same 6-month window.

Solution:
Swap two pieces of the build pipeline for modern Rust-based equivalents:

  1. Webpack → Rsbuild (built on Rspack). Rspack is a bundler built in Rust that targets close compatibility with Webpack's config/plugin/loader API, making it a relatively low-risk swap. Our existing configs mostly port over, with custom plugins swapping imports from webpack to @rspack/core. We can drop the auto-restart wrapper and forced-GC plugins from 2023, since they aren't necessary with Rsbuild's dev server.
  2. Babel → OXC. OXC is a Rust-based JS toolchain, including a transformer (like Babel).
    • bonus: Because OXC is built in Rust, we can leverage the Rust port of React Compiler, giving a ~10x speedup to what is by far the slowest babel transform today
    • caveat: Babel can't yet be fully removed, but shrinks to a single narrow job: the react-native-worklets/plugin pass (Reanimated worklets need Babel's plugin system specifically).

Apply both to the app's production/staging/ad-hoc build, Storybook, and the dev server.

Benchmarks:

  • Production, cold: ≈18.4s, ~16.4x faster
  • Dev, cold: ≈10.9s, ~27.7x faster
  • Dev, warm (HMR rebuild): ≈0.15–0.17s, ~57.7x faster
  • Storybook: ≈25.7s, ~4.6x faster
  • Storybook dev, cold: ≈14s, ~6.9x faster
  • Storybook dev, warm: ≈0.19s, ~41x faster

Note: Switching from Babel → OXC for most transforms will improve not only web builds, but the JS portion of iOS/Android builds as well.

Issue OwnerCurrent Issue Owner: @roryabraham

Activity

  1. self-assigned this
    on Jul 10, 2026
  2. roryabraham commented on Jul 10, 2026

    @roryabraham
    ContributorAuthor

    This issue is not open for proposals. Please do not post them.

  3. melvin-bot commented on Jul 13, 2026

    @melvin-bot

    @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  4. roryabraham commented on Jul 13, 2026

    @roryabraham
    ContributorAuthor

    First PR (webpack -> rsbuild) is already merged: #95319

    The second PR (babel -> oxc, to close this issue out) is ready for review: #93980

  5. roryabraham commented on Jul 14, 2026

    @roryabraham
    ContributorAuthor

    this is done. There's no deploy delay because it's a dev improvement, so I'm closing this out

  6. mitarachim commented on Jul 14, 2026

    @mitarachim

    Deploy Blocker #96054 was identified to be related to the PR #93980 that attempted to fix this issue.

  7. melvin-bot commented on Jul 14, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  8. lanitochka17 commented on Jul 14, 2026

    @lanitochka17

    Deploy Blocker #96086 was identified to be related to the PR #93980 that attempted to fix this issue.

  9. lanitochka17 commented on Jul 14, 2026

    @lanitochka17

    Deploy Blocker #96092 was identified to be related to the PR #93980 that attempted to fix this issue.

  10. melvin-bot commented on Jul 14, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  11. changed the title [-]Replace Webpack + Babel with Rsbuild + OXC for E/App[/-] [+][Due for payment 2026-07-23] Replace Webpack + Babel with Rsbuild + OXC for E/App[/+] on Jul 16, 2026
  12. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.34-14 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-07-23. 🎊

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions