0.31.0-3
✨ What's New ✨
🟢 Node.js!
uniffi-bindgen-react-native can now generate bindings that run directly on Node.js, joining React Native and the Web as a supported target. A new N-API runtime — published to npm as @ubjs/node — loads your compiled Rust cdylib at runtime and calls into it, so a single prebuilt native addon works with any UniFFI library, with no per-library glue code to build. See the Node.js reference for how to get started.
-
A new N-API runtime added under
runtimes/(#369), later refactored into layers (#385), with single-copy and string/byte optimizations across the FFI boundary (#378, #394). -
A new
ubrn generate napi bindingscommand (aliasednode) generates the TypeScript bindings, with the location of thecdylibresolved at bindgen time via colocated, absolute, or platform-package modes (#390, #398). -
The full fixture test suite now runs against the N-API flavour (#377, #382), including on Linux via colima.
-
index.tsgeneration added to the player pipeline (#391); callback function identifiers are now suffixed with the module name to avoid collisions across crates (#393). Thank you @markharding! -
Published to npm via CI (#386); the runtime package is now
@ubjs/node(#396) and the TypeScript runtime is now@ubjs/core(#399). -
Byte arrays (
Vec<u8>) can now be globally emitted asUint8Arrayinstead ofArrayBufferby settingbindings.typescript.strictByteArraysinuniffi.toml(#383 by @coriolinus).
🦊 What's Changed
- Migrate the
wrapper-ffi.ts(#359) andwrapper.ts(#363) generation to the newpipelineAPI. - Audit default-value positions and types, add a fixture, and fix related bugs (#392).
- Fix reserved C++ words being missed during template checking (#389). Thank you @bjtrounson!
- Several Windows fixes — thank you @pepperoni505!
- Have prettier only format JS and TS files (#368). Thank you @pepperoni505!
- Remove redundant files from the published package bundle (#381). Thank you @Simek!
- Commit an auto-applied change to the lockfile (#380). Thank you @AndrewFerr!
- CI: cross-compile
x86_64-apple-darwinon Apple Silicon (#395) and remove the zig-based cross compile (#397).
Full Changelog: 0.31.0-2...0.31.0-3