#codegen #uni-ffi #wasm #javascript

uniffi-runtime-javascript

Javascript runtime for UniFFI-generated bindings

1 unstable release

new 0.29.0-0 Apr 29, 2025

#198 in FFI

MPL-2.0 license

12KB
194 lines

uniffi-runtime-javascript

The command line tool uniffi-bindgen-react-native can generate Javascript bindings crate for your Rust crate, from [uniffi::export] proc-macros in your code.

These bindings crates depend on this crate. Currently this is for WASM runtimes only.

This crate is not intended to be used directly by hand-written code.

If you find this crate from a Cargo.toml, it is almost certain that the crate will have been generated.

For more information visit: https://jhugman.github.io/uniffi-bindgen-react-native

What is uniffi?

uniffi is a multi-language bindings generator for Rust, started at, and maintained by Mozilla.

For more information visit: https://mozilla.github.io/uniffi-rs

Most uniffi generated bindings go through a C ABI, called through different languages C FFI facilities. This crate is the beginnings of using Rust to call in to the C ABI.

Features

The crate is split into features, one per Javascript runtime:

  • wasm32: uses wasm-bindgen.

Future features may be:

  • napi: which uses napi-rs to provide node bindings.

Generating uniffi based bindings for other Javascript Runtimes without this crate

Dependencies

~0.5–0.8MB
~13K SLoC