Fabric renderer compatibility boundary: React Native New Architecture transition with legacy native modules
0 reputation · 10 Jun 2020, 14:56 UTC
0 reputation · 10 Jun 2020, 14:56 UTC
In React Native versions that support the New Architecture, the transition from the legacy JSON bridge to JSI changes how JavaScript communicates with native code. Fabric enables synchronous rendering, while TurboModules allow lazy loading of native modules. Teams activating this via the newArchEnabled flag in android/gradle.properties face a compatibility boundary when third-party libraries have not yet migrated to Fabric. The Interop Layer is designed to bridge that gap, but its practical limits remain an unresolved decision for projects in phased migration.
Enabling the New Architecture also alters memory management expectations because C++ host objects are exposed directly through JSI rather than serialized over an asynchronous bridge. Build times typically increase due to CMake or NDK compilation. These shifts create uncertainty about whether a mixed ecosystem—combining bridge-based modules and TurboModules—can be treated as stable without introducing leaks or layout inconsistencies.
What criteria determine whether a legacy native module is safe to use through the Interop Layer under Fabric? How can teams evaluate the memory overhead of JSI host objects before fully committing to the New Architecture? Is there a documented compatibility boundary for mixing TurboModules and bridge-based modules in the same release?
35275 reputation · 11 Jun 2020, 02:14 UTC
A legacy native module is generally safe to use through the Interop Layer if it adheres to the following criteria:
RCTBridgeModule or ReactContextBaseJavaModule patterns for data exchange are compatible, as the Interop Layer wraps these to appear as TurboModules.Transitioning to the New Architecture replaces JSON serialization with JSI (JavaScript Interface) HostObjects. Because these C++ objects are managed by the JavaScript garbage collector (GC), memory pressure shifts from the bridge queue to the C++ heap.
To evaluate overhead before a full commit, use these verification steps:
newArchEnabled=false versus true while performing the same set of native module calls.There is no single "hard" documented boundary, but rather a functional coexistence model. The New Architecture maintains a compatibility bridge that allows TurboModules and legacy bridge-based modules to operate in the same release.
Confirmed Behaviors:
This guidance assumes usage of React Native versions where the Interop Layer is stable (typically 0.7x+). It is uncertain whether certain highly complex third-party libraries that implement their own custom C++ JSI bindings will conflict with the Interop Layer's wrapping mechanism. Teams should verify the generated C++ glue code during the build process to ensure the Interop wrappers are correctly applied.
Missing Diagnostic: To provide a more specific risk assessment, are any of your legacy modules implementing custom UIManager modules or direct native view manipulation?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.