Skip to content

Commit 76996aa

Browse files
KyleAMathewsclaude
andcommitted
revert: remove route file updates and directive prologue handling
Reverting two sets of changes per maintainer feedback: 1. Route file updates - These auto-generated changes will be handled in a separate PR (TanStack#5772) to keep this PR focused on router-plugin fixes. 2. Directive prologue handling (insertAfterDirectives) - Maintainer indicated this wasn't necessary for the current use case. This PR now contains only: - ESLint fixes (removing unnecessary optional chaining) - Snapshot updates (removing ./ prepending) - .gitignore updates (test-results, .claude) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 8aff3bb commit 76996aa

File tree

40 files changed

+430
-270
lines changed

40 files changed

+430
-270
lines changed

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

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
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+
1113
import { Route as rootRouteImport } from './routes/__root'
1214
import { Route as WithoutLoaderRouteImport } from './routes/without-loader'
1315
import { Route as ViewportTestRouteImport } from './routes/viewport-test'
@@ -218,6 +220,97 @@ declare module '@tanstack/react-router' {
218220
}
219221
}
220222

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+
221314
interface LayoutLayout2RouteChildren {
222315
LayoutLayout2LayoutARoute: typeof LayoutLayout2LayoutARoute
223316
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, createFileRoute } from '@tanstack/react-router'
1+
import { Outlet } from '@tanstack/react-router'
22

3-
export const Route = createFileRoute('/_layout')({
3+
export const Route = createFileRoute({
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, createFileRoute } from '@tanstack/react-router'
1+
import { Link, Outlet } from '@tanstack/react-router'
22

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { createFileRoute } from '@tanstack/react-router'
2-
export const Route = createFileRoute('/_layout/_layout-2/layout-a')({
1+
export const Route = createFileRoute({
32
component: LayoutAComponent,
43
})
54

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { createFileRoute } from '@tanstack/react-router'
2-
export const Route = createFileRoute('/_layout/_layout-2/layout-b')({
1+
export const Route = createFileRoute({
32
component: LayoutBComponent,
43
})
54

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { createFileRoute } from '@tanstack/react-router'
21
import * as React from 'react'
32

4-
export const Route = createFileRoute('/')({
3+
export const Route = createFileRoute({
54
component: Home,
65
})
76

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, createFileRoute } from '@tanstack/react-router'
2+
import { ErrorComponent } from '@tanstack/react-router'
33
import { fetchPost } from '../posts'
44
import type { ErrorComponentProps } from '@tanstack/react-router'
55

6-
export const Route = createFileRoute('/posts/$postId')({
6+
export const Route = createFileRoute({
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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { createFileRoute } from '@tanstack/react-router'
21
import * as React from 'react'
32

4-
export const Route = createFileRoute('/posts/')({
3+
export const Route = createFileRoute({
54
component: PostsIndexComponent,
65
})
76

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, createFileRoute } from '@tanstack/react-router'
2+
import { Link, Outlet } from '@tanstack/react-router'
33
import { fetchPosts } from '../posts'
44

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

0 commit comments

Comments
 (0)