Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .changeset/clever-parks-report.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/cruel-buckets-shop.md

This file was deleted.

58 changes: 0 additions & 58 deletions .changeset/smooth-goats-ring.md

This file was deleted.

8 changes: 8 additions & 0 deletions examples/angular/todos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# todos

## 0.0.11

### Patch Changes

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]
- @tanstack/[email protected]

## 0.0.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/todos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "todos",
"version": "0.0.10",
"version": "0.0.11",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/projects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"dependencies": {
"@tailwindcss/vite": "^4.1.14",
"@tanstack/query-core": "^5.90.2",
"@tanstack/query-db-collection": "^0.2.30",
"@tanstack/react-db": "^0.1.31",
"@tanstack/query-db-collection": "^0.2.31",
"@tanstack/react-db": "^0.1.32",
"@tanstack/react-router": "^1.132.47",
"@tanstack/react-router-devtools": "^1.132.51",
"@tanstack/react-router-with-query": "^1.130.17",
Expand Down
10 changes: 10 additions & 0 deletions examples/react/todo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# examples/react/todo

## 0.1.10

### Patch Changes

- Updated dependencies [[`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]
- @tanstack/[email protected]
- @tanstack/[email protected]
- @tanstack/[email protected]

## 0.1.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/react/todo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/db-example-react-todo",
"private": true,
"version": "0.1.9",
"version": "0.1.10",
"dependencies": {
"@tanstack/electric-db-collection": "workspace:^",
"@tanstack/query-core": "^5.90.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/angular-db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/angular-db

## 0.1.15

### Patch Changes

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]

## 0.1.14

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-db/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/angular-db",
"description": "Angular integration for @tanstack/db",
"version": "0.1.14",
"version": "0.1.15",
"author": "Ethan McDaniel",
"license": "MIT",
"repository": {
Expand Down
20 changes: 20 additions & 0 deletions packages/db-ivm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# @tanstack/db-ivm

## 0.1.11

### Patch Changes

- Add `utils.setWindow()` method to live query collections to dynamically change limit and offset on ordered queries. ([#663](https://github.com/TanStack/db/pull/663))

You can now change the pagination window of an ordered live query without recreating the collection:

```ts
const users = createLiveQueryCollection((q) =>
q
.from({ user: usersCollection })
.orderBy(({ user }) => user.name, "asc")
.limit(10)
.offset(0)
)

users.utils.setWindow({ offset: 10, limit: 10 })
```

## 0.1.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/db-ivm/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/db-ivm",
"description": "Incremental View Maintenance for TanStack DB based on Differential Dataflow",
"version": "0.1.10",
"version": "0.1.11",
"dependencies": {
"fractional-indexing": "^3.2.0",
"sorted-btree": "^1.8.1"
Expand Down
33 changes: 33 additions & 0 deletions packages/db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# @tanstack/db

## 0.4.10

### Patch Changes

- Add `utils.setWindow()` method to live query collections to dynamically change limit and offset on ordered queries. ([#663](https://github.com/TanStack/db/pull/663))

You can now change the pagination window of an ordered live query without recreating the collection:

```ts
const users = createLiveQueryCollection((q) =>
q
.from({ user: usersCollection })
.orderBy(({ user }) => user.name, "asc")
.limit(10)
.offset(0)
)

users.utils.setWindow({ offset: 10, limit: 10 })
```

- Added comprehensive loading state tracking and configurable sync modes to collections and live queries: ([#669](https://github.com/TanStack/db/pull/669))
- Added `isLoadingSubset` property and `loadingSubset:change` events to all collections for tracking when data is being loaded
- Added `syncMode` configuration option to collections:
- `'eager'` (default): Loads all data immediately during initial sync
- `'on-demand'`: Only loads data as requested via `loadSubset` calls
- Added comprehensive status tracking to collection subscriptions with `status` property (`'ready'` | `'loadingSubset'`) and events (`status:change`, `status:ready`, `status:loadingSubset`, `unsubscribed`)
- Live queries automatically reflect loading state from their source collection subscriptions, with each query maintaining isolated loading state to prevent status "bleed" between independent queries
- Enhanced `setWindow` utility to return `Promise<void>` when loading is triggered, allowing callers to await data loading completion
- Added `subscription` parameter to `loadSubset` handler for advanced sync implementations that need to track subscription lifecycle

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a)]:
- @tanstack/[email protected]

## 0.4.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/db",
"description": "A reactive client store for building super fast apps on sync",
"version": "0.4.9",
"version": "0.4.10",
"dependencies": {
"@standard-schema/spec": "^1.0.0",
"@tanstack/db-ivm": "workspace:*"
Expand Down
7 changes: 7 additions & 0 deletions packages/electric-db-collection/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/electric-db-collection

## 0.1.34

### Patch Changes

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]

## 0.1.33

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/electric-db-collection/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/electric-db-collection",
"description": "ElectricSQL collection for TanStack DB",
"version": "0.1.33",
"version": "0.1.34",
"dependencies": {
"@electric-sql/client": "^1.0.14",
"@standard-schema/spec": "^1.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/query-db-collection/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/query-db-collection

## 0.2.31

### Patch Changes

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]

## 0.2.30

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/query-db-collection/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/query-db-collection",
"description": "TanStack Query collection for TanStack DB",
"version": "0.2.30",
"version": "0.2.31",
"dependencies": {
"@standard-schema/spec": "^1.0.0",
"@tanstack/db": "workspace:*"
Expand Down
60 changes: 60 additions & 0 deletions packages/react-db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# @tanstack/react-db

## 0.1.32

### Patch Changes

- Add `useLiveInfiniteQuery` hook for infinite scrolling with live updates. ([#669](https://github.com/TanStack/db/pull/669))

The new `useLiveInfiniteQuery` hook provides an infinite query pattern similar to TanStack Query's `useInfiniteQuery`, but with live updates from your local collection. It uses `liveQueryCollection.utils.setWindow()` internally to efficiently paginate through ordered data without recreating the query on each page fetch.

**Key features:**
- Automatic live updates as data changes in the collection
- Efficient pagination using dynamic window adjustment
- Peek-ahead mechanism to detect when more pages are available
- Compatible with TanStack Query's infinite query API patterns

**Example usage:**

```tsx
import { useLiveInfiniteQuery } from "@tanstack/react-db"

function PostList() {
const { data, pages, fetchNextPage, hasNextPage, isLoading } =
useLiveInfiniteQuery(
(q) =>
q
.from({ posts: postsCollection })
.orderBy(({ posts }) => posts.createdAt, "desc"),
{
pageSize: 20,
getNextPageParam: (lastPage, allPages) =>
lastPage.length === 20 ? allPages.length : undefined,
}
)

if (isLoading) return <div>Loading...</div>

return (
<div>
{pages.map((page, i) => (
<div key={i}>
{page.map((post) => (
<PostCard key={post.id} post={post} />
))}
</div>
))}
{hasNextPage && (
<button onClick={() => fetchNextPage()}>Load More</button>
)}
</div>
)
}
```

**Requirements:**
- Query must include `.orderBy()` for the window mechanism to work
- Returns flattened `data` array and `pages` array for flexible rendering
- Automatically detects new pages when data is synced to the collection

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]

## 0.1.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-db/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/react-db",
"description": "React integration for @tanstack/db",
"version": "0.1.31",
"version": "0.1.32",
"author": "Kyle Mathews",
"license": "MIT",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/rxdb-db-collection/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/rxdb-db-collection

## 0.1.21

### Patch Changes

- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
- @tanstack/[email protected]

## 0.1.20

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/rxdb-db-collection/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/rxdb-db-collection",
"description": "RxDB collection for TanStack DB",
"version": "0.1.20",
"version": "0.1.21",
"dependencies": {
"rxdb": "16.19.1",
"@standard-schema/spec": "^1.0.0",
Expand Down
Loading