matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Start addressing some wasm32-unknown-unknown errors for matrix-sdk-ui crate

Open zzorba opened this issue 1 year ago • 2 comments

This change consists mostly of type-wrangling to support building the matrix-sdk-ui crate for wasm32-unknown-unknown. It is a step along the way of (ideally) supporting wasm32 throughout the entire project. The matrix-sdk-ui packages is not yet compiling due to some blocking issues, but these changes should be able to be landed now as a step towards that goal.

The changes consist of one of two main types.

  1. Promoting some types related to futures to the matrix-sdk-base, where an existing 'polyfill' of sorts for Futures already existed. This includes stuff around 'boxing' futures and aborting them.
  2. Switching to use the matrix-sdk-base spawn instead of tokio::spawn. On non-wasm32 platforms this should be a noop.
  • [ ] Public API changes documented in changelogs (optional)

Signed-off-by: Daniel Salinas

zzorba avatar Oct 12 '24 18:10 zzorba

Codecov Report

Attention: Patch coverage is 42.85714% with 12 lines in your changes missing coverage. Please review.

Project coverage is 84.84%. Comparing base (8865e2f) to head (2592405).

Files with missing lines Patch % Lines
crates/matrix-sdk-common/src/executor.rs 56.25% 7 Missing :warning:
crates/matrix-sdk-base/src/store/observable_map.rs 0.00% 4 Missing :warning:
crates/matrix-sdk/src/sliding_sync/mod.rs 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4122      +/-   ##
==========================================
- Coverage   84.89%   84.84%   -0.05%     
==========================================
  Files         272      271       -1     
  Lines       29167    29179      +12     
==========================================
- Hits        24761    24758       -3     
- Misses       4406     4421      +15     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 13 '24 15:10 codecov[bot]

With an additional change to relax the use of Send+Sync in the eyeball package, I have the rest of this crate building locally.

remaining.patch

zzorba avatar Oct 13 '24 19:10 zzorba

Afraid I'm going to have to close this for now, will revisit in the new year when we have time to focus on this effort again.

zzorba avatar Nov 05 '24 14:11 zzorba

I rebased my patches and bunch of new changes: https://github.com/matrix-org/matrix-rust-sdk/compare/main...maan2003:matrix-rust-sdk:push-rumyppqlqkkq?expand=0

But I don't have the energy to go through review :/

maan2003 avatar Nov 06 '24 17:11 maan2003