diff --git a/e2e/react-router/basic-file-based/src/routeTree.gen.ts b/e2e/react-router/basic-file-based/src/routeTree.gen.ts index 2daaf9a821e..5c4c85f21c7 100644 --- a/e2e/react-router/basic-file-based/src/routeTree.gen.ts +++ b/e2e/react-router/basic-file-based/src/routeTree.gen.ts @@ -32,7 +32,6 @@ import { Route as StructuralSharingEnabledRouteImport } from './routes/structura import { Route as SearchParamsDefaultRouteImport } from './routes/search-params/default' import { Route as RedirectTargetRouteImport } from './routes/redirect/$target' import { Route as PostsPostIdRouteImport } from './routes/posts.$postId' -import { Route as NonNestedBazRouteImport } from './routes/non-nested/baz' import { Route as LayoutLayout2RouteImport } from './routes/_layout/_layout-2' import { Route as groupLazyinsideRouteImport } from './routes/(group)/lazyinside' import { Route as groupInsideRouteImport } from './routes/(group)/inside' @@ -41,6 +40,10 @@ import { Route as anotherGroupOnlyrouteinsideRouteImport } from './routes/(anoth import { Route as RelativeUseNavigateRouteRouteImport } from './routes/relative/useNavigate/route' import { Route as RelativeLinkRouteRouteImport } from './routes/relative/link/route' import { Route as ParamsPsNonNestedRouteRouteImport } from './routes/params-ps/non-nested/route' +import { Route as NonNestedSuffixRouteRouteImport } from './routes/non-nested/suffix/route' +import { Route as NonNestedPrefixRouteRouteImport } from './routes/non-nested/prefix/route' +import { Route as NonNestedPathRouteRouteImport } from './routes/non-nested/path/route' +import { Route as NonNestedNamedRouteRouteImport } from './routes/non-nested/named/route' import { Route as RedirectTargetIndexRouteImport } from './routes/redirect/$target/index' import { Route as ParamsPsWildcardIndexRouteImport } from './routes/params-ps/wildcard/index' import { Route as ParamsPsNamedIndexRouteImport } from './routes/params-ps/named/index' @@ -60,21 +63,35 @@ import { Route as ParamsPsWildcardPrefixChar123Char125RouteImport } from './rout import { Route as ParamsPsWildcardSplatRouteImport } from './routes/params-ps/wildcard/$' import { Route as ParamsPsNamedChar123fooChar125suffixRouteImport } from './routes/params-ps/named/{$foo}suffix' import { Route as ParamsPsNamedPrefixChar123fooChar125RouteImport } from './routes/params-ps/named/prefix{$foo}' -import { Route as NonNestedBazBazidRouteImport } from './routes/non-nested/baz.$bazid' import { Route as LayoutLayout2LayoutBRouteImport } from './routes/_layout/_layout-2/layout-b' import { Route as LayoutLayout2LayoutARouteImport } from './routes/_layout/_layout-2/layout-a' import { Route as groupSubfolderInsideRouteImport } from './routes/(group)/subfolder/inside' import { Route as groupLayoutInsidelayoutRouteImport } from './routes/(group)/_layout.insidelayout' import { Route as ParamsPsNonNestedFooRouteRouteImport } from './routes/params-ps/non-nested/$foo_/route' import { Route as ParamsPsNamedFooRouteRouteImport } from './routes/params-ps/named/$foo/route' +import { Route as NonNestedSuffixChar123bazChar125suffixRouteRouteImport } from './routes/non-nested/suffix/{$baz}suffix.route' +import { Route as NonNestedPrefixPrefixChar123bazChar125RouteRouteImport } from './routes/non-nested/prefix/prefix{$baz}.route' +import { Route as NonNestedPathBazRouteRouteImport } from './routes/non-nested/path/baz.route' +import { Route as NonNestedNamedBazRouteRouteImport } from './routes/non-nested/named/$baz.route' import { Route as RelativeUseNavigateWithSearchIndexRouteImport } from './routes/relative/useNavigate/with-search/index' import { Route as RelativeUseNavigatePathIndexRouteImport } from './routes/relative/useNavigate/path/index' import { Route as RelativeUseNavigateNestedIndexRouteImport } from './routes/relative/useNavigate/nested/index' import { Route as RelativeLinkWithSearchIndexRouteImport } from './routes/relative/link/with-search/index' import { Route as RelativeLinkPathIndexRouteImport } from './routes/relative/link/path/index' import { Route as RelativeLinkNestedIndexRouteImport } from './routes/relative/link/nested/index' +import { Route as NonNestedSuffixChar123bazChar125suffixIndexRouteImport } from './routes/non-nested/suffix/{$baz}suffix.index' +import { Route as NonNestedPrefixPrefixChar123bazChar125IndexRouteImport } from './routes/non-nested/prefix/prefix{$baz}.index' +import { Route as NonNestedPathBazIndexRouteImport } from './routes/non-nested/path/baz.index' +import { Route as NonNestedNamedBazIndexRouteImport } from './routes/non-nested/named/$baz.index' import { Route as ParamsPsNonNestedFooBarRouteImport } from './routes/params-ps/non-nested/$foo_/$bar' -import { Route as NonNestedBazBazidEditRouteImport } from './routes/non-nested/baz_.$bazid.edit' +import { Route as NonNestedSuffixChar123bazChar125suffixBarRouteImport } from './routes/non-nested/suffix/{$baz}suffix_.bar' +import { Route as NonNestedSuffixChar123bazChar125suffixFooRouteImport } from './routes/non-nested/suffix/{$baz}suffix.foo' +import { Route as NonNestedPrefixPrefixChar123bazChar125BarRouteImport } from './routes/non-nested/prefix/prefix{$baz}_.bar' +import { Route as NonNestedPrefixPrefixChar123bazChar125FooRouteImport } from './routes/non-nested/prefix/prefix{$baz}.foo' +import { Route as NonNestedPathBazBarRouteImport } from './routes/non-nested/path/baz_.bar' +import { Route as NonNestedPathBazFooRouteImport } from './routes/non-nested/path/baz.foo' +import { Route as NonNestedNamedBazBarRouteImport } from './routes/non-nested/named/$baz_.bar' +import { Route as NonNestedNamedBazFooRouteImport } from './routes/non-nested/named/$baz.foo' import { Route as ParamsPsNamedFooBarRouteRouteImport } from './routes/params-ps/named/$foo/$bar.route' import { Route as RelativeUseNavigatePathPathIndexRouteImport } from './routes/relative/useNavigate/path/$path/index' import { Route as RelativeUseNavigateNestedDeepIndexRouteImport } from './routes/relative/useNavigate/nested/deep/index' @@ -194,11 +211,6 @@ const PostsPostIdRoute = PostsPostIdRouteImport.update({ path: '/$postId', getParentRoute: () => PostsRoute, } as any) -const NonNestedBazRoute = NonNestedBazRouteImport.update({ - id: '/baz', - path: '/baz', - getParentRoute: () => NonNestedRouteRoute, -} as any) const LayoutLayout2Route = LayoutLayout2RouteImport.update({ id: '/_layout-2', getParentRoute: () => LayoutRoute, @@ -241,6 +253,26 @@ const ParamsPsNonNestedRouteRoute = ParamsPsNonNestedRouteRouteImport.update({ path: '/params-ps/non-nested', getParentRoute: () => rootRouteImport, } as any) +const NonNestedSuffixRouteRoute = NonNestedSuffixRouteRouteImport.update({ + id: '/suffix', + path: '/suffix', + getParentRoute: () => NonNestedRouteRoute, +} as any) +const NonNestedPrefixRouteRoute = NonNestedPrefixRouteRouteImport.update({ + id: '/prefix', + path: '/prefix', + getParentRoute: () => NonNestedRouteRoute, +} as any) +const NonNestedPathRouteRoute = NonNestedPathRouteRouteImport.update({ + id: '/path', + path: '/path', + getParentRoute: () => NonNestedRouteRoute, +} as any) +const NonNestedNamedRouteRoute = NonNestedNamedRouteRouteImport.update({ + id: '/named', + path: '/named', + getParentRoute: () => NonNestedRouteRoute, +} as any) const RedirectTargetIndexRoute = RedirectTargetIndexRouteImport.update({ id: '/', path: '/', @@ -345,11 +377,6 @@ const ParamsPsNamedPrefixChar123fooChar125Route = path: '/params-ps/named/prefix{$foo}', getParentRoute: () => rootRouteImport, } as any) -const NonNestedBazBazidRoute = NonNestedBazBazidRouteImport.update({ - id: '/$bazid', - path: '/$bazid', - getParentRoute: () => NonNestedBazRoute, -} as any) const LayoutLayout2LayoutBRoute = LayoutLayout2LayoutBRouteImport.update({ id: '/layout-b', path: '/layout-b', @@ -381,6 +408,28 @@ const ParamsPsNamedFooRouteRoute = ParamsPsNamedFooRouteRouteImport.update({ path: '/params-ps/named/$foo', getParentRoute: () => rootRouteImport, } as any) +const NonNestedSuffixChar123bazChar125suffixRouteRoute = + NonNestedSuffixChar123bazChar125suffixRouteRouteImport.update({ + id: '/{$baz}suffix', + path: '/{$baz}suffix', + getParentRoute: () => NonNestedSuffixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125RouteRoute = + NonNestedPrefixPrefixChar123bazChar125RouteRouteImport.update({ + id: '/prefix{$baz}', + path: '/prefix{$baz}', + getParentRoute: () => NonNestedPrefixRouteRoute, + } as any) +const NonNestedPathBazRouteRoute = NonNestedPathBazRouteRouteImport.update({ + id: '/baz', + path: '/baz', + getParentRoute: () => NonNestedPathRouteRoute, +} as any) +const NonNestedNamedBazRouteRoute = NonNestedNamedBazRouteRouteImport.update({ + id: '/$baz', + path: '/$baz', + getParentRoute: () => NonNestedNamedRouteRoute, +} as any) const RelativeUseNavigateWithSearchIndexRoute = RelativeUseNavigateWithSearchIndexRouteImport.update({ id: '/with-search/', @@ -415,15 +464,76 @@ const RelativeLinkNestedIndexRoute = RelativeLinkNestedIndexRouteImport.update({ path: '/nested/', getParentRoute: () => RelativeLinkRouteRoute, } as any) +const NonNestedSuffixChar123bazChar125suffixIndexRoute = + NonNestedSuffixChar123bazChar125suffixIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedSuffixChar123bazChar125suffixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125IndexRoute = + NonNestedPrefixPrefixChar123bazChar125IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedPrefixPrefixChar123bazChar125RouteRoute, + } as any) +const NonNestedPathBazIndexRoute = NonNestedPathBazIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedPathBazRouteRoute, +} as any) +const NonNestedNamedBazIndexRoute = NonNestedNamedBazIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedNamedBazRouteRoute, +} as any) const ParamsPsNonNestedFooBarRoute = ParamsPsNonNestedFooBarRouteImport.update({ id: '/$bar', path: '/$bar', getParentRoute: () => ParamsPsNonNestedFooRouteRoute, } as any) -const NonNestedBazBazidEditRoute = NonNestedBazBazidEditRouteImport.update({ - id: '/baz_/$bazid/edit', - path: '/baz/$bazid/edit', - getParentRoute: () => NonNestedRouteRoute, +const NonNestedSuffixChar123bazChar125suffixBarRoute = + NonNestedSuffixChar123bazChar125suffixBarRouteImport.update({ + id: '/{$baz}suffix_/bar', + path: '/{$baz}suffix/bar', + getParentRoute: () => NonNestedSuffixRouteRoute, + } as any) +const NonNestedSuffixChar123bazChar125suffixFooRoute = + NonNestedSuffixChar123bazChar125suffixFooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedSuffixChar123bazChar125suffixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125BarRoute = + NonNestedPrefixPrefixChar123bazChar125BarRouteImport.update({ + id: '/prefix{$baz}_/bar', + path: '/prefix{$baz}/bar', + getParentRoute: () => NonNestedPrefixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125FooRoute = + NonNestedPrefixPrefixChar123bazChar125FooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedPrefixPrefixChar123bazChar125RouteRoute, + } as any) +const NonNestedPathBazBarRoute = NonNestedPathBazBarRouteImport.update({ + id: '/baz_/bar', + path: '/baz/bar', + getParentRoute: () => NonNestedPathRouteRoute, +} as any) +const NonNestedPathBazFooRoute = NonNestedPathBazFooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedPathBazRouteRoute, +} as any) +const NonNestedNamedBazBarRoute = NonNestedNamedBazBarRouteImport.update({ + id: '/$baz_/bar', + path: '/$baz/bar', + getParentRoute: () => NonNestedNamedRouteRoute, +} as any) +const NonNestedNamedBazFooRoute = NonNestedNamedBazFooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedNamedBazRouteRoute, } as any) const ParamsPsNamedFooBarRouteRoute = ParamsPsNamedFooBarRouteRouteImport.update({ @@ -473,13 +583,16 @@ export interface FileRoutesByFullPath { '/posts': typeof PostsRouteWithChildren '/remountDeps': typeof RemountDepsRoute '/대한민국': typeof Char45824Char54620Char48124Char44397Route + '/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren + '/non-nested/path': typeof NonNestedPathRouteRouteWithChildren + '/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren + '/non-nested/suffix': typeof NonNestedSuffixRouteRouteWithChildren '/params-ps/non-nested': typeof ParamsPsNonNestedRouteRouteWithChildren '/relative/link': typeof RelativeLinkRouteRouteWithChildren '/relative/useNavigate': typeof RelativeUseNavigateRouteRouteWithChildren '/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute '/inside': typeof groupInsideRoute '/lazyinside': typeof groupLazyinsideRoute - '/non-nested/baz': typeof NonNestedBazRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute '/redirect/$target': typeof RedirectTargetRouteWithChildren '/search-params/default': typeof SearchParamsDefaultRoute @@ -489,13 +602,16 @@ export interface FileRoutesByFullPath { '/redirect': typeof RedirectIndexRoute '/relative': typeof RelativeIndexRoute '/search-params/': typeof SearchParamsIndexRoute + '/non-nested/named/$baz': typeof NonNestedNamedBazRouteRouteWithChildren + '/non-nested/path/baz': typeof NonNestedPathBazRouteRouteWithChildren + '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren + '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren '/params-ps/named/$foo': typeof ParamsPsNamedFooRouteRouteWithChildren '/params-ps/non-nested/$foo': typeof ParamsPsNonNestedFooRouteRouteWithChildren '/insidelayout': typeof groupLayoutInsidelayoutRoute '/subfolder/inside': typeof groupSubfolderInsideRoute '/layout-a': typeof LayoutLayout2LayoutARoute '/layout-b': typeof LayoutLayout2LayoutBRoute - '/non-nested/baz/$bazid': typeof NonNestedBazBazidRoute '/params-ps/named/prefix{$foo}': typeof ParamsPsNamedPrefixChar123fooChar125Route '/params-ps/named/{$foo}suffix': typeof ParamsPsNamedChar123fooChar125suffixRoute '/params-ps/wildcard/$': typeof ParamsPsWildcardSplatRoute @@ -516,8 +632,19 @@ export interface FileRoutesByFullPath { '/params-ps/wildcard': typeof ParamsPsWildcardIndexRoute '/redirect/$target/': typeof RedirectTargetIndexRoute '/params-ps/named/$foo/$bar': typeof ParamsPsNamedFooBarRouteRouteWithChildren - '/non-nested/baz/$bazid/edit': typeof NonNestedBazBazidEditRoute + '/non-nested/named/$baz/foo': typeof NonNestedNamedBazFooRoute + '/non-nested/named/$baz/bar': typeof NonNestedNamedBazBarRoute + '/non-nested/path/baz/foo': typeof NonNestedPathBazFooRoute + '/non-nested/path/baz/bar': typeof NonNestedPathBazBarRoute + '/non-nested/prefix/prefix{$baz}/foo': typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + '/non-nested/prefix/prefix{$baz}/bar': typeof NonNestedPrefixPrefixChar123bazChar125BarRoute + '/non-nested/suffix/{$baz}suffix/foo': typeof NonNestedSuffixChar123bazChar125suffixFooRoute + '/non-nested/suffix/{$baz}suffix/bar': typeof NonNestedSuffixChar123bazChar125suffixBarRoute '/params-ps/non-nested/$foo/$bar': typeof ParamsPsNonNestedFooBarRoute + '/non-nested/named/$baz/': typeof NonNestedNamedBazIndexRoute + '/non-nested/path/baz/': typeof NonNestedPathBazIndexRoute + '/non-nested/prefix/prefix{$baz}/': typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute + '/non-nested/suffix/{$baz}suffix/': typeof NonNestedSuffixChar123bazChar125suffixIndexRoute '/relative/link/nested': typeof RelativeLinkNestedIndexRoute '/relative/link/path': typeof RelativeLinkPathIndexRoute '/relative/link/with-search': typeof RelativeLinkWithSearchIndexRoute @@ -540,13 +667,16 @@ export interface FileRoutesByTo { '/notRemountDeps': typeof NotRemountDepsRoute '/remountDeps': typeof RemountDepsRoute '/대한민국': typeof Char45824Char54620Char48124Char44397Route + '/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren + '/non-nested/path': typeof NonNestedPathRouteRouteWithChildren + '/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren + '/non-nested/suffix': typeof NonNestedSuffixRouteRouteWithChildren '/params-ps/non-nested': typeof ParamsPsNonNestedRouteRouteWithChildren '/relative/link': typeof RelativeLinkRouteRouteWithChildren '/relative/useNavigate': typeof RelativeUseNavigateRouteRouteWithChildren '/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute '/inside': typeof groupInsideRoute '/lazyinside': typeof groupLazyinsideRoute - '/non-nested/baz': typeof NonNestedBazRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute '/search-params/default': typeof SearchParamsDefaultRoute '/structural-sharing/$enabled': typeof StructuralSharingEnabledRoute @@ -561,7 +691,6 @@ export interface FileRoutesByTo { '/subfolder/inside': typeof groupSubfolderInsideRoute '/layout-a': typeof LayoutLayout2LayoutARoute '/layout-b': typeof LayoutLayout2LayoutBRoute - '/non-nested/baz/$bazid': typeof NonNestedBazBazidRoute '/params-ps/named/prefix{$foo}': typeof ParamsPsNamedPrefixChar123fooChar125Route '/params-ps/named/{$foo}suffix': typeof ParamsPsNamedChar123fooChar125suffixRoute '/params-ps/wildcard/$': typeof ParamsPsWildcardSplatRoute @@ -582,8 +711,19 @@ export interface FileRoutesByTo { '/params-ps/wildcard': typeof ParamsPsWildcardIndexRoute '/redirect/$target': typeof RedirectTargetIndexRoute '/params-ps/named/$foo/$bar': typeof ParamsPsNamedFooBarRouteRouteWithChildren - '/non-nested/baz/$bazid/edit': typeof NonNestedBazBazidEditRoute + '/non-nested/named/$baz/foo': typeof NonNestedNamedBazFooRoute + '/non-nested/named/$baz/bar': typeof NonNestedNamedBazBarRoute + '/non-nested/path/baz/foo': typeof NonNestedPathBazFooRoute + '/non-nested/path/baz/bar': typeof NonNestedPathBazBarRoute + '/non-nested/prefix/prefix{$baz}/foo': typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + '/non-nested/prefix/prefix{$baz}/bar': typeof NonNestedPrefixPrefixChar123bazChar125BarRoute + '/non-nested/suffix/{$baz}suffix/foo': typeof NonNestedSuffixChar123bazChar125suffixFooRoute + '/non-nested/suffix/{$baz}suffix/bar': typeof NonNestedSuffixChar123bazChar125suffixBarRoute '/params-ps/non-nested/$foo/$bar': typeof ParamsPsNonNestedFooBarRoute + '/non-nested/named/$baz': typeof NonNestedNamedBazIndexRoute + '/non-nested/path/baz': typeof NonNestedPathBazIndexRoute + '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute + '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixIndexRoute '/relative/link/nested': typeof RelativeLinkNestedIndexRoute '/relative/link/path': typeof RelativeLinkPathIndexRoute '/relative/link/with-search': typeof RelativeLinkWithSearchIndexRoute @@ -610,6 +750,10 @@ export interface FileRoutesById { '/posts': typeof PostsRouteWithChildren '/remountDeps': typeof RemountDepsRoute '/대한민국': typeof Char45824Char54620Char48124Char44397Route + '/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren + '/non-nested/path': typeof NonNestedPathRouteRouteWithChildren + '/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren + '/non-nested/suffix': typeof NonNestedSuffixRouteRouteWithChildren '/params-ps/non-nested': typeof ParamsPsNonNestedRouteRouteWithChildren '/relative/link': typeof RelativeLinkRouteRouteWithChildren '/relative/useNavigate': typeof RelativeUseNavigateRouteRouteWithChildren @@ -619,7 +763,6 @@ export interface FileRoutesById { '/(group)/inside': typeof groupInsideRoute '/(group)/lazyinside': typeof groupLazyinsideRoute '/_layout/_layout-2': typeof LayoutLayout2RouteWithChildren - '/non-nested/baz': typeof NonNestedBazRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute '/redirect/$target': typeof RedirectTargetRouteWithChildren '/search-params/default': typeof SearchParamsDefaultRoute @@ -629,13 +772,16 @@ export interface FileRoutesById { '/redirect/': typeof RedirectIndexRoute '/relative/': typeof RelativeIndexRoute '/search-params/': typeof SearchParamsIndexRoute + '/non-nested/named/$baz': typeof NonNestedNamedBazRouteRouteWithChildren + '/non-nested/path/baz': typeof NonNestedPathBazRouteRouteWithChildren + '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren + '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren '/params-ps/named/$foo': typeof ParamsPsNamedFooRouteRouteWithChildren '/params-ps/non-nested/$foo_': typeof ParamsPsNonNestedFooRouteRouteWithChildren '/(group)/_layout/insidelayout': typeof groupLayoutInsidelayoutRoute '/(group)/subfolder/inside': typeof groupSubfolderInsideRoute '/_layout/_layout-2/layout-a': typeof LayoutLayout2LayoutARoute '/_layout/_layout-2/layout-b': typeof LayoutLayout2LayoutBRoute - '/non-nested/baz/$bazid': typeof NonNestedBazBazidRoute '/params-ps/named/prefix{$foo}': typeof ParamsPsNamedPrefixChar123fooChar125Route '/params-ps/named/{$foo}suffix': typeof ParamsPsNamedChar123fooChar125suffixRoute '/params-ps/wildcard/$': typeof ParamsPsWildcardSplatRoute @@ -656,8 +802,19 @@ export interface FileRoutesById { '/params-ps/wildcard/': typeof ParamsPsWildcardIndexRoute '/redirect/$target/': typeof RedirectTargetIndexRoute '/params-ps/named/$foo/$bar': typeof ParamsPsNamedFooBarRouteRouteWithChildren - '/non-nested/baz_/$bazid/edit': typeof NonNestedBazBazidEditRoute + '/non-nested/named/$baz/foo': typeof NonNestedNamedBazFooRoute + '/non-nested/named/$baz_/bar': typeof NonNestedNamedBazBarRoute + '/non-nested/path/baz/foo': typeof NonNestedPathBazFooRoute + '/non-nested/path/baz_/bar': typeof NonNestedPathBazBarRoute + '/non-nested/prefix/prefix{$baz}/foo': typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + '/non-nested/prefix/prefix{$baz}_/bar': typeof NonNestedPrefixPrefixChar123bazChar125BarRoute + '/non-nested/suffix/{$baz}suffix/foo': typeof NonNestedSuffixChar123bazChar125suffixFooRoute + '/non-nested/suffix/{$baz}suffix_/bar': typeof NonNestedSuffixChar123bazChar125suffixBarRoute '/params-ps/non-nested/$foo_/$bar': typeof ParamsPsNonNestedFooBarRoute + '/non-nested/named/$baz/': typeof NonNestedNamedBazIndexRoute + '/non-nested/path/baz/': typeof NonNestedPathBazIndexRoute + '/non-nested/prefix/prefix{$baz}/': typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute + '/non-nested/suffix/{$baz}suffix/': typeof NonNestedSuffixChar123bazChar125suffixIndexRoute '/relative/link/nested/': typeof RelativeLinkNestedIndexRoute '/relative/link/path/': typeof RelativeLinkPathIndexRoute '/relative/link/with-search/': typeof RelativeLinkWithSearchIndexRoute @@ -684,13 +841,16 @@ export interface FileRouteTypes { | '/posts' | '/remountDeps' | '/대한민국' + | '/non-nested/named' + | '/non-nested/path' + | '/non-nested/prefix' + | '/non-nested/suffix' | '/params-ps/non-nested' | '/relative/link' | '/relative/useNavigate' | '/onlyrouteinside' | '/inside' | '/lazyinside' - | '/non-nested/baz' | '/posts/$postId' | '/redirect/$target' | '/search-params/default' @@ -700,13 +860,16 @@ export interface FileRouteTypes { | '/redirect' | '/relative' | '/search-params/' + | '/non-nested/named/$baz' + | '/non-nested/path/baz' + | '/non-nested/prefix/prefix{$baz}' + | '/non-nested/suffix/{$baz}suffix' | '/params-ps/named/$foo' | '/params-ps/non-nested/$foo' | '/insidelayout' | '/subfolder/inside' | '/layout-a' | '/layout-b' - | '/non-nested/baz/$bazid' | '/params-ps/named/prefix{$foo}' | '/params-ps/named/{$foo}suffix' | '/params-ps/wildcard/$' @@ -727,8 +890,19 @@ export interface FileRouteTypes { | '/params-ps/wildcard' | '/redirect/$target/' | '/params-ps/named/$foo/$bar' - | '/non-nested/baz/$bazid/edit' + | '/non-nested/named/$baz/foo' + | '/non-nested/named/$baz/bar' + | '/non-nested/path/baz/foo' + | '/non-nested/path/baz/bar' + | '/non-nested/prefix/prefix{$baz}/foo' + | '/non-nested/prefix/prefix{$baz}/bar' + | '/non-nested/suffix/{$baz}suffix/foo' + | '/non-nested/suffix/{$baz}suffix/bar' | '/params-ps/non-nested/$foo/$bar' + | '/non-nested/named/$baz/' + | '/non-nested/path/baz/' + | '/non-nested/prefix/prefix{$baz}/' + | '/non-nested/suffix/{$baz}suffix/' | '/relative/link/nested' | '/relative/link/path' | '/relative/link/with-search' @@ -751,13 +925,16 @@ export interface FileRouteTypes { | '/notRemountDeps' | '/remountDeps' | '/대한민국' + | '/non-nested/named' + | '/non-nested/path' + | '/non-nested/prefix' + | '/non-nested/suffix' | '/params-ps/non-nested' | '/relative/link' | '/relative/useNavigate' | '/onlyrouteinside' | '/inside' | '/lazyinside' - | '/non-nested/baz' | '/posts/$postId' | '/search-params/default' | '/structural-sharing/$enabled' @@ -772,7 +949,6 @@ export interface FileRouteTypes { | '/subfolder/inside' | '/layout-a' | '/layout-b' - | '/non-nested/baz/$bazid' | '/params-ps/named/prefix{$foo}' | '/params-ps/named/{$foo}suffix' | '/params-ps/wildcard/$' @@ -793,8 +969,19 @@ export interface FileRouteTypes { | '/params-ps/wildcard' | '/redirect/$target' | '/params-ps/named/$foo/$bar' - | '/non-nested/baz/$bazid/edit' + | '/non-nested/named/$baz/foo' + | '/non-nested/named/$baz/bar' + | '/non-nested/path/baz/foo' + | '/non-nested/path/baz/bar' + | '/non-nested/prefix/prefix{$baz}/foo' + | '/non-nested/prefix/prefix{$baz}/bar' + | '/non-nested/suffix/{$baz}suffix/foo' + | '/non-nested/suffix/{$baz}suffix/bar' | '/params-ps/non-nested/$foo/$bar' + | '/non-nested/named/$baz' + | '/non-nested/path/baz' + | '/non-nested/prefix/prefix{$baz}' + | '/non-nested/suffix/{$baz}suffix' | '/relative/link/nested' | '/relative/link/path' | '/relative/link/with-search' @@ -820,6 +1007,10 @@ export interface FileRouteTypes { | '/posts' | '/remountDeps' | '/대한민국' + | '/non-nested/named' + | '/non-nested/path' + | '/non-nested/prefix' + | '/non-nested/suffix' | '/params-ps/non-nested' | '/relative/link' | '/relative/useNavigate' @@ -829,7 +1020,6 @@ export interface FileRouteTypes { | '/(group)/inside' | '/(group)/lazyinside' | '/_layout/_layout-2' - | '/non-nested/baz' | '/posts/$postId' | '/redirect/$target' | '/search-params/default' @@ -839,13 +1029,16 @@ export interface FileRouteTypes { | '/redirect/' | '/relative/' | '/search-params/' + | '/non-nested/named/$baz' + | '/non-nested/path/baz' + | '/non-nested/prefix/prefix{$baz}' + | '/non-nested/suffix/{$baz}suffix' | '/params-ps/named/$foo' | '/params-ps/non-nested/$foo_' | '/(group)/_layout/insidelayout' | '/(group)/subfolder/inside' | '/_layout/_layout-2/layout-a' | '/_layout/_layout-2/layout-b' - | '/non-nested/baz/$bazid' | '/params-ps/named/prefix{$foo}' | '/params-ps/named/{$foo}suffix' | '/params-ps/wildcard/$' @@ -866,8 +1059,19 @@ export interface FileRouteTypes { | '/params-ps/wildcard/' | '/redirect/$target/' | '/params-ps/named/$foo/$bar' - | '/non-nested/baz_/$bazid/edit' + | '/non-nested/named/$baz/foo' + | '/non-nested/named/$baz_/bar' + | '/non-nested/path/baz/foo' + | '/non-nested/path/baz_/bar' + | '/non-nested/prefix/prefix{$baz}/foo' + | '/non-nested/prefix/prefix{$baz}_/bar' + | '/non-nested/suffix/{$baz}suffix/foo' + | '/non-nested/suffix/{$baz}suffix_/bar' | '/params-ps/non-nested/$foo_/$bar' + | '/non-nested/named/$baz/' + | '/non-nested/path/baz/' + | '/non-nested/prefix/prefix{$baz}/' + | '/non-nested/suffix/{$baz}suffix/' | '/relative/link/nested/' | '/relative/link/path/' | '/relative/link/with-search/' @@ -1075,13 +1279,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof PostsPostIdRouteImport parentRoute: typeof PostsRoute } - '/non-nested/baz': { - id: '/non-nested/baz' - path: '/baz' - fullPath: '/non-nested/baz' - preLoaderRoute: typeof NonNestedBazRouteImport - parentRoute: typeof NonNestedRouteRoute - } '/_layout/_layout-2': { id: '/_layout/_layout-2' path: '' @@ -1138,6 +1335,34 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ParamsPsNonNestedRouteRouteImport parentRoute: typeof rootRouteImport } + '/non-nested/suffix': { + id: '/non-nested/suffix' + path: '/suffix' + fullPath: '/non-nested/suffix' + preLoaderRoute: typeof NonNestedSuffixRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } + '/non-nested/prefix': { + id: '/non-nested/prefix' + path: '/prefix' + fullPath: '/non-nested/prefix' + preLoaderRoute: typeof NonNestedPrefixRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } + '/non-nested/path': { + id: '/non-nested/path' + path: '/path' + fullPath: '/non-nested/path' + preLoaderRoute: typeof NonNestedPathRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } + '/non-nested/named': { + id: '/non-nested/named' + path: '/named' + fullPath: '/non-nested/named' + preLoaderRoute: typeof NonNestedNamedRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } '/redirect/$target/': { id: '/redirect/$target/' path: '/' @@ -1271,13 +1496,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ParamsPsNamedPrefixChar123fooChar125RouteImport parentRoute: typeof rootRouteImport } - '/non-nested/baz/$bazid': { - id: '/non-nested/baz/$bazid' - path: '/$bazid' - fullPath: '/non-nested/baz/$bazid' - preLoaderRoute: typeof NonNestedBazBazidRouteImport - parentRoute: typeof NonNestedBazRoute - } '/_layout/_layout-2/layout-b': { id: '/_layout/_layout-2/layout-b' path: '/layout-b' @@ -1320,6 +1538,34 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ParamsPsNamedFooRouteRouteImport parentRoute: typeof rootRouteImport } + '/non-nested/suffix/{$baz}suffix': { + id: '/non-nested/suffix/{$baz}suffix' + path: '/{$baz}suffix' + fullPath: '/non-nested/suffix/{$baz}suffix' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRouteImport + parentRoute: typeof NonNestedSuffixRouteRoute + } + '/non-nested/prefix/prefix{$baz}': { + id: '/non-nested/prefix/prefix{$baz}' + path: '/prefix{$baz}' + fullPath: '/non-nested/prefix/prefix{$baz}' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteImport + parentRoute: typeof NonNestedPrefixRouteRoute + } + '/non-nested/path/baz': { + id: '/non-nested/path/baz' + path: '/baz' + fullPath: '/non-nested/path/baz' + preLoaderRoute: typeof NonNestedPathBazRouteRouteImport + parentRoute: typeof NonNestedPathRouteRoute + } + '/non-nested/named/$baz': { + id: '/non-nested/named/$baz' + path: '/$baz' + fullPath: '/non-nested/named/$baz' + preLoaderRoute: typeof NonNestedNamedBazRouteRouteImport + parentRoute: typeof NonNestedNamedRouteRoute + } '/relative/useNavigate/with-search/': { id: '/relative/useNavigate/with-search/' path: '/with-search' @@ -1362,6 +1608,34 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof RelativeLinkNestedIndexRouteImport parentRoute: typeof RelativeLinkRouteRoute } + '/non-nested/suffix/{$baz}suffix/': { + id: '/non-nested/suffix/{$baz}suffix/' + path: '/' + fullPath: '/non-nested/suffix/{$baz}suffix/' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixIndexRouteImport + parentRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRoute + } + '/non-nested/prefix/prefix{$baz}/': { + id: '/non-nested/prefix/prefix{$baz}/' + path: '/' + fullPath: '/non-nested/prefix/prefix{$baz}/' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125IndexRouteImport + parentRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRoute + } + '/non-nested/path/baz/': { + id: '/non-nested/path/baz/' + path: '/' + fullPath: '/non-nested/path/baz/' + preLoaderRoute: typeof NonNestedPathBazIndexRouteImport + parentRoute: typeof NonNestedPathBazRouteRoute + } + '/non-nested/named/$baz/': { + id: '/non-nested/named/$baz/' + path: '/' + fullPath: '/non-nested/named/$baz/' + preLoaderRoute: typeof NonNestedNamedBazIndexRouteImport + parentRoute: typeof NonNestedNamedBazRouteRoute + } '/params-ps/non-nested/$foo_/$bar': { id: '/params-ps/non-nested/$foo_/$bar' path: '/$bar' @@ -1369,12 +1643,61 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ParamsPsNonNestedFooBarRouteImport parentRoute: typeof ParamsPsNonNestedFooRouteRoute } - '/non-nested/baz_/$bazid/edit': { - id: '/non-nested/baz_/$bazid/edit' - path: '/baz/$bazid/edit' - fullPath: '/non-nested/baz/$bazid/edit' - preLoaderRoute: typeof NonNestedBazBazidEditRouteImport - parentRoute: typeof NonNestedRouteRoute + '/non-nested/suffix/{$baz}suffix_/bar': { + id: '/non-nested/suffix/{$baz}suffix_/bar' + path: '/{$baz}suffix/bar' + fullPath: '/non-nested/suffix/{$baz}suffix/bar' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixBarRouteImport + parentRoute: typeof NonNestedSuffixRouteRoute + } + '/non-nested/suffix/{$baz}suffix/foo': { + id: '/non-nested/suffix/{$baz}suffix/foo' + path: '/foo' + fullPath: '/non-nested/suffix/{$baz}suffix/foo' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixFooRouteImport + parentRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRoute + } + '/non-nested/prefix/prefix{$baz}_/bar': { + id: '/non-nested/prefix/prefix{$baz}_/bar' + path: '/prefix{$baz}/bar' + fullPath: '/non-nested/prefix/prefix{$baz}/bar' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125BarRouteImport + parentRoute: typeof NonNestedPrefixRouteRoute + } + '/non-nested/prefix/prefix{$baz}/foo': { + id: '/non-nested/prefix/prefix{$baz}/foo' + path: '/foo' + fullPath: '/non-nested/prefix/prefix{$baz}/foo' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125FooRouteImport + parentRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRoute + } + '/non-nested/path/baz_/bar': { + id: '/non-nested/path/baz_/bar' + path: '/baz/bar' + fullPath: '/non-nested/path/baz/bar' + preLoaderRoute: typeof NonNestedPathBazBarRouteImport + parentRoute: typeof NonNestedPathRouteRoute + } + '/non-nested/path/baz/foo': { + id: '/non-nested/path/baz/foo' + path: '/foo' + fullPath: '/non-nested/path/baz/foo' + preLoaderRoute: typeof NonNestedPathBazFooRouteImport + parentRoute: typeof NonNestedPathBazRouteRoute + } + '/non-nested/named/$baz_/bar': { + id: '/non-nested/named/$baz_/bar' + path: '/$baz/bar' + fullPath: '/non-nested/named/$baz/bar' + preLoaderRoute: typeof NonNestedNamedBazBarRouteImport + parentRoute: typeof NonNestedNamedRouteRoute + } + '/non-nested/named/$baz/foo': { + id: '/non-nested/named/$baz/foo' + path: '/foo' + fullPath: '/non-nested/named/$baz/foo' + preLoaderRoute: typeof NonNestedNamedBazFooRouteImport + parentRoute: typeof NonNestedNamedBazRouteRoute } '/params-ps/named/$foo/$bar': { id: '/params-ps/named/$foo/$bar' @@ -1421,26 +1744,141 @@ declare module '@tanstack/react-router' { } } -interface NonNestedBazRouteChildren { - NonNestedBazBazidRoute: typeof NonNestedBazBazidRoute +interface NonNestedNamedBazRouteRouteChildren { + NonNestedNamedBazFooRoute: typeof NonNestedNamedBazFooRoute + NonNestedNamedBazIndexRoute: typeof NonNestedNamedBazIndexRoute } -const NonNestedBazRouteChildren: NonNestedBazRouteChildren = { - NonNestedBazBazidRoute: NonNestedBazBazidRoute, +const NonNestedNamedBazRouteRouteChildren: NonNestedNamedBazRouteRouteChildren = + { + NonNestedNamedBazFooRoute: NonNestedNamedBazFooRoute, + NonNestedNamedBazIndexRoute: NonNestedNamedBazIndexRoute, + } + +const NonNestedNamedBazRouteRouteWithChildren = + NonNestedNamedBazRouteRoute._addFileChildren( + NonNestedNamedBazRouteRouteChildren, + ) + +interface NonNestedNamedRouteRouteChildren { + NonNestedNamedBazRouteRoute: typeof NonNestedNamedBazRouteRouteWithChildren + NonNestedNamedBazBarRoute: typeof NonNestedNamedBazBarRoute } -const NonNestedBazRouteWithChildren = NonNestedBazRoute._addFileChildren( - NonNestedBazRouteChildren, -) +const NonNestedNamedRouteRouteChildren: NonNestedNamedRouteRouteChildren = { + NonNestedNamedBazRouteRoute: NonNestedNamedBazRouteRouteWithChildren, + NonNestedNamedBazBarRoute: NonNestedNamedBazBarRoute, +} + +const NonNestedNamedRouteRouteWithChildren = + NonNestedNamedRouteRoute._addFileChildren(NonNestedNamedRouteRouteChildren) + +interface NonNestedPathBazRouteRouteChildren { + NonNestedPathBazFooRoute: typeof NonNestedPathBazFooRoute + NonNestedPathBazIndexRoute: typeof NonNestedPathBazIndexRoute +} + +const NonNestedPathBazRouteRouteChildren: NonNestedPathBazRouteRouteChildren = { + NonNestedPathBazFooRoute: NonNestedPathBazFooRoute, + NonNestedPathBazIndexRoute: NonNestedPathBazIndexRoute, +} + +const NonNestedPathBazRouteRouteWithChildren = + NonNestedPathBazRouteRoute._addFileChildren( + NonNestedPathBazRouteRouteChildren, + ) + +interface NonNestedPathRouteRouteChildren { + NonNestedPathBazRouteRoute: typeof NonNestedPathBazRouteRouteWithChildren + NonNestedPathBazBarRoute: typeof NonNestedPathBazBarRoute +} + +const NonNestedPathRouteRouteChildren: NonNestedPathRouteRouteChildren = { + NonNestedPathBazRouteRoute: NonNestedPathBazRouteRouteWithChildren, + NonNestedPathBazBarRoute: NonNestedPathBazBarRoute, +} + +const NonNestedPathRouteRouteWithChildren = + NonNestedPathRouteRoute._addFileChildren(NonNestedPathRouteRouteChildren) + +interface NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren { + NonNestedPrefixPrefixChar123bazChar125FooRoute: typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + NonNestedPrefixPrefixChar123bazChar125IndexRoute: typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute +} + +const NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren: NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren = + { + NonNestedPrefixPrefixChar123bazChar125FooRoute: + NonNestedPrefixPrefixChar123bazChar125FooRoute, + NonNestedPrefixPrefixChar123bazChar125IndexRoute: + NonNestedPrefixPrefixChar123bazChar125IndexRoute, + } + +const NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren = + NonNestedPrefixPrefixChar123bazChar125RouteRoute._addFileChildren( + NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren, + ) + +interface NonNestedPrefixRouteRouteChildren { + NonNestedPrefixPrefixChar123bazChar125RouteRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren + NonNestedPrefixPrefixChar123bazChar125BarRoute: typeof NonNestedPrefixPrefixChar123bazChar125BarRoute +} + +const NonNestedPrefixRouteRouteChildren: NonNestedPrefixRouteRouteChildren = { + NonNestedPrefixPrefixChar123bazChar125RouteRoute: + NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren, + NonNestedPrefixPrefixChar123bazChar125BarRoute: + NonNestedPrefixPrefixChar123bazChar125BarRoute, +} + +const NonNestedPrefixRouteRouteWithChildren = + NonNestedPrefixRouteRoute._addFileChildren(NonNestedPrefixRouteRouteChildren) + +interface NonNestedSuffixChar123bazChar125suffixRouteRouteChildren { + NonNestedSuffixChar123bazChar125suffixFooRoute: typeof NonNestedSuffixChar123bazChar125suffixFooRoute + NonNestedSuffixChar123bazChar125suffixIndexRoute: typeof NonNestedSuffixChar123bazChar125suffixIndexRoute +} + +const NonNestedSuffixChar123bazChar125suffixRouteRouteChildren: NonNestedSuffixChar123bazChar125suffixRouteRouteChildren = + { + NonNestedSuffixChar123bazChar125suffixFooRoute: + NonNestedSuffixChar123bazChar125suffixFooRoute, + NonNestedSuffixChar123bazChar125suffixIndexRoute: + NonNestedSuffixChar123bazChar125suffixIndexRoute, + } + +const NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren = + NonNestedSuffixChar123bazChar125suffixRouteRoute._addFileChildren( + NonNestedSuffixChar123bazChar125suffixRouteRouteChildren, + ) + +interface NonNestedSuffixRouteRouteChildren { + NonNestedSuffixChar123bazChar125suffixRouteRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren + NonNestedSuffixChar123bazChar125suffixBarRoute: typeof NonNestedSuffixChar123bazChar125suffixBarRoute +} + +const NonNestedSuffixRouteRouteChildren: NonNestedSuffixRouteRouteChildren = { + NonNestedSuffixChar123bazChar125suffixRouteRoute: + NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren, + NonNestedSuffixChar123bazChar125suffixBarRoute: + NonNestedSuffixChar123bazChar125suffixBarRoute, +} + +const NonNestedSuffixRouteRouteWithChildren = + NonNestedSuffixRouteRoute._addFileChildren(NonNestedSuffixRouteRouteChildren) interface NonNestedRouteRouteChildren { - NonNestedBazRoute: typeof NonNestedBazRouteWithChildren - NonNestedBazBazidEditRoute: typeof NonNestedBazBazidEditRoute + NonNestedNamedRouteRoute: typeof NonNestedNamedRouteRouteWithChildren + NonNestedPathRouteRoute: typeof NonNestedPathRouteRouteWithChildren + NonNestedPrefixRouteRoute: typeof NonNestedPrefixRouteRouteWithChildren + NonNestedSuffixRouteRoute: typeof NonNestedSuffixRouteRouteWithChildren } const NonNestedRouteRouteChildren: NonNestedRouteRouteChildren = { - NonNestedBazRoute: NonNestedBazRouteWithChildren, - NonNestedBazBazidEditRoute: NonNestedBazBazidEditRoute, + NonNestedNamedRouteRoute: NonNestedNamedRouteRouteWithChildren, + NonNestedPathRouteRoute: NonNestedPathRouteRouteWithChildren, + NonNestedPrefixRouteRoute: NonNestedPrefixRouteRouteWithChildren, + NonNestedSuffixRouteRoute: NonNestedSuffixRouteRouteWithChildren, } const NonNestedRouteRouteWithChildren = NonNestedRouteRoute._addFileChildren( diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx deleted file mode 100644 index 7160b5d7aa6..00000000000 --- a/e2e/react-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' - -export const Route = createFileRoute('/non-nested/baz/$bazid')({ - component: RouteComponent, -}) - -function RouteComponent() { - const params = Route.useParams() - - return ( - <> -
- Hello "/non-nested/baz/$bazid"! -
-
- params:{' '} - - {JSON.stringify(params)} - -
- - ) -} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/baz.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/baz.tsx deleted file mode 100644 index 149903da04c..00000000000 --- a/e2e/react-router/basic-file-based/src/routes/non-nested/baz.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { Outlet, createFileRoute } from '@tanstack/react-router' - -export const Route = createFileRoute('/non-nested/baz')({ - component: RouteComponent, -}) - -function RouteComponent() { - return ( - <> -
Hello "/non-nested/baz"!
- - - ) -} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx deleted file mode 100644 index 491385c9901..00000000000 --- a/e2e/react-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' - -export const Route = createFileRoute('/non-nested/baz_/$bazid/edit')({ - component: RouteComponent, -}) - -function RouteComponent() { - const params = Route.useParams() - return ( - <> -
- Hello "/non-nested/baz_/$bazid/edit"! -
-
- params:{' '} - - {JSON.stringify(params)} - -
- - ) -} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx new file mode 100644 index 00000000000..e89a7b2ead3 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/named/$baz/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested named baz foo page +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx new file mode 100644 index 00000000000..4b7ead5028e --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/named/$baz/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested named baz index +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx new file mode 100644 index 00000000000..0339500185f --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/named/$baz')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested named baz route layout +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx new file mode 100644 index 00000000000..e39ff43a5ee --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/named/$baz_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested named bar +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx new file mode 100644 index 00000000000..55803fc8c35 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx @@ -0,0 +1,58 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/named')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested named layout +
+
+ + To named index + + + To named foo + + + To named foo 2 + + + To named bar + + + To named bar 2 + +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx new file mode 100644 index 00000000000..f80dd73a792 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/path/baz/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested path baz foo page +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx new file mode 100644 index 00000000000..ac8c66b6723 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/path/baz/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested path baz index +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx new file mode 100644 index 00000000000..3a6172415cc --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/path/baz')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested path baz route layout +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx new file mode 100644 index 00000000000..ce18ed69a27 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/path/baz_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested path bar +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx new file mode 100644 index 00000000000..b6df6654e51 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx @@ -0,0 +1,33 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/path')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested path layout +
+
+ + To path index + + + To path foo + + + To path foo 2 + + + To path bar + + + To path bar 2 + +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx new file mode 100644 index 00000000000..9283c8a6111 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested prefix foo page +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx new file mode 100644 index 00000000000..d7afe25934c --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested prefix index +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx new file mode 100644 index 00000000000..baa99c974a9 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested prefix route layout +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx new file mode 100644 index 00000000000..6a0cd93430b --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested prefix bar +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx new file mode 100644 index 00000000000..c0b1b5d8cbe --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx @@ -0,0 +1,58 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/prefix')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested prefix layout +
+
+ + To prefix index + + + To prefix foo + + + To prefix foo 2 + + + To prefix bar + + + To prefix bar 2 + +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx index 83a42874acb..2c23aaea942 100644 --- a/e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx @@ -12,23 +12,17 @@ function RouteComponent() { diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx new file mode 100644 index 00000000000..a7548429a02 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx @@ -0,0 +1,58 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/suffix')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested suffix layout +
+
+ + To suffix index + + + To suffix foo + + + To suffix foo 2 + + + To suffix bar + + + To suffix bar 2 + +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx new file mode 100644 index 00000000000..41796223b99 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested suffix foo page +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx new file mode 100644 index 00000000000..3291f4a104b --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested suffix index +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx new file mode 100644 index 00000000000..724217f6abc --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested suffix route layout +
+ +
+ ) +} diff --git a/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx new file mode 100644 index 00000000000..b56ff69c442 --- /dev/null +++ b/e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested suffix bar +
+
+ {JSON.stringify(params)} +
+
+ ) +} diff --git a/e2e/react-router/basic-file-based/tests/app.spec.ts b/e2e/react-router/basic-file-based/tests/app.spec.ts index 38de31e8299..d825ca7b51f 100644 --- a/e2e/react-router/basic-file-based/tests/app.spec.ts +++ b/e2e/react-router/basic-file-based/tests/app.spec.ts @@ -308,38 +308,3 @@ test('Should remount deps when remountDeps does change ', async ({ page }) => { 'Page component mounts: 2', ) }) - -test('Should not nest non-nested paths', async ({ page }) => { - await page.goto('/non-nested') - await page.waitForURL('/non-nested') - const nonNestedPathHeading = page.getByTestId('non-nested-path-heading') - const bazIdLink = page.getByTestId('l-to-non-nested-bazid') - const bazIdEditLink = page.getByTestId('l-to-non-nested-bazid-edit') - - await expect(nonNestedPathHeading).toBeInViewport() - await expect(bazIdLink).toHaveAttribute('href', '/non-nested/baz/123') - await expect(bazIdEditLink).toHaveAttribute( - 'href', - '/non-nested/baz/456/edit', - ) - - await bazIdLink.click() - await page.waitForURL('/non-nested/baz/123') - const bazHeading = page.getByTestId('non-nested-baz-heading') - const bazIdHeading = page.getByTestId('non-nested-bazid-heading') - const bazIdParam = page.getByTestId('non-nested-bazid-param') - await expect(nonNestedPathHeading).toBeInViewport() - await expect(bazHeading).toBeInViewport() - await expect(bazIdHeading).toBeInViewport() - await expect(bazIdParam).toContainText(JSON.stringify({ bazid: '123' })) - - await bazIdEditLink.click() - await page.waitForURL('/non-nested/baz/456/edit') - const bazIdEditHeading = page.getByTestId('non-nested-bazid-edit-heading') - const bazIdEditParam = page.getByTestId('non-nested-bazid-edit-param') - await expect(nonNestedPathHeading).toBeInViewport() - await expect(bazHeading).toBeHidden() - await expect(bazIdHeading).toBeHidden() - await expect(bazIdEditHeading).toBeInViewport() - await expect(bazIdEditParam).toContainText(JSON.stringify({ bazid: '456' })) -}) diff --git a/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts b/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts new file mode 100644 index 00000000000..2fdede5549a --- /dev/null +++ b/e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts @@ -0,0 +1,192 @@ +import { expect, test } from '@playwright/test' + +const testCases: Array<{ + name: string + testPathDesc: string + testPathPrefix: string + testPathSuffix: string + paramValue: Record + paramValue2: Record +}> = [ + { + name: 'Named path params', + testPathDesc: 'named', + testPathPrefix: '', + testPathSuffix: '', + paramValue: { baz: 'baz' }, + paramValue2: { baz: 'baz_' }, + }, + { + name: 'prefix params', + testPathPrefix: 'prefix', + testPathSuffix: '', + testPathDesc: 'prefix', + paramValue: { baz: 'baz' }, + paramValue2: { baz: 'baz_' }, + }, + { + name: 'suffix params', + testPathPrefix: '', + testPathSuffix: 'suffix', + testPathDesc: 'suffix', + paramValue: { baz: 'baz' }, + paramValue2: { baz: 'baz2' }, + }, + { + name: 'path', + testPathPrefix: '', + testPathSuffix: '', + testPathDesc: 'path', + paramValue: {}, + paramValue2: {}, + }, +] + +test.describe('Non-nested paths', () => { + testCases.forEach( + ({ + name, + testPathDesc, + testPathPrefix, + testPathSuffix, + paramValue, + paramValue2, + }) => { + test.describe(name, () => { + const path = `/non-nested/${testPathDesc}` + const paramNameDesc = Object.keys(paramValue)[0] ?? 'baz' + + test.beforeEach(async ({ page }) => { + await page.goto('/non-nested') + await page.waitForURL('/non-nested') + }) + + test('Should not un-nest nested paths', async ({ page }) => { + const nonNestedPathHeading = page.getByTestId( + 'non-nested-path-heading', + ) + await expect(nonNestedPathHeading).toBeVisible() + + await page.getByTestId(`l-to-${testPathDesc}`).click() + await page.waitForURL(path) + + const rootRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-root-route-heading`, + ) + + await expect(rootRouteHeading).toBeVisible() + + const pathRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-route-heading`, + ) + + const indexHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-index-heading`, + ) + + const fooHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-foo-heading`, + ) + + const indexParams = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-index-param`, + ) + + const fooParams = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-foo-param`, + ) + + const indexLink = page.getByTestId(`to-${testPathDesc}-index`) + const fooLink = page.getByTestId(`to-${testPathDesc}-foo`) + const foo2Link = page.getByTestId(`to-${testPathDesc}-foo-2`) + + const indexPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}` + const fooPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}/foo` + const foo2Path = `${path}/${testPathPrefix}${paramValue2[paramNameDesc] ?? 'baz'}${testPathSuffix}/foo` + + console.log(await indexLink.getAttribute('href')) + await expect(indexLink).toHaveAttribute('href', indexPath) + await expect(fooLink).toHaveAttribute('href', fooPath) + await expect(foo2Link).toHaveAttribute('href', foo2Path) + + await indexLink.click() + await page.waitForURL(indexPath) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).toBeVisible() + await expect(indexHeading).toBeVisible() + const indexParamValue = await indexParams.innerText() + expect(JSON.parse(indexParamValue)).toEqual(paramValue) + + await fooLink.click() + await page.waitForURL(fooPath) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).toBeVisible() + await expect(fooHeading).toBeVisible() + const fooParamValue = await fooParams.innerText() + expect(JSON.parse(fooParamValue)).toEqual(paramValue) + + await foo2Link.click() + await page.waitForURL(foo2Path) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).toBeVisible() + await expect(fooHeading).toBeVisible() + const foo2ParamValue = await fooParams.innerText() + expect(JSON.parse(foo2ParamValue)).toEqual(paramValue2) + }) + + test('Should not nest non-nested paths', async ({ page }) => { + const nonNestedPathHeading = page.getByTestId( + 'non-nested-path-heading', + ) + await expect(nonNestedPathHeading).toBeVisible() + + await page.getByTestId(`l-to-${testPathDesc}`).click() + await page.waitForURL(path) + + const rootRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-root-route-heading`, + ) + + await expect(rootRouteHeading).toBeVisible() + + const pathRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-route-heading`, + ) + + const barHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-bar-heading`, + ) + + const barParams = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-bar-param`, + ) + + const barLink = page.getByTestId(`to-${testPathDesc}-bar`) + const bar2Link = page.getByTestId(`to-${testPathDesc}-bar-2`) + + const barPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}/bar` + const bar2Path = `${path}/${testPathPrefix}${paramValue2[paramNameDesc] ?? 'baz'}${testPathSuffix}/bar` + await expect(barLink).toHaveAttribute('href', barPath) + + await expect(bar2Link).toHaveAttribute('href', bar2Path) + + await barLink.click() + await page.waitForURL(barPath) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).not.toBeVisible() + await expect(barHeading).toBeVisible() + const barParamValue = await barParams.innerText() + expect(JSON.parse(barParamValue)).toEqual(paramValue) + + await bar2Link.click() + await page.waitForURL(bar2Path) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).not.toBeVisible() + await expect(barHeading).toBeVisible() + const bar2ParamValue = await barParams.innerText() + expect(JSON.parse(bar2ParamValue)).toEqual(paramValue2) + }) + }) + }, + ) +}) diff --git a/e2e/solid-router/basic-file-based/src/routeTree.gen.ts b/e2e/solid-router/basic-file-based/src/routeTree.gen.ts index 23092968648..1dab293d2e0 100644 --- a/e2e/solid-router/basic-file-based/src/routeTree.gen.ts +++ b/e2e/solid-router/basic-file-based/src/routeTree.gen.ts @@ -30,7 +30,6 @@ import { Route as ParamsPsIndexRouteImport } from './routes/params-ps/index' import { Route as SearchParamsDefaultRouteImport } from './routes/search-params/default' import { Route as RedirectTargetRouteImport } from './routes/redirect/$target' import { Route as PostsPostIdRouteImport } from './routes/posts.$postId' -import { Route as NonNestedBazRouteImport } from './routes/non-nested/baz' import { Route as LayoutLayout2RouteImport } from './routes/_layout/_layout-2' import { Route as groupLazyinsideRouteImport } from './routes/(group)/lazyinside' import { Route as groupInsideRouteImport } from './routes/(group)/inside' @@ -39,6 +38,10 @@ import { Route as anotherGroupOnlyrouteinsideRouteImport } from './routes/(anoth import { Route as RelativeUseNavigateRouteRouteImport } from './routes/relative/useNavigate/route' import { Route as RelativeLinkRouteRouteImport } from './routes/relative/link/route' import { Route as ParamsPsNonNestedRouteRouteImport } from './routes/params-ps/non-nested/route' +import { Route as NonNestedSuffixRouteRouteImport } from './routes/non-nested/suffix/route' +import { Route as NonNestedPrefixRouteRouteImport } from './routes/non-nested/prefix/route' +import { Route as NonNestedPathRouteRouteImport } from './routes/non-nested/path/route' +import { Route as NonNestedNamedRouteRouteImport } from './routes/non-nested/named/route' import { Route as RedirectTargetIndexRouteImport } from './routes/redirect/$target/index' import { Route as RelativeUseNavigateRelativeUseNavigateBRouteImport } from './routes/relative/useNavigate/relative-useNavigate-b' import { Route as RelativeUseNavigateRelativeUseNavigateARouteImport } from './routes/relative/useNavigate/relative-useNavigate-a' @@ -51,21 +54,35 @@ import { Route as RedirectTargetViaLoaderRouteImport } from './routes/redirect/$ import { Route as RedirectTargetViaBeforeLoadRouteImport } from './routes/redirect/$target/via-beforeLoad' import { Route as PostsPostIdEditRouteImport } from './routes/posts_.$postId.edit' import { Route as ParamsSingleValueRouteImport } from './routes/params.single.$value' -import { Route as NonNestedBazBazidRouteImport } from './routes/non-nested/baz.$bazid' import { Route as LayoutLayout2LayoutBRouteImport } from './routes/_layout/_layout-2/layout-b' import { Route as LayoutLayout2LayoutARouteImport } from './routes/_layout/_layout-2/layout-a' import { Route as groupSubfolderInsideRouteImport } from './routes/(group)/subfolder/inside' import { Route as groupLayoutInsidelayoutRouteImport } from './routes/(group)/_layout.insidelayout' import { Route as ParamsPsNonNestedFooRouteRouteImport } from './routes/params-ps/non-nested/$foo_/route' import { Route as ParamsPsNamedFooRouteRouteImport } from './routes/params-ps/named/$foo/route' +import { Route as NonNestedSuffixChar123bazChar125suffixRouteRouteImport } from './routes/non-nested/suffix/{$baz}suffix.route' +import { Route as NonNestedPrefixPrefixChar123bazChar125RouteRouteImport } from './routes/non-nested/prefix/prefix{$baz}.route' +import { Route as NonNestedPathBazRouteRouteImport } from './routes/non-nested/path/baz.route' +import { Route as NonNestedNamedBazRouteRouteImport } from './routes/non-nested/named/$baz.route' import { Route as RelativeUseNavigateWithSearchIndexRouteImport } from './routes/relative/useNavigate/with-search/index' import { Route as RelativeUseNavigatePathIndexRouteImport } from './routes/relative/useNavigate/path/index' import { Route as RelativeUseNavigateNestedIndexRouteImport } from './routes/relative/useNavigate/nested/index' import { Route as RelativeLinkWithSearchIndexRouteImport } from './routes/relative/link/with-search/index' import { Route as RelativeLinkPathIndexRouteImport } from './routes/relative/link/path/index' import { Route as RelativeLinkNestedIndexRouteImport } from './routes/relative/link/nested/index' +import { Route as NonNestedSuffixChar123bazChar125suffixIndexRouteImport } from './routes/non-nested/suffix/{$baz}suffix.index' +import { Route as NonNestedPrefixPrefixChar123bazChar125IndexRouteImport } from './routes/non-nested/prefix/prefix{$baz}.index' +import { Route as NonNestedPathBazIndexRouteImport } from './routes/non-nested/path/baz.index' +import { Route as NonNestedNamedBazIndexRouteImport } from './routes/non-nested/named/$baz.index' import { Route as ParamsPsNonNestedFooBarRouteImport } from './routes/params-ps/non-nested/$foo_/$bar' -import { Route as NonNestedBazBazidEditRouteImport } from './routes/non-nested/baz_.$bazid.edit' +import { Route as NonNestedSuffixChar123bazChar125suffixBarRouteImport } from './routes/non-nested/suffix/{$baz}suffix_.bar' +import { Route as NonNestedSuffixChar123bazChar125suffixFooRouteImport } from './routes/non-nested/suffix/{$baz}suffix.foo' +import { Route as NonNestedPrefixPrefixChar123bazChar125BarRouteImport } from './routes/non-nested/prefix/prefix{$baz}_.bar' +import { Route as NonNestedPrefixPrefixChar123bazChar125FooRouteImport } from './routes/non-nested/prefix/prefix{$baz}.foo' +import { Route as NonNestedPathBazBarRouteImport } from './routes/non-nested/path/baz_.bar' +import { Route as NonNestedPathBazFooRouteImport } from './routes/non-nested/path/baz.foo' +import { Route as NonNestedNamedBazBarRouteImport } from './routes/non-nested/named/$baz_.bar' +import { Route as NonNestedNamedBazFooRouteImport } from './routes/non-nested/named/$baz.foo' import { Route as ParamsPsNamedFooBarRouteRouteImport } from './routes/params-ps/named/$foo/$bar.route' import { Route as RelativeUseNavigatePathPathIndexRouteImport } from './routes/relative/useNavigate/path/$path/index' import { Route as RelativeUseNavigateNestedDeepIndexRouteImport } from './routes/relative/useNavigate/nested/deep/index' @@ -173,11 +190,6 @@ const PostsPostIdRoute = PostsPostIdRouteImport.update({ path: '/$postId', getParentRoute: () => PostsRoute, } as any) -const NonNestedBazRoute = NonNestedBazRouteImport.update({ - id: '/baz', - path: '/baz', - getParentRoute: () => NonNestedRouteRoute, -} as any) const LayoutLayout2Route = LayoutLayout2RouteImport.update({ id: '/_layout-2', getParentRoute: () => LayoutRoute, @@ -220,6 +232,26 @@ const ParamsPsNonNestedRouteRoute = ParamsPsNonNestedRouteRouteImport.update({ path: '/params-ps/non-nested', getParentRoute: () => rootRouteImport, } as any) +const NonNestedSuffixRouteRoute = NonNestedSuffixRouteRouteImport.update({ + id: '/suffix', + path: '/suffix', + getParentRoute: () => NonNestedRouteRoute, +} as any) +const NonNestedPrefixRouteRoute = NonNestedPrefixRouteRouteImport.update({ + id: '/prefix', + path: '/prefix', + getParentRoute: () => NonNestedRouteRoute, +} as any) +const NonNestedPathRouteRoute = NonNestedPathRouteRouteImport.update({ + id: '/path', + path: '/path', + getParentRoute: () => NonNestedRouteRoute, +} as any) +const NonNestedNamedRouteRoute = NonNestedNamedRouteRouteImport.update({ + id: '/named', + path: '/named', + getParentRoute: () => NonNestedRouteRoute, +} as any) const RedirectTargetIndexRoute = RedirectTargetIndexRouteImport.update({ id: '/', path: '/', @@ -285,11 +317,6 @@ const ParamsSingleValueRoute = ParamsSingleValueRouteImport.update({ path: '/params/single/$value', getParentRoute: () => rootRouteImport, } as any) -const NonNestedBazBazidRoute = NonNestedBazBazidRouteImport.update({ - id: '/$bazid', - path: '/$bazid', - getParentRoute: () => NonNestedBazRoute, -} as any) const LayoutLayout2LayoutBRoute = LayoutLayout2LayoutBRouteImport.update({ id: '/layout-b', path: '/layout-b', @@ -321,6 +348,28 @@ const ParamsPsNamedFooRouteRoute = ParamsPsNamedFooRouteRouteImport.update({ path: '/params-ps/named/$foo', getParentRoute: () => rootRouteImport, } as any) +const NonNestedSuffixChar123bazChar125suffixRouteRoute = + NonNestedSuffixChar123bazChar125suffixRouteRouteImport.update({ + id: '/{$baz}suffix', + path: '/{$baz}suffix', + getParentRoute: () => NonNestedSuffixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125RouteRoute = + NonNestedPrefixPrefixChar123bazChar125RouteRouteImport.update({ + id: '/prefix{$baz}', + path: '/prefix{$baz}', + getParentRoute: () => NonNestedPrefixRouteRoute, + } as any) +const NonNestedPathBazRouteRoute = NonNestedPathBazRouteRouteImport.update({ + id: '/baz', + path: '/baz', + getParentRoute: () => NonNestedPathRouteRoute, +} as any) +const NonNestedNamedBazRouteRoute = NonNestedNamedBazRouteRouteImport.update({ + id: '/$baz', + path: '/$baz', + getParentRoute: () => NonNestedNamedRouteRoute, +} as any) const RelativeUseNavigateWithSearchIndexRoute = RelativeUseNavigateWithSearchIndexRouteImport.update({ id: '/with-search/', @@ -355,15 +404,76 @@ const RelativeLinkNestedIndexRoute = RelativeLinkNestedIndexRouteImport.update({ path: '/nested/', getParentRoute: () => RelativeLinkRouteRoute, } as any) +const NonNestedSuffixChar123bazChar125suffixIndexRoute = + NonNestedSuffixChar123bazChar125suffixIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedSuffixChar123bazChar125suffixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125IndexRoute = + NonNestedPrefixPrefixChar123bazChar125IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedPrefixPrefixChar123bazChar125RouteRoute, + } as any) +const NonNestedPathBazIndexRoute = NonNestedPathBazIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedPathBazRouteRoute, +} as any) +const NonNestedNamedBazIndexRoute = NonNestedNamedBazIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => NonNestedNamedBazRouteRoute, +} as any) const ParamsPsNonNestedFooBarRoute = ParamsPsNonNestedFooBarRouteImport.update({ id: '/$bar', path: '/$bar', getParentRoute: () => ParamsPsNonNestedFooRouteRoute, } as any) -const NonNestedBazBazidEditRoute = NonNestedBazBazidEditRouteImport.update({ - id: '/baz_/$bazid/edit', - path: '/baz/$bazid/edit', - getParentRoute: () => NonNestedRouteRoute, +const NonNestedSuffixChar123bazChar125suffixBarRoute = + NonNestedSuffixChar123bazChar125suffixBarRouteImport.update({ + id: '/{$baz}suffix_/bar', + path: '/{$baz}suffix/bar', + getParentRoute: () => NonNestedSuffixRouteRoute, + } as any) +const NonNestedSuffixChar123bazChar125suffixFooRoute = + NonNestedSuffixChar123bazChar125suffixFooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedSuffixChar123bazChar125suffixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125BarRoute = + NonNestedPrefixPrefixChar123bazChar125BarRouteImport.update({ + id: '/prefix{$baz}_/bar', + path: '/prefix{$baz}/bar', + getParentRoute: () => NonNestedPrefixRouteRoute, + } as any) +const NonNestedPrefixPrefixChar123bazChar125FooRoute = + NonNestedPrefixPrefixChar123bazChar125FooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedPrefixPrefixChar123bazChar125RouteRoute, + } as any) +const NonNestedPathBazBarRoute = NonNestedPathBazBarRouteImport.update({ + id: '/baz_/bar', + path: '/baz/bar', + getParentRoute: () => NonNestedPathRouteRoute, +} as any) +const NonNestedPathBazFooRoute = NonNestedPathBazFooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedPathBazRouteRoute, +} as any) +const NonNestedNamedBazBarRoute = NonNestedNamedBazBarRouteImport.update({ + id: '/$baz_/bar', + path: '/$baz/bar', + getParentRoute: () => NonNestedNamedRouteRoute, +} as any) +const NonNestedNamedBazFooRoute = NonNestedNamedBazFooRouteImport.update({ + id: '/foo', + path: '/foo', + getParentRoute: () => NonNestedNamedBazRouteRoute, } as any) const ParamsPsNamedFooBarRouteRoute = ParamsPsNamedFooBarRouteRouteImport.update({ @@ -412,13 +522,16 @@ export interface FileRoutesByFullPath { '/notRemountDeps': typeof NotRemountDepsRoute '/posts': typeof PostsRouteWithChildren '/remountDeps': typeof RemountDepsRoute + '/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren + '/non-nested/path': typeof NonNestedPathRouteRouteWithChildren + '/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren + '/non-nested/suffix': typeof NonNestedSuffixRouteRouteWithChildren '/params-ps/non-nested': typeof ParamsPsNonNestedRouteRouteWithChildren '/relative/link': typeof RelativeLinkRouteRouteWithChildren '/relative/useNavigate': typeof RelativeUseNavigateRouteRouteWithChildren '/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute '/inside': typeof groupInsideRoute '/lazyinside': typeof groupLazyinsideRoute - '/non-nested/baz': typeof NonNestedBazRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute '/redirect/$target': typeof RedirectTargetRouteWithChildren '/search-params/default': typeof SearchParamsDefaultRoute @@ -427,13 +540,16 @@ export interface FileRoutesByFullPath { '/redirect': typeof RedirectIndexRoute '/relative': typeof RelativeIndexRoute '/search-params/': typeof SearchParamsIndexRoute + '/non-nested/named/$baz': typeof NonNestedNamedBazRouteRouteWithChildren + '/non-nested/path/baz': typeof NonNestedPathBazRouteRouteWithChildren + '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren + '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren '/params-ps/named/$foo': typeof ParamsPsNamedFooRouteRouteWithChildren '/params-ps/non-nested/$foo': typeof ParamsPsNonNestedFooRouteRouteWithChildren '/insidelayout': typeof groupLayoutInsidelayoutRoute '/subfolder/inside': typeof groupSubfolderInsideRoute '/layout-a': typeof LayoutLayout2LayoutARoute '/layout-b': typeof LayoutLayout2LayoutBRoute - '/non-nested/baz/$bazid': typeof NonNestedBazBazidRoute '/params/single/$value': typeof ParamsSingleValueRoute '/posts/$postId/edit': typeof PostsPostIdEditRoute '/redirect/$target/via-beforeLoad': typeof RedirectTargetViaBeforeLoadRoute @@ -447,8 +563,19 @@ export interface FileRoutesByFullPath { '/relative/useNavigate/relative-useNavigate-b': typeof RelativeUseNavigateRelativeUseNavigateBRoute '/redirect/$target/': typeof RedirectTargetIndexRoute '/params-ps/named/$foo/$bar': typeof ParamsPsNamedFooBarRouteRouteWithChildren - '/non-nested/baz/$bazid/edit': typeof NonNestedBazBazidEditRoute + '/non-nested/named/$baz/foo': typeof NonNestedNamedBazFooRoute + '/non-nested/named/$baz/bar': typeof NonNestedNamedBazBarRoute + '/non-nested/path/baz/foo': typeof NonNestedPathBazFooRoute + '/non-nested/path/baz/bar': typeof NonNestedPathBazBarRoute + '/non-nested/prefix/prefix{$baz}/foo': typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + '/non-nested/prefix/prefix{$baz}/bar': typeof NonNestedPrefixPrefixChar123bazChar125BarRoute + '/non-nested/suffix/{$baz}suffix/foo': typeof NonNestedSuffixChar123bazChar125suffixFooRoute + '/non-nested/suffix/{$baz}suffix/bar': typeof NonNestedSuffixChar123bazChar125suffixBarRoute '/params-ps/non-nested/$foo/$bar': typeof ParamsPsNonNestedFooBarRoute + '/non-nested/named/$baz/': typeof NonNestedNamedBazIndexRoute + '/non-nested/path/baz/': typeof NonNestedPathBazIndexRoute + '/non-nested/prefix/prefix{$baz}/': typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute + '/non-nested/suffix/{$baz}suffix/': typeof NonNestedSuffixChar123bazChar125suffixIndexRoute '/relative/link/nested': typeof RelativeLinkNestedIndexRoute '/relative/link/path': typeof RelativeLinkPathIndexRoute '/relative/link/with-search': typeof RelativeLinkWithSearchIndexRoute @@ -470,13 +597,16 @@ export interface FileRoutesByTo { '/editing-b': typeof EditingBRoute '/notRemountDeps': typeof NotRemountDepsRoute '/remountDeps': typeof RemountDepsRoute + '/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren + '/non-nested/path': typeof NonNestedPathRouteRouteWithChildren + '/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren + '/non-nested/suffix': typeof NonNestedSuffixRouteRouteWithChildren '/params-ps/non-nested': typeof ParamsPsNonNestedRouteRouteWithChildren '/relative/link': typeof RelativeLinkRouteRouteWithChildren '/relative/useNavigate': typeof RelativeUseNavigateRouteRouteWithChildren '/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute '/inside': typeof groupInsideRoute '/lazyinside': typeof groupLazyinsideRoute - '/non-nested/baz': typeof NonNestedBazRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute '/search-params/default': typeof SearchParamsDefaultRoute '/params-ps': typeof ParamsPsIndexRoute @@ -490,7 +620,6 @@ export interface FileRoutesByTo { '/subfolder/inside': typeof groupSubfolderInsideRoute '/layout-a': typeof LayoutLayout2LayoutARoute '/layout-b': typeof LayoutLayout2LayoutBRoute - '/non-nested/baz/$bazid': typeof NonNestedBazBazidRoute '/params/single/$value': typeof ParamsSingleValueRoute '/posts/$postId/edit': typeof PostsPostIdEditRoute '/redirect/$target/via-beforeLoad': typeof RedirectTargetViaBeforeLoadRoute @@ -504,8 +633,19 @@ export interface FileRoutesByTo { '/relative/useNavigate/relative-useNavigate-b': typeof RelativeUseNavigateRelativeUseNavigateBRoute '/redirect/$target': typeof RedirectTargetIndexRoute '/params-ps/named/$foo/$bar': typeof ParamsPsNamedFooBarRouteRouteWithChildren - '/non-nested/baz/$bazid/edit': typeof NonNestedBazBazidEditRoute + '/non-nested/named/$baz/foo': typeof NonNestedNamedBazFooRoute + '/non-nested/named/$baz/bar': typeof NonNestedNamedBazBarRoute + '/non-nested/path/baz/foo': typeof NonNestedPathBazFooRoute + '/non-nested/path/baz/bar': typeof NonNestedPathBazBarRoute + '/non-nested/prefix/prefix{$baz}/foo': typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + '/non-nested/prefix/prefix{$baz}/bar': typeof NonNestedPrefixPrefixChar123bazChar125BarRoute + '/non-nested/suffix/{$baz}suffix/foo': typeof NonNestedSuffixChar123bazChar125suffixFooRoute + '/non-nested/suffix/{$baz}suffix/bar': typeof NonNestedSuffixChar123bazChar125suffixBarRoute '/params-ps/non-nested/$foo/$bar': typeof ParamsPsNonNestedFooBarRoute + '/non-nested/named/$baz': typeof NonNestedNamedBazIndexRoute + '/non-nested/path/baz': typeof NonNestedPathBazIndexRoute + '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute + '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixIndexRoute '/relative/link/nested': typeof RelativeLinkNestedIndexRoute '/relative/link/path': typeof RelativeLinkPathIndexRoute '/relative/link/with-search': typeof RelativeLinkWithSearchIndexRoute @@ -531,6 +671,10 @@ export interface FileRoutesById { '/notRemountDeps': typeof NotRemountDepsRoute '/posts': typeof PostsRouteWithChildren '/remountDeps': typeof RemountDepsRoute + '/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren + '/non-nested/path': typeof NonNestedPathRouteRouteWithChildren + '/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren + '/non-nested/suffix': typeof NonNestedSuffixRouteRouteWithChildren '/params-ps/non-nested': typeof ParamsPsNonNestedRouteRouteWithChildren '/relative/link': typeof RelativeLinkRouteRouteWithChildren '/relative/useNavigate': typeof RelativeUseNavigateRouteRouteWithChildren @@ -540,7 +684,6 @@ export interface FileRoutesById { '/(group)/inside': typeof groupInsideRoute '/(group)/lazyinside': typeof groupLazyinsideRoute '/_layout/_layout-2': typeof LayoutLayout2RouteWithChildren - '/non-nested/baz': typeof NonNestedBazRouteWithChildren '/posts/$postId': typeof PostsPostIdRoute '/redirect/$target': typeof RedirectTargetRouteWithChildren '/search-params/default': typeof SearchParamsDefaultRoute @@ -549,13 +692,16 @@ export interface FileRoutesById { '/redirect/': typeof RedirectIndexRoute '/relative/': typeof RelativeIndexRoute '/search-params/': typeof SearchParamsIndexRoute + '/non-nested/named/$baz': typeof NonNestedNamedBazRouteRouteWithChildren + '/non-nested/path/baz': typeof NonNestedPathBazRouteRouteWithChildren + '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren + '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren '/params-ps/named/$foo': typeof ParamsPsNamedFooRouteRouteWithChildren '/params-ps/non-nested/$foo_': typeof ParamsPsNonNestedFooRouteRouteWithChildren '/(group)/_layout/insidelayout': typeof groupLayoutInsidelayoutRoute '/(group)/subfolder/inside': typeof groupSubfolderInsideRoute '/_layout/_layout-2/layout-a': typeof LayoutLayout2LayoutARoute '/_layout/_layout-2/layout-b': typeof LayoutLayout2LayoutBRoute - '/non-nested/baz/$bazid': typeof NonNestedBazBazidRoute '/params/single/$value': typeof ParamsSingleValueRoute '/posts_/$postId/edit': typeof PostsPostIdEditRoute '/redirect/$target/via-beforeLoad': typeof RedirectTargetViaBeforeLoadRoute @@ -569,8 +715,19 @@ export interface FileRoutesById { '/relative/useNavigate/relative-useNavigate-b': typeof RelativeUseNavigateRelativeUseNavigateBRoute '/redirect/$target/': typeof RedirectTargetIndexRoute '/params-ps/named/$foo/$bar': typeof ParamsPsNamedFooBarRouteRouteWithChildren - '/non-nested/baz_/$bazid/edit': typeof NonNestedBazBazidEditRoute + '/non-nested/named/$baz/foo': typeof NonNestedNamedBazFooRoute + '/non-nested/named/$baz_/bar': typeof NonNestedNamedBazBarRoute + '/non-nested/path/baz/foo': typeof NonNestedPathBazFooRoute + '/non-nested/path/baz_/bar': typeof NonNestedPathBazBarRoute + '/non-nested/prefix/prefix{$baz}/foo': typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + '/non-nested/prefix/prefix{$baz}_/bar': typeof NonNestedPrefixPrefixChar123bazChar125BarRoute + '/non-nested/suffix/{$baz}suffix/foo': typeof NonNestedSuffixChar123bazChar125suffixFooRoute + '/non-nested/suffix/{$baz}suffix_/bar': typeof NonNestedSuffixChar123bazChar125suffixBarRoute '/params-ps/non-nested/$foo_/$bar': typeof ParamsPsNonNestedFooBarRoute + '/non-nested/named/$baz/': typeof NonNestedNamedBazIndexRoute + '/non-nested/path/baz/': typeof NonNestedPathBazIndexRoute + '/non-nested/prefix/prefix{$baz}/': typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute + '/non-nested/suffix/{$baz}suffix/': typeof NonNestedSuffixChar123bazChar125suffixIndexRoute '/relative/link/nested/': typeof RelativeLinkNestedIndexRoute '/relative/link/path/': typeof RelativeLinkPathIndexRoute '/relative/link/with-search/': typeof RelativeLinkWithSearchIndexRoute @@ -596,13 +753,16 @@ export interface FileRouteTypes { | '/notRemountDeps' | '/posts' | '/remountDeps' + | '/non-nested/named' + | '/non-nested/path' + | '/non-nested/prefix' + | '/non-nested/suffix' | '/params-ps/non-nested' | '/relative/link' | '/relative/useNavigate' | '/onlyrouteinside' | '/inside' | '/lazyinside' - | '/non-nested/baz' | '/posts/$postId' | '/redirect/$target' | '/search-params/default' @@ -611,13 +771,16 @@ export interface FileRouteTypes { | '/redirect' | '/relative' | '/search-params/' + | '/non-nested/named/$baz' + | '/non-nested/path/baz' + | '/non-nested/prefix/prefix{$baz}' + | '/non-nested/suffix/{$baz}suffix' | '/params-ps/named/$foo' | '/params-ps/non-nested/$foo' | '/insidelayout' | '/subfolder/inside' | '/layout-a' | '/layout-b' - | '/non-nested/baz/$bazid' | '/params/single/$value' | '/posts/$postId/edit' | '/redirect/$target/via-beforeLoad' @@ -631,8 +794,19 @@ export interface FileRouteTypes { | '/relative/useNavigate/relative-useNavigate-b' | '/redirect/$target/' | '/params-ps/named/$foo/$bar' - | '/non-nested/baz/$bazid/edit' + | '/non-nested/named/$baz/foo' + | '/non-nested/named/$baz/bar' + | '/non-nested/path/baz/foo' + | '/non-nested/path/baz/bar' + | '/non-nested/prefix/prefix{$baz}/foo' + | '/non-nested/prefix/prefix{$baz}/bar' + | '/non-nested/suffix/{$baz}suffix/foo' + | '/non-nested/suffix/{$baz}suffix/bar' | '/params-ps/non-nested/$foo/$bar' + | '/non-nested/named/$baz/' + | '/non-nested/path/baz/' + | '/non-nested/prefix/prefix{$baz}/' + | '/non-nested/suffix/{$baz}suffix/' | '/relative/link/nested' | '/relative/link/path' | '/relative/link/with-search' @@ -654,13 +828,16 @@ export interface FileRouteTypes { | '/editing-b' | '/notRemountDeps' | '/remountDeps' + | '/non-nested/named' + | '/non-nested/path' + | '/non-nested/prefix' + | '/non-nested/suffix' | '/params-ps/non-nested' | '/relative/link' | '/relative/useNavigate' | '/onlyrouteinside' | '/inside' | '/lazyinside' - | '/non-nested/baz' | '/posts/$postId' | '/search-params/default' | '/params-ps' @@ -674,7 +851,6 @@ export interface FileRouteTypes { | '/subfolder/inside' | '/layout-a' | '/layout-b' - | '/non-nested/baz/$bazid' | '/params/single/$value' | '/posts/$postId/edit' | '/redirect/$target/via-beforeLoad' @@ -688,8 +864,19 @@ export interface FileRouteTypes { | '/relative/useNavigate/relative-useNavigate-b' | '/redirect/$target' | '/params-ps/named/$foo/$bar' - | '/non-nested/baz/$bazid/edit' + | '/non-nested/named/$baz/foo' + | '/non-nested/named/$baz/bar' + | '/non-nested/path/baz/foo' + | '/non-nested/path/baz/bar' + | '/non-nested/prefix/prefix{$baz}/foo' + | '/non-nested/prefix/prefix{$baz}/bar' + | '/non-nested/suffix/{$baz}suffix/foo' + | '/non-nested/suffix/{$baz}suffix/bar' | '/params-ps/non-nested/$foo/$bar' + | '/non-nested/named/$baz' + | '/non-nested/path/baz' + | '/non-nested/prefix/prefix{$baz}' + | '/non-nested/suffix/{$baz}suffix' | '/relative/link/nested' | '/relative/link/path' | '/relative/link/with-search' @@ -714,6 +901,10 @@ export interface FileRouteTypes { | '/notRemountDeps' | '/posts' | '/remountDeps' + | '/non-nested/named' + | '/non-nested/path' + | '/non-nested/prefix' + | '/non-nested/suffix' | '/params-ps/non-nested' | '/relative/link' | '/relative/useNavigate' @@ -723,7 +914,6 @@ export interface FileRouteTypes { | '/(group)/inside' | '/(group)/lazyinside' | '/_layout/_layout-2' - | '/non-nested/baz' | '/posts/$postId' | '/redirect/$target' | '/search-params/default' @@ -732,13 +922,16 @@ export interface FileRouteTypes { | '/redirect/' | '/relative/' | '/search-params/' + | '/non-nested/named/$baz' + | '/non-nested/path/baz' + | '/non-nested/prefix/prefix{$baz}' + | '/non-nested/suffix/{$baz}suffix' | '/params-ps/named/$foo' | '/params-ps/non-nested/$foo_' | '/(group)/_layout/insidelayout' | '/(group)/subfolder/inside' | '/_layout/_layout-2/layout-a' | '/_layout/_layout-2/layout-b' - | '/non-nested/baz/$bazid' | '/params/single/$value' | '/posts_/$postId/edit' | '/redirect/$target/via-beforeLoad' @@ -752,8 +945,19 @@ export interface FileRouteTypes { | '/relative/useNavigate/relative-useNavigate-b' | '/redirect/$target/' | '/params-ps/named/$foo/$bar' - | '/non-nested/baz_/$bazid/edit' + | '/non-nested/named/$baz/foo' + | '/non-nested/named/$baz_/bar' + | '/non-nested/path/baz/foo' + | '/non-nested/path/baz_/bar' + | '/non-nested/prefix/prefix{$baz}/foo' + | '/non-nested/prefix/prefix{$baz}_/bar' + | '/non-nested/suffix/{$baz}suffix/foo' + | '/non-nested/suffix/{$baz}suffix_/bar' | '/params-ps/non-nested/$foo_/$bar' + | '/non-nested/named/$baz/' + | '/non-nested/path/baz/' + | '/non-nested/prefix/prefix{$baz}/' + | '/non-nested/suffix/{$baz}suffix/' | '/relative/link/nested/' | '/relative/link/path/' | '/relative/link/with-search/' @@ -938,13 +1142,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof PostsPostIdRouteImport parentRoute: typeof PostsRoute } - '/non-nested/baz': { - id: '/non-nested/baz' - path: '/baz' - fullPath: '/non-nested/baz' - preLoaderRoute: typeof NonNestedBazRouteImport - parentRoute: typeof NonNestedRouteRoute - } '/_layout/_layout-2': { id: '/_layout/_layout-2' path: '' @@ -1001,6 +1198,34 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof ParamsPsNonNestedRouteRouteImport parentRoute: typeof rootRouteImport } + '/non-nested/suffix': { + id: '/non-nested/suffix' + path: '/suffix' + fullPath: '/non-nested/suffix' + preLoaderRoute: typeof NonNestedSuffixRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } + '/non-nested/prefix': { + id: '/non-nested/prefix' + path: '/prefix' + fullPath: '/non-nested/prefix' + preLoaderRoute: typeof NonNestedPrefixRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } + '/non-nested/path': { + id: '/non-nested/path' + path: '/path' + fullPath: '/non-nested/path' + preLoaderRoute: typeof NonNestedPathRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } + '/non-nested/named': { + id: '/non-nested/named' + path: '/named' + fullPath: '/non-nested/named' + preLoaderRoute: typeof NonNestedNamedRouteRouteImport + parentRoute: typeof NonNestedRouteRoute + } '/redirect/$target/': { id: '/redirect/$target/' path: '/' @@ -1085,13 +1310,6 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof ParamsSingleValueRouteImport parentRoute: typeof rootRouteImport } - '/non-nested/baz/$bazid': { - id: '/non-nested/baz/$bazid' - path: '/$bazid' - fullPath: '/non-nested/baz/$bazid' - preLoaderRoute: typeof NonNestedBazBazidRouteImport - parentRoute: typeof NonNestedBazRoute - } '/_layout/_layout-2/layout-b': { id: '/_layout/_layout-2/layout-b' path: '/layout-b' @@ -1134,6 +1352,34 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof ParamsPsNamedFooRouteRouteImport parentRoute: typeof rootRouteImport } + '/non-nested/suffix/{$baz}suffix': { + id: '/non-nested/suffix/{$baz}suffix' + path: '/{$baz}suffix' + fullPath: '/non-nested/suffix/{$baz}suffix' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRouteImport + parentRoute: typeof NonNestedSuffixRouteRoute + } + '/non-nested/prefix/prefix{$baz}': { + id: '/non-nested/prefix/prefix{$baz}' + path: '/prefix{$baz}' + fullPath: '/non-nested/prefix/prefix{$baz}' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteImport + parentRoute: typeof NonNestedPrefixRouteRoute + } + '/non-nested/path/baz': { + id: '/non-nested/path/baz' + path: '/baz' + fullPath: '/non-nested/path/baz' + preLoaderRoute: typeof NonNestedPathBazRouteRouteImport + parentRoute: typeof NonNestedPathRouteRoute + } + '/non-nested/named/$baz': { + id: '/non-nested/named/$baz' + path: '/$baz' + fullPath: '/non-nested/named/$baz' + preLoaderRoute: typeof NonNestedNamedBazRouteRouteImport + parentRoute: typeof NonNestedNamedRouteRoute + } '/relative/useNavigate/with-search/': { id: '/relative/useNavigate/with-search/' path: '/with-search' @@ -1176,6 +1422,34 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof RelativeLinkNestedIndexRouteImport parentRoute: typeof RelativeLinkRouteRoute } + '/non-nested/suffix/{$baz}suffix/': { + id: '/non-nested/suffix/{$baz}suffix/' + path: '/' + fullPath: '/non-nested/suffix/{$baz}suffix/' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixIndexRouteImport + parentRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRoute + } + '/non-nested/prefix/prefix{$baz}/': { + id: '/non-nested/prefix/prefix{$baz}/' + path: '/' + fullPath: '/non-nested/prefix/prefix{$baz}/' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125IndexRouteImport + parentRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRoute + } + '/non-nested/path/baz/': { + id: '/non-nested/path/baz/' + path: '/' + fullPath: '/non-nested/path/baz/' + preLoaderRoute: typeof NonNestedPathBazIndexRouteImport + parentRoute: typeof NonNestedPathBazRouteRoute + } + '/non-nested/named/$baz/': { + id: '/non-nested/named/$baz/' + path: '/' + fullPath: '/non-nested/named/$baz/' + preLoaderRoute: typeof NonNestedNamedBazIndexRouteImport + parentRoute: typeof NonNestedNamedBazRouteRoute + } '/params-ps/non-nested/$foo_/$bar': { id: '/params-ps/non-nested/$foo_/$bar' path: '/$bar' @@ -1183,12 +1457,61 @@ declare module '@tanstack/solid-router' { preLoaderRoute: typeof ParamsPsNonNestedFooBarRouteImport parentRoute: typeof ParamsPsNonNestedFooRouteRoute } - '/non-nested/baz_/$bazid/edit': { - id: '/non-nested/baz_/$bazid/edit' - path: '/baz/$bazid/edit' - fullPath: '/non-nested/baz/$bazid/edit' - preLoaderRoute: typeof NonNestedBazBazidEditRouteImport - parentRoute: typeof NonNestedRouteRoute + '/non-nested/suffix/{$baz}suffix_/bar': { + id: '/non-nested/suffix/{$baz}suffix_/bar' + path: '/{$baz}suffix/bar' + fullPath: '/non-nested/suffix/{$baz}suffix/bar' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixBarRouteImport + parentRoute: typeof NonNestedSuffixRouteRoute + } + '/non-nested/suffix/{$baz}suffix/foo': { + id: '/non-nested/suffix/{$baz}suffix/foo' + path: '/foo' + fullPath: '/non-nested/suffix/{$baz}suffix/foo' + preLoaderRoute: typeof NonNestedSuffixChar123bazChar125suffixFooRouteImport + parentRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRoute + } + '/non-nested/prefix/prefix{$baz}_/bar': { + id: '/non-nested/prefix/prefix{$baz}_/bar' + path: '/prefix{$baz}/bar' + fullPath: '/non-nested/prefix/prefix{$baz}/bar' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125BarRouteImport + parentRoute: typeof NonNestedPrefixRouteRoute + } + '/non-nested/prefix/prefix{$baz}/foo': { + id: '/non-nested/prefix/prefix{$baz}/foo' + path: '/foo' + fullPath: '/non-nested/prefix/prefix{$baz}/foo' + preLoaderRoute: typeof NonNestedPrefixPrefixChar123bazChar125FooRouteImport + parentRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRoute + } + '/non-nested/path/baz_/bar': { + id: '/non-nested/path/baz_/bar' + path: '/baz/bar' + fullPath: '/non-nested/path/baz/bar' + preLoaderRoute: typeof NonNestedPathBazBarRouteImport + parentRoute: typeof NonNestedPathRouteRoute + } + '/non-nested/path/baz/foo': { + id: '/non-nested/path/baz/foo' + path: '/foo' + fullPath: '/non-nested/path/baz/foo' + preLoaderRoute: typeof NonNestedPathBazFooRouteImport + parentRoute: typeof NonNestedPathBazRouteRoute + } + '/non-nested/named/$baz_/bar': { + id: '/non-nested/named/$baz_/bar' + path: '/$baz/bar' + fullPath: '/non-nested/named/$baz/bar' + preLoaderRoute: typeof NonNestedNamedBazBarRouteImport + parentRoute: typeof NonNestedNamedRouteRoute + } + '/non-nested/named/$baz/foo': { + id: '/non-nested/named/$baz/foo' + path: '/foo' + fullPath: '/non-nested/named/$baz/foo' + preLoaderRoute: typeof NonNestedNamedBazFooRouteImport + parentRoute: typeof NonNestedNamedBazRouteRoute } '/params-ps/named/$foo/$bar': { id: '/params-ps/named/$foo/$bar' @@ -1235,26 +1558,141 @@ declare module '@tanstack/solid-router' { } } -interface NonNestedBazRouteChildren { - NonNestedBazBazidRoute: typeof NonNestedBazBazidRoute +interface NonNestedNamedBazRouteRouteChildren { + NonNestedNamedBazFooRoute: typeof NonNestedNamedBazFooRoute + NonNestedNamedBazIndexRoute: typeof NonNestedNamedBazIndexRoute } -const NonNestedBazRouteChildren: NonNestedBazRouteChildren = { - NonNestedBazBazidRoute: NonNestedBazBazidRoute, +const NonNestedNamedBazRouteRouteChildren: NonNestedNamedBazRouteRouteChildren = + { + NonNestedNamedBazFooRoute: NonNestedNamedBazFooRoute, + NonNestedNamedBazIndexRoute: NonNestedNamedBazIndexRoute, + } + +const NonNestedNamedBazRouteRouteWithChildren = + NonNestedNamedBazRouteRoute._addFileChildren( + NonNestedNamedBazRouteRouteChildren, + ) + +interface NonNestedNamedRouteRouteChildren { + NonNestedNamedBazRouteRoute: typeof NonNestedNamedBazRouteRouteWithChildren + NonNestedNamedBazBarRoute: typeof NonNestedNamedBazBarRoute } -const NonNestedBazRouteWithChildren = NonNestedBazRoute._addFileChildren( - NonNestedBazRouteChildren, -) +const NonNestedNamedRouteRouteChildren: NonNestedNamedRouteRouteChildren = { + NonNestedNamedBazRouteRoute: NonNestedNamedBazRouteRouteWithChildren, + NonNestedNamedBazBarRoute: NonNestedNamedBazBarRoute, +} + +const NonNestedNamedRouteRouteWithChildren = + NonNestedNamedRouteRoute._addFileChildren(NonNestedNamedRouteRouteChildren) + +interface NonNestedPathBazRouteRouteChildren { + NonNestedPathBazFooRoute: typeof NonNestedPathBazFooRoute + NonNestedPathBazIndexRoute: typeof NonNestedPathBazIndexRoute +} + +const NonNestedPathBazRouteRouteChildren: NonNestedPathBazRouteRouteChildren = { + NonNestedPathBazFooRoute: NonNestedPathBazFooRoute, + NonNestedPathBazIndexRoute: NonNestedPathBazIndexRoute, +} + +const NonNestedPathBazRouteRouteWithChildren = + NonNestedPathBazRouteRoute._addFileChildren( + NonNestedPathBazRouteRouteChildren, + ) + +interface NonNestedPathRouteRouteChildren { + NonNestedPathBazRouteRoute: typeof NonNestedPathBazRouteRouteWithChildren + NonNestedPathBazBarRoute: typeof NonNestedPathBazBarRoute +} + +const NonNestedPathRouteRouteChildren: NonNestedPathRouteRouteChildren = { + NonNestedPathBazRouteRoute: NonNestedPathBazRouteRouteWithChildren, + NonNestedPathBazBarRoute: NonNestedPathBazBarRoute, +} + +const NonNestedPathRouteRouteWithChildren = + NonNestedPathRouteRoute._addFileChildren(NonNestedPathRouteRouteChildren) + +interface NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren { + NonNestedPrefixPrefixChar123bazChar125FooRoute: typeof NonNestedPrefixPrefixChar123bazChar125FooRoute + NonNestedPrefixPrefixChar123bazChar125IndexRoute: typeof NonNestedPrefixPrefixChar123bazChar125IndexRoute +} + +const NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren: NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren = + { + NonNestedPrefixPrefixChar123bazChar125FooRoute: + NonNestedPrefixPrefixChar123bazChar125FooRoute, + NonNestedPrefixPrefixChar123bazChar125IndexRoute: + NonNestedPrefixPrefixChar123bazChar125IndexRoute, + } + +const NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren = + NonNestedPrefixPrefixChar123bazChar125RouteRoute._addFileChildren( + NonNestedPrefixPrefixChar123bazChar125RouteRouteChildren, + ) + +interface NonNestedPrefixRouteRouteChildren { + NonNestedPrefixPrefixChar123bazChar125RouteRoute: typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren + NonNestedPrefixPrefixChar123bazChar125BarRoute: typeof NonNestedPrefixPrefixChar123bazChar125BarRoute +} + +const NonNestedPrefixRouteRouteChildren: NonNestedPrefixRouteRouteChildren = { + NonNestedPrefixPrefixChar123bazChar125RouteRoute: + NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren, + NonNestedPrefixPrefixChar123bazChar125BarRoute: + NonNestedPrefixPrefixChar123bazChar125BarRoute, +} + +const NonNestedPrefixRouteRouteWithChildren = + NonNestedPrefixRouteRoute._addFileChildren(NonNestedPrefixRouteRouteChildren) + +interface NonNestedSuffixChar123bazChar125suffixRouteRouteChildren { + NonNestedSuffixChar123bazChar125suffixFooRoute: typeof NonNestedSuffixChar123bazChar125suffixFooRoute + NonNestedSuffixChar123bazChar125suffixIndexRoute: typeof NonNestedSuffixChar123bazChar125suffixIndexRoute +} + +const NonNestedSuffixChar123bazChar125suffixRouteRouteChildren: NonNestedSuffixChar123bazChar125suffixRouteRouteChildren = + { + NonNestedSuffixChar123bazChar125suffixFooRoute: + NonNestedSuffixChar123bazChar125suffixFooRoute, + NonNestedSuffixChar123bazChar125suffixIndexRoute: + NonNestedSuffixChar123bazChar125suffixIndexRoute, + } + +const NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren = + NonNestedSuffixChar123bazChar125suffixRouteRoute._addFileChildren( + NonNestedSuffixChar123bazChar125suffixRouteRouteChildren, + ) + +interface NonNestedSuffixRouteRouteChildren { + NonNestedSuffixChar123bazChar125suffixRouteRoute: typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren + NonNestedSuffixChar123bazChar125suffixBarRoute: typeof NonNestedSuffixChar123bazChar125suffixBarRoute +} + +const NonNestedSuffixRouteRouteChildren: NonNestedSuffixRouteRouteChildren = { + NonNestedSuffixChar123bazChar125suffixRouteRoute: + NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren, + NonNestedSuffixChar123bazChar125suffixBarRoute: + NonNestedSuffixChar123bazChar125suffixBarRoute, +} + +const NonNestedSuffixRouteRouteWithChildren = + NonNestedSuffixRouteRoute._addFileChildren(NonNestedSuffixRouteRouteChildren) interface NonNestedRouteRouteChildren { - NonNestedBazRoute: typeof NonNestedBazRouteWithChildren - NonNestedBazBazidEditRoute: typeof NonNestedBazBazidEditRoute + NonNestedNamedRouteRoute: typeof NonNestedNamedRouteRouteWithChildren + NonNestedPathRouteRoute: typeof NonNestedPathRouteRouteWithChildren + NonNestedPrefixRouteRoute: typeof NonNestedPrefixRouteRouteWithChildren + NonNestedSuffixRouteRoute: typeof NonNestedSuffixRouteRouteWithChildren } const NonNestedRouteRouteChildren: NonNestedRouteRouteChildren = { - NonNestedBazRoute: NonNestedBazRouteWithChildren, - NonNestedBazBazidEditRoute: NonNestedBazBazidEditRoute, + NonNestedNamedRouteRoute: NonNestedNamedRouteRouteWithChildren, + NonNestedPathRouteRoute: NonNestedPathRouteRouteWithChildren, + NonNestedPrefixRouteRoute: NonNestedPrefixRouteRouteWithChildren, + NonNestedSuffixRouteRoute: NonNestedSuffixRouteRouteWithChildren, } const NonNestedRouteRouteWithChildren = NonNestedRouteRoute._addFileChildren( diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx deleted file mode 100644 index d43c79c7807..00000000000 --- a/e2e/solid-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { createFileRoute } from '@tanstack/solid-router' - -export const Route = createFileRoute('/non-nested/baz/$bazid')({ - component: RouteComponent, -}) - -function RouteComponent() { - const params = Route.useParams() - - return ( - <> -
- Hello "/non-nested/baz/$bazid"! -
-
- params:{' '} - - {JSON.stringify(params())} - -
- - ) -} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/baz.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/baz.tsx deleted file mode 100644 index 42e76f8e3a0..00000000000 --- a/e2e/solid-router/basic-file-based/src/routes/non-nested/baz.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { Outlet, createFileRoute } from '@tanstack/solid-router' - -export const Route = createFileRoute('/non-nested/baz')({ - component: RouteComponent, -}) - -function RouteComponent() { - return ( - <> -
Hello "/non-nested/baz"!
- - - ) -} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx deleted file mode 100644 index 7cc0062d73c..00000000000 --- a/e2e/solid-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { createFileRoute } from '@tanstack/solid-router' - -export const Route = createFileRoute('/non-nested/baz_/$bazid/edit')({ - component: RouteComponent, -}) - -function RouteComponent() { - const params = Route.useParams() - return ( - <> -
- Hello "/non-nested/baz_/$bazid/edit"! -
-
- params:{' '} - - {JSON.stringify(params())} - -
- - ) -} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx new file mode 100644 index 00000000000..1ce1960f8b8 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/named/$baz/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested named baz foo page +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx new file mode 100644 index 00000000000..91a8186db62 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/named/$baz/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested named baz index +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx new file mode 100644 index 00000000000..93bb825be1d --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/named/$baz')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested named baz route layout +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx new file mode 100644 index 00000000000..1f2170a771d --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/named/$baz_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested named bar +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx new file mode 100644 index 00000000000..1eb6cb54d43 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx @@ -0,0 +1,58 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/named')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested named layout +
+
+ + To named index + + + To named foo + + + To named foo 2 + + + To named bar + + + To named bar 2 + +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx new file mode 100644 index 00000000000..f7b6e97632e --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/path/baz/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested path baz foo page +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx new file mode 100644 index 00000000000..9053ec481e2 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/path/baz/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested path baz index +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx new file mode 100644 index 00000000000..ed7f8ba7900 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/path/baz')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested path baz route layout +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx new file mode 100644 index 00000000000..462c0ee4e14 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/path/baz_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested path bar +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx new file mode 100644 index 00000000000..279b6fbfab5 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx @@ -0,0 +1,33 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/path')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested path layout +
+
+ + To path index + + + To path foo + + + To path foo 2 + + + To path bar + + + To path bar 2 + +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx new file mode 100644 index 00000000000..ad9e1479df8 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested prefix foo page +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx new file mode 100644 index 00000000000..a6e09a9d97d --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested prefix index +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx new file mode 100644 index 00000000000..41d94b7f7ef --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested prefix route layout +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx new file mode 100644 index 00000000000..c1a3928b011 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested prefix bar +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx new file mode 100644 index 00000000000..6a80067245c --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx @@ -0,0 +1,58 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/prefix')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested prefix layout +
+
+ + To prefix index + + + To prefix foo + + + To prefix foo 2 + + + To prefix bar + + + To prefix bar 2 + +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx index f63bb147172..5a21eff91e4 100644 --- a/e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx @@ -12,23 +12,17 @@ function RouteComponent() {
  • - - /non-nested/baz/123 + + To named param tests -
  • -
  • - - /non-nested/baz/456/edit + + To prefix param tests + + + To suffix param tests + + + To path tests
diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/route.tsx new file mode 100644 index 00000000000..5fbee63113b --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/route.tsx @@ -0,0 +1,58 @@ +import { Link, Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/suffix')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested suffix layout +
+
+ + To suffix index + + + To suffix foo + + + To suffix foo 2 + + + To suffix bar + + + To suffix bar 2 + +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx new file mode 100644 index 00000000000..ac5df1dc158 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx @@ -0,0 +1,20 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix/foo')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + + return ( +
+
+ Hello nested suffix foo page +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx new file mode 100644 index 00000000000..0dd908d0a32 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix/')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello nested suffix index +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx new file mode 100644 index 00000000000..d27f65d510c --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx @@ -0,0 +1,16 @@ +import { Outlet, createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+
+ Hello non-nested suffix route layout +
+ +
+ ) +} diff --git a/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx new file mode 100644 index 00000000000..26403727c65 --- /dev/null +++ b/e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/solid-router' + +export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix_/bar')({ + component: RouteComponent, +}) + +function RouteComponent() { + const params = Route.useParams() + return ( +
+
+ Hello non-nested suffix bar +
+
+ {JSON.stringify(params())} +
+
+ ) +} diff --git a/e2e/solid-router/basic-file-based/tests/app.spec.ts b/e2e/solid-router/basic-file-based/tests/app.spec.ts index 2b0ffa17a9b..c0b1b69dc59 100644 --- a/e2e/solid-router/basic-file-based/tests/app.spec.ts +++ b/e2e/solid-router/basic-file-based/tests/app.spec.ts @@ -296,38 +296,3 @@ test('Should remount deps when remountDeps does change ', async ({ page }) => { 'Page component mounts: 2', ) }) - -test('Should not nest non-nested paths', async ({ page }) => { - await page.goto('/non-nested') - await page.waitForURL('/non-nested') - const nonNestedPathHeading = page.getByTestId('non-nested-path-heading') - const bazIdLink = page.getByTestId('l-to-non-nested-bazid') - const bazIdEditLink = page.getByTestId('l-to-non-nested-bazid-edit') - - await expect(nonNestedPathHeading).toBeInViewport() - await expect(bazIdLink).toHaveAttribute('href', '/non-nested/baz/123') - await expect(bazIdEditLink).toHaveAttribute( - 'href', - '/non-nested/baz/456/edit', - ) - - await bazIdLink.click() - await page.waitForURL('/non-nested/baz/123') - const bazHeading = page.getByTestId('non-nested-baz-heading') - const bazIdHeading = page.getByTestId('non-nested-bazid-heading') - const bazIdParam = page.getByTestId('non-nested-bazid-param') - await expect(nonNestedPathHeading).toBeInViewport() - await expect(bazHeading).toBeInViewport() - await expect(bazIdHeading).toBeInViewport() - await expect(bazIdParam).toContainText(JSON.stringify({ bazid: '123' })) - - await bazIdEditLink.click() - await page.waitForURL('/non-nested/baz/456/edit') - const bazIdEditHeading = page.getByTestId('non-nested-bazid-edit-heading') - const bazIdEditParam = page.getByTestId('non-nested-bazid-edit-param') - await expect(nonNestedPathHeading).toBeInViewport() - await expect(bazHeading).toBeHidden() - await expect(bazIdHeading).toBeHidden() - await expect(bazIdEditHeading).toBeInViewport() - await expect(bazIdEditParam).toContainText(JSON.stringify({ bazid: '456' })) -}) diff --git a/e2e/solid-router/basic-file-based/tests/non-nested-paths.spec.ts b/e2e/solid-router/basic-file-based/tests/non-nested-paths.spec.ts new file mode 100644 index 00000000000..2fdede5549a --- /dev/null +++ b/e2e/solid-router/basic-file-based/tests/non-nested-paths.spec.ts @@ -0,0 +1,192 @@ +import { expect, test } from '@playwright/test' + +const testCases: Array<{ + name: string + testPathDesc: string + testPathPrefix: string + testPathSuffix: string + paramValue: Record + paramValue2: Record +}> = [ + { + name: 'Named path params', + testPathDesc: 'named', + testPathPrefix: '', + testPathSuffix: '', + paramValue: { baz: 'baz' }, + paramValue2: { baz: 'baz_' }, + }, + { + name: 'prefix params', + testPathPrefix: 'prefix', + testPathSuffix: '', + testPathDesc: 'prefix', + paramValue: { baz: 'baz' }, + paramValue2: { baz: 'baz_' }, + }, + { + name: 'suffix params', + testPathPrefix: '', + testPathSuffix: 'suffix', + testPathDesc: 'suffix', + paramValue: { baz: 'baz' }, + paramValue2: { baz: 'baz2' }, + }, + { + name: 'path', + testPathPrefix: '', + testPathSuffix: '', + testPathDesc: 'path', + paramValue: {}, + paramValue2: {}, + }, +] + +test.describe('Non-nested paths', () => { + testCases.forEach( + ({ + name, + testPathDesc, + testPathPrefix, + testPathSuffix, + paramValue, + paramValue2, + }) => { + test.describe(name, () => { + const path = `/non-nested/${testPathDesc}` + const paramNameDesc = Object.keys(paramValue)[0] ?? 'baz' + + test.beforeEach(async ({ page }) => { + await page.goto('/non-nested') + await page.waitForURL('/non-nested') + }) + + test('Should not un-nest nested paths', async ({ page }) => { + const nonNestedPathHeading = page.getByTestId( + 'non-nested-path-heading', + ) + await expect(nonNestedPathHeading).toBeVisible() + + await page.getByTestId(`l-to-${testPathDesc}`).click() + await page.waitForURL(path) + + const rootRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-root-route-heading`, + ) + + await expect(rootRouteHeading).toBeVisible() + + const pathRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-route-heading`, + ) + + const indexHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-index-heading`, + ) + + const fooHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-foo-heading`, + ) + + const indexParams = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-index-param`, + ) + + const fooParams = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-foo-param`, + ) + + const indexLink = page.getByTestId(`to-${testPathDesc}-index`) + const fooLink = page.getByTestId(`to-${testPathDesc}-foo`) + const foo2Link = page.getByTestId(`to-${testPathDesc}-foo-2`) + + const indexPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}` + const fooPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}/foo` + const foo2Path = `${path}/${testPathPrefix}${paramValue2[paramNameDesc] ?? 'baz'}${testPathSuffix}/foo` + + console.log(await indexLink.getAttribute('href')) + await expect(indexLink).toHaveAttribute('href', indexPath) + await expect(fooLink).toHaveAttribute('href', fooPath) + await expect(foo2Link).toHaveAttribute('href', foo2Path) + + await indexLink.click() + await page.waitForURL(indexPath) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).toBeVisible() + await expect(indexHeading).toBeVisible() + const indexParamValue = await indexParams.innerText() + expect(JSON.parse(indexParamValue)).toEqual(paramValue) + + await fooLink.click() + await page.waitForURL(fooPath) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).toBeVisible() + await expect(fooHeading).toBeVisible() + const fooParamValue = await fooParams.innerText() + expect(JSON.parse(fooParamValue)).toEqual(paramValue) + + await foo2Link.click() + await page.waitForURL(foo2Path) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).toBeVisible() + await expect(fooHeading).toBeVisible() + const foo2ParamValue = await fooParams.innerText() + expect(JSON.parse(foo2ParamValue)).toEqual(paramValue2) + }) + + test('Should not nest non-nested paths', async ({ page }) => { + const nonNestedPathHeading = page.getByTestId( + 'non-nested-path-heading', + ) + await expect(nonNestedPathHeading).toBeVisible() + + await page.getByTestId(`l-to-${testPathDesc}`).click() + await page.waitForURL(path) + + const rootRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-root-route-heading`, + ) + + await expect(rootRouteHeading).toBeVisible() + + const pathRouteHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-route-heading`, + ) + + const barHeading = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-bar-heading`, + ) + + const barParams = page.getByTestId( + `non-nested-${testPathDesc}-${paramNameDesc}-bar-param`, + ) + + const barLink = page.getByTestId(`to-${testPathDesc}-bar`) + const bar2Link = page.getByTestId(`to-${testPathDesc}-bar-2`) + + const barPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}/bar` + const bar2Path = `${path}/${testPathPrefix}${paramValue2[paramNameDesc] ?? 'baz'}${testPathSuffix}/bar` + await expect(barLink).toHaveAttribute('href', barPath) + + await expect(bar2Link).toHaveAttribute('href', bar2Path) + + await barLink.click() + await page.waitForURL(barPath) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).not.toBeVisible() + await expect(barHeading).toBeVisible() + const barParamValue = await barParams.innerText() + expect(JSON.parse(barParamValue)).toEqual(paramValue) + + await bar2Link.click() + await page.waitForURL(bar2Path) + await expect(rootRouteHeading).toBeVisible() + await expect(pathRouteHeading).not.toBeVisible() + await expect(barHeading).toBeVisible() + const bar2ParamValue = await barParams.innerText() + expect(JSON.parse(bar2ParamValue)).toEqual(paramValue2) + }) + }) + }, + ) +}) diff --git a/packages/router-core/src/path.ts b/packages/router-core/src/path.ts index 617685a10bf..f69aa5e26ee 100644 --- a/packages/router-core/src/path.ts +++ b/packages/router-core/src/path.ts @@ -161,8 +161,8 @@ export function resolvePath({ base = removeBasepath(basepath, base, caseSensitive) to = removeBasepath(basepath, to, caseSensitive) - let baseSegments = parsePathname(base, parseCache).slice() - const toSegments = parsePathname(to, parseCache) + let baseSegments = parseBasePathSegments(base, parseCache).slice() + const toSegments = parseRoutePathSegments(to, parseCache) if (baseSegments.length > 1 && last(baseSegments)?.value === '/') { baseSegments.pop() @@ -206,14 +206,26 @@ export function resolvePath({ } export type ParsePathnameCache = LRUCache> + +export const parseBasePathSegments = ( + pathname?: string, + cache?: ParsePathnameCache, +): ReadonlyArray => parsePathname(pathname, cache, true) + +export const parseRoutePathSegments = ( + pathname?: string, + cache?: ParsePathnameCache, +): ReadonlyArray => parsePathname(pathname, cache, false) + export const parsePathname = ( pathname?: string, cache?: ParsePathnameCache, + basePathValues?: boolean, ): ReadonlyArray => { if (!pathname) return [] const cached = cache?.get(pathname) if (cached) return cached - const parsed = baseParsePathname(pathname) + const parsed = baseParsePathname(pathname, basePathValues) cache?.set(pathname, parsed) return parsed } @@ -243,7 +255,10 @@ const WILDCARD_W_CURLY_BRACES_RE = /^(.*?)\{\$\}(.*)$/ // prefix{$}suffix * - `/foo/[$]{$foo} - Dynamic route with a static prefix of `$` * - `/foo/{$foo}[$]` - Dynamic route with a static suffix of `$` */ -function baseParsePathname(pathname: string): ReadonlyArray { +function baseParsePathname( + pathname: string, + basePathValues?: boolean, +): ReadonlyArray { pathname = cleanPath(pathname) const segments: Array = [] @@ -266,7 +281,8 @@ function baseParsePathname(pathname: string): ReadonlyArray { segments.push( ...split.map((part): Segment => { // strip tailing underscore for non-nested paths - const partToMatch = part.slice(-1) === '_' ? part.slice(0, -1) : part + const partToMatch = + !basePathValues && part.slice(-1) === '_' ? part.slice(0, -1) : part // Check for wildcard with curly braces: prefix{$}suffix const wildcardBracesMatch = partToMatch.match(WILDCARD_W_CURLY_BRACES_RE) @@ -380,7 +396,7 @@ export function interpolatePath({ decodeCharMap, parseCache, }: InterpolatePathOptions): InterPolatePathResult { - const interpolatedPathSegments = parsePathname(path, parseCache) + const interpolatedPathSegments = parseRoutePathSegments(path, parseCache) function encodeParam(key: string): any { const value = params[key] @@ -580,11 +596,11 @@ export function matchByPath( to = removeBasepath(basepath, `${to ?? '$'}`, caseSensitive) // Parse the from and to - const baseSegments = parsePathname( + const baseSegments = parseBasePathSegments( from.startsWith('/') ? from : `/${from}`, parseCache, ) - const routeSegments = parsePathname( + const routeSegments = parseRoutePathSegments( to.startsWith('/') ? to : `/${to}`, parseCache, ) diff --git a/packages/router-core/src/process-route-tree.ts b/packages/router-core/src/process-route-tree.ts index a95c0a64e99..221cedc26de 100644 --- a/packages/router-core/src/process-route-tree.ts +++ b/packages/router-core/src/process-route-tree.ts @@ -3,7 +3,7 @@ import { SEGMENT_TYPE_OPTIONAL_PARAM, SEGMENT_TYPE_PARAM, SEGMENT_TYPE_PATHNAME, - parsePathname, + parseRoutePathSegments, trimPathLeft, trimPathRight, } from './path' @@ -70,7 +70,7 @@ function sortRoutes( } const trimmed = trimPathLeft(d.fullPath) - let parsed = parsePathname(trimmed) + let parsed = parseRoutePathSegments(trimmed) // Removes the leading slash if it is not the only remaining segment let skip = 0 diff --git a/packages/router-core/tests/match-by-path.test.ts b/packages/router-core/tests/match-by-path.test.ts index bb886cf7540..4de3b8d6c76 100644 --- a/packages/router-core/tests/match-by-path.test.ts +++ b/packages/router-core/tests/match-by-path.test.ts @@ -24,6 +24,7 @@ describe('default path matching', () => { ['/a/1', '/a/$id', { id: '1' }], ['/a/1/b', '/a/$id/b', { id: '1' }], ['/a/1/b/2', '/a/$id/b/$other', { id: '1', other: '2' }], + ['/a/1_/b/2', '/a/$id/b/$other', { id: '1_', other: '2' }], ['/a/1/b/2', '/a/$id/b/$id', { id: '2' }], ])('params %s => %s', (from, to, result) => { expect( @@ -110,12 +111,14 @@ describe('case insensitive path matching', () => { ['/a/1', '/A/{-$id}', { id: '1' }], ['/a', '/A/{-$id}', {}], ['/a/1/b', '/A/{-$id}/B', { id: '1' }], + ['/a/1_/b', '/A/{-$id}/B', { id: '1_' }], // ['/a/b', '/A/{-$id}/B', {}], ['/a/1/b/2', '/A/{-$id}/B/{-$other}', { id: '1', other: '2' }], // ['/a/b/2', '/A/{-$id}/B/{-$other}', { other: '2' }], ['/a/1/b', '/A/{-$id}/B/{-$other}', { id: '1' }], // ['/a/b', '/A/{-$id}/B/{-$other}', {}], ['/a/1/b/2', '/A/{-$id}/B/{-$id}', { id: '2' }], + ['/a/1/b/2_', '/A/{-$id}/B/{-$id}', { id: '2_' }], ])('optional %s => %s', (from, to, result) => { expect( matchByPath('/', from, { to, caseSensitive: false, fuzzy: false }), @@ -201,12 +204,12 @@ describe('fuzzy path matching', () => { describe('non-nested paths', () => { describe('default path matching', () => { it.each([ - ['/', '/a_', '/a_', {}], - ['/', '/a_/b_', '/a_/b_', {}], - ['/', '/a_', '/a_/', {}], - ['/', '/a_/', '/a_/', {}], - ['/', '/a_/', '/a_', undefined], - ['/', '/b_', '/a_', undefined], + ['/', '/a', '/a_', {}], + ['/', '/a/b', '/a_/b_', {}], + ['/', '/a', '/a_/', {}], + ['/', '/a/', '/a_/', {}], + ['/', '/a/', '/a_', undefined], + ['/', '/b', '/a_', undefined], ])('static %s %s => %s', (base, from, to, result) => { expect( matchByPath(base, from, { to, caseSensitive: true, fuzzy: false }), @@ -217,6 +220,7 @@ describe('non-nested paths', () => { ['/a/1', '/a_/$id_', { id: '1' }], ['/a/1/b', '/a_/$id_/b_', { id: '1' }], ['/a/1/b/2', '/a_/$id_/b_/$other_', { id: '1', other: '2' }], + ['/a/1_/b/2', '/a_/$id_/b_/$other_', { id: '1_', other: '2' }], ['/a/1/b/2', '/a_/$id_/b_/$id_', { id: '2' }], ])('params %s => %s', (from, to, result) => { expect( diff --git a/packages/router-core/tests/path.test.ts b/packages/router-core/tests/path.test.ts index ae5b3aaadbe..7f77809c54f 100644 --- a/packages/router-core/tests/path.test.ts +++ b/packages/router-core/tests/path.test.ts @@ -347,12 +347,24 @@ describe('interpolatePath', () => { params: { id: '123' }, result: '/users/123', }, + { + name: 'should interpolate the path', + path: '/users/$id', + params: { id: '123_' }, + result: '/users/123_', + }, { name: 'should interpolate the path with multiple params', path: '/users/$id/$name', params: { id: '123', name: 'tanner' }, result: '/users/123/tanner', }, + { + name: 'should interpolate the path with multiple params', + path: '/users/$id/$name', + params: { id: '123_', name: 'tanner' }, + result: '/users/123_/tanner', + }, { name: 'should interpolate the path with extra params', path: '/users/$id', @@ -512,6 +524,12 @@ describe('interpolatePath', () => { params: { foo: 'bar' }, result: '/bar.suffix', }, + { + name: 'with suffix', + to: '/{$foo}.suffix', + params: { foo: 'bar_' }, + result: '/bar_.suffix', + }, { name: 'with prefix and suffix', to: '/prefix{$param}.suffix', @@ -780,6 +798,16 @@ describe('matchPathname', () => { bar: 'foo', }, }, + { + name: 'regular', + input: '/docs/foo_', + matchingOptions: { + to: '/docs/$bar', + }, + expectedMatchedParams: { + bar: 'foo_', + }, + }, { name: 'regular curly braces', input: '/docs/foo', @@ -790,6 +818,16 @@ describe('matchPathname', () => { bar: 'foo', }, }, + { + name: 'with prefix', + input: '/docs/prefixfoo_', + matchingOptions: { + to: '/docs/prefix{$bar}', + }, + expectedMatchedParams: { + bar: 'foo_', + }, + }, { name: 'with prefix', input: '/docs/prefixfoo', @@ -1130,7 +1168,7 @@ describe('non-nested paths', async () => { describe('resolvePath', () => { describe.each([ ['/', '/', '/a_', '/a'], - ['/', '/', 'a/', '/a'], + ['/', '/', 'a_/', '/a'], ['/', '/', '/a_/b_', '/a/b'], ['/', 'a', 'b_', '/a/b'], ['/a/b', 'c', '/a/b/c_', '/a/b/c'], @@ -1323,7 +1361,7 @@ describe('non-nested paths', async () => { }, { name: 'with nested prefix + suffix', - to: '/params/named/prefix{$foo}suffix', + to: '/params_/named_/prefix{$foo}suffix_', expected: '/params/named/prefix{$foo}suffix', }, ])('$name', ({ to, expected }) => {