Skip to content

Conversation

@fewerner
Copy link
Contributor

@fewerner fewerner commented Oct 7, 2025

What's new in this PR

This PR removes the explicit usage of wasm-bindgen for target wasm32-unknown-unknown .
It replaces it with uniffi-bindgen-react-native which takes uniffi annotations to create a wasm-bindgen crate from which it compiles to wasm32-unknown-unknown .

Here an overview of what's still open to do:

  • Remove compilation warnings in wasm crate compilation step
  • make teardown of database connection not timeout
  • adjust interop tests
  • Adjust CI
  • Rebase
  • wasm-pack tests

A very helpful reference is the ubrn documentation:
https://jhugman.github.io/uniffi-bindgen-react-native/guides/web/pre-installation.html


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

🐰 Bencher Report

Branchfelix/feat/uniffi-wasm-ubrn
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
Commit add f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
17,756.00 µs
Commit add f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
736.50 µs
Commit add f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
4,169.90 µs
Commit add f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
7,607.20 µs
Commit add f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
11,750.00 µs
Commit add f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
14,456.00 µs
Commit add f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
984,310.00 µs
Commit add f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
735.98 µs
Commit add f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
79,234.00 µs
Commit add f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
216,240.00 µs
Commit add f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
423,590.00 µs
Commit add f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
672,290.00 µs
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
116,450.00 µs
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
23,129.00 µs
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
41,796.00 µs
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
57,860.00 µs
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
77,304.00 µs
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
93,409.00 µs
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
⚠️ NO THRESHOLD
17,178.00 µs
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
⚠️ NO THRESHOLD
116,500.00 µs
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
⚠️ NO THRESHOLD
35,348.00 µs
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
⚠️ NO THRESHOLD
56,560.00 µs
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
⚠️ NO THRESHOLD
75,778.00 µs
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
⚠️ NO THRESHOLD
96,232.00 µs
Commit remove f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
10,999.00 µs
Commit remove f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
567.64 µs
Commit remove f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
2,301.70 µs
Commit remove f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
4,087.40 µs
Commit remove f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
6,249.70 µs
Commit remove f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
8,296.80 µs
Commit remove f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
13,588.00 µs
Commit remove f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
134,620.00 µs
Commit remove f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
110,500.00 µs
Commit remove f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
86,882.00 µs
Commit remove f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
62,421.00 µs
Commit remove f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
38,648.00 µs
Commit update f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
134,560.00 µs
Commit update f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
760.90 µs
Commit update f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
28,088.00 µs
Commit update f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
54,946.00 µs
Commit update f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
82,334.00 µs
Commit update f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
108,210.00 µs
🐰 View full continuous benchmarking report in Bencher

@fewerner fewerner force-pushed the felix/feat/uniffi-wasm-ubrn branch from a98f433 to cb5bc36 Compare October 8, 2025 12:40
@SimonThormeyer SimonThormeyer force-pushed the felix/feat/uniffi-wasm-ubrn branch from cb5bc36 to 7bf2b56 Compare October 8, 2025 14:13
@fewerner fewerner force-pushed the felix/feat/uniffi-wasm-ubrn branch 3 times, most recently from 52205b8 to 7a1757e Compare October 16, 2025 09:54
@fewerner fewerner force-pushed the felix/feat/uniffi-wasm-ubrn branch 2 times, most recently from 32b1d51 to dea4e35 Compare October 30, 2025 10:03
@fewerner fewerner changed the title Felix/feat/uniffi wasm ubrn feat: use urbn for wasm target Oct 30, 2025
@fewerner fewerner force-pushed the felix/feat/uniffi-wasm-ubrn branch 21 times, most recently from 7b62e01 to b0a8720 Compare November 5, 2025 14:52
The import of inMemoryDatabase pointed to the old file, idk if this got
messed up during rebase.
cipherSuite should also be imported from the ts file instead of the js
file in this bun test.
uniffi generates interfaces that it uses in function signatures.
At this point we are aware that we loose some type safety because the
Interface is a weak type and the actual uniffi class that implements the
type is a strong type.
We consider flagging this in the ubrn repo.
- ubrns factories have create, new and default methods with links in
docs strings that can't be resolved.
- uniffiDestroy methods have an inheritDocs tag which fails, potentially
because we mock ubrn for the types (should be resolved with next
release)
Compiling the intermediate wasm crate produces some deprecation warnings
that we ignore at this point.
we have to call wasm-build separately
ubrn doesn't allow us to reuse the ffi artifact. We should consider
contributing to it so this is possible but for now we should not depend
on this artifact
We want to define these functions as static members instead of instance
members. Thus, we define them as free functions here and make them
static members in the wrappers due to uniffi limitations. This also
removes some code duplication between CoreCrypto and CoreCryptoContext
on rust side.
This aligns the methods with ts and swift
The bun postinstall script needs yarn. Fortunately, it is enough to
provide it as a dev dependency.
We don't use this file. Make stamps and CI artifacts should not depend
on it.
@fewerner fewerner force-pushed the felix/feat/uniffi-wasm-ubrn branch from e0758f8 to 81b8c47 Compare November 20, 2025 11:47
@fewerner fewerner merged commit 81b8c47 into main Nov 20, 2025
52 checks passed
@fewerner fewerner deleted the felix/feat/uniffi-wasm-ubrn branch November 20, 2025 12:23
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.

6 participants