Skip to content
Source
Sign inSign up
TanStack/db

fix: bind standalone descriptor queries to receiving clients #2077

MergedKyleAMathewsmerged 53 commits intomain fromrefs/pull/2077/headmerged by KyleAMathews

Showing 41 changed files with 96 additions and 2 deletions (loading 39).

x
0 of 41 viewed, 41 left
9 additions and 0 deletions.changeset/standalone-descriptor-queries.mdAdded
View file
@@ -0,0 +1,9 @@
+---
+'@tanstack/db': minor
+'@tanstack/react-db': patch
+'@tanstack/svelte-db': patch
+---
+​
+Allow a `Query` built with Collection descriptors outside a `DbClient` to bind its sources when a client consumes it. Building or extending a query keeps descriptors unbound until that consumption. A reusable factory descriptor can now serve the same prebuilt query in separate client scopes, including React providers and server preloads. A prepared query is a bound snapshot; reuse the original unbound query across clients. The exported IR now represents an unbound descriptor with `DescriptorRef`; visitors of `IR.From` must handle the `descriptorRef` variant.
+​
+React hooks bind standalone descriptor queries through their `DbProvider` client and report a provider hint when no client is available. Svelte hooks bind through their client and release deferred sources after failed query setup.
87 additions and 2 deletionsdocs/contributing/oracle-reviews/issue-2072-alias-shadowing-outer-joins.mdModified
View file
@@ -160,12 +160,21 @@
​
## Chained joins and main-correlated route work — 2026-10-10 follow-up
​
-The nine-item user review inspected `2d0cbafabddb898d8fadcb7d304ff06fb0154d7e` without executing its findings. The current repair started from `43d7c3d771c52c39bff38ba5a4fb7b1d02e99215`; its executable commit is `b41dc35bf`. This section records the bounded oracle evidence for the two reported behavior gaps. The task-local lossless ledger is `/private/tmp/pr2095-user-review-ledger.md`.
+The nine-item user review inspected `2d0cbafabddb898d8fadcb7d304ff06fb0154d7e` without executing its findings. The current repair started from `43d7c3d771c52c39bff38ba5a4fb7b1d02e99215`; its executable commit is `b41dc35bf`. This section records the bounded oracle evidence for the two reported behavior gaps.
​
**Absent local binding law.** `ARCHITECTURE.md` §Identity and law 1 distinguish a captured ancestor's `issue` from a child's same-named declaration. Once a LEFT join has no child `issue`, a later routed joined row may carry the ancestor context but cannot supply the missing child source. The prior outer-join matrix had one join only. It was green for its declared boundary and could not generate the reported two-join sequence.
​
The primary `includes-alias-shadowing-oracle.test.ts` now recomputes two LEFT joins from plain parent, comment, issue, and tag rows. Its legal history has two parent routes: one child issue is absent and the other is matched. It adds and removes the absent issue, then removes and restores the second joined side. Each cut compares exact public child rows, including the local issue ID and `isUndefined`, under shadowed and renamed aliases, eager and on-demand sources, and routing caused by either a parent-dependent QueryRef or a captured ancestor operand. The model uses source roles and plain numeric relations; it does not read compiler namespaces, binding maps, or route metadata. The QueryRef filters tags by parent, while the direct source reads the parent in its equality operand; the model states that distinction explicitly.
​
+A 2026-10-11 review control adds a parent label to this plain-row model and
+selected child result, then changes that label while the two joins have matched