WebAssembly (WASM) is a modern binary instruction format for a stack-based virtual machine. It is designed as a portable compilation target for high-level languages like C/C++ and Rust, enabling deployment on the web for client and server applications. WASM aims to enable near-native performance for web applications, providing a more efficient and secure alternative to traditional JavaScript. Its key features include fast loading times, efficient execution, and the ability to run alongside JavaScript, allowing developers to build complex client-side web applications that perform better than those written solely in JavaScript.
By adding WASM support for opendal, we will allow users to use opendal in targets like wasm32-unknown-unknown. In a short word, users can use opendal in web browser!
We have addressed most blockers by #3796 and adding a basic test for s3 #3802. It's time for us to move forward.

This tracking issue is used to track our current progress of wasm support. Welcome to join in us!
Tasks
Add OPFS support
After opendal is ready for WASM, we can start to work for opfs now!
Add support for more services
Please run the following command to check if opendal can build under wasm32 arch:
cargo build --target wasm32-unknown-unknown --no-default-features --features=services-s3
Visit #3796 for possible fix or ask directly in this issue.
It's possible that some services can't support wasm at all, like fs. Please also provide your feedback here. We will collect them into a seperate doc.
Testing
Benchmark
Existing issues
By adding WASM support for opendal, we will allow users to use
opendalin targets likewasm32-unknown-unknown. In a short word, users can useopendalin web browser!We have addressed most blockers by #3796 and adding a basic test for s3 #3802. It's time for us to move forward.
This tracking issue is used to track our current progress of wasm support. Welcome to join in us!
Tasks
Add OPFS support
After opendal is ready for WASM, we can start to work for opfs now!
Add support for more services
Please run the following command to check if opendal can build under
wasm32arch:Visit #3796 for possible fix or ask directly in this issue.
It's possible that some services can't support wasm at all, like
fs. Please also provide your feedback here. We will collect them into a seperate doc.cacache(can't support)etcd(can't support)foundationdb(can't support)fs(can't support)hdfs(can't support)mongodb(can't support)mysql(can't support)persy(can't support)postgresql(can't support)redb(can't support)redis(can't support)rocksdb(can't support)sftp(can't support)sled(can't support)sqlite(can't support)tikv(can't support)Testing
Benchmark
Existing issues
wasm-pack test --nodedoesn't work fors3_read_on_wasmwasm-pack test --chrome --headlessdoesn't work fors3_read_on_wasm#3809