jccampagne opened a new pull request, #7199: URL: https://github.com/apache/opendal/pull/7199
# Which issue does this PR close? This is a draft PR to get early feedback for OPFS backend. See https://github.com/apache/opendal/issues/5799 This only adds tests and write to OPFS backend. I will extend this PR for the missing features (read, stat, delete), if that's ok. This is still a draft, so there are debug logs, and comments in the code to help with devs; most of them will be removed later. # Rationale for this change I needed OPFS for my Rust project targetting WASM32 (in the browser). I discovered OpenDAL but OPFS support was limited, so I decided to implement it. I managed to make it work for my project (using OpenDAL as a dependency), I had implemented (read, write, stat, delete...). But the code was more like a prototype quality as I was learning OpenDA architecture and API. This is my 3rd iteration. Still early, and incomplete, but I would like some early feedback if possible to make sure I am on the right track to follow the spirit of OpenDAL. Do not hesitate to comment. As I understand it, OPFS as 2 kinds of APIs: - synchronous `FileSystemSyncAccessHandle` interface: can only be used in workers; - asynchronous `FileSystemWritableFileStream` interface: can be using in main JS thread and works, but less efficient. I decided to go for the async version as it suits my use case (for now), and it it the most generic use case and requires less setup to use (no workers). I saw the `TwoWays` trait - that could be used later to implement the alternative using the synch version of OPFS. # What changes are included in this PR? Added write. Added edge tests in `core/edge/opfs_wasm32`. I ran the tests on 3 different engine: - Gecko (firefox) - Chromium (Chrome) - Webkit (Safari) # Are there any user-facing changes? Addition of write to the OPFS operator. # AI Usage Statement Yes, Gemini and Claude to navigate the codebase, documentation; and help with some code. -- 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]
