feat(examples): Electron offline-first todo app with SQLite persistence#1345
Open
kevin-dp wants to merge 6 commits intokevin/persistence-electronfrom
Open
feat(examples): Electron offline-first todo app with SQLite persistence#1345kevin-dp wants to merge 6 commits intokevin/persistence-electronfrom
kevin-dp wants to merge 6 commits intokevin/persistence-electronfrom
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: |
Contributor
|
Size Change: 0 B Total Size: 94.6 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 3.85 kB ℹ️ View Unchanged
|
…stence Adds a complete Electron example demonstrating offline-first architecture with TanStack DB, combining SQLite persistence for collection data with a SQLite-backed offline transaction outbox. Key features: - SQLite persistence via IPC bridge (main process ↔ renderer) - Custom ElectronSQLiteStorageAdapter for the offline transactions outbox, ensuring pending mutations survive app restarts - Server state persisted to JSON file so data survives dev server restarts - fetchWithRetry for resilient network calls with exponential backoff - Reset button to clear all state (server, SQLite, outbox) - DevTools menu (Cmd+Shift+I) for testing offline mode - StrictMode-safe initialization (ref guard prevents ghost Web Lock from double-mount blocking leader election) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sort devDependencies alphabetically and align concurrently version with the rest of the workspace. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use ElectronCollectionCoordinator in the Electron todo app so that local mutations are routed through the leader and all windows receive immediate tx:committed notifications, eliminating the flash on insert. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fb9f996 to
784699e
Compare
15902a8 to
741845b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ElectronSQLiteStorageAdapter)pnpm devrestartsfetchWithRetryfor resilient network calls with exponential backoffTest plan
cd examples/electron/offline-first && pnpm install && pnpm devpnpm dev— todos still there🤖 Generated with Claude Code