惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
月光博客
月光博客
IT之家
IT之家
B
Blog RSS Feed
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园_首页
B
Blog
V
V2EX
腾讯CDC
Vercel News
Vercel News
量子位
Microsoft Security Blog
Microsoft Security Blog

Mozilla Hacks – the Web developer blog

Intent to Ship: JPEG XL – Mozilla Hacks - the Web developer blog PACT: Anonymous Credentials for the Web – Mozilla Hacks - the Web developer blog Announcing Web Serial Support in Firefox – Mozilla Hacks - the Web developer blog Behind the Scenes Hardening Firefox with Claude Mythos Preview – Mozilla Hacks - the Web developer blog Trustworthy JavaScript for the Open Web – Mozilla Hacks - the Web developer blog Firefox Developer Edition and Beta: Try out Mozilla’s .rpm package! – Mozilla Hacks - the Web developer blog Why is WebAssembly a second-class language on the web? – Mozilla Hacks - the Web developer blog Goodbye innerHTML, Hello setHTML: Stronger XSS Protection in Firefox 148 – Mozilla Hacks - the Web developer blog Launching Interop 2026 – Mozilla Hacks - the Web developer blog CRLite: Fast, private, and comprehensive certificate revocation checking in Firefox – Mozilla Hacks - the Web developer blog Improving Firefox Stability in the Enterprise by Reducing DLL Injection – Mozilla Hacks - the Web developer blog Launching Interop 2025 – Mozilla Hacks - the Web developer blog Llamafile v0.8.14: a new UI, performance gains, and more – Mozilla Hacks - the Web developer blog 0Din: A GenAI Bug Bounty Program – Securing Tomorrow’s AI Together – Mozilla Hacks - the Web developer blog Announcing Official Puppeteer Support for Firefox – Mozilla Hacks - the Web developer blog Snapshots for IPC Fuzzing – Mozilla Hacks - the Web developer blog Sponsoring sqlite-vec to enable more powerful Local AI applications – Mozilla Hacks - the Web developer blog Experimenting with local alt text generation in Firefox Nightly – Mozilla Hacks - the Web developer blog Llamafile’s progress, four months in – Mozilla Hacks - the Web developer blog Porting a cross-platform GUI application to Rust – Mozilla Hacks - the Web developer blog
Introducing Uniffi for React Native: Rust-Powered Turbo M...
Mark Mayo · 2024-12-05 · via Mozilla Hacks – the Web developer blog

Today Mozilla and Filament are releasing Uniffi for React Native, a new tool we’ve been using to build React Native Turbo Modules in Rust, under an open source license. This allows millions of developers writing cross-platform React Native apps to use Rust  – a modern programming language known for its safety and performance benefits to build single implementations of their app’s core logic to work seamlessly across iOS and Android. 

This is a big win for us and for Filament who co-developed the library with Mozilla and James Hugman, the lead developer. We think it will be awesome for many other developers too. Less code is good. Memory safety is good. Performance is good. We get all three, plus the joy of using a language we love in more places.

For those familiar with React Native, it’s a great framework for creating cross-platform apps, but it has its challenges. React Native apps rely on a single JavaScript thread, which can slow things down when handling complex tasks. Developers have traditionally worked around this by writing code twice – once for iOS and once for Android – or by using C++, which can be difficult to manage. Uniffi for React Native offers a better solution by enabling developers to offload heavy tasks to Rust, which is now easy to integrate with React Native. As a result, you’ve got faster, smoother apps and a streamlined development process.

How Uniffi for React Native works

Unifii for React Native is a uniFFI bindings generator for using Rust from React Native via Turbo Modules. It lets us work at an abstraction level high enough to stay focused on our applications’s needs rather than getting lost in the gory technical details of bespoke native cross-platform development  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.

We’re stoked about this work continuing. In 2020, we started with Uniffi as a modern day ‘write once; run anywhere’ toolset for Rust. Uniffi has come a long way since we developed the technology as a bit of a hack to get us a single implementation of Firefox Sync’s core (in Rust) that we could then deploy to both our Android and iOS apps! Since then Mozilla has used uniffi-rs to successfully deploy Rust in mobile and desktop products used by hundreds of millions of users. This Rust code runs important subsystems such as bookmarks and history sync, Firefox Suggest, telemetry and experimentation. Beyond Mozilla, Uniffi is used in Android (in AOSP), high-profile security products and some complex libraries familiar to the community.

Currently the Uniffi for React Native project is an early release. We don’t have a cool landing page or examples in the repo (coming!), but open source contributor Johannes Marbach has already been sponsored by Unomed to use Uniffi for React Native to create a React Native Library for the Matrix SDK .

Need an idea on how you might give it a whirl? I’ve got two uses that we’re very excited about:

1) Use Rust to offload computationally heavy code to a multi-threaded/memory-safe subsystem to escape single-threaded JS performance bottlenecks in React Native. If you know, you know.

2) Leverage the incredible library of Rust crates in your React Native app. One of the Filament devs showed how powerful this is, recently. With a rudimentary knowledge of Rust, they were able to find a fast blurhashing library on crates.io to replace a slow Typescript implementation and get it running the same day. We’re hoping we can really improve the tooling even more to make this kind of optimization as easy as possible.

Uniffi represents a step forward in cross-platform development, combining the power of Rust with the flexibility of React Native to unlock new possibilities for app developers. 

We’re excited to have the community explore what’s possible. Please check out the library on Github and jump into the conversation on Matrix

Disclosure: in addition to this collaboration, Mozilla Ventures is an investor in Filament. 

Technologist at Mozilla Innovations

More articles by Mark Mayo…

CEO at Filament

More articles by Tony Haile…