Skip to content
Source
Sign inSign up
TanStack/db

Load browser SQLite WASM as a separate asset by default #2103

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 22 commits intomain fromrefs/pull/2103/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 26 changed files with 88 additions and 0 deletions (loading 22).

x
0 of 26 viewed, 26 left
5 additions and 0 deletions.changeset/browser-sqlite-separate-wasm.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/browser-db-sqlite-persistence': patch
+---
+​
+Ship wa-sqlite WebAssembly as a separate asset that the browser loads automatically, instead of inlining it in the OPFS worker. In Vite development, the package finds its assets without configuration; production builds drop that lookup. An install that Vite cannot resolve by package name, or a worker from another installed version of the package, now reports `PersistenceUnavailableError`, and excluding the package from pre-bundling fixes it.
9 additions and 0 deletions.github/workflows/e2e-tests.ymlModified
View file
@@ -136,6 +136,15 @@
cd packages/browser-db-sqlite-persistence
pnpm test:opfs-fairness
​
+ - name: Run Browser SQLite packaged consumer E2E tests
+ if: matrix.group == 'browser'
+ # Build browser dependencies already built this package's workspace
+ # dependencies; test:e2e would rebuild them.
+ run: |
+ cd packages/browser-db-sqlite-persistence
+ pnpm build
+ pnpm exec vitest --config vitest.e2e.config.ts --run
+​
- name: Run Browser SQLite OPFS with live Electric E2E tests
if: matrix.group == 'browser'
run: |