Xuanwo commented on issue #3803:
URL: 
https://github.com/apache/incubator-opendal/issues/3803#issuecomment-1873125437

   Hi @fyears, thank you for your interest! As @Young-Flash mentioned, our 
WebAssembly support is still in the early stages and not yet ready for 
practical use.
   
   > * any doc to use the wasm version? by importing any library in 
js/typescript? any npm package?
   
   Not yet. WASM support is still in active development, and we need to address 
existing bugs such as https://github.com/apache/incubator-opendal/issues/3810 
before proceeding.
   
   We haven't released it yet. (However, you can create a wasm library by 
running `cargo add opendal` and building it.)
   
   > * would you like to consider adding hooks for js fetch function? For 
example, I plan to use opendal in a special js environment and I have to use a 
special fetch function to get around the annoying cors limitatioms. Moreover, 
users might need to intercept/monitor/debug some network connections .
   
   We are using 
[`web-sys`](https://rustwasm.github.io/wasm-bindgen/api/web_sys/) now, and I'm 
not sure if `web-sys` support this use case.
   
   > * would you like to consider adding hooks for js fs functiom? For example, 
in browser environment, file system might need some mocking by using indexeddb.
   
   We will not support the `fs` service on wasm, which means there's no need to 
provide hooks either. We have a plan to support opfs: 
https://github.com/apache/incubator-opendal/issues/2442. If users require 
IndexedDB, we can offer native support for it.
   
   > * in js world, there is a technique called “tree shaking” (by importing 
part of the package). For example developers only interested in s3 might only 
import opendal/s3 without importing others. It’s especially useful to support 
this because users have to download the assets in browser environment. Is it 
possible for opendal to support tree shaking?
   
   Nice question. We want this as well, but I'm not sure how to implement it. 
We can re-visit this after we have build a usable opendal wasm lib.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to