Introducing Uniffi for React Native: Rust -Powered Turbo Modules – Mozilla Hacks – The Web Developer Blog

Today Mozilla and Filament Are releasing Uniffi for React NativeA new tool we’ve been using to build react native turbo modules in rust, Under an open source license. This allows millions of developers written cross-platform React native Apps to use Rust – A modern programming language know for its safety and performance benefits to build single implements 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 HugmanThe lead development. We think it will be welcome 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 that Familiar with React Native, It’s a Great Framework for Creating Cross-Platform Apps, but it has its challenges. React Native Apps relay on a Single Javascript Thread, which can sleep things down when handling complex tasks. Developers have traditionally worked Around this by written code Twice – Once for iOS and Once for Android – Or by using C ++, which can be different to manage. Uniffi for react native offers a better solution by enabling development developers to offload Heavy Tasks to Rust, which is now easy to integrate with reacts new. 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 raather Provides tooling to generate:

  • Typescript and jsi c ++ to call rust from type Typescript and back again
  • A turbo-module that installs the bindings into a running react native library.

We’re stocked about this work continuing. In 2020, we started with Uniffi as a modern day ‘write on; Run Anywhere ‘Toolset for Rust. Uniffi has come a long way Since we develop the technology as a bit of a hack to get us a single implementation of firefox sync’s core (in rust) that we cou a cou a coud 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 sugest, 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 alredy 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 white? I’ve got two uses that we’re very excited about:

1) Use rust to offload computational 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.

Unifffi 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 development.

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 investment in Filament.

Technologist at Mozilla Innovations

More articles by mark mayo…

CEO at Filament

More articles by tony hailee…

Ramesh Ghorai is the founder of www.livenewsblogger.com, a platform dedicated to delivering exclusive live news from across the globe and the local market. With a passion for covering diverse topics, he ensures readers stay updated with the latest and most reliable information. Over the past two years, Ramesh has also specialized in writing top software reviews, partnering with various software companies to provide in-depth insights and unbiased evaluations. His mission is to combine news reporting with valuable technology reviews, helping readers stay informed and make smarter choices.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top