Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ coverage
packages/router-generator/tests/**/*.gen.ts
packages/router-generator/tests/**/*.gen.js
e2e/**/port*.txt
test-results/
**/test-results/

# misc
.DS_Store
Expand Down Expand Up @@ -79,3 +81,6 @@ vite.config.ts.timestamp_*
**/llms

**/.tanstack

# Claude Code settings
.claude/
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.

import type { CreateFileRoute, FileRoutesByPath } from '@tanstack/react-router'

import { Route as rootRouteImport } from './routes/__root'
import { Route as WithoutLoaderRouteImport } from './routes/without-loader'
import { Route as ViewportTestRouteImport } from './routes/viewport-test'
Expand Down Expand Up @@ -220,97 +218,6 @@ declare module '@tanstack/react-router' {
}
}

declare module './routes/index' {
const createFileRoute: CreateFileRoute<
'/',
FileRoutesByPath['/']['parentRoute'],
FileRoutesByPath['/']['id'],
FileRoutesByPath['/']['path'],
FileRoutesByPath['/']['fullPath']
>
}
declare module './routes/_layout' {
const createFileRoute: CreateFileRoute<
'/_layout',
FileRoutesByPath['/_layout']['parentRoute'],
FileRoutesByPath['/_layout']['id'],
FileRoutesByPath['/_layout']['path'],
FileRoutesByPath['/_layout']['fullPath']
>
}
declare module './routes/posts' {
const createFileRoute: CreateFileRoute<
'/posts',
FileRoutesByPath['/posts']['parentRoute'],
FileRoutesByPath['/posts']['id'],
FileRoutesByPath['/posts']['path'],
FileRoutesByPath['/posts']['fullPath']
>
}
declare module './routes/viewport-test' {
const createFileRoute: CreateFileRoute<
'/viewport-test',
FileRoutesByPath['/viewport-test']['parentRoute'],
FileRoutesByPath['/viewport-test']['id'],
FileRoutesByPath['/viewport-test']['path'],
FileRoutesByPath['/viewport-test']['fullPath']
>
}
declare module './routes/without-loader' {
const createFileRoute: CreateFileRoute<
'/without-loader',
FileRoutesByPath['/without-loader']['parentRoute'],
FileRoutesByPath['/without-loader']['id'],
FileRoutesByPath['/without-loader']['path'],
FileRoutesByPath['/without-loader']['fullPath']
>
}
declare module './routes/_layout/_layout-2' {
const createFileRoute: CreateFileRoute<
'/_layout/_layout-2',
FileRoutesByPath['/_layout/_layout-2']['parentRoute'],
FileRoutesByPath['/_layout/_layout-2']['id'],
FileRoutesByPath['/_layout/_layout-2']['path'],
FileRoutesByPath['/_layout/_layout-2']['fullPath']
>
}
declare module './routes/posts.$postId' {
const createFileRoute: CreateFileRoute<
'/posts/$postId',
FileRoutesByPath['/posts/$postId']['parentRoute'],
FileRoutesByPath['/posts/$postId']['id'],
FileRoutesByPath['/posts/$postId']['path'],
FileRoutesByPath['/posts/$postId']['fullPath']
>
}
declare module './routes/posts.index' {
const createFileRoute: CreateFileRoute<
'/posts/',
FileRoutesByPath['/posts/']['parentRoute'],
FileRoutesByPath['/posts/']['id'],
FileRoutesByPath['/posts/']['path'],
FileRoutesByPath['/posts/']['fullPath']
>
}
declare module './routes/_layout/_layout-2/layout-a' {
const createFileRoute: CreateFileRoute<
'/_layout/_layout-2/layout-a',
FileRoutesByPath['/_layout/_layout-2/layout-a']['parentRoute'],
FileRoutesByPath['/_layout/_layout-2/layout-a']['id'],
FileRoutesByPath['/_layout/_layout-2/layout-a']['path'],
FileRoutesByPath['/_layout/_layout-2/layout-a']['fullPath']
>
}
declare module './routes/_layout/_layout-2/layout-b' {
const createFileRoute: CreateFileRoute<
'/_layout/_layout-2/layout-b',
FileRoutesByPath['/_layout/_layout-2/layout-b']['parentRoute'],
FileRoutesByPath['/_layout/_layout-2/layout-b']['id'],
FileRoutesByPath['/_layout/_layout-2/layout-b']['path'],
FileRoutesByPath['/_layout/_layout-2/layout-b']['fullPath']
>
}

interface LayoutLayout2RouteChildren {
LayoutLayout2LayoutARoute: typeof LayoutLayout2LayoutARoute
LayoutLayout2LayoutBRoute: typeof LayoutLayout2LayoutBRoute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Outlet } from '@tanstack/react-router'
import { Outlet, createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute({
export const Route = createFileRoute('/_layout')({
component: LayoutComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link, Outlet } from '@tanstack/react-router'
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute({
export const Route = createFileRoute('/_layout/_layout-2')({
component: LayoutComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const Route = createFileRoute({
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/_layout/_layout-2/layout-a')({
component: LayoutAComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const Route = createFileRoute({
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/_layout/_layout-2/layout-b')({
component: LayoutBComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createFileRoute } from '@tanstack/react-router'
import * as React from 'react'

export const Route = createFileRoute({
export const Route = createFileRoute('/')({
component: Home,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react'
import { ErrorComponent } from '@tanstack/react-router'
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import { fetchPost } from '../posts'
import type { ErrorComponentProps } from '@tanstack/react-router'

export const Route = createFileRoute({
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId } }) => fetchPost(postId),
errorComponent: PostErrorComponent as any,
notFoundComponent: () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createFileRoute } from '@tanstack/react-router'
import * as React from 'react'

export const Route = createFileRoute({
export const Route = createFileRoute('/posts/')({
component: PostsIndexComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react'
import { Link, Outlet } from '@tanstack/react-router'
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
import { fetchPosts } from '../posts'

export const Route = createFileRoute({
export const Route = createFileRoute('/posts')({
loader: fetchPosts,
component: PostsComponent,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const Route = createFileRoute({
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/viewport-test')({
component: () => <div>Hello /viewport-test!</div>,
})
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const Route = createFileRoute({
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/without-loader')({
component: () => <div>Hello /without-loader!</div>,
})
Loading
Loading