Update dependency @tanstack/query-db-collection to v1.0.8 #2065
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:
1.0.5->1.0.8Release Notes
TanStack/db (@tanstack/query-db-collection)
v1.0.8Compare Source
Patch Changes
Fix writeInsert/writeUpsert throwing error when collection uses select option (#1023)
When a Query Collection was configured with a
selectoption to extract items from a wrapped API response (e.g.,{ data: [...], meta: {...} }), callingwriteInsert()orwriteUpsert()would corrupt the query cache and trigger the error: "select() must return an array of objects".The fix routes cache updates through a new
updateCacheDatafunction that preserves the wrapper structure by using theselectfunction to identify which property contains the items array (via reference equality), then updates only that property while keeping metadata intact.v1.0.7Compare 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 queriesUpdated dependencies [
b3b1940,09da081,86ad40c]:v1.0.6Compare Source
Patch Changes
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.Use regular dependency for @tanstack/db instead of peerDependency to match the standard pattern used by other TanStack DB packages and prevent duplicate installations (#952)
Updated dependencies [
c4b9399,a1a484e]: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.