Skip to content

feat(wasm): complete PR of all wasm related changes to compile matrix-sdk-ffi bindings #5127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

zzorba
Copy link
Contributor

@zzorba zzorba commented May 28, 2025

Here is a complete PR that contains all changes needed to compile the matrix-sdk-ffi bindings on a wasm PR. This is not intended to be reviewed/merged, but serve as a reference for the other smaller PRs with an e2e working example.

The first 5 commits on this branch correspond to separate PRs that have already been opened. The last mega-commit needs to be broken up further after those 5 commits have landed.

The remaining changes correspond to roughly:

  • Relaxing Send conditionally on the async_trait annotations
  • Removing components related to sqlite + files from the matrix-sdk-ffi crate conditionally.
  • Avoiding the use of anyhow, which has Send requirements that are not met on a wasm platform.
  • Removing wasm32 restrictions on some code (qrcode, many e2e features, timeline subscriptions), which are no longer needed due to improvements in upstream dependencies. Most of these seem to have been added defensively/reflexively.

With these bindings, it is possible to use https://github.com/jhugman/uniffi-bindgen-react-native to generate JS/TS bindings that are callable from normal JS code for all elements marked as uniffi.

  • Public API changes documented in changelogs (optional)

Signed-off-by: Daniel Salinas

@zzorba
Copy link
Contributor Author

zzorba commented May 28, 2025

From bindings/matrix-sdk-ffi, this can be compiled with the following command: cargo build --target wasm32-unknown-unknown --features js --no-default-features

@zzorba
Copy link
Contributor Author

zzorba commented May 28, 2025

One thought looking at this, would I be better off exporting the 'useful' things from matrix-sdk-common from the matrix-sdk crate, instead of adding more deps onto matrix-sdk-common externally?

@zzorba zzorba force-pushed the wasm_mega_pr branch 6 times, most recently from b5b9905 to 7a33aac Compare June 4, 2025 13:37
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.83%. Comparing base (34d3cd4) to head (fa7f596).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5127      +/-   ##
==========================================
- Coverage   85.87%   85.83%   -0.04%     
==========================================
  Files         338      339       +1     
  Lines       37070    37392     +322     
==========================================
+ Hits        31834    32096     +262     
- Misses       5236     5296      +60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zzorba zzorba force-pushed the wasm_mega_pr branch 7 times, most recently from fa7f596 to 8cd3431 Compare June 6, 2025 13:21
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.

1 participant