Skip to content

Commit 0c20635

Browse files
Daniel Salinasclaude
authored andcommitted
Complete uniffi 0.29 upgrade and async callback infrastructure
This commit completes the uniffi upgrade from 0.28.0 to 0.29.1 and establishes the infrastructure for async callbacks in WASM32 environments. Key changes: - Upgrade uniffi to 0.29.1 with git source for async callback support - Fix FFI macros to use smart async runtime selection for WASM32 vs native - Update tokio features across matrix-sdk crates for WASM32 compatibility - Add TypeScript bindings configuration to uniffi.toml - Fix xtask build system for uniffi 0.29 API changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8834d2d commit 0c20635

File tree

12 files changed

+153
-108
lines changed

12 files changed

+153
-108
lines changed

Cargo.lock

Lines changed: 85 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ base64 = "0.22.1"
3333
bitflags = "2.8.0"
3434
byteorder = "1.5.0"
3535
chrono = "0.4.39"
36+
console_error_panic_hook = "0.1.7"
3637
eyeball = { version = "0.8.8", features = ["tracing"] }
3738
eyeball-im = { version = "0.7.0", features = ["tracing"] }
3839
eyeball-im-util = "0.9.0"
@@ -93,8 +94,9 @@ tracing = { version = "0.1.40", default-features = false, features = ["std"] }
9394
tracing-core = "0.1.32"
9495
tracing-subscriber = "0.3.18"
9596
unicode-normalization = "0.1.24"
96-
uniffi = { version = "0.28.0" }
97-
uniffi_bindgen = { version = "0.28.0" }
97+
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "c7f6caa3d1bf20f934346cefd8e82b5093f0dc6f" }
98+
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "c7f6caa3d1bf20f934346cefd8e82b5093f0dc6f" }
99+
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "c7f6caa3d1bf20f934346cefd8e82b5093f0dc6f" }
98100
url = "2.5.4"
99101
uuid = "1.12.1"
100102
vodozemac = { version = "0.9.0", features = ["insecure-pk-encryption"] }

bindings/matrix-sdk-ffi-macros/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ pub fn export(attr: TokenStream, item: TokenStream) -> TokenStream {
4848

4949
let attr2 = proc_macro2::TokenStream::from(attr);
5050
let item2 = proc_macro2::TokenStream::from(item.clone());
51-
5251
let res = match syn::parse(item) {
5352
Ok(item) => match has_async_fn(item) {
54-
true => quote! { #[uniffi::export(async_runtime = "tokio", #attr2)] },
53+
true => {
54+
quote! {
55+
#[cfg_attr(target_arch = "wasm32", uniffi::export(#attr2))]
56+
#[cfg_attr(not(target_arch = "wasm32"), uniffi::export(async_runtime = "tokio", #attr2))]
57+
}
58+
}
5559
false => quote! { #[uniffi::export(#attr2)] },
5660
},
5761
Err(e) => e.into_compile_error(),

0 commit comments

Comments
 (0)