@tanstack/react-db 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-db",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "React integration for @tanstack/db",
5
5
  "author": "Kyle Mathews",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "use-sync-external-store": "^1.6.0",
44
- "@tanstack/db": "0.7.1"
44
+ "@tanstack/db": "0.7.2"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=16.8.0"
@@ -13,7 +13,7 @@ description: >
13
13
  type: framework
14
14
  library: db
15
15
  framework: react
16
- library_version: '0.6.0'
16
+ library_version: '0.6.17'
17
17
  requires:
18
18
  - db-core
19
19
  sources:
@@ -229,7 +229,7 @@ const { data: projects } = useLiveQuery((q) =>
229
229
  ),
230
230
  })),
231
231
  )
232
- // project.issues is string[] — no subcomponent needed
232
+ // project.issues is Array<{ id: string; title: string }> — no subcomponent needed
233
233
  ```
234
234
 
235
235
  See db-core/live-queries/SKILL.md for full includes rules (correlation conditions, nested includes, aggregates).
@@ -238,7 +238,8 @@ See db-core/live-queries/SKILL.md for full includes rules (correlation condition
238
238
 
239
239
  Live query results include computed, read-only virtual properties on every row:
240
240
 
241
- - `$synced`: `true` when the row is confirmed by sync; `false` when it is still optimistic.
241
+ - `$synced`: `true` when no pending local optimistic write affects the row;
242
+ `false` while one does. It does not prove backend confirmation.
242
243
  - `$origin`: `"local"` if the last confirmed change came from this client, otherwise `"remote"`.
243
244
  - `$key`: the row key for the result.
244
245
  - `$collectionId`: the source collection ID.
@@ -253,7 +254,7 @@ const { data } = useLiveQuery(
253
254
  .where(({ todo }) => eq(todo.$synced, false)),
254
255
  [],
255
256
  )
256
- // Shows only optimistic (unconfirmed) todos
257
+ // Shows rows with pending local optimistic writes
257
258
  ```
258
259
 
259
260
  ## React-Specific Patterns
@@ -354,7 +355,12 @@ Source: docs/guides/live-queries.md
354
355
 
355
356
  ### HIGH "Not a Collection" error from duplicate @tanstack/db
356
357
 
357
- If `useLiveQuery` throws `InvalidSourceError: The value provided for alias "todo" is not a Collection`, it usually means two copies of `@tanstack/db` are installed. The collection was created by one copy, but `useLiveQuery` checks `instanceof` against the other.
358
+ If a query-builder alias throws
359
+ `InvalidSourceError: The value provided for alias "todo" is not a Collection`,
360
+ it can mean two copies of `@tanstack/db` are installed. Direct
361
+ `useLiveQuery(preCreatedCollection)` detection is structural and works across
362
+ package copies or realms, but `q.from({ todo: collection })` still validates
363
+ the source with the core collection class.
358
364
 
359
365
  In dev mode, TanStack DB also throws `DuplicateDbInstanceError` if two instances are detected.
360
366
 
@@ -372,7 +378,7 @@ If multiple versions appear, fix with one of:
372
378
  {
373
379
  "pnpm": {
374
380
  "overrides": {
375
- "@tanstack/db": "^0.6.0"
381
+ "@tanstack/db": "^0.6.17"
376
382
  }
377
383
  }
378
384
  }