Repository navigation
Conversation
tomayac
left a comment
There was a problem hiding this comment.
Thanks a lot for this, @jurerotar! This looks great! Two quick remarks:
The shipped sqlite3-worker1.mjs imports ./sqlite3.mjs, which is built without the COS flag, so Workers don't get the COS benefits. Since many apps run SQLite in a worker for OPFS, could we also pass emcc.flags.esm=-sCROSS_ORIGIN_STORAGE and have the hash step patch both loaders? The Wasm file is the same for both main thread and Worker, so the hash is likewise the same.
This is something Claude noted, so passing it on:
emcc.flags.bundler=… on the command line replaces the value upstream's mkwasmbuilds.c generates. That's empty today (zEmccExtra = 0 for .bundler), but a quick check in the script that upstream's value is still empty would stop us from silently dropping flags SQLite adds later.
Sure! I was purposely excluding sqlite3.mjs, because worker1 and promiser apis are deprecated, but honestly, no reason why improvements can't be applied to them anyway. I'll fix this right up! Edit: Alrighty, tiny problem. |
We enable COS only for bundler-friendly build, since sqlite3.mjs is used only in deprecated promiser and worker builds and node.js build has no use for this.
Addresses #178.