Skip to content

Commit e5b9b85

Browse files
authored
chore(tanstack-start): Update deps & integration tests (#4575)
1 parent b28c5e8 commit e5b9b85

File tree

7 files changed

+158
-132
lines changed

7 files changed

+158
-132
lines changed

.changeset/beige-parrots-yawn.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/tanstack-start': minor
3+
---
4+
5+
**Breaking change:** Update `@tanstack/react-router` peer dependency from `>=1.49.1` to `>=1.81.9`. Also update `@tanstack/start` peer dependency from `>=1.49.1` to `>=1.81.9`. This update coincides with the [changed server function syntax & server middleware](https://github.com/TanStack/router/pull/2513) that will allow the SDK more functionality in the future.
6+
7+
When updating your `@clerk/tanstack-start` version you'll need to change various pieces in your code, Clerk's documentation ([quickstart](https://clerk.com/docs/quickstarts/tanstack-start), [reference](https://clerk.com/docs/references/tanstack-start/overview)) has been updated to account for that.

integration/templates/tanstack-start/app/client.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { createRouter } from './router'
44

55
const router = createRouter()
66

7-
hydrateRoot(document.getElementById('root')!, <StartClient router={router} />)
7+
hydrateRoot(document!, <StartClient router={router} />)

integration/templates/tanstack-start/app/routeTree.gen.ts

+64-71
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,39 @@
1-
/* prettier-ignore-start */
2-
31
/* eslint-disable */
42

53
// @ts-nocheck
64

75
// noinspection JSUnusedGlobalSymbols
86

9-
// This file is auto-generated by TanStack Router
7+
// This file was automatically generated by TanStack Router.
8+
// You should NOT make any changes in this file as it will be overwritten.
9+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
1010

1111
// Import Routes
1212

1313
import { Route as rootRoute } from './routes/__root'
14+
import { Route as SignInImport } from './routes/sign-in'
1415
import { Route as LayoutImport } from './routes/_layout'
1516
import { Route as IndexImport } from './routes/index'
16-
import { Route as LayoutLayout2Import } from './routes/_layout/_layout-2'
17-
import { Route as LayoutLayout2LayoutBImport } from './routes/_layout/_layout-2/layout-b'
18-
import { Route as LayoutLayout2LayoutAImport } from './routes/_layout/_layout-2/layout-a'
1917

2018
// Create/Update Routes
2119

20+
const SignInRoute = SignInImport.update({
21+
id: '/sign-in',
22+
path: '/sign-in',
23+
getParentRoute: () => rootRoute,
24+
} as any)
25+
2226
const LayoutRoute = LayoutImport.update({
2327
id: '/_layout',
2428
getParentRoute: () => rootRoute,
2529
} as any)
2630

2731
const IndexRoute = IndexImport.update({
32+
id: '/',
2833
path: '/',
2934
getParentRoute: () => rootRoute,
3035
} as any)
3136

32-
const LayoutLayout2Route = LayoutLayout2Import.update({
33-
id: '/_layout-2',
34-
getParentRoute: () => LayoutRoute,
35-
} as any)
36-
37-
const LayoutLayout2LayoutBRoute = LayoutLayout2LayoutBImport.update({
38-
path: '/layout-b',
39-
getParentRoute: () => LayoutLayout2Route,
40-
} as any)
41-
42-
const LayoutLayout2LayoutARoute = LayoutLayout2LayoutAImport.update({
43-
path: '/layout-a',
44-
getParentRoute: () => LayoutLayout2Route,
45-
} as any)
46-
4737
// Populate the FileRoutesByPath interface
4838

4939
declare module '@tanstack/react-router' {
@@ -62,43 +52,61 @@ declare module '@tanstack/react-router' {
6252
preLoaderRoute: typeof LayoutImport
6353
parentRoute: typeof rootRoute
6454
}
65-
'/_layout/_layout-2': {
66-
id: '/_layout/_layout-2'
67-
path: ''
68-
fullPath: ''
69-
preLoaderRoute: typeof LayoutLayout2Import
70-
parentRoute: typeof LayoutImport
71-
}
72-
'/_layout/_layout-2/layout-a': {
73-
id: '/_layout/_layout-2/layout-a'
74-
path: '/layout-a'
75-
fullPath: '/layout-a'
76-
preLoaderRoute: typeof LayoutLayout2LayoutAImport
77-
parentRoute: typeof LayoutLayout2Import
78-
}
79-
'/_layout/_layout-2/layout-b': {
80-
id: '/_layout/_layout-2/layout-b'
81-
path: '/layout-b'
82-
fullPath: '/layout-b'
83-
preLoaderRoute: typeof LayoutLayout2LayoutBImport
84-
parentRoute: typeof LayoutLayout2Import
55+
'/sign-in': {
56+
id: '/sign-in'
57+
path: '/sign-in'
58+
fullPath: '/sign-in'
59+
preLoaderRoute: typeof SignInImport
60+
parentRoute: typeof rootRoute
8561
}
8662
}
8763
}
8864

8965
// Create and export the route tree
9066

91-
export const routeTree = rootRoute.addChildren({
92-
IndexRoute,
93-
LayoutRoute: LayoutRoute.addChildren({
94-
LayoutLayout2Route: LayoutLayout2Route.addChildren({
95-
LayoutLayout2LayoutARoute,
96-
LayoutLayout2LayoutBRoute,
97-
}),
98-
}),
99-
})
67+
export interface FileRoutesByFullPath {
68+
'/': typeof IndexRoute
69+
'': typeof LayoutRoute
70+
'/sign-in': typeof SignInRoute
71+
}
72+
73+
export interface FileRoutesByTo {
74+
'/': typeof IndexRoute
75+
'': typeof LayoutRoute
76+
'/sign-in': typeof SignInRoute
77+
}
78+
79+
export interface FileRoutesById {
80+
__root__: typeof rootRoute
81+
'/': typeof IndexRoute
82+
'/_layout': typeof LayoutRoute
83+
'/sign-in': typeof SignInRoute
84+
}
85+
86+
export interface FileRouteTypes {
87+
fileRoutesByFullPath: FileRoutesByFullPath
88+
fullPaths: '/' | '' | '/sign-in'
89+
fileRoutesByTo: FileRoutesByTo
90+
to: '/' | '' | '/sign-in'
91+
id: '__root__' | '/' | '/_layout' | '/sign-in'
92+
fileRoutesById: FileRoutesById
93+
}
94+
95+
export interface RootRouteChildren {
96+
IndexRoute: typeof IndexRoute
97+
LayoutRoute: typeof LayoutRoute
98+
SignInRoute: typeof SignInRoute
99+
}
100+
101+
const rootRouteChildren: RootRouteChildren = {
102+
IndexRoute: IndexRoute,
103+
LayoutRoute: LayoutRoute,
104+
SignInRoute: SignInRoute,
105+
}
100106

101-
/* prettier-ignore-end */
107+
export const routeTree = rootRoute
108+
._addFileChildren(rootRouteChildren)
109+
._addFileTypes<FileRouteTypes>()
102110

103111
/* ROUTE_MANIFEST_START
104112
{
@@ -107,33 +115,18 @@ export const routeTree = rootRoute.addChildren({
107115
"filePath": "__root.tsx",
108116
"children": [
109117
"/",
110-
"/_layout"
118+
"/_layout",
119+
"/sign-in"
111120
]
112121
},
113122
"/": {
114123
"filePath": "index.tsx"
115124
},
116125
"/_layout": {
117-
"filePath": "_layout.tsx",
118-
"children": [
119-
"/_layout/_layout-2"
120-
]
121-
},
122-
"/_layout/_layout-2": {
123-
"filePath": "_layout/_layout-2.tsx",
124-
"parent": "/_layout",
125-
"children": [
126-
"/_layout/_layout-2/layout-a",
127-
"/_layout/_layout-2/layout-b"
128-
]
129-
},
130-
"/_layout/_layout-2/layout-a": {
131-
"filePath": "_layout/_layout-2/layout-a.tsx",
132-
"parent": "/_layout/_layout-2"
126+
"filePath": "_layout.tsx"
133127
},
134-
"/_layout/_layout-2/layout-b": {
135-
"filePath": "_layout/_layout-2/layout-b.tsx",
136-
"parent": "/_layout/_layout-2"
128+
"/sign-in": {
129+
"filePath": "sign-in.tsx"
137130
}
138131
}
139132
}

integration/templates/tanstack-start/app/routes/__root.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
createRootRoute,
55
} from '@tanstack/react-router'
66
import { TanStackRouterDevtools } from '@tanstack/router-devtools'
7-
import { Body, Head, Html, Meta, Scripts } from '@tanstack/start'
7+
import { Meta, Scripts } from '@tanstack/start'
88
import * as React from 'react'
99
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
1010
import { NotFound } from '~/components/NotFound'
@@ -33,17 +33,17 @@ export const Route = createRootRoute({
3333
function RootDocument({ children }: { children: React.ReactNode }) {
3434
return (
3535
<ClerkProvider>
36-
<Html>
37-
<Head>
36+
<html>
37+
<head>
3838
<Meta />
39-
</Head>
40-
<Body>
39+
</head>
40+
<body>
4141
{children}
4242
<ScrollRestoration />
4343
<TanStackRouterDevtools position="bottom-right" />
4444
<Scripts />
45-
</Body>
46-
</Html>
45+
</body>
46+
</html>
4747
</ClerkProvider>
4848
)
4949
}

integration/templates/tanstack-start/package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@
88
"start": "vinxi start --port=$PORT"
99
},
1010
"dependencies": {
11-
"@tanstack/react-router": "^1.46.4",
12-
"@tanstack/router-devtools": "^1.46.5",
13-
"@tanstack/router-plugin": "^1.45.13",
14-
"@tanstack/start": "^1.46.4",
11+
"@tanstack/react-router": "^1.81.9",
12+
"@tanstack/router-devtools": "^1.81.9",
13+
"@tanstack/router-plugin": "^1.81.9",
14+
"@tanstack/start": "^1.81.9",
1515
"@typescript-eslint/parser": "^7.18.0",
16-
"@vitejs/plugin-react": "^4.3.1",
17-
"isbot": "^5.1.14",
16+
"isbot": "^5.1.17",
1817
"react": "18.3.1",
1918
"react-dom": "18.3.1",
20-
"tailwind-merge": "^2.4.0",
21-
"vinxi": "0.4.1"
19+
"tailwind-merge": "^2.5.4",
20+
"vinxi": "0.4.3"
2221
},
2322
"devDependencies": {
2423
"@types/node": "^20.12.11",
2524
"@types/react": "18.3.12",
2625
"@types/react-dom": "18.3.1",
27-
"@vitejs/plugin-react": "^4.3.1",
26+
"@vitejs/plugin-react": "^4.3.3",
2827
"autoprefixer": "^10.4.20",
2928
"postcss": "^8.4.47",
3029
"prettier": "^3.3.3",

packages/tanstack-start/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
},
6363
"devDependencies": {
6464
"@clerk/eslint-config-custom": "workspace:*",
65-
"@tanstack/react-router": "^1.49.1",
66-
"@tanstack/start": "^1.49.1",
65+
"@tanstack/react-router": "^1.81.9",
66+
"@tanstack/start": "^1.81.9",
6767
"@types/node": "^18.19.43",
6868
"@types/react": "18.3.12",
6969
"@types/react-dom": "18.3.1",
@@ -72,8 +72,8 @@
7272
"vinxi": "^0.4.1"
7373
},
7474
"peerDependencies": {
75-
"@tanstack/react-router": ">=1.49.1",
76-
"@tanstack/start": ">=1.49.1",
75+
"@tanstack/react-router": ">=1.81.9",
76+
"@tanstack/start": ">=1.81.9",
7777
"react": ">=18 || >=19.0.0-beta",
7878
"react-dom": ">=18 || >=19.0.0-beta"
7979
},

0 commit comments

Comments
 (0)