Skip to content

Commit 4a7c53f

Browse files
committed
Merge main branch and resolve conflicts
- Updated utils.ts to use Map instead of WeakMap for cycle detection (from main) - Kept all collection indexing utility functions - Updated optimizer.ts to use main branch patterns while preserving enhancements - Added distinct import to compiler/index.ts from main branch - Fixed non-null assertions in compiler to match main branch style - All review comments from PR #257 remain addressed
2 parents 0e747e8 + 11215d9 commit 4a7c53f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+7342
-2933
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,9 @@ dev-debug.log
145145
# Task files
146146
tasks.json
147147
tasks/
148+
149+
## Tanstack Start
150+
.nitro
151+
.output
152+
.tanstack
153+
.claude

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
**/docs
77
**/snap
88
pnpm-lock.yaml
9+
**/routeTree.gen.ts

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,18 @@ TanStack DB is **backend agnostic** and **incrementally adoptable**:
4848
Sync data into collections:
4949

5050
```ts
51-
import { createQueryCollection } from "@tanstack/db-collections"
52-
53-
const todoCollection = createQueryCollection({
54-
queryKey: ["todos"],
55-
queryFn: async () => fetch("/api/todos"),
56-
getKey: (item) => item.id,
57-
schema: todoSchema, // any standard schema
58-
})
51+
import { createCollection, QueryClient } from "@tanstack/react-db"
52+
import { queryCollectionOptions } from "@tanstack/query-db-collection"
53+
54+
const todoCollection = createCollection(
55+
queryCollectionOptions({
56+
queryKey: ["todos"],
57+
queryFn: async () => fetch("/api/todos"),
58+
queryClient: new QueryClient(),
59+
getKey: (item) => item.id,
60+
schema: todoSchema, // any standard schema
61+
})
62+
)
5963
```
6064

6165
Use live queries in your components:
@@ -135,7 +139,9 @@ There's also an example [React todo app](./examples/react/todo) and usage exampl
135139
## 🔧 Install
136140

137141
```bash
138-
npm install @tanstack/react-db @tanstack/db-collections
142+
npm install @tanstack/react-db
143+
# Optional: for specific collection types
144+
npm install @tanstack/electric-db-collection @tanstack/query-db-collection
139145
```
140146

141147
Other framework integrations are in progress.

docs/config.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545
},
4646
{
4747
"label": "Guides",
48-
"children": [
49-
50-
]
48+
"children": []
5149
},
5250
{
5351
"label": "API Reference",

docs/framework/react/adapter.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ npm install @tanstack/react-db
1414
See the [React Functions Reference](../reference/index.md) to see the full list of hooks available in the React Adapter.
1515

1616
## Basic Usage
17-

docs/framework/solid/adapter.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
---
22
title: TanStack DB Solid Adapter
33
ref: docs/framework/react/adapter.md
4-
replace: {
5-
"React": "Solid",
6-
"react": "solid"
7-
}
4+
replace: { "React": "Solid", "react": "solid" }
85
---

docs/framework/svelte/adapter.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
---
22
title: TanStack DB Svelte Adapter
33
ref: docs/framework/react/adapter.md
4-
replace: {
5-
"React": "Svelte",
6-
"react": "svelte"
7-
}
4+
replace: { "React": "Svelte", "react": "svelte" }
85
---

docs/framework/vue/adapter.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
---
22
title: TanStack DB Vue Adapter
33
ref: docs/framework/react/adapter.md
4-
replace: {
5-
"React": "Vue",
6-
"react": "vue"
7-
}
4+
replace: { "React": "Vue", "react": "vue" }
85
---

0 commit comments

Comments
 (0)