Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b83dda0
chore(quest): claim quest/m2/uniffi-namespaces.md
kixelated Oct 24, 2026
22a18e2
wip(uniffi): key types by crate and name, and fix Python's same-name …
kixelated Oct 24, 2026
5b3af97
wip(uniffi): walk an external type through its own crate's interface
kixelated Oct 24, 2026
a035366
wip(uniffi): Go keeps a type's helpers apart from an external namesake's
kixelated Oct 24, 2026
02224ef
wip(uniffi): rename the namespaces fixture's bounds to find_bounds
kixelated Oct 24, 2026
7a03932
Merge branch 'quest/m2/uniffi-namespaces-go' into quest/m2/uniffi-nam…
kixelated Oct 24, 2026
efbcbf6
wip(uniffi): rename the namespaces fixture's bounds to find_bounds
kixelated Oct 24, 2026
3f1ba5c
wip(uniffi): rename the namespaces fixture's bounds to find_bounds
kixelated Oct 24, 2026
51845d3
wip(uniffi): rename the namespaces fixture's bounds to find_bounds
kixelated Oct 24, 2026
249079e
wip(uniffi): rename the namespaces fixture's bounds to find_bounds
kixelated Oct 24, 2026
3db65bc
wip(uniffi): same-named external types in C++ and C
kixelated Oct 24, 2026
a5cd4d4
Merge branch 'quest/m2/uniffi-namespaces-cpp' into quest/m2/uniffi-na…
kixelated Oct 24, 2026
4cd2331
wip(uniffi): qualify external types in the Dart generator
kixelated Oct 24, 2026
0f302bb
wip(uniffi): Swift names ambiguous external types through their module
kixelated Oct 24, 2026
e2ce803
wip(uniffi): qualify external types in Kotlin with their package
kixelated Oct 24, 2026
2697682
wip(uniffi): C++ catches another crate's error by its qualified class
kixelated Oct 24, 2026
b2e2828
Merge branch 'quest/m2/uniffi-namespaces-swift' into quest/m2/uniffi-…
kixelated Oct 24, 2026
3be3698
wip(uniffi): format the Dart generator's namespace changes
kixelated Oct 24, 2026
73de3aa
Merge branch 'quest/m2/uniffi-namespaces-dart' into quest/m2/uniffi-n…
kixelated Oct 24, 2026
c0a8522
wip(uniffi): Dart takes its shared runtime from the same crate every run
kixelated Oct 24, 2026
e27654a
Merge branch 'quest/m2/uniffi-namespaces-kotlin' into quest/m2/uniffi…
kixelated Oct 24, 2026
92c23cc
Merge remote-tracking branch 'origin/main' into quest/m2/uniffi-names…
kixelated Oct 24, 2026
da5520b
docs(uniffi): record the namespaces change and its migration
kixelated Oct 24, 2026
899cc21
fix(uniffi): resolve a Dart variant's enum in its crate, and import e…
kixelated Oct 24, 2026
8670b55
Merge remote-tracking branch 'origin/main' into quest/m2/uniffi-names…
kixelated Oct 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ members = [
"uniffi/dart/fixtures/library_config",
"uniffi/dart/fixtures/map_type",
"uniffi/dart/fixtures/metadata",
"uniffi/dart/fixtures/namespaces",
"uniffi/dart/fixtures/proc-macro",
"uniffi/dart/fixtures/proc-macro-no-implicit-prelude",
"uniffi/dart/fixtures/simple-fns",
Expand Down Expand Up @@ -86,6 +87,8 @@ members = [
"uniffi/fixtures/metadata",
"uniffi/fixtures/multi-arch-extract",
"uniffi/fixtures/mutable-records",
"uniffi/fixtures/namespaces/media",
"uniffi/fixtures/namespaces/net",
"uniffi/fixtures/proc-macro",
"uniffi/fixtures/proc-macro-no-implicit-prelude",
"uniffi/fixtures/regressions/cdylib-crate-type-dependency/cdylib-dependency",
Expand Down
1 change: 0 additions & 1 deletion quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ deletes the quests that follow it.
- [Shared ownership](/quest/m2/ts-shared.md) - `Arc`/`Rc`/`Weak` keep exact counts, and locks and atomics become plain values
- [Collections](/quest/m2/ts-collections.md) - maps, sets, and queues keep Rust's key semantics
- [Translate moq-net's model to TypeScript](/quest/m2/ts-model.md) - the driver grows from moq-net's codec to its model, for moq to compare against WASM
- [Namespaced external types](/quest/m2/uniffi-namespaces.md) - two crates linked into one library can each export a same-named type in every generator
- [Zero-copy byte returns](/quest/m2/ffi-bytes-return.md) - returned payloads reach the host without a copy, if the payload numbers justify it
- [Cheaper async](/quest/m2/ffi-async.md) - `RustFuture` exports cost fewer crossings, if the numbers show they matter
- [Namespaced FFI contract](/quest/m2/uniffi-contract.md) - bindings and a cdylib from different UniFFI forks refuse to load together
Expand Down
4 changes: 0 additions & 4 deletions quest/m2/uniffi-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ anyway.

Public API: the generated contract check, and the scaffolding's exported
contract symbol.

## Related

- [Namespaced external types](/quest/m2/uniffi-namespaces.md) - may change the contract first
37 changes: 0 additions & 37 deletions quest/m2/uniffi-namespaces.md

This file was deleted.

10 changes: 10 additions & 0 deletions uniffi/MIGRATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Migrating

## Unreleased

- `uniffi_bindgen`: a name no longer identifies a type across crates.
`ComponentInterface::is_name_used_as_error(name)` is now `is_used_as_error(&ty)`,
`ComponentInterface::get_type(name)` finds only the crate's own types, and
`VisitMut::visit_error_name` takes the module path of the crate that defines the error.
- Generated C: every type and function name starts with the crate's namespace, so a crate
whose items did not already start with it gets renamed C symbols.
17 changes: 17 additions & 0 deletions uniffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ uniffi-rs:
consumer.
- Test expectations that hold a path relative to the workspace root (`file!()` output and
trybuild snapshots) gain the `uniffi/` prefix.
- A crate can use another crate's type of the same name
([mozilla/uniffi-rs#3026](https://github.com/mozilla/uniffi-rs/issues/3026)): the type
universe, the errors, and the recursion check key types by crate and name, and an external
type is walked through its own crate's interface. Kotlin spells external types with their
package, Swift qualifies an ambiguous one with its module (so same-named types need one
Swift module per crate), and Python keeps both definitions (mozilla/uniffi-rs#2985, from
upstream `main`). Container helpers for an external type carry its namespace. The
`namespaces` fixture covers it in every generator.
- Scaffolding is written to a temporary file and renamed into place. Two trybuild cases
expanding `generate_and_include_scaffolding!` on one UDL write it concurrently, and the
in-place truncate let one include a partial file.
Expand All @@ -82,6 +90,8 @@ uniffi-bindgen-go, on top of upstream v0.7.1+v0.31.0:
- The UniFFI 0.32 port ([NordSecurity/uniffi-bindgen-go#98](https://github.com/NordSecurity/uniffi-bindgen-go/pull/98)).
- Generated async calls take a `context.Context` and cancel the Rust future.
- An exported `Display` on an enum error renders as its `Error()`.
- Container helpers for another crate's type carry its namespace, so they don't collide with
a same-named local type's.
- `Types.go` renders its object, enum, error, record, callback interface, and custom type
templates in their own functions, with byte-identical output. Inlined into one, the borrow
checker took about 16 GB to check it, more than a CI runner has.
Expand All @@ -94,10 +104,17 @@ uniffi-dart, on top of upstream `main` at acterglobal/uniffi-dart@72d26c1:
disposed objects refused as arguments.
- Record errors keep their converter name, and futures cancel per operation (moq's
`nix/uniffi-dart-record-error.patch` and `nix/uniffi-dart-cancellation.patch`).
- Another crate's library is imported with a `uniffi_<namespace>` prefix that its types,
converters, and container helpers go through, the shared runtime comes from the same crate
every run, and the test harness drives library mode.

uniffi-bindgen-cpp, on top of upstream `main` at NordSecurity/uniffi-bindgen-cpp@20bef75:

- LiveKit's async support (livekit/uniffi-bindgen-cpp, by Alan George), ported to UniFFI 0.32.
- `error_style = "expected"`, `strip_type_prefix`, exported `Display` and `Debug` on enums,
newline-terminated files, released async results, and the C backend (`--lang c`).
- The CMake test suite finds the fixtures in the root workspace's target directory.
- Another crate's types are qualified from the global namespace, with aliased converters and
namespaced container helpers, definitions sort per crate, and `strip_type_prefix` renames
per crate. The C backend supports external types, and prefixes every C name with its
namespace.
17 changes: 12 additions & 5 deletions uniffi/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ and RTTI may be off) and include only `<namespace>.h` from C.
uniffi-bindgen-cpp --lang c --library your_rust_library.so --out-dir output_directory
```

Names are the uniffi names in snake case: `MyObject.do_thing` is `my_object_do_thing`, and its
handle is `my_object *`, released with `my_object_free`. The rest follows from a few rules:
Names are the uniffi names in snake case, prefixed with the namespace unless they already start
with it, since every crate's C API shares one scope: in namespace `app`, `MyObject.do_thing` is
`app_my_object_do_thing`, and its handle is `app_my_object *`, released with
`app_my_object_free`; `AppObject` is `app_object`. The rest follows from a few rules:

* A call that can fail returns an error struct, or NULL on success, and writes its result to a
trailing `out` pointer. An error is a tagged union with a `message`; free it with `<error>_free`.
Expand All @@ -79,9 +81,14 @@ handle is `my_object *`, released with `my_object_free`. The rest follows from a
or will never run.
* Callbacks run on the default dispatcher thread unless `<namespace>_set_dispatcher` installs a
host's own, which receives `<namespace>_work *` items to run with `<namespace>_work_run`.

The C backend refuses what it cannot render faithfully, such as callback interfaces, custom and
external types, timestamps, durations, and exported traits other than `Display` on errors.
* A type from another crate keeps that crate's C name and `_free`, and its header is included.
Generate the C API of every crate involved (one `--crate` each, or all at once) and compile
each one's `<namespace>.cpp` and `<namespace>_c.cpp`; a crate's implementation converts its
own types for the others.

The C backend refuses what it cannot render faithfully, such as callback interfaces, custom
types, timestamps, durations, and exported traits other than `Display` on errors, including in
another crate whose types it uses.

# Configuration options

Expand Down
Loading