Skip to content

Commit

Permalink
fix: start dependency chains
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed May 14, 2024
1 parent 00abc36 commit 3e99326
Show file tree
Hide file tree
Showing 21 changed files with 276 additions and 74 deletions.
33 changes: 27 additions & 6 deletions examples/react/authenticated-routes/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,51 @@ const AuthInvoicesInvoiceIdRoute = AuthInvoicesInvoiceIdImport.update({
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/_auth': {
id: '/_auth'
path: ''
fullPath: ''
preLoaderRoute: typeof AuthImport
parentRoute: typeof rootRoute
}
'/login': {
id: '/login'
path: '/login'
fullPath: '/login'
preLoaderRoute: typeof LoginImport
parentRoute: typeof rootRoute
}
'/_auth/dashboard': {
id: '/_auth/dashboard'
path: '/dashboard'
fullPath: '/dashboard'
preLoaderRoute: typeof AuthDashboardImport
parentRoute: typeof AuthImport
}
'/_auth/invoices': {
id: '/_auth/invoices'
path: '/invoices'
fullPath: '/invoices'
preLoaderRoute: typeof AuthInvoicesImport
parentRoute: typeof AuthImport
}
'/_auth/invoices/$invoiceId': {
id: '/_auth/invoices/$invoiceId'
path: '/$invoiceId'
fullPath: '/invoices/$invoiceId'
preLoaderRoute: typeof AuthInvoicesInvoiceIdImport
parentRoute: typeof AuthInvoicesImport
}
'/_auth/invoices/': {
id: '/_auth/invoices/'
path: '/'
fullPath: '/invoices/'
preLoaderRoute: typeof AuthInvoicesIndexImport
parentRoute: typeof AuthInvoicesImport
}
Expand All @@ -93,16 +114,16 @@ declare module '@tanstack/react-router' {

// Create and export the route tree

export const routeTree = rootRoute.addChildren([
export const routeTree = rootRoute.addChildren({
IndexRoute,
AuthRoute.addChildren([
AuthRoute: AuthRoute.addChildren({
AuthDashboardRoute,
AuthInvoicesRoute.addChildren([
AuthInvoicesRoute: AuthInvoicesRoute.addChildren({
AuthInvoicesInvoiceIdRoute,
AuthInvoicesIndexRoute,
]),
]),
}),
}),
LoginRoute,
])
})

/* prettier-ignore-end */
44 changes: 38 additions & 6 deletions examples/react/basic-file-based-codesplitting/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,38 +84,65 @@ const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexLazyImport
parentRoute: typeof rootRoute
}
'/posts': {
id: '/posts'
path: '/posts'
fullPath: '/posts'
preLoaderRoute: typeof PostsImport
parentRoute: typeof rootRoute
}
'/_layout-test': {
id: '/_layout-test'
path: ''
fullPath: ''
preLoaderRoute: typeof LayoutTestLazyImport
parentRoute: typeof rootRoute
}
'/posts/$postId': {
id: '/posts/$postId'
path: '/$postId'
fullPath: '/posts/$postId'
preLoaderRoute: typeof PostsPostIdRouteImport
parentRoute: typeof PostsImport
}
'/_layout-test/layout-a': {
id: '/_layout-test/layout-a'
path: '/layout-a'
fullPath: '/layout-a'
preLoaderRoute: typeof LayoutTestLayoutAImport
parentRoute: typeof LayoutTestLazyImport
}
'/_layout-test/layout-b': {
id: '/_layout-test/layout-b'
path: '/layout-b'
fullPath: '/layout-b'
preLoaderRoute: typeof LayoutTestLayoutBImport
parentRoute: typeof LayoutTestLazyImport
}
'/posts/': {
id: '/posts/'
path: '/'
fullPath: '/posts/'
preLoaderRoute: typeof PostsIndexImport
parentRoute: typeof PostsImport
}
'/posts/$postId/deep': {
id: '/posts/$postId/deep'
path: '/posts/$postId/deep'
fullPath: '/posts/$postId/deep'
preLoaderRoute: typeof PostsPostIdDeepImport
parentRoute: typeof rootRoute
}
'/_layout-test/layout-b/test': {
id: '/_layout-test/layout-b/test'
path: '/test'
fullPath: '/layout-b/test'
preLoaderRoute: typeof LayoutTestLayoutBTestLazyImport
parentRoute: typeof LayoutTestLayoutBImport
}
Expand All @@ -124,14 +151,19 @@ declare module '@tanstack/react-router' {

// Create and export the route tree

export const routeTree = rootRoute.addChildren([
export const routeTree = rootRoute.addChildren({
IndexLazyRoute,
PostsRoute.addChildren([PostsPostIdRouteRoute, PostsIndexRoute]),
LayoutTestLazyRoute.addChildren([
PostsRoute: PostsRoute.addChildren({
PostsPostIdRouteRoute,
PostsIndexRoute,
}),
LayoutTestLazyRoute: LayoutTestLazyRoute.addChildren({
LayoutTestLayoutARoute,
LayoutTestLayoutBRoute.addChildren([LayoutTestLayoutBTestLazyRoute]),
]),
LayoutTestLayoutBRoute: LayoutTestLayoutBRoute.addChildren({
LayoutTestLayoutBTestLazyRoute,
}),
}),
PostsPostIdDeepRoute,
])
})

/* prettier-ignore-end */
35 changes: 31 additions & 4 deletions examples/react/basic-react-query-file-based/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,58 @@ const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/_layout': {
id: '/_layout'
path: ''
fullPath: ''
preLoaderRoute: typeof LayoutImport
parentRoute: typeof rootRoute
}
'/posts': {
id: '/posts'
path: '/posts'
fullPath: '/posts'
preLoaderRoute: typeof PostsImport
parentRoute: typeof rootRoute
}
'/_layout/layout-a': {
id: '/_layout/layout-a'
path: '/layout-a'
fullPath: '/layout-a'
preLoaderRoute: typeof LayoutLayoutAImport
parentRoute: typeof LayoutImport
}
'/_layout/layout-b': {
id: '/_layout/layout-b'
path: '/layout-b'
fullPath: '/layout-b'
preLoaderRoute: typeof LayoutLayoutBImport
parentRoute: typeof LayoutImport
}
'/posts/$postId': {
id: '/posts/$postId'
path: '/$postId'
fullPath: '/posts/$postId'
preLoaderRoute: typeof PostsPostIdImport
parentRoute: typeof PostsImport
}
'/posts/': {
id: '/posts/'
path: '/'
fullPath: '/posts/'
preLoaderRoute: typeof PostsIndexImport
parentRoute: typeof PostsImport
}
'/posts/$postId/deep': {
id: '/posts/$postId/deep'
path: '/posts/$postId/deep'
fullPath: '/posts/$postId/deep'
preLoaderRoute: typeof PostsPostIdDeepImport
parentRoute: typeof rootRoute
}
Expand All @@ -103,11 +127,14 @@ declare module '@tanstack/react-router' {

// Create and export the route tree

export const routeTree = rootRoute.addChildren([
export const routeTree = rootRoute.addChildren({
IndexRoute,
LayoutRoute.addChildren([LayoutLayoutARoute, LayoutLayoutBRoute]),
PostsRoute.addChildren([PostsPostIdRoute, PostsIndexRoute]),
LayoutRoute: LayoutRoute.addChildren({
LayoutLayoutARoute,
LayoutLayoutBRoute,
}),
PostsRoute: PostsRoute.addChildren({ PostsPostIdRoute, PostsIndexRoute }),
PostsPostIdDeepRoute,
])
})

/* prettier-ignore-end */

0 comments on commit 3e99326

Please sign in to comment.