query icon indicating copy to clipboard operation
query copied to clipboard

feat(query-core, react-query): backport v5 types, deprecate `isLoading` in favor of `isPending` in mutation observer results

Open manudeli opened this issue 8 months ago • 3 comments

Deprecation and Property to enhance migration to v5 gradually:

  • Marked isLoading property as deprecated in multiple MutationObserver result interfaces (MutationObserverBaseResult, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult) and added the isPending property as its replacement.

Type backport like v5:

  • Exported UseSuspenseQueryOptions, UseSuspenseQueryResult, SuspenseQueriesResults, SuspenseQueriesOptions, DefinedInitialDataOptions, and UndefinedInitialDataOptions, DefinedInitialDataOptions and UndefinedInitialDataOptions types like v5
image

Many people are still on v4, and the same is true for my company. If we backport some of the v5 APIs to v4 well, it would ease their migration and reduce friction. This can help accelerate the adoption of v5 eventually, allowing us to concentrate our efforts on v5 improvements.

What I want to backport after this Pull Request

  1. useSuspenseInfiniteQuery
  2. infiniteQueryOptions

manudeli avatar Jun 11 '25 13:06 manudeli

View your CI Pipeline Execution ↗ for commit 569efbb26759be1008610990d689551dd21e7eea.

Command Status Duration Result
nx affected --targets=test:lib,test:types,test:... ✅ Succeeded 1m 19s View ↗
nx affected --targets=test:lib --base=79f0b9ad2... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-11 16:21:32 UTC

nx-cloud[bot] avatar Jun 11 '25 13:06 nx-cloud[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 569efbb26759be1008610990d689551dd21e7eea:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

codesandbox-ci[bot] avatar Jun 11 '25 13:06 codesandbox-ci[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.62%. Comparing base (84e8ae5) to head (569efbb). Report is 29 commits behind head on v4.

Additional details and impacted files
@@            Coverage Diff             @@
##               v4    #9266      +/-   ##
==========================================
- Coverage   95.16%   91.62%   -3.54%     
==========================================
  Files          13      117     +104     
  Lines         496     4478    +3982     
  Branches      179     1184    +1005     
==========================================
+ Hits          472     4103    +3631     
- Misses         23      344     +321     
- Partials        1       31      +30     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 11 '25 13:06 codecov[bot]

This resolve this eslint warning image

manudeli avatar Jun 17 '25 09:06 manudeli