Update dependency @tanstack/db to v0.5.12 #2064
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.5.8->0.5.12Release Notes
TanStack/db (@tanstack/db)
v0.5.12Compare Source
Patch Changes
Enhanced LoadSubsetOptions with separate cursor expressions and offset for flexible pagination. (#960)
LoadSubsetOptions.whereno longer includes cursor expressions for pagination. If you have a custom sync layer or query collection that implementsloadSubset, you must now handle pagination separately:cursorproperty (cursor.whereFromandcursor.whereCurrent) and combine them withwhereyourselfoffsetpropertyPreviously, cursor expressions were baked into the
whereclause. Now they are passed separately so sync layers can choose their preferred pagination strategy.Changes:
CursorExpressionstype withwhereFrom,whereCurrent, and optionallastKeypropertiescursortoLoadSubsetOptionsfor cursor-based pagination (separate fromwhere)offsettoLoadSubsetOptionsfor offset-based pagination supportrequestSnapshotcalls when cursor is present:whereCurrent(all ties at boundary, no limit)whereFrom(rows after cursor, with limit)offsetfor query key generationtruncateevent to collections, emitted when synced data is truncated (e.g., aftermust-refetch)setWindowpagination: cursor expressions are now correctly built when paging through resultsloadNextItemsnow passes the correct window offset to prevent incorrect deduplicationCollectionSubscribernow listens fortruncateevents to reset cursor tracking stateBenefits:
where) and pagination (cursor/offset)setWindowcorrectly triggers backend loading for subsequent pages in multi-column orderBy queriesEnsure deterministic iteration order for collections and indexes. (#958)
SortedMap improvements:
compareKeysutility toutils/comparison.tsfor reuseBTreeIndex improvements:
CollectionStateManager changes:
SortedMapforsyncedData, ensuring deterministic iteration ordercomparefunction is provided, entries are sorted by key onlyThis ensures that live queries with
orderByandlimitproduce 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:
or(gt(col1, v1), and(eq(col1, v1), gt(col2, v2)))) for backend optimizationBenefits:
Updated dependencies [
52c29fa]:v0.5.11Compare Source
Patch Changes
fix(db): compile filter expression once in createFilterFunctionFromExpression (#954)
Fixed a performance issue in
createFilterFunctionFromExpressionwhere the expression was being recompiled on every filter call. This only affected realtime change event filtering for pushed-down predicates at the collection level when using orderBy + limit. The core query engine was not affected as it already compiled predicates once.fix(query-db-collection): use deep equality for object field comparison in query observer (#967)
Fixed an issue where updating object fields (non-primitives) with
refetch: falseinonUpdatehandlers would cause the value to rollback to the previous state every other update. The query observer was using shallow equality (===) to compare items, which compares object properties by reference rather than by value. This caused the observer to incorrectly detect differences and write stale data back to syncedData. Now usesdeepEqualsfor proper value comparison.v0.5.10Compare Source
Patch Changes
Type utils in collection options as specific type (e.g. ElectricCollectionUtils) instead of generic UtilsRecord. (#940)
Fix proxy to handle frozen objects correctly. Previously, creating a proxy for a frozen object (such as data from state management libraries that freeze their state) would throw a TypeError when attempting to modify properties via the proxy. The proxy now uses an unfrozen internal copy as the Proxy target, allowing modifications to be tracked correctly while preserving the immutability of the original object. (#933)
Also adds support for
Object.seal()andObject.preventExtensions()on proxies, allowing these operations to work correctly on change-tracking proxies.v0.5.9Compare Source
Patch Changes
DuplicateKeyErroris thrown when duplicate keys are detected within the same batch. (#929)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.