[Request]: Web support with wasm
What do you need?
Have you considered web support ? It would be amazing for cross platform apps!
Answer is same as always. There are efforts of running sqlite on the browser. But the biggest problem is persistance, but TL:DR: it doesn't really work and adds a lot of complexity, providing this for free is not really sustainable.
Thanks for the quick reply!
In my apps, I’ve built cross-platform offline-first support with web compatibility using expo SQLite, but hit the OPFS single-tab limitation. I fixed this with a SharedWorker and master/slave architecture, similar to Notion’s approach (details here: notion wasm sqllite I can share more on my setup if you’re interested...
I’m exploring op-sqlite as a replacement, but web support is key. If you added expo-sqlite-like web compatibility, op-sqlite could directly leverage this model for a best-of-both-worlds solution. Thoughts?
Oh, I didn't know expo added support for web. It's definitely interesting, but I don't like expo only setups and I'm not familiar with the entire react-native-web compilation chain, so... PRs are welcome :)
I started playing around with this
I just added react-native-web to the sample app, and for now I'm just trying to load sqlite via @sqlite.org/sqlite-wasm. I got as far as having a SharedWorker load "correctly", however, it seems OPFS is not working. @abretonc7s if you understand webpack better maybe you can give a hand and see what is wrong.
I still have no idea how this entire thing is supposed to work as a packaged library. But if sqlite can be loaded worse case, I can just add a lot of instructions to modify the webpack config and op-sqlite can just be a API on top for web.