Repository navigation
Description
Background
Native iOS/Android bundles are built by Metro, which transforms in JavaScript and minifies with single-threaded terser. We ship ~38MB of minified JS. Every engineer bundles several times a day, and CI bundles on every build.
Problem
When an engineer or CI builds the app for iOS/Android, they wait 88-94s for a cold bundle, 11s for every warm rebuild, and 63s for a cold dev server — several times a day, for every engineer.
Solution
Adopt Re.Pack (Rspack-based). We keep the babel path only for the ~23 packages that require it (Flow-typed RN core, native-component registration) and run everything else through fast Rust tools (OXC/SWC) in parallel. Native and web then share the same React Compiler pipeline.
This also reconsolidates us onto the Rust React Compiler. Today we use the babel React Compiler on iOS/Android and the Rust React Compiler on web, and the two have logical differences. After this change, native runs the same OXC loader web already uses.
Results
Same machine, same day, identical code:
- Prod bundle, cold: 88-94s → 54s (~1.7x faster)
- Prod bundle, warm: 11s → 2s (~5.5x faster)
- Dev server, cold: 63s → 47s (25% faster)
- Dev server, warm: 8s → 4s (2x faster)
- Minified JS: 38.1MB → 35.7MB (6.3% smaller)
- Hermes bytecode: 45.1MB → 46.7MB (3.5% larger; known cause with a contained fix to try, and staging
ManualAppStartuptelemetry will show whether it matters)
Verified
Clean boots on iOS simulator, Android emulator, and HybridApp. RN DevTools fully functional. Fast Refresh and dev menu at Metro parity.
Trade-offs
- Re.Pack is a separate bundler, not a fork of Metro, so Metro fixes do not flow into it. When a new RN version ships, things either work as-is or the Re.Pack team adds support. Tracking RN releases is what that team does at Callstack.
- We could miss a future Metro improvement, though the items people actually ask about (tree shaking, code splitting, faster builds, caching) are already in Re.Pack.
- Metro is the default, so libraries get tested against it first and we may hit an edge case. Config takes more work. After a brand-new RN release we may wait for a compatible Re.Pack version.
- Metro stays in the repo and one flag switches back. Our web build already runs on the same engine, so this reduces the number of build systems rather than adding one.
Non-blocking follow-ups
- Switch the babel step to standard
@babel/parser, the parser Metro uses. No perf change expected; it removes a slow-parser edge case for good. - File upstream issues: hermes-parser slowness (repro in hand) and Flow support in OXC.
- Add a small CI check for the babel allowlist. Today, a dependency update that adds a package needing the babel step fails at app launch instead of at build; the check catches it in the PR.
Prior art
A previous attempt at this was tracked in #58311, closed as not planned while blocked on callstack/repack#1153.
Reported in Slack.
Metadata
Metadata
Type
Projects
- StatusShow more project fieldsDone
Activity
elirangoshen commentedon Sep 7, 2026
Hi, I will be in vacation from tomorrow (08.09) until 15.09
I will find someone from my team to continue to work on this issue while I'm away
kacper-mikolajczak commentedon Sep 8, 2026
Hi 👋 I will be filling in for @elirangoshen here. I am resolving merge conflicts and staying in touch with C+. Let me know if you need anything
elirangoshen commentedon Sep 21, 2026
Hi, I also wanted to add another follow up which I mention in the pr as well
What is your thoughts about it ?
roryabraham commentedon Sep 21, 2026
happy to create another follow-up, but frankly the problem described in that comment isn't clear to me.
collectioneur commentedon Sep 22, 2026
Hey! On an iOS dev build, opening Create expense via the FAB throws
View config not found for component RNCViewPagerand shows "page not found". It's a gap in the Re.PackBABEL_PACKAGESallowlist: packages outside it skip babel codegen, socodegenNativeComponent()runs at runtime and falls back to the legacy path, which has no view config in bridgeless mode.Four packages with codegen specs are missing:
react-native-pager-viewreact-native-gesture-handler@rnmapbox/maps@ua/react-native-airshipI scanned the iOS and Android bundles from the dev server: these four have surviving
codegenNativeComponent( after adding them the count is zero).Anything bundled by Re.Pack is likely affected, so dev builds (
npm run ios/npm run android, standalone and HybridApp) and standalone release bundles. HybridApp release still uses Metro, so production should be fineScreen.Recording.2026-09-22.at.13.22.09.mov
elirangoshen commentedon Sep 22, 2026
Im working on a pr to fix it
elirangoshen commentedon Sep 22, 2026
#101878
65 remaining items
MelvinBot commentedon Oct 27, 2026
Status: The OXC React Compiler consolidation merged today, so native and web now share one React Compiler. The HybridApp release switch to Re.Pack is still the main open item. Removing Metro from standalone builds is still a draft.
Since the last update (Oct 20)
Reviewinglabel.kacper-mikolajczakclosed the [DO NOT MERGE] Re.Pack 5.4.1 canary PR on Oct 22.shubham1206agranoted the issue isn't finished.mallenexpensifyasked to be tagged when payment is due.Next steps
elirangoshen: land the reopened HybridApp Re.Pack switch PR, then watch staging for Android/iOS blockers. I can't see that PR, so I can't confirm its status.elirangoshen: move [DX] Remove Metro from standalone native builds out of draft. It hasn't changed since Oct 15. A second PR will remove Metro from HybridApp builds.elirangoshen: close or update the OXC compiler tracking issue now that its PR has merged.@babel/parser, file upstream issues, and add a CI check for the babel allowlist.view run
elirangoshen commentedon Oct 28, 2026
Ill prepare the draft or of removing metro next
shubham1206agra commentedon Oct 28, 2026
@elirangoshen Something weird is going on with Re.pack. When I try to terminate the process with
Ctrl+C, it does not work for some reason. I am not sure what is the issue there.elirangoshen commentedon Oct 30, 2026
Update: the consolidate pr has been merged , and also the remove metro from standalone builds.
There's an issue that in some scenarios its not possible to stop the repack terminal in ctrl + c - an issue has been filled to upstream and I will check if we should patch it until it will be solved.
next task is to open pr for remove the metro leftovers from the submodule.
melvin-bot commentedon Nov 2, 2026
@elirangoshen, @roryabraham, @shubham1206agra, @kacper-mikolajczak Whoops! This issue is 2 days overdue. Let's get this updated quick!
roryabraham commentedon Nov 3, 2026
Awaiting PR to remove Metro leftovers from Mobile-Expensify
melvin-bot commentedon Nov 3, 2026
@elirangoshen, @roryabraham, @shubham1206agra, @kacper-mikolajczak Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
elirangoshen commentedon Nov 3, 2026
The pr has been merged https://github.com/Expensify/Mobile-Expensify/pull/14213#issuecomment-6584926494
roryabraham commentedon Nov 3, 2026
@MelvinBot status update
MelvinBot commentedon Nov 3, 2026
Status: The migration’s implementation appears complete; rollout confirmation remains.
elirangoshenconfirmed Mobile-Expensify cleanup merged. I cannot independently access that PR.Next: Confirm the Mobile-Expensify changes reached staging/production, complete regression checks, and settle the C+ checklist/payment before closing. The issue-body follow-ups remain unchecked but explicitly non-blocking.
roryabraham commentedon Nov 3, 2026
@MelvinBot create an updated payment summary
MelvinBot commentedon Nov 3, 2026
Updated Payment Summary
shubham1206agra— $175 via NewDot, unchanged from the confirmed summary.elirangoshenandkacper-mikolajczak— no separate payment required (contractors).Resolving PRs: Native Re.Pack pipeline, codegen allowlist, and Android release assets.
Payment owner:
mallenexpensify; confirm eligibility and any existing payout before processing to avoid duplicate payment.