Conversation
|
Cursor Agent can help with this pull request. Just |
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@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: +1.06 kB (+1.15%) Total Size: 93 kB
ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.7 kB ℹ️ View Unchanged
|
…//github.com/TanStack/db into cursor/virtual-props-rfc-implementation-8087
🎯 Changes
This PR implements the virtual properties system as described in the RFC. This introduces computed, read-only metadata fields prefixed with
$to every row, providing information about its sync status, origin, key, and source collection ID.Key aspects of this implementation:
$synced: Indicates whether a row reflects confirmed state from the backend (true) or has pending optimistic mutations (false).$origin: Specifies if the last confirmed change originated from the local client ('local') or was received via sync ('remote').$key: The primary identifier of the row.$collectionId: The ID of the collection the row originated from.where(({ item }) => eq(item.$synced, true))).RefProxyandReftypes to include virtual properties, ensuring type safety and discoverability.This feature enhances data visibility and enables more sophisticated UI logic based on the state and origin of data.
✅ Checklist
pnpm test:pr.🚀 Release Impact