-
Notifications
You must be signed in to change notification settings - Fork 117
Migrate Collection Info to Dedicated Pages #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Collection Info to Dedicated Pages #725
Conversation
- Created dedicated pages for each collection type: - trailbase-collection.md - local-storage-collection.md - local-only-collection.md - derived-collections.md - Simplified overview.md Collections section: - Reduced from ~743 to 408 lines (45% reduction) - Replaced detailed content with brief one-sentence descriptions - Added links to individual collection type pages - Each collection page includes: - Overview and use cases - Installation instructions - Configuration options - Code examples - Complete working examples - Cross-references to related documentation This makes the documentation more navigable and easier to maintain. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Reorganized the collection types in overview.md into logical categories: - Fetch Collections: QueryCollection - Sync Collections: ElectricCollection, TrailBaseCollection, RxDBCollection - Local Collections: LocalStorageCollection, LocalOnlyCollection - Derived Collections: Derived Collections This makes it easier to understand the different collection types at a glance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-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: 84.5 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a page for "derived collections"? these are what you get from a live query, and we have the live query docs?
- Removed derived-collections.md page (covered in live queries docs) - Removed RxDBCollection from overview (being removed from library) - Removed arbitrary "When Not to Use" sections from local collection docs - Added storageEventApi documentation to LocalStorageCollection: - Documents custom event API for cross-tab/process sync - Added to optional options list - Included examples for Electron, WebSocket, and IPC use cases Changes based on feedback from @samwillis
…ction-docs-011CUXhbpUwQkUkz2fq7qQhx
Clarified that server collection mutations are handled by their operation handlers (onInsert, onUpdate, onDelete), not automatically without configuration. Updated comments to match the pattern shown in the mutations guide. Before: "Server collection mutations are handled automatically" After: "Server collection mutations are handled by their onInsert handler automatically (onInsert will be called and awaited first)"
Fixed a critical misunderstanding about how manual transactions work.
When using createTransaction, the collection's operation handlers
(onInsert, onUpdate, onDelete) are NOT automatically called. The
mutationFn is responsible for handling ALL persistence.
Changed examples from:
// Server collection mutations are handled automatically
To the correct pattern:
// Handle server collection mutations explicitly in mutationFn
await Promise.all(
transaction.mutations
.filter((m) => m.collection === serverCollection)
.map((m) => api.items.create(m.modified))
)
Fixed in:
- docs/guides/mutations.md
- docs/collections/local-only-collection.md
- docs/collections/local-storage-collection.md
Changed 'with a generic ingestion endpoint' to 'for real-time sync with your existing API' to accurately match what the example shows (api.todos.create()).
…ction-docs-011CUXhbpUwQkUkz2fq7qQhx
samwillis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect ![]()
Created dedicated pages for each collection type:
Simplified overview.md Collections section:
Each collection page includes:
This makes the documentation more navigable and easier to maintain.
🤖 Generated with Claude Code
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact