Turbo Module Architecture

The Turbo Native Module Architecture

The old bridge serialized every call to JSON and queued it, so every call was asynchronous. The New Architecture, the only architecture since React Native 0.82 36,878 (Bridgeless Mode), replaces it with JSI, the JavaScript Interface: a C++ API that lets Hermes 11,328 hold a reference to a C++ host object and call its methods directly. A Turbo Native Module is such a host object, generated for you:

How a call to a Turbo Native Module reaches Kotlin, and what Codegen generates
How a call to a Turbo Native Module reaches Kotlin, and what Codegen generates

Three properties follow. Calls can be synchronous: a method that returns a value, rather than a Promise, blocks JavaScript until Kotlin answers, which is fine for a quick read and wrong for anything slow. Modules are lazy: TurboModuleRegistry.getEnforcing() creates one on first use, so an app with fifty modules does not pay for fifty at startup. And the contract is typed: Codegen reads your TypeScript spec and generates the C++ glue and an abstract Java class, so a Kotlin method with the wrong signature fails to compile instead of failing at run time. You write the spec, the Kotlin class and a package that registers it.