opendal
opendal copied to clipboard
WASM Support
We need to wait for some key deps to support wasm:
- https://github.com/tokio-rs/tokio/pull/4716
https://github.com/tokio-rs/tokio/pull/4716 has been closed. We can try to find out how blocks are in front of us.
We can allow accessing s3/gcs from browser
Some blocks:
- ureq: we need to find a replace for ureq related API.
- maybe we need to call: https://docs.rs/web-sys/latest/web_sys/struct.Request.html
- web_sys::RequestInit is not send
note: future is not `Send` as this value is used across an await
--> /home/xuanwo/.cargo/registry/src/github.com-1ecc6299db9ec823/reqwest-0.11.14/src/wasm/client.rs:225:57
|
185 | let mut init = web_sys::RequestInit::new();
| -------- has type `web_sys::features::gen_RequestInit::RequestInit` which is not `Send`
...
225 | let js_resp = super::promise::<web_sys::Response>(p)
| _________________________________________________________^
226 | | .await
| |______________^ await occurs here, with `mut init` maybe used later
...
252 | }
| - `mut init` is later dropped here
= note: required for the cast from `impl futures::Future<Output = std::result::Result<rps::RpCompleteMultipart, error::Error>>` to the object type `dyn futures::Future<Output = std::result::Result<rps::RpCompleteMultipart, error::Error>> + std::marker::Send`
We can use https://docs.rs/tokio/latest/tokio/task/struct.LocalSet.html for JsFuture