mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 12:04:21 +01:00
Lots of cleanup still left to do. Draft PR for adding support for OPFS for WASM build (add support for limbo in browser). Overall explanation of the architecture: this follows the sqlite wasm architecture for OPFS. main <> (limbo-worker.js) limbo (VFS - opfs.js) <> opfs-sync-proxy The main thread loads limbo-worker.js which bootstraps the opfs.js and opfs-sync-proxy.js and then launches the limbo-wasm.js. At that point it can be used with worker.postmessage and worker.onmessage interactions from the main thread. The VFS provided by opfs.js provides a sync API by offloading async operations to opfs-sync-proxy.js. This is done through SharedArrayBuffer and Atomic.wait() to make the actual async operations appear synchronous for limbo. resolves #531 Closes #594