github jhugman/uniffi-bindgen-react-native 0.31.0-8
v0.31.0-8

one hour ago

✨ What's New ✨

🖥️ @ubjs/electron

Run a native UniFFI library in an Electron utility process, and call it from a sandboxed page through the page's wasm2 --async bindings. See the Electron reference.

🔌 --async bindings connect through one port

ubrn generate wasm2 bindings --async also writes index.port.ts, whose uniffiInitAsync(port) connects every namespace through one port, and player-definitions.ts for the receiver on the far side. Use @ubjs/core and @ubjs/worker from this release.

⏳ @ubjs/node runs the async poll loop

@ubjs/node now drives each async function's future itself, as @ubjs/wasm does, and so gains a peer dependency on @ubjs/core. Abort in-flight async calls before calling unload().

🦊 What's Changed

  • @ubjs/node ships its TypeScript types, and ESM named imports of all its exports work.
  • An @ubjs/worker ChannelPort may carry a closed promise. When it settles, pending calls reject with ChannelClosedError.

Fixes

  • jsi2: objects dropped without uniffiDestroy() are freed once Hermes collects them. Upgrade @ubjs/react-native and regenerate your bindings.
  • jsi: strings, records and byte arrays that Rust passes to a JS callback no longer leak. Regenerate your jsi bindings (#510). Thank you @helios1138!
  • @ubjs/node no longer leaks memory on each call to an async method of a callback interface implemented in JS (#469). Thank you @stupside!
  • @ubjs/node works in Electron, copying buffers where V8's memory cage refuses external ones (#514, replacing #417). Thank you @injaneity for the first version of this fix!
  • @ubjs/node no longer deadlocks when an async call is cancelled while Rust wakes it.
  • A failing cancel or free is logged rather than thrown from an async call, and a free that a closed channel rejects is not logged at all.
  • A type named Cursor no longer collides with the runtime's own Cursor class (#491). Thank you @zeenix!
  • A type named like a JavaScript global, such as Object, no longer breaks the generated module: it becomes Object_ (#497). Thank you @qalqi!
  • iOS frameworks carry 0.31.0 rather than 0.31.0-8 as their bundle version, as App Store Connect requires (#512). Thank you @zzorba!

Testing and CI

  • --async fixtures also run against @ubjs/node behind a channel, and under real Electron through @ubjs/electron.
  • The N-API runtime's tests also run under Electron (#514).
  • preview-packages.yml can publish @ubjs/node previews (#523).

⚠️ Breaking Changes

  • Regenerated napi bindings need @ubjs/node and @ubjs/core from this release: on an older @ubjs/node they fail with IncompatiblePlayer. Existing bindings keep working.
  • @ubjs/worker's ChannelPort.closed is now typed as a promise.
  • @ubjs/node's register() now takes a definitions table rather than any object.
  • Types named like a JavaScript global get a trailing underscore even where they worked before: a Rust Date is now Date_ (#497).

Full Changelog: 0.31.0-7...0.31.0-8

Don't miss a new uniffi-bindgen-react-native release

NewReleases is sending notifications on new releases.