Skip to content

Bump uniffi to 0.30.x - #343

Merged
jhugman merged 16 commits into
mainfrom
jhugman/bump-uniffi-to-0.30.x
Feb 27, 2026
Merged

jhugman merged 16 commits into
mainfrom
jhugman/bump-uniffi-to-0.30.x

Conversation

@jhugman

@jhugman jhugman commented Feb 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #316 .

This PR takes inspiration from–but supercedes #322, #333 and #338.

Changes in uniffi 0.30 changelog.

Closes #322
Closes #333
Closes #338

@jhugman
jhugman force-pushed the jhugman/bump-uniffi-to-0.30.x branch from 35e52ea to a221f6b Compare February 25, 2026 18:00
…r to UniffiHandle

Pure mechanical rename across TypeScript sources and codegen templates.
Add `CustomTupleError` fixture to demonstrate and test custom types used
as error types. Update `ffi_error_converter_name` in filters.rs to unwrap
`Type::Custom { builtin }` when the builtin is an Enum or Object, so the
correct FfiConverter is used for error handling.

Corresponding to mozilla/uniffi-rs#2658
…ts only)

Add a `call_trait_impl` function to the ext-types sub-lib that accepts
an `Arc<dyn UniffiOneTrait>` (an external trait from a different crate),
and add a TypeScript test that implements `UniffiOneTrait` in TypeScript
and passes it to the Rust function via `callTraitImpl`.

The feature works without code generation changes because:
- `FfiConverterTypeUniffiOneTrait` is a `FfiConverterObjectWithCallbacks`
  defined in the `uniffi_one_ns` generated module
- The vtable for `UniffiOneTrait` is registered there and handles both
  Rust-backed and TypeScript-backed implementations via the handle map
- The `imported_types_sublib` module correctly imports and reuses this
  converter from `uniffi_one_ns`, so lowering a TypeScript object works
  transparently across crate boundaries

Corresponds to: mozilla/uniffi-rs#2430
@jhugman
jhugman force-pushed the jhugman/bump-uniffi-to-0.30.x branch from a221f6b to 954284f Compare February 25, 2026 19:03
@jhugman
jhugman requested a review from zzorba February 25, 2026 19:04
- Add #[uniffi::trait_interface] to pub trait Getters in traits.rs
- Uncomment Getters interface definition in coverall.udl (as [Trait, WithForeign])
- Uncomment make_rust_getters, test_getters, test_round_trip_through_rust,
  and test_round_trip_through_foreign namespace functions in the UDL
- Add coverall.initialize() call to test_coverall.ts to register the
  Getters vtable before any foreign-trait calls are made
- Add TypeScriptGetters class implementing all Getters methods including
  the "unexpected-error" case that triggers CALL_UNEXPECTED_ERROR
- Add four new tests exercising Rust and TypeScript Getters implementations,
  round-trip-through-rust, and round-trip-through-foreign paths
Documents new features (uniffi traits for records/enums, external trait
objects, custom error types, custom type defaults), the uniffi-rs 0.30.x
bump, and breaking renames of UniffiRustArcPtr→UniffiGcObject and
UnsafeMutableRawPointer→UniffiHandle.

Also fixes the malformed ## header in the Upcoming releases section.
- uniffi-trait `Ord` in objects,
- unifff-traits in enums and records.
- implementing traits from external crates to callback-interfaces.md
@jhugman
jhugman force-pushed the jhugman/bump-uniffi-to-0.30.x branch from 6bb39c6 to 21cf48e Compare February 25, 2026 20:05

@zzorba zzorba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I think the choices you made on handling the toString + compare methods in typescript are very idiomatically reasonable, given the language limitations around non-class types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump to uniffi-rs 0.3.0

2 participants