-
Notifications
You must be signed in to change notification settings - Fork 162
Virtual props RFC implementation #1213
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
base: main
Are you sure you want to change the base?
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
|
🎯 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