WhoBuilt

Bring Your Favorite Language to React Native

May 6, 2025· 24 min· 624 views·Watch on YouTube

Speaker

Callstack senior software engineer and React Native core contributor Robert Pasiński presents Polyen, a toolkit for using WebAssembly modules written in languages such as Rust or Go in React Native, at the React Universe Meetup.

React Native’s native code boundary

Pasiński describes how JavaScript connects to native platform code. The older JavaScript bridge serialized messages and communicated asynchronously; the New Architecture uses JSI for direct access to JavaScript engines and native data. TurboModules still rely on C or C++ to connect to platform languages such as Java, Kotlin, Swift, and Objective-C.

Why WebAssembly helps

Building native code means handling separate targets, toolchains, and language boundaries for platforms such as iPhone, Android, and Windows. Pasiński presents WebAssembly as a shared, platform-agnostic target with explicit imports and exports. A module can only access capabilities supplied to it, such as a network function.

How Polyen runs WebAssembly in React Native

Polyen is a toolkit in active development that aims to provide Web API compatibility and near-native performance. It compiles WebAssembly modules back to C so they become part of the app and can connect to React Native through JSI. A bundler integration can let developers import a module reference and create an instance.

Current limits and a Rust example

Because modules are compiled into the app, Polyen cannot dynamically load arbitrary code; Pasiński describes that as a security benefit. The project also lacks threading support in React Native and does not yet support every WebAssembly feature. He demonstrates a Rust crypto library computing a digest in an example app.

Takeaways

  • A shared WebAssembly target can reduce the platform-specific build work required to bring compiled languages into React Native.
  • Polyen compiles modules into the app as C, aiming for fast JSI integration without interpretation or just-in-time compilation.
  • Precompiling modules limits dynamic loading, so teams should plan for modules to be known at build time.
  • Check the project’s feature coverage before depending on threading or less common WebAssembly extensions.

Mentioned in this talk

Search inside this talk

What was claimed 10

Show all 10 facts

Related talks

Bring Your Favorite Language to React Native, Robert Pasiński · WhoBuilt