-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
refactor: consolidate noop function usage across framework packages #9228
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
TkDodo
merged 1 commit into
TanStack:main
from
epicenter-so:refactor/reuse-noop-from-query-core
Jun 3, 2025
Merged
refactor: consolidate noop function usage across framework packages #9228
TkDodo
merged 1 commit into
TanStack:main
from
epicenter-so:refactor/reuse-noop-from-query-core
Jun 3, 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
Multiple framework-specific packages (`solid-query`, `svelte-query`, and `angular-query-experimental`) were maintaining their own implementations of the `noop` function, creating unnecessary code duplication across the codebase. ```typescript // Before: Each package had its own noop // packages/svelte-query/src/utils.ts export function noop(): void {} // packages/solid-query/src/utils.ts (missing, causing import errors) // Local noop definitions scattered across files ``` Consolidated all `noop` usage to import from the canonical implementation in `@tanstack/query-core`, which all framework packages already depend on. ```typescript // After: Single source of truth import { noop } from '@tanstack/query-core' ``` - **Removed duplicate `noop` definition** from `packages/svelte-query/src/utils.ts` - **Updated import statements** in Solid Query and Svelte Query to use `noop` from `@tanstack/query-core` - **Fixed missing utils file** in Solid Query that was causing import errors - **Resolved TypeScript compatibility** issues with `noop`'s overloaded return types - **Persisters were intentionally left unchanged** as they don't import `query-core` and maintain their own lightweight utils - **Framework packages already depend on `query-core`**, making this consolidation natural and dependency-free
View your CI Pipeline Execution ↗ for commit 5e71f10.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9228 +/- ##
===========================================
+ Coverage 45.30% 84.06% +38.75%
===========================================
Files 209 49 -160
Lines 8257 822 -7435
Branches 1856 168 -1688
===========================================
- Hits 3741 691 -3050
+ Misses 4076 113 -3963
+ Partials 440 18 -422 🚀 New features to boost your workflow:
|
TkDodo
approved these changes
Jun 3, 2025
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.
Multiple framework-specific packages (
solid-query
,svelte-query
, andangular-query-experimental
) were maintaining their own implementations of thenoop
function, creating unnecessary code duplication across the codebase.Consolidated all
noop
usage to import from the canonical implementation in@tanstack/query-core
, which all framework packages already depend on.Removed duplicate
noop
definition frompackages/svelte-query/src/utils.ts
Updated import statements in Solid Query and Svelte Query to use
noop
from@tanstack/query-core
Fixed missing utils file in Solid Query that was causing import errors
Resolved TypeScript compatibility issues with
noop
's overloaded return typesPersisters were intentionally left unchanged as they don't import
query-core
and maintain their own lightweight utilsFramework packages already depend on
query-core
, making this consolidation natural and dependency-free