-
Notifications
You must be signed in to change notification settings - Fork 125
Replace @tanstack/pacer with @tanstack/pacer-lite #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
KyleAMathews
merged 7 commits into
main
from
claude/paced-mutations-01Jm8KbaZGKyRxTXj8NkbkcN
Nov 21, 2025
Merged
Replace @tanstack/pacer with @tanstack/pacer-lite #880
KyleAMathews
merged 7 commits into
main
from
claude/paced-mutations-01Jm8KbaZGKyRxTXj8NkbkcN
Nov 21, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace @tanstack/pacer with @tanstack/pacer-lite for paced mutations implementation. The lite version provides the same core functionality with minimal overhead and no external dependencies, making it more suitable for library use. Changes: - Update package.json to use @tanstack/pacer-lite ^0.1.0 - Replace Debouncer with LiteDebouncer in debounceStrategy - Replace Throttler with LiteThrottler in throttleStrategy - Replace AsyncQueuer with LiteQueuer in queueStrategy - Implement manual promise chaining in queueStrategy to maintain async serialization behavior All tests pass and the build completes successfully.
🦋 Changeset detectedLatest commit: 2a86676 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Contributor
|
Size Change: +26 B (+0.03%) Total Size: 86.2 kB
ℹ️ View Unchanged
|
The dependency is only needed in @tanstack/db package.
Contributor
|
Size Change: 0 B Total Size: 3.34 kB ℹ️ View Unchanged
|
KevinVandy
approved these changes
Nov 21, 2025
Add comprehensive unit tests for createPacedMutations and all three strategies (debounce, throttle, queue) that test the core functionality directly without React dependencies. Tests cover: - Debounce strategy with timer reset and leading edge execution - Throttle strategy with leading/trailing edge behavior - Queue strategy with sequential processing and serialization - Error handling for failed transactions - Transaction batching and merging behavior These tests verify the pacer-lite migration maintains correct behavior.
Use type assertions to handle vitest mock.calls type inference issues.
Remove redundant strategy behavior tests from React package since those are now comprehensively tested in the core package. Kept: - Simple smoke tests for each strategy (verify React hook wrapper works) - All memoization tests (React-specific behavior) Removed: - Detailed debounce timer reset tests (now in core) - Detailed throttle leading/trailing tests (now in core) - Queue serialization tests (now in core) - Transaction batching tests (now in core) Reduced test file from 472 to 249 lines with better separation of concerns.
- Add explanatory comments for manual promise chaining in queueStrategy explaining why LiteQueuer lacks async queue primitives and how we compensate with manual serialization - Enhance error handling documentation clarifying that errors are surfaced via transaction.isPersisted and don't break the chain - Add test coverage for queue with zero/no wait option - Extract createReadyCollection helper to reduce test duplication
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace @tanstack/pacer with @tanstack/pacer-lite for paced mutations implementation. The lite version provides the same core functionality with minimal overhead and no external dependencies, making it more suitable for library use.
Changes:
All tests pass and the build completes successfully.
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact