Skip to content

Commit 68f7201

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 0823d50 commit 68f7201

File tree

12 files changed

+143
-108
lines changed

12 files changed

+143
-108
lines changed

Cargo.lock

Lines changed: 75 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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ base64 = "0.22.1"
3535
bitflags = "2.8.0"
3636
byteorder = "1.5.0"
3737
chrono = "0.4.39"
38+
console_error_panic_hook = "0.1.7"
3839
eyeball = { version = "0.8.8", features = ["tracing"] }
3940
eyeball-im = { version = "0.7.0", features = ["tracing"] }
4041
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"] }
@@ -158,6 +160,8 @@ tracing-core = { git = "https://github.com/element-hq/tracing.git", rev = "ca943
158160
tracing-subscriber = { git = "https://github.com/element-hq/tracing.git", rev = "ca9431f74d37c9d3b5e6a9f35b2c706711dab7dd" }
159161
tracing-appender = { git = "https://github.com/element-hq/tracing.git", rev = "ca9431f74d37c9d3b5e6a9f35b2c706711dab7dd" }
160162
paranoid-android = { git = "https://github.com/element-hq/paranoid-android.git", rev = "69388ac5b4afeed7be4401c70ce17f6d9a2cf19b" }
163+
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "c7f6caa3d1bf20f934346cefd8e82b5093f0dc6f" }
164+
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "c7f6caa3d1bf20f934346cefd8e82b5093f0dc6f" }
161165

162166
[workspace.lints.rust]
163167
rust_2018_idioms = "warn"

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)