Skip to content
Source
Sign inSign up
TanStack/db

feat(db): rebuild includes materialization as one D2 graph #1740

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 22 commits intomain fromrefs/pull/1740/headmerged by tannerlinsley

Showing 54 changed files with 223 additions and 9 deletions (loading 51).

x
0 of 54 viewed, 54 left
8 additions and 0 deletions.changeset/fix-includes-materialization.mdAdded
View file
@@ -0,0 +1,8 @@
+---
+'@tanstack/db': patch
+'@tanstack/db-ivm': patch
+'@tanstack/powersync-db-collection': patch
+'@tanstack/query-db-collection': patch
+---
+​
+Rebuild correlated include materialization as one D2 graph, fixing stale or missing nested results across route changes, batching, lazy loading, optimistic updates, and layered queries. Add canonical structural relation keys, abortable subset demand, and coherent publication for Collection-valued includes. Dispose delayed PowerSync subset hooks after cleanup, and prevent released Query Collection cache results from reaching the collection.
11 additions and 0 deletionsAGENTS.mdModified
View file
@@ -2,6 +2,17 @@
​
This guide provides principles and patterns for AI agents contributing to the TanStack DB codebase. These guidelines are derived from PR review patterns and reflect the quality standards expected in this project.
​
+## Required reading: live-query materialization
+​
+Before reading, analyzing, or modifying correlated live-query materialization
+code under `packages/db/src/query/live/`, read
+`packages/db/src/query/live/ARCHITECTURE.md` in full. Read it before changing
+the related includes oracle tests as well.
+​
+Treat that document's component boundaries and normative laws as constraints.
+If a change intentionally revises an architectural contract, update the
+architecture document in the same pull request.