Skip to content

Conversation

manudeli
Copy link
Member

@manudeli manudeli commented Jun 30, 2025

PeerDep @tanstack/react-query to version 4.40.0 and deprecate old options

@ha1fstack (issue reporter), could you review these changes, please?

  • Updated dependencies for @tanstack/react-query and related packages to version 4.40.0 in pnpm-lock.yaml and pnpm-workspace.yaml.
  • Adjusted peer dependencies in package.json to reflect the new version.
  • Deprecated certain options and types in the react-query-4 package to align with the latest API changes.
  • Updated tests to accommodate changes in type expectations and removed unused imports.

Next thing to do: TanStack/query#9334

After several years of polishing the Suspensive React Query interface — from raising the first issue to this PR and finally merging into TanStack Query v4 — it feels like we’re nearing the end of a long journey of Suspensive React Query. 감성적이게 되는 날입니다 🥲

PR Checklist

  • I did below actions if need
  1. I read the Contributing Guide
  2. I added documents and tests.

…e old options

- Updated dependencies for @tanstack/react-query and related packages to version 4.40.0 in pnpm-lock.yaml and pnpm-workspace.yaml.
- Adjusted peer dependencies in package.json to reflect the new version.
- Deprecated certain options and types in the react-query-4 package to align with the latest API changes.
- Updated tests to accommodate changes in type expectations and removed unused imports.

Co-authored-by: halfstack <61955474+ha1fstack@users.noreply.github.com>
@manudeli manudeli self-assigned this Jun 30, 2025
Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: 9d2e076

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@suspensive/react-query-4 Minor
@suspensive/react-query-5 Minor
@suspensive/react-query Minor
@suspensive/react Minor
@suspensive/react-dom Minor
@suspensive/jotai Minor
@suspensive/codemods Minor

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

Copy link

vercel bot commented Jun 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v2.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 2:36pm
v3.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 2:36pm
visualization.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 2:36pm

Copy link

coauthors bot commented Jun 30, 2025

People can be co-author:

Candidate Reasons Count Add this as commit message
@manudeli #1639 (comment) #1639 (comment) #1639 (review) #1639 (review) #1639 5 Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
@gwansikk #1639 (comment) #1639 (review) 2 Co-authored-by: gwansikk <39869096+gwansikk@users.noreply.github.com>
@ha1fstack #1639 (comment) #1639 (review) 2 Co-authored-by: ha1fstack <61955474+ha1fstack@users.noreply.github.com>

Copy link

github-actions bot commented Jun 30, 2025

Size Change: -1.05 kB (-1.65%)

Total Size: 62.8 kB

Filename Size Change
packages/react-query-4/dist/index.cjs 1.65 kB -24 B (-1.44%)
packages/react-query-4/dist/index.js 390 B +3 B (+0.78%)
packages/react-query-4/dist/queryOptions.cjs 563 B +23 B (+4.26%)
packages/react-query-4/dist/SuspenseQueries.cjs 661 B -267 B (-28.77%) 🎉
packages/react-query-4/dist/SuspenseQueries.js 139 B -10 B (-6.71%)
packages/react-query-4/dist/SuspenseQuery.cjs 825 B -231 B (-21.88%) 🎉
packages/react-query-4/dist/SuspenseQuery.js 136 B -11 B (-7.48%)
packages/react-query-4/dist/useSuspenseQueries.cjs 571 B -266 B (-31.78%) 🎉
packages/react-query-4/dist/useSuspenseQuery.cjs 569 B -269 B (-32.1%) 🎉
ℹ️ View Unchanged
Filename Size
packages/jotai/dist/Atom.cjs 660 B
packages/jotai/dist/Atom.js 115 B
packages/jotai/dist/AtomValue.cjs 647 B
packages/jotai/dist/AtomValue.js 120 B
packages/jotai/dist/index.cjs 753 B
packages/jotai/dist/index.js 158 B
packages/jotai/dist/SetAtom.cjs 645 B
packages/jotai/dist/SetAtom.js 118 B
packages/react-dom/dist/FadeIn.cjs 2.26 kB
packages/react-dom/dist/FadeIn.js 140 B
packages/react-dom/dist/index.cjs 2.48 kB
packages/react-dom/dist/index.js 177 B
packages/react-dom/dist/InView.cjs 2.21 kB
packages/react-dom/dist/InView.js 130 B
packages/react-dom/dist/useFadeIn.cjs 2.16 kB
packages/react-dom/dist/useFadeIn.js 133 B
packages/react-dom/dist/useInView.cjs 1.98 kB
packages/react-dom/dist/useInView.js 120 B
packages/react-native/dist/index.cjs 619 B
packages/react-native/dist/index.js 122 B
packages/react-native/dist/TestText.cjs 612 B
packages/react-native/dist/TestText.js 119 B
packages/react-query-4/dist/infiniteQueryOptions.cjs 548 B
packages/react-query-4/dist/infiniteQueryOptions.js 144 B
packages/react-query-4/dist/Mutation.cjs 821 B
packages/react-query-4/dist/Mutation.js 132 B
packages/react-query-4/dist/mutationOptions.cjs 541 B
packages/react-query-4/dist/mutationOptions.js 137 B
packages/react-query-4/dist/PrefetchInfiniteQuery.cjs 722 B
packages/react-query-4/dist/PrefetchInfiniteQuery.js 155 B
packages/react-query-4/dist/PrefetchQuery.cjs 712 B
packages/react-query-4/dist/PrefetchQuery.js 147 B
packages/react-query-4/dist/QueryClientConsumer.cjs 665 B
packages/react-query-4/dist/QueryClientConsumer.js 140 B
packages/react-query-4/dist/queryOptions.js 136 B
packages/react-query-4/dist/SuspenseInfiniteQuery.cjs 1.07 kB
packages/react-query-4/dist/SuspenseInfiniteQuery.js 155 B
packages/react-query-4/dist/usePrefetchInfiniteQuery.cjs 648 B
packages/react-query-4/dist/usePrefetchInfiniteQuery.js 148 B
packages/react-query-4/dist/usePrefetchQuery.cjs 639 B
packages/react-query-4/dist/usePrefetchQuery.js 140 B
packages/react-query-4/dist/useSuspenseInfiniteQuery.cjs 845 B
packages/react-query-4/dist/useSuspenseInfiniteQuery.js 148 B
packages/react-query-4/dist/useSuspenseQueries.js 142 B
packages/react-query-4/dist/useSuspenseQuery.js 140 B
packages/react-query-5/dist/index.cjs 1.39 kB
packages/react-query-5/dist/index.js 386 B
packages/react-query-5/dist/infiniteQueryOptions.cjs 573 B
packages/react-query-5/dist/infiniteQueryOptions.js 144 B
packages/react-query-5/dist/Mutation.cjs 821 B
packages/react-query-5/dist/Mutation.js 132 B
packages/react-query-5/dist/mutationOptions.cjs 541 B
packages/react-query-5/dist/mutationOptions.js 137 B
packages/react-query-5/dist/PrefetchInfiniteQuery.cjs 647 B
packages/react-query-5/dist/PrefetchInfiniteQuery.js 145 B
packages/react-query-5/dist/PrefetchQuery.cjs 639 B
packages/react-query-5/dist/PrefetchQuery.js 137 B
packages/react-query-5/dist/QueryClientConsumer.cjs 663 B
packages/react-query-5/dist/QueryClientConsumer.js 140 B
packages/react-query-5/dist/queryOptions.cjs 563 B
packages/react-query-5/dist/queryOptions.js 136 B
packages/react-query-5/dist/SuspenseInfiniteQuery.cjs 833 B
packages/react-query-5/dist/SuspenseInfiniteQuery.js 145 B
packages/react-query-5/dist/SuspenseQueries.cjs 671 B
packages/react-query-5/dist/SuspenseQueries.js 139 B
packages/react-query-5/dist/SuspenseQuery.cjs 825 B
packages/react-query-5/dist/SuspenseQuery.js 136 B
packages/react-query-5/dist/usePrefetchInfiniteQuery.cjs 577 B
packages/react-query-5/dist/usePrefetchInfiniteQuery.js 148 B
packages/react-query-5/dist/usePrefetchQuery.cjs 569 B
packages/react-query-5/dist/usePrefetchQuery.js 140 B
packages/react-query-5/dist/useSuspenseInfiniteQuery.cjs 577 B
packages/react-query-5/dist/useSuspenseInfiniteQuery.js 148 B
packages/react-query-5/dist/useSuspenseQueries.cjs 571 B
packages/react-query-5/dist/useSuspenseQueries.js 142 B
packages/react-query-5/dist/useSuspenseQuery.cjs 569 B
packages/react-query-5/dist/useSuspenseQuery.js 140 B
packages/react-query/dist/index.cjs 822 B
packages/react-query/dist/index.js 274 B
packages/react-query/dist/v4.cjs 820 B
packages/react-query/dist/v4.js 273 B
packages/react-query/dist/v5.cjs 821 B
packages/react-query/dist/v5.js 273 B
packages/react/dist/ClientOnly.cjs 1.08 kB
packages/react/dist/ClientOnly.js 141 B
packages/react/dist/DefaultProps.cjs 1.04 kB
packages/react/dist/DefaultProps.js 167 B
packages/react/dist/Delay.cjs 1.52 kB
packages/react/dist/Delay.js 159 B
packages/react/dist/ErrorBoundary.cjs 2.85 kB
packages/react/dist/ErrorBoundary.js 207 B
packages/react/dist/ErrorBoundaryGroup.cjs 1.64 kB
packages/react/dist/ErrorBoundaryGroup.js 197 B
packages/react/dist/index.cjs 3.99 kB
packages/react/dist/index.js 312 B
packages/react/dist/Suspense.cjs 1.44 kB
packages/react/dist/Suspense.js 172 B

compressed-size-action

… usePrefetchQuery tests

- Changed import statements in PrefetchQuery.test-d.tsx and usePrefetchQuery.test-d.tsx to source queryOptions from @tanstack/react-query instead of local files.
- This aligns the tests with the updated package structure following the recent dependency updates.
…tack/react-query

- Removed the local import of queryOptions and replaced it with the import from @tanstack/react-query to ensure consistency with the updated package structure.
@manudeli manudeli marked this pull request as ready for review June 30, 2025 14:22
@manudeli manudeli changed the title chore: update react-query dependencies to version 4.40.0 and deprecate old options chore(react-query): update dependencies to version 4.40.0 and deprecate old options Jun 30, 2025
@manudeli manudeli changed the title chore(react-query): update dependencies to version 4.40.0 and deprecate old options chore(react-query): update peerDependency, @tanstack/react-query to version 4.40.0 and deprecate old options Jun 30, 2025
@manudeli manudeli changed the title chore(react-query): update peerDependency, @tanstack/react-query to version 4.40.0 and deprecate old options fix(react-query): update peerDependency, @tanstack/react-query to version 4.40.0 and deprecate old options Jun 30, 2025
Copy link
Collaborator

@gwansikk gwansikk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The day has finally come when it is officially supported. It's a historic day. 그동안의 여정의 결과, 멋있습니다. 계속 킵고잉하시죠!! Suspensive!

Comment on lines +68 to +69
* @deprecated Use `queryOptions` from \@tanstack/react-query@^4.40.0
* @example
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @deprecated Use `queryOptions` from \@tanstack/react-query@^4.40.0
* @example
* @deprecated Use `queryOptions` from \@tanstack/react-query@^4.40.0
* @see (If a migration guide becomes available later.)
* @example

this is a suggestion

Copy link
Contributor

@ha1fstack ha1fstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work as always, thank you for prompt update!

Comment on lines +67 to +90
const [
query1,
query2,
// query3
] = useQueries({
queries: [
query.options1(),
{ ...query.options2() },
queryOptions({
queryKey: [...queryKey, 4] as const,
queryFn: () => Promise.resolve({ field: 'success' }),
select: (data) => {
expectTypeOf(data).toEqualTypeOf<{ field: string }>()
return data.field
},
}),
// queryOptions({
// queryKey: [...queryKey, 4] as const,
// queryFn: () => Promise.resolve({ field: 'success' }),
// select: (data) => {
// expectTypeOf(data).toEqualTypeOf<{ field: string }>()
// return data.field
// },
// }),
],
})
expectTypeOf(query1).toEqualTypeOf<UseQueryResult<{ field: string }>>()
expectTypeOf(query1.data).toEqualTypeOf<{ field: string } | undefined>()
expectTypeOf(query2).toEqualTypeOf<UseQueryResult<{ field: string }>>()
expectTypeOf(query2.data).toEqualTypeOf<{ field: string } | undefined>()
expectTypeOf(query3).toEqualTypeOf<UseQueryResult<string>>()
expectTypeOf(query3.data).toEqualTypeOf<string | undefined>()
// expectTypeOf(query3).toEqualTypeOf<UseQueryResult<string>>()
// expectTypeOf(query3.data).toEqualTypeOf<string | undefined>()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for commenting out instead of removing it?

Copy link
Member Author

@manudeli manudeli Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was problem already before

image

It's because of @tanstack/react-query v4's useQueries type fault. I'll fix it in TanStack v4

image

@manudeli manudeli merged commit 0f20895 into main Jul 1, 2025
17 checks passed
@manudeli manudeli deleted the react-query/deprecated-tanstack-supported branch July 1, 2025 03:16
@manudeli manudeli mentioned this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants