Old architecture vs. new architecturePart 6 of 14
Build time vs. run time
Two build tracks that only meet inside the app package
BeginnerVerified on React Native 0.88Updated 6 December 2026
Read first: The new architecture
The big idea#
Some work happens once, on the developer's machine, when the app is built. The rest happens every time a user opens the app. A build is really two separate pipelines, one for JavaScript and one for native code, and they only meet inside the APK or IPA.
Concepts#
Two build tracks#
Build time: two tracks
Boxes: Your code (JS, TS); Metro (One bundle); hermesc (Compile); Bytecode (.hbc file); Specs (Native*.ts); Codegen (Glue code); Compilers (Gradle, Xcode); Binaries (Native libs); App package (APK, IPA). Arrows: Your code to Metro; Metro to hermesc; hermesc to Bytecode; Bytecode to App package; Specs to Codegen; Codegen to Compilers; Compilers to Binaries; Binaries to App package.
- JavaScript
- Build time
- Native
- Other
The JS track:
- Metro works in three steps: it resolves every
import, transforms each file with Babel (TypeScript to JavaScript, JSX to function calls) and serializes everything into one bundle. hermescthen compiles the bundle into bytecode. In release builds,index.android.bundle/main.jsbundleis Hermes bytecode, not readable JS.
The native track:
- Codegen runs as a Gradle task on Android and during
pod installon iOS (in Expo, during prebuild and the native build). A library may ship its glue pre-generated. - The native compilers produce
.solibraries andclasses.dexon Android, and the app executable on iOS. Since 0.84, React Native's core on iOS is downloaded prebuilt instead of compiled from source. - Minifiers like R8 only affect this track (Java/Kotlin), never the JS bundle.
Run time: what happens on launch#
- The native app starts (
Application.onCreate()orAppDelegate/SceneDelegate). This is plain native code, before any JS exists. ReactHostcreates aReactInstanceand starts Hermes (see Bridgeless mode).- Hermes memory-maps the bytecode file, so the operating system loads pieces of it only when that code first runs.
- JSI globals are installed: the entry points for Turbo Modules and Fabric.
- The event loop starts and
runApplicationrenders the root component. - Turbo Modules are created on first use. Their glue was compiled in at build time.
- Fabric renders, commits and mounts the UI.
Development builds are different#
| Development | Release | |
|---|---|---|
| Where JS comes from | Metro dev server, over the network | Inside the app |
| Format | Plain JS text | Hermes bytecode |
| Who compiles it | Hermes on the device, lazily | hermesc on the build machine |
| Minified | No | Yes |
| Fast Refresh | Yes | No |
| Native track | Same as release | Same |
In short, a JavaScript change needs a reload, and a change to a spec or native code needs a rebuild.
Myths vs reality#
Myth
Hermes loads a bytecode file containing the JavaScript and the native code generated by Codegen
Reality: the tracks never mix. Bytecode contains only JavaScript, and Codegen's output is compiled into the native binary. At run time, JS calls that glue through JSI.
Myth
Bytecode is executed directly by Hermes, without being interpreted
Reality: bytecode skips parsing and compiling on the device, which is the startup win, but Hermes still interprets it. Even Hermes V1 has no JIT.
Myth
Turn on Codegen and Turbo Modules before building
Reality: there's nothing to turn on. Since 0.82 both are always part of every build.
In practice#
OTA updates (EAS Update, CodePush and similar) can only replace the JS track's output: the bundle and assets. They can never change the native binary. If an OTA bundle calls a Turbo Module method added in a newer spec, the installed binary has no glue for it, and the call fails. Systems like Expo's runtime version and fingerprint exist to prevent exactly this. Anything that touches the native track needs a store release.
In one sentence
JavaScript and native code are built on two separate tracks that only meet inside the APK or IPA, so at run time Hermes interprets the bytecode and calls the precompiled native glue through JSI, and an OTA update can only ever replace the JavaScript side.