Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 5, 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.38

Patch Changes

@tanstack/db@0.5.12

Patch Changes

  • Ensure deterministic iteration order for collections and indexes. (#958)

    SortedMap improvements:

    • Added key-based tie-breaking when values compare as equal, ensuring deterministic ordering
    • Optimized to skip value comparison entirely when no comparator is provided (key-only sorting)
    • Extracted compareKeys utility to utils/comparison.ts for reuse

    BTreeIndex improvements:

    • Keys within the same indexed value are now returned in deterministic sorted order
    • Optimized with fast paths for empty sets and single-key sets to avoid unnecessary allocations

    CollectionStateManager changes:

    • Collections now always use SortedMap for syncedData, ensuring deterministic iteration order
    • When no compare function is provided, entries are sorted by key only

    This ensures that live queries with orderBy and limit produce stable, deterministic results even when multiple rows have equal sort values.

  • Enhanced multi-column orderBy support with lazy loading and composite cursor optimization. (#926)

    Changes:

    • Create index on first orderBy column even for multi-column orderBy queries, enabling lazy loading with first-column ordering
    • Pass multi-column orderBy to loadSubset with precise composite cursors (e.g., or(gt(col1, v1), and(eq(col1, v1), gt(col2, v2)))) for backend optimization
    • Use wide bounds (first column only) for local index operations to ensure no rows are missed
    • Use precise composite cursor for sync layer loadSubset to minimize data transfer

    Benefits:

    • Multi-column orderBy queries with limit now support lazy loading (previously disabled)
    • Sync implementations (like Electric) can optimize queries using composite indexes on the backend
    • Local collection uses first-column index efficiently while backend gets precise cursor
  • Updated dependencies [52c29fa]:

    • @tanstack/db-ivm@0.1.14

@tanstack/db-ivm@0.1.14

Patch Changes

  • Use row keys for stable tie-breaking in ORDER BY operations instead of hash-based object IDs. (#957)

    Previously, when multiple rows had equal ORDER BY values, tie-breaking used globalObjectIdGenerator.getId(key) which could produce hash collisions and wasn't stable across page reloads for object references. Now, the row key (which is always string | number and unique per row) is used directly for tie-breaking, ensuring deterministic and stable ordering.

    This also simplifies the internal TaggedValue type from a 3-tuple [K, V, Tag] to a 2-tuple [K, V], removing unnecessary complexity.

@tanstack/electric-db-collection@0.2.13

Patch Changes

@tanstack/offline-transactions@1.0.2

Patch Changes

@tanstack/powersync-db-collection@0.1.16

Patch Changes

@tanstack/query-db-collection@1.0.7

Patch Changes

@tanstack/react-db@0.1.56

Patch Changes

@tanstack/rxdb-db-collection@0.1.44

Patch Changes

@tanstack/solid-db@0.1.55

Patch Changes

@tanstack/svelte-db@0.1.55

Patch Changes

@tanstack/trailbase-db-collection@0.1.56

Patch Changes

@tanstack/vue-db@0.0.88

Patch Changes

@github-actions github-actions bot force-pushed the changeset-release/main branch 10 times, most recently from cd82843 to dfdc6ba Compare December 8, 2025 15:14
@github-actions github-actions bot force-pushed the changeset-release/main branch from dfdc6ba to 8b257ae Compare December 10, 2025 08:17
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