Commit b1684db
committed
fix: drop unused React Query imports from generated router
The tanstack-query branch of the router template imports ReactNode,
QueryClient and the TanstackQueryProvider default export whenever the add-on
is enabled, but ReactNode and TanstackQueryProvider are only referenced inside
the tRPC `Wrap` block and QueryClient is never referenced at all. Generated
projects set `noUnusedLocals: true`, so a fresh scaffold ships code that
violates its own tsconfig.
Gates the two tRPC-only imports behind `addOnEnabled.tRPC` and removes the
QueryClient import outright.
setupRouterSsrQueryIntegration is deliberately left alone — it is used, and
removing it silently breaks SSR query dehydration.1 parent efbc8d5 commit b1684db
2 files changed
Lines changed: 15 additions & 4 deletions
File tree
- .changeset
- packages/create/src/frameworks/react/project/base/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
6 | 5 | | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
0 commit comments