Skip to content

Commit

Permalink
Merge branch 'main' into revert-1840-revert-1831-app-router-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge authored Apr 22, 2024
2 parents 36343e4 + 088a773 commit 919eb5e
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-llamas-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": patch
---

bump zod and t3-env
5 changes: 5 additions & 0 deletions .changeset/great-hornets-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

Infers tRPC input & output types to the client for app router
4 changes: 2 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@planetscale/database": "^1.16.0",
"@prisma/adapter-planetscale": "^5.10.2",
"@prisma/client": "^5.10.2",
"@t3-oss/env-nextjs": "^0.9.2",
"@t3-oss/env-nextjs": "^0.10.0",
"@tanstack/react-query": "^5.25.0",
"@trpc/client": "next",
"@trpc/next": "next",
Expand All @@ -93,6 +93,6 @@
"tsup": "^6.7.0",
"type-fest": "^3.7.0",
"typescript": "^5.4.2",
"zod": "3.22.4"
"zod": "^3.23.0"
}
}
4 changes: 2 additions & 2 deletions cli/template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"lint": "next lint"
},
"dependencies": {
"@t3-oss/env-nextjs": "^0.9.2",
"@t3-oss/env-nextjs": "^0.10.0",
"next": "^14.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "3.22.4"
"zod": "^3.23.0"
},
"devDependencies": {
"@types/eslint": "^8.56.2",
Expand Down
15 changes: 15 additions & 0 deletions cli/template/extras/src/trpc/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { loggerLink, unstable_httpBatchStreamLink } from "@trpc/client";
import { createTRPCReact } from "@trpc/react-query";
import { type inferRouterInputs, type inferRouterOutputs } from "@trpc/server";
import { useState } from "react";
import SuperJSON from "superjson";

Expand All @@ -22,6 +23,20 @@ const getQueryClient = () => {

export const api = createTRPCReact<AppRouter>();

/**
* Inference helper for inputs.
*
* @example type HelloInput = RouterInputs['example']['hello']
*/
export type RouterInputs = inferRouterInputs<AppRouter>;

/**
* Inference helper for outputs.
*
* @example type HelloOutput = RouterOutputs['example']['hello']
*/
export type RouterOutputs = inferRouterOutputs<AppRouter>;

export function TRPCReactProvider(props: { children: React.ReactNode }) {
const queryClient = getQueryClient();

Expand Down
50 changes: 25 additions & 25 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions upgrade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@radix-ui/react-label": "^2.0.1",
"@radix-ui/react-select": "^1.2.1",
"@radix-ui/react-slot": "^1.0.1",
"@t3-oss/env-nextjs": "^0.9.2",
"@t3-oss/env-nextjs": "^0.10.0",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"gitdiff-parser": "^0.3.1",
Expand All @@ -38,7 +38,7 @@
"shiki": "^0.14.1",
"tailwind-merge": "^1.12.0",
"tailwindcss-animate": "^1.0.5",
"zod": "3.22.4"
"zod": "^3.23.0"
},
"devDependencies": {
"@types/eslint": "^8.56.2",
Expand Down
2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"tailwind-scrollbar": "^3.0.0",
"treeify": "^1.1.0",
"unist-util-visit": "^4.1.2",
"zod": "3.22.4"
"zod": "^3.23.0"
},
"devDependencies": {
"@astrojs/react": "^2.1.3",
Expand Down

0 comments on commit 919eb5e

Please sign in to comment.