Add Origin Private File System support
There is a recent Web API providing access to a file system private to the origin of the page. This could be useful for a cross platform application targeting desktop and WASM, using either the fs backend on desktop or the new backend on WASM.
It is not a small task, but maybe some people could find this interesting.
Interesting! I plan to make OpenDAL work in wasm first and than add OPFS support.
We are ready for this now!
That's great news ! Unfortunately, AFAIK, there is no high level API for interacting with OPFS in Rust at the moment, but the building blocks are in web-sys. The addition of OPFS was discussed in https://github.com/rustwasm/wasm-bindgen/issues/2868 if anyone is interested.
We need to wait for https://github.com/rustwasm/wasm-bindgen/issues/3755
Hello, everyone. This issue has been submitted as this year's OSPP project. I hope we can push this issue forward.
Apply for this project: https://summer-ospp.ac.cn/org/prodetail/241110348
Goal
Add Origin Private File System (OPFS) support for opendal so that users can use opfs in wasm runtime or browser.
The usage will look like:
let op = Operator::via_map(Scheme::Opfs, map)?;
let bs = op.read("path/to/file").await?;
opfs should only be provided in wasm32 target.
Requirement
- Know about Origin Private File System
- Know about how to build/test rust project
- Better to have some knowledge about WASM
Mentorship
Mentor: @PsiACE Discussion: mailing list and discord
I'm interested!
cc @PsiACE and @LYZJU2019, any updates on this?
Here are my brief ideas on implementing this service.
Tasks
- [ ] setup servies (add deps, figure out CI, add
Accessplace holder) - [ ] implement core features
- [ ] read and stat
- [ ] list
- [ ] write and create_dir
- [ ] delete
- [ ] setup tests
- [ ] examples and docs
I believe we should focus on getting our services layout ready first. https://github.com/apache/opendal/pull/5269 is almost ready but still needs some work. Maybe we can leave all functions unimplemented for now.
Hi, @LYZJU2019 do you have time to address the comments in PR? Or maybe @Eason0729 can help based on your existing work.
Hi @Xuanwo , thanks for bringing this up.
I'm happy to help out if @LYZJU2019 isn’t available. However, I’m new to this codebase, and I won’t be available for the next week. Once I’m back, I can jump in and take a look.
I have open a new issue for OPFS, hopefully we can have a working OPFS in browser soon.