Skip to content

refactor: migrate react-query v3 → @tanstack/react-query v5#952

Merged
EightRice merged 1 commit into
masterfrom
chore/migrate-react-query-v5
Jun 16, 2026
Merged

refactor: migrate react-query v3 → @tanstack/react-query v5#952
EightRice merged 1 commit into
masterfrom
chore/migrate-react-query-v5

Conversation

@EightRice

@EightRice EightRice commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the legacy react-query v3 package (unmaintained), consolidating on @tanstack/react-query v5 — which was already a dependency, used by the wagmi provider. A prior migration attempt had been started and abandoned (a commented-out TanStack provider in App.tsx); this completes it.

Net: 45 files migrated, react-query removed from the dependency tree (-471/+322 lines, mostly the lockfile shrinking).

Provider strategy (lowest-risk)

App.tsx keeps its configured QueryClient (with the project's defaultOptions) but now imports it from @tanstack/react-query. The wagmi Web3Provider already wraps the whole app with its own TanStack v5 client higher in the tree, so both clients are valid v5 and every hook resolves to App's nearest provider — defaultOptions preserved exactly. Unifying to a single client is deferred (it would change wagmi's internal query behavior, risking wallet flows).

Changes

  • 26 useQuery call sites: positional (key, fn, opts) → object { queryKey, queryFn, ...opts }
  • 19 useMutation call sites: positional (fn, opts) → object { mutationFn, ...opts }
  • cacheTimegcTime (App.tsx + 4 hooks)
  • keepPreviousData: trueplaceholderData: keepPreviousData (useAllDAOs)
  • useEvmProposalOps: 8 positional invalidateQueries(["k"])invalidateQueries({ queryKey: ["k"] }) — this is a silent runtime break in v5 (positional args are ignored), so it's the highest-value fix to verify
  • All query keys were already arrays (v5-compatible); no useInfiniteQuery; onSuccess on mutations and resetQueries() no-arg are unchanged in v5

Test plan

  • yarn installreact-query gone from tree
  • npx tsc --noEmit — green
  • yarn build — green
  • yarn lint:check — green
  • yarn test:unit — same 2 pre-existing jsdom-env failures, no new regressions
  • Deploy-preview smoke: DAO list + Tezos↔Etherlink network switch (useAllDAOs placeholderData), proposal auto-refetch (useProposals), voting (useVote), treasury/balances, lite polls, Etherlink proposal create/execute → confirm member/proposal lists refresh (validates the invalidateQueries fix), wallet connect/disconnect

Removes the legacy react-query v3 package (unmaintained), consolidating
on @tanstack/react-query v5 which was already a dependency. A prior
migration attempt had been started and abandoned (commented-out TanStack
provider in App.tsx).

Provider strategy: App.tsx keeps its configured QueryClient but now
imports it from @tanstack/react-query. The wagmi Web3Provider already
wraps the app with its own TanStack v5 client higher in the tree; both
clients are valid v5, so all 45 hooks resolve to App's nearest provider
and defaultOptions are preserved exactly. (Unifying to a single client
is deferred — would alter wagmi's internal query behavior.)

Changes:
- 26 useQuery call sites: positional (key, fn, opts) → object form
- 19 useMutation call sites: positional (fn, opts) → object form
- cacheTime → gcTime (App.tsx + 4 hooks)
- keepPreviousData → placeholderData: keepPreviousData (useAllDAOs)
- useEvmProposalOps: 8 positional invalidateQueries(["k"]) →
  invalidateQueries({ queryKey: ["k"] }) — silent runtime break in v5
- All query keys were already arrays (v5-compatible); no useInfiniteQuery
- onSuccess on mutations and resetQueries() no-arg are unchanged in v5
- Removed "react-query" from package.json

yarn build, tsc --noEmit, lint:check all green. Unit tests: same 2
pre-existing jsdom-env failures, no new regressions.
@netlify

netlify Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploy Preview for tezos-homebase ready!

Name Link
🔨 Latest commit 788f735
🔍 Latest deploy log https://app.netlify.com/projects/tezos-homebase/deploys/6a2d732be68771000819bc66
😎 Deploy Preview https://deploy-preview-952--tezos-homebase.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 26 (🟢 up 1 from production)
Accessibility: 91 (no change from production)
Best Practices: 83 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@EightRice EightRice merged commit 9cd2e31 into master Jun 16, 2026
6 checks passed
@EightRice EightRice deleted the chore/migrate-react-query-v5 branch June 16, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant