feat(examples): add wa-sqlite OPFS persistence demo#1329
feat(examples): add wa-sqlite OPFS persistence demo#1329kevin-dp wants to merge 3 commits intocursor/persistence-plan-design-doc-f6d0from
Conversation
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-browser-wa-sqlite-persisted-collection
@tanstack/db-cloudflare-do-sqlite-persisted-collection
@tanstack/db-electron-sqlite-persisted-collection
@tanstack/db-ivm
@tanstack/db-node-sqlite-persisted-collection
@tanstack/db-react-native-sqlite-persisted-collection
@tanstack/db-sqlite-persisted-collection-core
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 94.6 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.85 kB ℹ️ View Unchanged
|
1fa0478 to
eb53ea9
Compare
…ctions Add a new /wa-sqlite route to the offline-transactions example that demonstrates collection-level persistence using wa-sqlite with OPFS. Unlike the existing IndexedDB/localStorage pages (which use offline executor mutation queuing), this uses persistedCollectionOptions for local-first data storage in a real SQLite database in the browser. - Add PersistedTodoDemo component with CRUD operations - Add persisted-todos.ts collection setup using wa-sqlite OPFS - Configure Vite to alias wa-sqlite package to source for ?worker imports - Add WASM middleware to serve .wasm files before TanStack Start's catch-all - Fix router.tsx missing getRouter export required by TanStack Start Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
490d519 to
d7a150d
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The infinite retry loop here might be related to #1065 |
Summary
/wa-sqliteroute to the offline-transactions example app demonstrating collection-level persistence using@tanstack/db-browser-wa-sqlite-persisted-collectionpersistedCollectionOptionsfor local-first data storage in a real SQLite database in the browser via OPFS.wasmrequests), source aliasing for?workerimports, and a fix for the missinggetRouterexportTest plan
pnpm devinexamples/react/offline-transactions@tanstack/dband@tanstack/db-browser-wa-sqlite-persisted-collectionNote: the IndexedDB and localStorage examples in this demo are actually broken (were already broken before this PR). The API routes at
/api/todoswon't work in SPA mode because there's no server to handle them. ThefetchWithRetrykeeps retrying with exponential backoff, causing an infinite "Loading todos..." state.🤖 Generated with Claude Code