Skip to content
Source
Sign inSign up
TanStack/db

feat(offline-transactions): implement offline-first transaction system #559

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

Showing 85 changed files with 97 additions and 0 deletions (loading 80).

x
0 of 85 viewed, 85 left
69 additions and 0 deletions.changeset/offline-transactions-initial.mdAdded
View file
@@ -0,0 +1,69 @@
+---
+"@tanstack/offline-transactions": minor
+"@tanstack/db": patch
+---
+​
+Add offline-transactions package with robust offline-first capabilities
+​
+New package `@tanstack/offline-transactions` provides a comprehensive offline-first transaction system with:
+​
+**Core Features:**
+​
+- Persistent outbox pattern for reliable transaction processing
+- Leader election for multi-tab coordination (Web Locks API with BroadcastChannel fallback)
+- Automatic storage capability detection with graceful degradation
+- Retry logic with exponential backoff and jitter
+- Sequential transaction processing (FIFO ordering)
+​
+**Storage:**
+​
+- Automatic fallback chain: IndexedDB → localStorage → online-only
+- Detects and handles private mode, SecurityError, QuotaExceededError
+- Custom storage adapter support
+- Diagnostic callbacks for storage failures
+​
+**Developer Experience:**
+​
+- TypeScript-first with full type safety