-
-
Notifications
You must be signed in to change notification settings - Fork 3.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 our terms of service and privacy 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?
feat(react-query): backport v5 apis about infinite query #9334
Conversation
View your CI Pipeline Execution ↗ for commit 91170ba
☁️ Nx Cloud last updated this comment at |
5b39d68
to
8e281a9
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.
…in useInfiniteQuery and useSuspenseInfiniteQuery - Standardized spacing in deprecated JSDoc comments for clarity. - Reorganized type imports in useSuspenseInfiniteQuery for better readability.
…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 | Added useSuspenseInfiniteQuery hook |
packages/react-query/src/useQuery.ts | Expanded deprecation messages on useQuery overloads |
packages/react-query/src/useInfiniteQuery.ts | Expanded deprecation messages on useInfiniteQuery overloads |
packages/react-query/src/queryOptions.ts | Wrapped UndefinedInitialDataOptions in WithRequired |
packages/react-query/src/infiniteQueryOptions.ts | Created infiniteQueryOptions 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 for useSuspenseInfiniteQuery |
packages/react-query/src/tests/queryOptions.types.test.tsx | Updated queryOptions tests with useQuery |
packages/react-query/src/tests/infiniteQueryOptions.types.test.tsx | Added type tests for infiniteQueryOptions |
packages/react-query/src/tests/infiniteQueryOptions.test.tsx | Added runtime test for infiniteQueryOptions |
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<
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.