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

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

Your codeJS, TS
MetroOne bundle
hermescCompile
Bytecode.hbc file
SpecsNative*.ts
CodegenGlue code
CompilersGradle, Xcode
BinariesNative libs
App packageAPK, IPA

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.

5 steps

The JS track and the native track never mix until packaging.
  • 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.
  • hermesc then compiles the bundle into bytecode. In release builds, index.android.bundle / main.jsbundle is Hermes bytecode, not readable JS.

The native track:

  • Codegen runs as a Gradle task on Android and during pod install on iOS (in Expo, during prebuild and the native build). A library may ship its glue pre-generated.
  • The native compilers produce .so libraries and classes.dex on 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#

  1. The native app starts (Application.onCreate() or AppDelegate / SceneDelegate). This is plain native code, before any JS exists.
  2. ReactHost creates a ReactInstance and starts Hermes (see Bridgeless mode).
  3. Hermes memory-maps the bytecode file, so the operating system loads pieces of it only when that code first runs.
  4. JSI globals are installed: the entry points for Turbo Modules and Fabric.
  5. The event loop starts and runApplication renders the root component.
  6. Turbo Modules are created on first use. Their glue was compiled in at build time.
  7. Fabric renders, commits and mounts the UI.

Development builds are different#

DevelopmentRelease
Where JS comes fromMetro dev server, over the networkInside the app
FormatPlain JS textHermes bytecode
Who compiles itHermes on the device, lazilyhermesc on the build machine
MinifiedNoYes
Fast RefreshYesNo
Native trackSame as releaseSame

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.