Skip to content

Commit 498fccf

Browse files
authored
Update starters to TanStack Start RC (#606)
* Update starters to TanStack Start RC * revert LLM haywire * revert LLM haywire
1 parent 1b832ff commit 498fccf

25 files changed

+2600
-1205
lines changed

examples/react/projects/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,49 @@
1616
},
1717
"dependencies": {
1818
"@tailwindcss/vite": "^4.1.13",
19-
"@tanstack/query-core": "^5.90.1",
19+
"@tanstack/query-core": "^5.90.2",
2020
"@tanstack/query-db-collection": "^0.2.22",
2121
"@tanstack/react-db": "^0.1.23",
22-
"@tanstack/react-router": "^1.131.50",
23-
"@tanstack/react-router-devtools": "^1.131.50",
22+
"@tanstack/react-router": "^1.132.25",
23+
"@tanstack/react-router-devtools": "^1.132.25",
2424
"@tanstack/react-router-with-query": "^1.130.17",
25-
"@tanstack/react-start": "^1.131.50",
26-
"@tanstack/router-plugin": "^1.131.50",
27-
"@trpc/client": "^11.5.1",
28-
"@trpc/server": "^11.5.1",
29-
"better-auth": "^1.3.13",
25+
"@tanstack/react-start": "^1.132.25",
26+
"@tanstack/router-plugin": "^1.132.25",
27+
"@trpc/client": "^11.6.0",
28+
"@trpc/server": "^11.6.0",
29+
"better-auth": "^1.3.23",
3030
"dotenv": "^17.2.2",
3131
"drizzle-orm": "^0.44.5",
3232
"drizzle-zod": "^0.8.3",
3333
"pg": "^8.16.3",
3434
"react": "^19.1.1",
3535
"react-dom": "^19.1.1",
3636
"tailwindcss": "^4.1.13",
37-
"vite": "^6.3.6",
37+
"vite": "^7.1.7",
3838
"vite-tsconfig-paths": "^5.1.4",
39-
"zod": "^3.25.76"
39+
"zod": "^4.1.11"
4040
},
4141
"devDependencies": {
42-
"@eslint/compat": "^1.3.2",
42+
"@eslint/compat": "^1.4.0",
4343
"@eslint/js": "^9.36.0",
4444
"@testing-library/dom": "^10.4.1",
4545
"@testing-library/react": "^16.3.0",
4646
"@types/pg": "^8.15.5",
47-
"@types/react": "^19.1.13",
47+
"@types/react": "^19.1.15",
4848
"@types/react-dom": "^19.1.9",
49-
"@typescript-eslint/eslint-plugin": "^8.44.0",
50-
"@typescript-eslint/parser": "^8.44.0",
51-
"@vitejs/plugin-react": "^4.7.0",
49+
"@typescript-eslint/eslint-plugin": "^8.45.0",
50+
"@typescript-eslint/parser": "^8.45.0",
51+
"@vitejs/plugin-react": "^5.0.4",
5252
"concurrently": "^9.2.1",
53-
"drizzle-kit": "^0.31.4",
53+
"drizzle-kit": "^0.31.5",
5454
"eslint": "^9.36.0",
5555
"eslint-config-prettier": "^10.1.8",
5656
"eslint-plugin-prettier": "^5.5.4",
5757
"eslint-plugin-react": "^7.37.5",
5858
"globals": "^16.4.0",
5959
"jsdom": "^27.0.0",
6060
"prettier": "^3.6.2",
61-
"tsx": "^4.20.5",
61+
"tsx": "^4.20.6",
6262
"typescript": "^5.9.2",
6363
"vite": "^6.3.6",
6464
"vitest": "^3.2.4",

examples/react/projects/src/routeTree.gen.ts

Lines changed: 51 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
// You should NOT make any changes in this file as it will be overwritten.
99
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
1010

11-
import { createServerRootRoute } from '@tanstack/react-start/server'
12-
1311
import { Route as rootRouteImport } from './routes/__root'
1412
import { Route as LoginRouteImport } from './routes/login'
1513
import { Route as AuthenticatedRouteImport } from './routes/_authenticated'
1614
import { Route as AuthenticatedIndexRouteImport } from './routes/_authenticated/index'
15+
import { Route as ApiAuthRouteImport } from './routes/api/auth'
16+
import { Route as ApiTrpcSplatRouteImport } from './routes/api/trpc/$'
1717
import { Route as AuthenticatedProjectProjectIdRouteImport } from './routes/_authenticated/project/$projectId'
18-
import { ServerRoute as ApiAuthServerRouteImport } from './routes/api/auth'
19-
import { ServerRoute as ApiTrpcSplatServerRouteImport } from './routes/api/trpc/$'
20-
21-
const rootServerRouteImport = createServerRootRoute()
2218

2319
const LoginRoute = LoginRouteImport.update({
2420
id: '/login',
@@ -34,81 +30,71 @@ const AuthenticatedIndexRoute = AuthenticatedIndexRouteImport.update({
3430
path: '/',
3531
getParentRoute: () => AuthenticatedRoute,
3632
} as any)
37-
const AuthenticatedProjectProjectIdRoute =
38-
AuthenticatedProjectProjectIdRouteImport.update({
39-
id: '/project/$projectId',
40-
path: '/project/$projectId',
41-
getParentRoute: () => AuthenticatedRoute,
42-
} as any)
43-
const ApiAuthServerRoute = ApiAuthServerRouteImport.update({
33+
const ApiAuthRoute = ApiAuthRouteImport.update({
4434
id: '/api/auth',
4535
path: '/api/auth',
46-
getParentRoute: () => rootServerRouteImport,
36+
getParentRoute: () => rootRouteImport,
4737
} as any)
48-
const ApiTrpcSplatServerRoute = ApiTrpcSplatServerRouteImport.update({
38+
const ApiTrpcSplatRoute = ApiTrpcSplatRouteImport.update({
4939
id: '/api/trpc/$',
5040
path: '/api/trpc/$',
51-
getParentRoute: () => rootServerRouteImport,
41+
getParentRoute: () => rootRouteImport,
5242
} as any)
43+
const AuthenticatedProjectProjectIdRoute =
44+
AuthenticatedProjectProjectIdRouteImport.update({
45+
id: '/project/$projectId',
46+
path: '/project/$projectId',
47+
getParentRoute: () => AuthenticatedRoute,
48+
} as any)
5349

5450
export interface FileRoutesByFullPath {
5551
'/login': typeof LoginRoute
52+
'/api/auth': typeof ApiAuthRoute
5653
'/': typeof AuthenticatedIndexRoute
5754
'/project/$projectId': typeof AuthenticatedProjectProjectIdRoute
55+
'/api/trpc/$': typeof ApiTrpcSplatRoute
5856
}
5957
export interface FileRoutesByTo {
6058
'/login': typeof LoginRoute
59+
'/api/auth': typeof ApiAuthRoute
6160
'/': typeof AuthenticatedIndexRoute
6261
'/project/$projectId': typeof AuthenticatedProjectProjectIdRoute
62+
'/api/trpc/$': typeof ApiTrpcSplatRoute
6363
}
6464
export interface FileRoutesById {
6565
__root__: typeof rootRouteImport
6666
'/_authenticated': typeof AuthenticatedRouteWithChildren
6767
'/login': typeof LoginRoute
68+
'/api/auth': typeof ApiAuthRoute
6869
'/_authenticated/': typeof AuthenticatedIndexRoute
6970
'/_authenticated/project/$projectId': typeof AuthenticatedProjectProjectIdRoute
71+
'/api/trpc/$': typeof ApiTrpcSplatRoute
7072
}
7173
export interface FileRouteTypes {
7274
fileRoutesByFullPath: FileRoutesByFullPath
73-
fullPaths: '/login' | '/' | '/project/$projectId'
75+
fullPaths:
76+
| '/login'
77+
| '/api/auth'
78+
| '/'
79+
| '/project/$projectId'
80+
| '/api/trpc/$'
7481
fileRoutesByTo: FileRoutesByTo
75-
to: '/login' | '/' | '/project/$projectId'
82+
to: '/login' | '/api/auth' | '/' | '/project/$projectId' | '/api/trpc/$'
7683
id:
7784
| '__root__'
7885
| '/_authenticated'
7986
| '/login'
87+
| '/api/auth'
8088
| '/_authenticated/'
8189
| '/_authenticated/project/$projectId'
90+
| '/api/trpc/$'
8291
fileRoutesById: FileRoutesById
8392
}
8493
export interface RootRouteChildren {
8594
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren
8695
LoginRoute: typeof LoginRoute
87-
}
88-
export interface FileServerRoutesByFullPath {
89-
'/api/auth': typeof ApiAuthServerRoute
90-
'/api/trpc/$': typeof ApiTrpcSplatServerRoute
91-
}
92-
export interface FileServerRoutesByTo {
93-
'/api/auth': typeof ApiAuthServerRoute
94-
'/api/trpc/$': typeof ApiTrpcSplatServerRoute
95-
}
96-
export interface FileServerRoutesById {
97-
__root__: typeof rootServerRouteImport
98-
'/api/auth': typeof ApiAuthServerRoute
99-
'/api/trpc/$': typeof ApiTrpcSplatServerRoute
100-
}
101-
export interface FileServerRouteTypes {
102-
fileServerRoutesByFullPath: FileServerRoutesByFullPath
103-
fullPaths: '/api/auth' | '/api/trpc/$'
104-
fileServerRoutesByTo: FileServerRoutesByTo
105-
to: '/api/auth' | '/api/trpc/$'
106-
id: '__root__' | '/api/auth' | '/api/trpc/$'
107-
fileServerRoutesById: FileServerRoutesById
108-
}
109-
export interface RootServerRouteChildren {
110-
ApiAuthServerRoute: typeof ApiAuthServerRoute
111-
ApiTrpcSplatServerRoute: typeof ApiTrpcSplatServerRoute
96+
ApiAuthRoute: typeof ApiAuthRoute
97+
ApiTrpcSplatRoute: typeof ApiTrpcSplatRoute
11298
}
11399

114100
declare module '@tanstack/react-router' {
@@ -134,30 +120,26 @@ declare module '@tanstack/react-router' {
134120
preLoaderRoute: typeof AuthenticatedIndexRouteImport
135121
parentRoute: typeof AuthenticatedRoute
136122
}
137-
'/_authenticated/project/$projectId': {
138-
id: '/_authenticated/project/$projectId'
139-
path: '/project/$projectId'
140-
fullPath: '/project/$projectId'
141-
preLoaderRoute: typeof AuthenticatedProjectProjectIdRouteImport
142-
parentRoute: typeof AuthenticatedRoute
143-
}
144-
}
145-
}
146-
declare module '@tanstack/react-start/server' {
147-
interface ServerFileRoutesByPath {
148123
'/api/auth': {
149124
id: '/api/auth'
150125
path: '/api/auth'
151126
fullPath: '/api/auth'
152-
preLoaderRoute: typeof ApiAuthServerRouteImport
153-
parentRoute: typeof rootServerRouteImport
127+
preLoaderRoute: typeof ApiAuthRouteImport
128+
parentRoute: typeof rootRouteImport
154129
}
155130
'/api/trpc/$': {
156131
id: '/api/trpc/$'
157132
path: '/api/trpc/$'
158133
fullPath: '/api/trpc/$'
159-
preLoaderRoute: typeof ApiTrpcSplatServerRouteImport
160-
parentRoute: typeof rootServerRouteImport
134+
preLoaderRoute: typeof ApiTrpcSplatRouteImport
135+
parentRoute: typeof rootRouteImport
136+
}
137+
'/_authenticated/project/$projectId': {
138+
id: '/_authenticated/project/$projectId'
139+
path: '/project/$projectId'
140+
fullPath: '/project/$projectId'
141+
preLoaderRoute: typeof AuthenticatedProjectProjectIdRouteImport
142+
parentRoute: typeof AuthenticatedRoute
161143
}
162144
}
163145
}
@@ -179,14 +161,19 @@ const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
179161
const rootRouteChildren: RootRouteChildren = {
180162
AuthenticatedRoute: AuthenticatedRouteWithChildren,
181163
LoginRoute: LoginRoute,
164+
ApiAuthRoute: ApiAuthRoute,
165+
ApiTrpcSplatRoute: ApiTrpcSplatRoute,
182166
}
183167
export const routeTree = rootRouteImport
184168
._addFileChildren(rootRouteChildren)
185169
._addFileTypes<FileRouteTypes>()
186-
const rootServerRouteChildren: RootServerRouteChildren = {
187-
ApiAuthServerRoute: ApiAuthServerRoute,
188-
ApiTrpcSplatServerRoute: ApiTrpcSplatServerRoute,
170+
171+
import type { getRouter } from './router.tsx'
172+
import type { startInstance } from './start.tsx'
173+
declare module '@tanstack/react-start' {
174+
interface Register {
175+
ssr: true
176+
router: Awaited<ReturnType<typeof getRouter>>
177+
config: Awaited<ReturnType<typeof startInstance.getOptions>>
178+
}
189179
}
190-
export const serverRouteTree = rootServerRouteImport
191-
._addFileChildren(rootServerRouteChildren)
192-
._addFileTypes<FileServerRouteTypes>()

examples/react/projects/src/router.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,10 @@ import { routeTree } from "./routeTree.gen"
66
import "./styles.css"
77

88
// Create a new router instance
9-
export const createRouter = () => {
10-
const router = createTanstackRouter({
9+
export function getRouter() {
10+
return createTanstackRouter({
1111
routeTree,
1212
scrollRestoration: true,
1313
defaultPreloadStaleTime: 0,
1414
})
15-
16-
return router
17-
}
18-
19-
// Register the router instance for type safety
20-
declare module "@tanstack/react-router" {
21-
interface Register {
22-
router: ReturnType<typeof createRouter>
23-
}
2415
}

examples/react/projects/src/routes/__root.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import * as React from "react"
12
import {
2-
Outlet,
33
HeadContent,
4+
Outlet,
45
Scripts,
56
createRootRoute,
67
} from "@tanstack/react-router"
@@ -29,12 +30,12 @@ export const Route = createRootRoute({
2930
},
3031
],
3132
}),
32-
33+
shellComponent: RootDocument,
3334
component: () => (
34-
<RootDocument>
35+
<>
3536
<Outlet />
3637
<TanStackRouterDevtools />
37-
</RootDocument>
38+
</>
3839
),
3940
})
4041

examples/react/projects/src/routes/_authenticated.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { useEffect, useState } from "react"
12
import {
23
Link,
34
Outlet,
45
createFileRoute,
56
useNavigate,
67
} from "@tanstack/react-router"
7-
import { useEffect, useState } from "react"
88
import { useLiveQuery } from "@tanstack/react-db"
99
import { authClient } from "@/lib/auth-client"
1010
import { projectCollection } from "@/lib/collections"

examples/react/projects/src/routes/_authenticated/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { useEffect } from "react"
12
import { createFileRoute, redirect, useNavigate } from "@tanstack/react-router"
23
import { useLiveQuery } from "@tanstack/react-db"
3-
import { useEffect } from "react"
44
import { projectCollection, todoCollection } from "@/lib/collections"
55
import { authClient } from "@/lib/auth-client"
66

0 commit comments

Comments
 (0)