Skip to content

Commit

Permalink
upgrade trpc to v11 (beta) and react query to v5 (stable)
Browse files Browse the repository at this point in the history
  • Loading branch information
ettorepuccetti committed Jan 14, 2024
1 parent d0a7316 commit ea9695c
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 67 deletions.
13 changes: 4 additions & 9 deletions cypress/components/_constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ function WrapperComponentForTesting({
children: React.ReactNode;
session: Session | null;
}) {
const [queryClient] = useState(
() =>
new QueryClient({
defaultOptions: { queries: { retry: false } },
}),
);
const [queryClient] = useState(() => new QueryClient());
const [trpcClient] = useState(() =>
api.createClient({
transformer: superjson,
Expand Down Expand Up @@ -105,8 +100,9 @@ export function buildTrpcMutationMock<TData, TVariables>(
mutate: stub,
context: undefined,
isError: false,
isLoading: false,
isSuccess: false,
isPending: false,
submittedAt: 0,
// eslint-disable-next-line @typescript-eslint/no-empty-function
reset: () => {},
isIdle: true,
Expand Down Expand Up @@ -150,12 +146,11 @@ export function buildTrpcQueryMock<TData>(
isFetchedAfterMount: true,
isInitialLoading: false,
isPlaceholderData: false,
isPreviousData: false,
isRefetchError: false,
isRefetching: false,
isStale: false,
// eslint-disable-next-line @typescript-eslint/no-empty-function
remove: () => {},
trpc: { path: "" },
isPending: false,
};
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-slot": "^1.0.2",
"@t3-oss/env-nextjs": "^0.7.3",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.45.0",
"@trpc/next": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
"@tanstack/react-query": "^5.17.10",
"@trpc/client": "11.0.0-next-beta.193",
"@trpc/next": "11.0.0-next-beta.193",
"@trpc/react-query": "11.0.0-next-beta.193",
"@trpc/server": "11.0.0-next-beta.193",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"dotenv": "^16.3.1",
Expand Down
102 changes: 49 additions & 53 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/hooks/trpcHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { api } from "~/utils/api";

export const useTaskQuery = () => {
return api.task.getAll.useQuery(undefined, {
queryKey: ["task.getAll", undefined],
refetchOnWindowFocus: false,
});
};
Expand Down

0 comments on commit ea9695c

Please sign in to comment.