Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 15, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@tanstack/angular-db@0.1.15

Patch Changes

@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)

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

    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)

    • 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]:

    • @tanstack/db-ivm@0.1.11

@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)

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

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

@tanstack/electric-db-collection@0.1.34

Patch Changes

@tanstack/query-db-collection@0.2.31

Patch Changes

@tanstack/react-db@0.1.32

Patch Changes

  • Add useLiveInfiniteQuery hook for infinite scrolling with live updates. (#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:

    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, b0687ab]:

    • @tanstack/db@0.4.10

@tanstack/rxdb-db-collection@0.1.21

Patch Changes

@tanstack/solid-db@0.1.32

Patch Changes

@tanstack/svelte-db@0.1.32

Patch Changes

@tanstack/trailbase-db-collection@0.1.32

Patch Changes

@tanstack/vue-db@0.0.65

Patch Changes

todos@0.0.11

Patch Changes

  • Updated dependencies [63aa8ef, b0687ab]:
    • @tanstack/db@0.4.10
    • @tanstack/angular-db@0.1.15

@tanstack/db-example-react-todo@0.1.10

Patch Changes

  • Updated dependencies [b0687ab]:
    • @tanstack/react-db@0.1.32
    • @tanstack/electric-db-collection@0.1.34
    • @tanstack/query-db-collection@0.2.31
    • @tanstack/trailbase-db-collection@0.1.32

@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 12258da to 1f6271f Compare October 15, 2025 18:21
@github-actions github-actions bot force-pushed the changeset-release/main branch from 1f6271f to 229f0da Compare October 15, 2025 18:40
@KyleAMathews KyleAMathews merged commit 7044f95 into main Oct 15, 2025
@KyleAMathews KyleAMathews deleted the changeset-release/main branch October 15, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant