UniFFI for React Native: Rust-Powered Turbo Modules
Article Summary
Mark Mayo from Mozilla and Tony Haile from Filament just open-sourced a tool that lets React Native developers write their native modules once in Rust instead of twice in platform-specific code. This could change how millions of developers build cross-platform apps.
Mozilla and Filament released UniFFI for React Native, a bindings generator that creates Turbo Modules from Rust code. It builds on Mozilla's UniFFI technology, which already powers critical systems in Firefox used by hundreds of millions of users. The tool generates TypeScript, JSI C++, and the glue code needed to call Rust from React Native seamlessly.
Key Takeaways
- Write native logic once in Rust instead of twice for iOS and Android
- Escape JavaScript's single-threaded bottleneck with multi-threaded Rust subsystems
- Tap into thousands of Rust crates for instant performance wins
- Already used in production: Matrix SDK for React Native built with it
- Mozilla uses UniFFI in Firefox for sync, telemetry, and experimentation
React Native developers can now build faster, memory-safe native modules in Rust with a single codebase instead of maintaining separate iOS and Android implementations.