React Native

React Native Firebase Roadmap: TurboModules Migration

A roadmap update on our migration to TurboModules. Learn about our migration, next steps, and the performance benefits this brings to React Native Firebase.

4 min readReact Native Firebase Roadmap: TurboModules Migration

Introduction

In a recent announcement for React Native v0.80, the maintainers confirmed the legacy NativeModule system is now officially frozen and will be removed entirely in a future version. This change makes migration to TurboModules critical for the React Native Firebase library, and this post outlines our plan, progress, and next steps.

What Makes This Migration So Complex?

React Native Firebase has a long history. Originally created over 9 years ago, its foundation is built on plain JavaScript, long before TypeScript became the industry standard. This history presents our biggest challenge, as TurboModule specifications must be written in TypeScript.

So, what makes this migration so complex? It comes down to three key reasons:

  1. Language Rewrite: We must convert the entire JavaScript codebase to TypeScript. To add to the complexity, the codebase also supports Flow, an alternative type-checker, meaning we are carefully translating between type systems.
  2. Sheer Scale: React Native Firebase isn’t a single library but a massive suite of packages. Each one requires a meticulous, package-by-package refactor.
  3. Native Integration: Every refactored package requires updating the native Android (Java/Kotlin) and iOS (Objective-C/Swift) code to integrate with the new TurboModule system.

The Goal: A Full Migration to TurboModules

Our primary goal is to ensure React Native Firebase remains compatible and performant. With NativeModules being phased out, this work is now our main focus. Beyond ensuring compatibility, this migration unlocks several key improvements offered by TurboModules:

  • Direct JSI Communication: A faster, more direct link between JavaScript and native code that reduces overhead.
  • Lazy Loading: Faster app startup times by only loading modules from memory when they are used.
  • Stronger Type Safety: TypeScript-defined interfaces improve reliability across the JS and native boundary.
  • Future-Proofing: Ensures we can adopt future React Native optimizations.

Current Status: Migrating the Functions Package

The first step on our roadmap is migrating the Cloud Functions package (@react-native-firebase/functions). The initial work for this is available for review in our pull request feat(functions): turbo modules implementation.

This PR contains the complete refactor. We've rewritten the package in TypeScript, created its TurboModule spec file, and generated the new native interfaces, integrating them into the package’s existing native implementation. We've also ensured the new module integrates with our core App package. This first migration serves as a template for the other packages to follow.

However, merging this pull request is currently blocked by a bug we identified in React Native on iOS where null values within object properties are incorrectly stripped out. We're hoping the issue can be resolved upstream, but we may find a temporary solution in the meanwhile to keep the migration moving forward.

What's Next on the Roadmap?

Our long-term goal is to migrate every React Native Firebase package. This will be a gradual process, and we will continue to tackle it module by module.

A key outcome of this roadmap item will be a fully TypeScript codebase. This will allow us to auto-generate our API reference documentation directly from the code, leading to more accurate and reliable docs for everyone.

We are committed to transparency throughout this migration and will share further roadmap updates as we hit new milestones.

Follow @invertaseio on X to stay up to date on our progress.