UniFFI is a multi-language bindings generator for Rust.
This project, uniffi-bindgen-react-native
, is a uniFFI bindings generator for using Rust from React Native.
It provides tooling to generate:
- Typescript and JSI C++ to call Rust from Typescript and back again
- a Turbo-Module that installs the bindings into a running React Native library.
If you're ready to start, then start with a step-by-step tutorial to make a Rust turbo-module.
If you're new to uniFFI, then the UniFFI user guide or the UniFFI examples are interesting places to start.
- Spend more time writing Typescript and Rust
- Full compatibility with
uniffi-rs
- Your Rust SDK is portable across multiple languages.
WASM is an amazing virtual machine however:
- your Rust crate must make alternative arrangements if it needs things that the virtual machine does not offer:
- threads and
- file access.
- you need to maintain a separate FFI (this is a temporary issue, solvable by something like uniFFI).
- @unomed/react-native-matrix-sdk
- ChessTiles on iOS "uniffi-bindgen-react-native lets us run our performance critical solution search algorithm and business logic in Rust, while rapidly prototying the UI with React Native"
If this tool sounds interesting to you, please help us develop it! You can:
- View the contributor guidelines.
- File or work on issues here in GitHub.
- Join discussions in the #uniffi-bindgen-js:matrix.org room on Matrix.
This project is governed by Mozilla's Community Participation Guidelines.
uniffi-bindgen-react-native
is led by James Hugman, with deep collaboration from the Filament engineering team, funded by Filament and Mozilla.