Skip to content

chore(client): remove the unused @tanstack/react-query dependency - #4448

Open
gilgardosh wants to merge 2 commits into
claude/urql-step-6-dedupe-fragmentsfrom
claude/urql-step-7-drop-react-query
Open

chore(client): remove the unused @tanstack/react-query dependency#4448
gilgardosh wants to merge 2 commits into
claude/urql-step-6-dedupe-fragmentsfrom
claude/urql-step-7-drop-react-query

Conversation

@gilgardosh

Copy link
Copy Markdown
Collaborator

Step 7 of 10 in the urql quick-wins sequence — tracking doc in #4437.

⚠️ Stacked on #4447 (step 6) → #4446#4444. Retarget as the stack merges.

What changed

@tanstack/react-query@5.102.8 was a declared dependency with a QueryClientProvider mounted at the root of the app — configured with refetchOnWindowFocus: false and retry: 1 — and nothing ever used it.

The only reference anywhere in the repo was the import in root-layout.tsx that created and mounted it. No file imports useQuery, useMutation or useSuspenseQuery from it; all GraphQL fetching goes through urql. Verified repo-wide, not just in packages/client.

Provider, QueryClient construction and the dependency are all removed. The surrounding UrqlProvider > UserProvider nesting is otherwise unchanged.

⚠️ @tanstack/react-table is untouched

Different package, and load-bearing — it backs every table in the app, and packages/client/CLAUDE.md documents a v9-specific API convention around it. Only react-query is removed here. Worth a second look during review, since the two names are one character apart.

Testing

Nothing to test — this removes code that was never reached. The value is in the verification that it wasn't reached, which is the grep above plus a green build.

yarn test:client   48 files, 373 passed, 0 skipped
yarn lint          0 errors
tsc --noEmit       clean
vite build         ✓ built in 4.79s

yarn.lock is updated by the removal.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The remaining documentation nit is minor and does not block approval.

Pull request overview

Removes the unused @tanstack/react-query dependency and root provider while preserving urql and React Table usage.

Changes:

  • Removed QueryClient and QueryClientProvider.
  • Removed dependency and lockfile entries.
  • Added changeset documentation.
File summaries
File Summary
yarn.lock Removes React Query packages.
packages/client/src/router/layouts/root-layout.tsx Removes the unused provider.
packages/client/package.json Removes the dependency.
.changeset/urql-drop-dead-react-query.md Documents the cleanup.
.changeset/@accounter_client-4448-dependencies.md Records the dependency removal.

Review note: Narrow the changeset’s “only reference” claim to live application/source references; historical references remain (nit, 1 vote).

Review details

Suppressed comments (1)

.changeset/urql-drop-dead-react-query.md:11

  • This says the only reference is the root-layout import, but the repository still contains historical references in packages/client/CHANGELOG.md and prior dependency changesets. Narrow this to live application/source references so the release note is factually accurate.
reference anywhere in the repo was the import in `router/layouts/root-layout.tsx` that created and
mounted it; no file imports `useQuery`, `useMutation` or `useSuspenseQuery` from it. All GraphQL data
fetching goes through urql.
  • Files reviewed: 4/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The package was a declared dependency with a `QueryClientProvider` mounted at the
root of the app — configured with `refetchOnWindowFocus: false` and `retry: 1` —
and nothing ever used it. The only reference in the entire repo was the import in
`root-layout.tsx` that created and mounted it; no file imports `useQuery`,
`useMutation` or `useSuspenseQuery` from it. All GraphQL fetching goes through
urql.

Provider, `QueryClient` construction and dependency all removed. The surrounding
`UrqlProvider > UserProvider` nesting is otherwise unchanged.

`@tanstack/react-table` is a different package and is untouched — it backs every
table in the app.

Step 7 of the urql quick-wins sequence.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
@gilgardosh
gilgardosh force-pushed the claude/urql-step-6-dedupe-fragments branch from 59be74d to 8a974ea Compare September 12, 2026 12:44
@gilgardosh
gilgardosh force-pushed the claude/urql-step-7-drop-react-query branch from c965e3a to 3dd9213 Compare September 12, 2026 12:53
@gilgardosh
gilgardosh deployed to accounter-fullstack September 12, 2026 12:53 — with GitHub Actions Active
@gilgardosh
gilgardosh deployed to accounter-fullstack September 12, 2026 12:53 — with GitHub Actions Active
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.

3 participants