Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.3k
feat(react-query): backport v5 apis about infinite query#9334
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:v4
Are you sure you want to change the base?
Conversation
nx-cloudbot commentedJun 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View yourCI Pipeline Execution ↗ for commit91170ba
☁️Nx Cloud last updated this comment at |
5b39d68
to8e281a9
Compare…s for useSuspenseInfiniteQuery- Refactored infinite query tests to use a unified options function.- Added type checks for the new `useSuspenseInfiniteQuery` hook.- Improved test structure for better readability and maintainability.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
…in useInfiniteQuery and useSuspenseInfiniteQuery- Standardized spacing in deprecated JSDoc comments for clarity.- Reorganized type imports in useSuspenseInfiniteQuery for better readability.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
…nts across query methods- Unified formatting of deprecated JSDoc comments in QueryCache, QueryClient, and types to enhance clarity.- Updated comments to reflect upcoming changes in method signatures and usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR backports v5 infinite query APIs into the v4 codebase, introducing new utilities and marking older overloads as deprecated.
- Added a new
useSuspenseInfiniteQuery
hook with built-in suspense and error boundary support - Introduced the
infiniteQueryOptions
helper for building infinite query option objects - Updated deprecation messages on various
useQuery
anduseInfiniteQuery
overloads and consolidated exports
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/react-query/src/useSuspenseInfiniteQuery.ts | AddeduseSuspenseInfiniteQuery hook |
packages/react-query/src/useQuery.ts | Expanded deprecation messages onuseQuery overloads |
packages/react-query/src/useInfiniteQuery.ts | Expanded deprecation messages onuseInfiniteQuery overloads |
packages/react-query/src/queryOptions.ts | WrappedUndefinedInitialDataOptions inWithRequired |
packages/react-query/src/infiniteQueryOptions.ts | CreatedinfiniteQueryOptions utility |
packages/react-query/src/index.ts | Exported new hook and options utility |
packages/react-query/src/tests/useSuspenseInfiniteQuery.types.test.tsx | Added type tests foruseSuspenseInfiniteQuery |
packages/react-query/src/tests/queryOptions.types.test.tsx | UpdatedqueryOptions tests withuseQuery |
packages/react-query/src/tests/infiniteQueryOptions.types.test.tsx | Added type tests forinfiniteQueryOptions |
packages/react-query/src/tests/infiniteQueryOptions.test.tsx | Added runtime test forinfiniteQueryOptions |
packages/query-core/src/types.ts | Consolidated deprecated comments into single lines |
packages/query-core/src/queryClient.ts | Consolidated deprecated comments into single lines |
packages/query-core/src/queryCache.ts | Consolidated deprecated comments into single lines |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/react-query/src/useSuspenseInfiniteQuery.ts:44
- [nitpick] Consider adding a JSDoc comment above
useSuspenseInfiniteQuery
to explain its purpose, parameters, and return type for better discoverability and maintainability.
export function useSuspenseInfiniteQuery<
packages/react-query/src/__tests__/useSuspenseInfiniteQuery.types.test.tsxShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
New Features and Utilities:
infiniteQueryOptions
useSuspenseInfiniteQuery
Deprecations:
useQuery
anduseInfiniteQuery
as deprecated, with a note that they will be removed in the next major version. (packages/react-query/src/useQuery.ts
,packages/react-query/src/useInfiniteQuery.ts
)Package and Export Updates:
useSuspenseInfiniteQuery
,infiniteQueryOptions
, and related types from the main package index.