@Guy Bedford before I hack together a solution, I thought I'd ask here first...
What are your thoughts on the best way to wire up WASI to Browser storage (ie. localstorage)? I see there are wasi wits for filesystem
and io
, wondering if you have any insight on the best way to do this in today's day?
Right now I was just thinking of importing a JavaScript handle to a function, but thought perhaps you had alternate ideas?
I think ideally JCO offer standard ways of using Web APIs just like wasm-bindgen does, supporting automatic integration of some standard web WITs for things like local storage.
Then if we had that - one could then use a wasi-virt-style approach in JCO to virtualize WASI-fs on top of a browser local storage, all within the component model composition primitives.
Certainly a custom localstorage WIT is a good place to start, but if anyone is interested in tackling some of these problems more generally it would be great to have contributions and I'd be happy to provide guidance.
I took a look at IndexedDB via WIT this week, and it looks like we should probably wait for async to land, as the APIs to browser storage is async.
Last updated: Nov 22 2024 at 16:03 UTC