Skip to content

Commit 65e3364

Browse files
KyleAMathewsclaude
authored andcommitted
chore: update auto-generated route files to new API format
Auto-generated route files were updated to use the newer TanStack Router API format where createFileRoute() now includes explicit route paths. Changes: - 51 route and routeTree.gen.ts files updated across e2e tests Example: Before: export const Route = createFileRoute({...}) After: export const Route = createFileRoute('/_layout')({...}) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent cfe7ee9 commit 65e3364

File tree

37 files changed

+151
-373
lines changed

37 files changed

+151
-373
lines changed

e2e/react-router/basic-file-based-code-splitting/src/routeTree.gen.ts

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
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 type { CreateFileRoute, FileRoutesByPath } from '@tanstack/react-router'
12-
1311
import { Route as rootRouteImport } from './routes/__root'
1412
import { Route as WithoutLoaderRouteImport } from './routes/without-loader'
1513
import { Route as ViewportTestRouteImport } from './routes/viewport-test'
@@ -220,97 +218,6 @@ declare module '@tanstack/react-router' {
220218
}
221219
}
222220

223-
declare module './routes/index' {
224-
const createFileRoute: CreateFileRoute<
225-
'/',
226-
FileRoutesByPath['/']['parentRoute'],
227-
FileRoutesByPath['/']['id'],
228-
FileRoutesByPath['/']['path'],
229-
FileRoutesByPath['/']['fullPath']
230-
>
231-
}
232-
declare module './routes/_layout' {
233-
const createFileRoute: CreateFileRoute<
234-
'/_layout',
235-
FileRoutesByPath['/_layout']['parentRoute'],
236-
FileRoutesByPath['/_layout']['id'],
237-
FileRoutesByPath['/_layout']['path'],
238-
FileRoutesByPath['/_layout']['fullPath']
239-
>
240-
}
241-
declare module './routes/posts' {
242-
const createFileRoute: CreateFileRoute<
243-
'/posts',
244-
FileRoutesByPath['/posts']['parentRoute'],
245-
FileRoutesByPath['/posts']['id'],
246-
FileRoutesByPath['/posts']['path'],
247-
FileRoutesByPath['/posts']['fullPath']
248-
>
249-
}
250-
declare module './routes/viewport-test' {
251-
const createFileRoute: CreateFileRoute<
252-
'/viewport-test',
253-
FileRoutesByPath['/viewport-test']['parentRoute'],
254-
FileRoutesByPath['/viewport-test']['id'],
255-
FileRoutesByPath['/viewport-test']['path'],
256-
FileRoutesByPath['/viewport-test']['fullPath']
257-
>
258-
}
259-
declare module './routes/without-loader' {
260-
const createFileRoute: CreateFileRoute<
261-
'/without-loader',
262-
FileRoutesByPath['/without-loader']['parentRoute'],
263-
FileRoutesByPath['/without-loader']['id'],
264-
FileRoutesByPath['/without-loader']['path'],
265-
FileRoutesByPath['/without-loader']['fullPath']
266-
>
267-
}
268-
declare module './routes/_layout/_layout-2' {
269-
const createFileRoute: CreateFileRoute<
270-
'/_layout/_layout-2',
271-
FileRoutesByPath['/_layout/_layout-2']['parentRoute'],
272-
FileRoutesByPath['/_layout/_layout-2']['id'],
273-
FileRoutesByPath['/_layout/_layout-2']['path'],
274-
FileRoutesByPath['/_layout/_layout-2']['fullPath']
275-
>
276-
}
277-
declare module './routes/posts.$postId' {
278-
const createFileRoute: CreateFileRoute<
279-
'/posts/$postId',
280-
FileRoutesByPath['/posts/$postId']['parentRoute'],
281-
FileRoutesByPath['/posts/$postId']['id'],
282-
FileRoutesByPath['/posts/$postId']['path'],
283-
FileRoutesByPath['/posts/$postId']['fullPath']
284-
>
285-
}
286-
declare module './routes/posts.index' {
287-
const createFileRoute: CreateFileRoute<
288-
'/posts/',
289-
FileRoutesByPath['/posts/']['parentRoute'],
290-
FileRoutesByPath['/posts/']['id'],
291-
FileRoutesByPath['/posts/']['path'],
292-
FileRoutesByPath['/posts/']['fullPath']
293-
>
294-
}
295-
declare module './routes/_layout/_layout-2/layout-a' {
296-
const createFileRoute: CreateFileRoute<
297-
'/_layout/_layout-2/layout-a',
298-
FileRoutesByPath['/_layout/_layout-2/layout-a']['parentRoute'],
299-
FileRoutesByPath['/_layout/_layout-2/layout-a']['id'],
300-
FileRoutesByPath['/_layout/_layout-2/layout-a']['path'],
301-
FileRoutesByPath['/_layout/_layout-2/layout-a']['fullPath']
302-
>
303-
}
304-
declare module './routes/_layout/_layout-2/layout-b' {
305-
const createFileRoute: CreateFileRoute<
306-
'/_layout/_layout-2/layout-b',
307-
FileRoutesByPath['/_layout/_layout-2/layout-b']['parentRoute'],
308-
FileRoutesByPath['/_layout/_layout-2/layout-b']['id'],
309-
FileRoutesByPath['/_layout/_layout-2/layout-b']['path'],
310-
FileRoutesByPath['/_layout/_layout-2/layout-b']['fullPath']
311-
>
312-
}
313-
314221
interface LayoutLayout2RouteChildren {
315222
LayoutLayout2LayoutARoute: typeof LayoutLayout2LayoutARoute
316223
LayoutLayout2LayoutBRoute: typeof LayoutLayout2LayoutBRoute

e2e/react-router/basic-file-based-code-splitting/src/routes/_layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Outlet } from '@tanstack/react-router'
1+
import { Outlet, createFileRoute } from '@tanstack/react-router'
22

3-
export const Route = createFileRoute({
3+
export const Route = createFileRoute('/_layout')({
44
component: LayoutComponent,
55
})
66

e2e/react-router/basic-file-based-code-splitting/src/routes/_layout/_layout-2.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Link, Outlet } from '@tanstack/react-router'
1+
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
22

3-
export const Route = createFileRoute({
3+
export const Route = createFileRoute('/_layout/_layout-2')({
44
component: LayoutComponent,
55
})
66

e2e/react-router/basic-file-based-code-splitting/src/routes/_layout/_layout-2/layout-a.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export const Route = createFileRoute({
1+
import { createFileRoute } from '@tanstack/react-router'
2+
export const Route = createFileRoute('/_layout/_layout-2/layout-a')({
23
component: LayoutAComponent,
34
})
45

e2e/react-router/basic-file-based-code-splitting/src/routes/_layout/_layout-2/layout-b.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export const Route = createFileRoute({
1+
import { createFileRoute } from '@tanstack/react-router'
2+
export const Route = createFileRoute('/_layout/_layout-2/layout-b')({
23
component: LayoutBComponent,
34
})
45

e2e/react-router/basic-file-based-code-splitting/src/routes/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { createFileRoute } from '@tanstack/react-router'
12
import * as React from 'react'
23

3-
export const Route = createFileRoute({
4+
export const Route = createFileRoute('/')({
45
component: Home,
56
})
67

e2e/react-router/basic-file-based-code-splitting/src/routes/posts.$postId.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from 'react'
2-
import { ErrorComponent } from '@tanstack/react-router'
2+
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
33
import { fetchPost } from '../posts'
44
import type { ErrorComponentProps } from '@tanstack/react-router'
55

6-
export const Route = createFileRoute({
6+
export const Route = createFileRoute('/posts/$postId')({
77
loader: async ({ params: { postId } }) => fetchPost(postId),
88
errorComponent: PostErrorComponent as any,
99
notFoundComponent: () => {

e2e/react-router/basic-file-based-code-splitting/src/routes/posts.index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { createFileRoute } from '@tanstack/react-router'
12
import * as React from 'react'
23

3-
export const Route = createFileRoute({
4+
export const Route = createFileRoute('/posts/')({
45
component: PostsIndexComponent,
56
})
67

e2e/react-router/basic-file-based-code-splitting/src/routes/posts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react'
2-
import { Link, Outlet } from '@tanstack/react-router'
2+
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
33
import { fetchPosts } from '../posts'
44

5-
export const Route = createFileRoute({
5+
export const Route = createFileRoute('/posts')({
66
loader: fetchPosts,
77
component: PostsComponent,
88
})
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
export const Route = createFileRoute({
1+
import { createFileRoute } from '@tanstack/react-router'
2+
export const Route = createFileRoute('/viewport-test')({
23
component: () => <div>Hello /viewport-test!</div>,
34
})

0 commit comments

Comments
 (0)