Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions e2e/solid-router/basic-file-based/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.

import { Route as rootRouteImport } from './routes/__root'
import { Route as Char45824Char54620Char48124Char44397RouteImport } from './routes/대한민국'
import { Route as RemountDepsRouteImport } from './routes/remountDeps'
import { Route as PostsRouteImport } from './routes/posts'
import { Route as NotRemountDepsRouteImport } from './routes/notRemountDeps'
Expand Down Expand Up @@ -88,6 +89,12 @@ import { Route as RelativeLinkPathPathIndexRouteImport } from './routes/relative
import { Route as RelativeLinkNestedDeepIndexRouteImport } from './routes/relative/link/nested/deep/index'
import { Route as ParamsPsNamedFooBarBazRouteImport } from './routes/params-ps/named/$foo/$bar.$baz'

const Char45824Char54620Char48124Char44397Route =
Char45824Char54620Char48124Char44397RouteImport.update({
id: '/대한민국',
path: '/대한민국',
getParentRoute: () => rootRouteImport,
} as any)
const RemountDepsRoute = RemountDepsRouteImport.update({
id: '/remountDeps',
path: '/remountDeps',
Expand Down Expand Up @@ -514,6 +521,7 @@ export interface FileRoutesByFullPath {
'/notRemountDeps': typeof NotRemountDepsRoute
'/posts': typeof PostsRouteWithChildren
'/remountDeps': typeof RemountDepsRoute
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren
'/non-nested/path': typeof NonNestedPathRouteRouteWithChildren
'/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren
Expand Down Expand Up @@ -589,6 +597,7 @@ export interface FileRoutesByTo {
'/editing-b': typeof EditingBRoute
'/notRemountDeps': typeof NotRemountDepsRoute
'/remountDeps': typeof RemountDepsRoute
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren
'/non-nested/path': typeof NonNestedPathRouteRouteWithChildren
'/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren
Expand Down Expand Up @@ -663,6 +672,7 @@ export interface FileRoutesById {
'/notRemountDeps': typeof NotRemountDepsRoute
'/posts': typeof PostsRouteWithChildren
'/remountDeps': typeof RemountDepsRoute
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/non-nested/named': typeof NonNestedNamedRouteRouteWithChildren
'/non-nested/path': typeof NonNestedPathRouteRouteWithChildren
'/non-nested/prefix': typeof NonNestedPrefixRouteRouteWithChildren
Expand Down Expand Up @@ -744,6 +754,7 @@ export interface FileRouteTypes {
| '/notRemountDeps'
| '/posts'
| '/remountDeps'
| '/대한민국'
| '/non-nested/named'
| '/non-nested/path'
| '/non-nested/prefix'
Expand Down Expand Up @@ -819,6 +830,7 @@ export interface FileRouteTypes {
| '/editing-b'
| '/notRemountDeps'
| '/remountDeps'
| '/대한민국'
| '/non-nested/named'
| '/non-nested/path'
| '/non-nested/prefix'
Expand Down Expand Up @@ -892,6 +904,7 @@ export interface FileRouteTypes {
| '/notRemountDeps'
| '/posts'
| '/remountDeps'
| '/대한민국'
| '/non-nested/named'
| '/non-nested/path'
| '/non-nested/prefix'
Expand Down Expand Up @@ -973,6 +986,7 @@ export interface RootRouteChildren {
NotRemountDepsRoute: typeof NotRemountDepsRoute
PostsRoute: typeof PostsRouteWithChildren
RemountDepsRoute: typeof RemountDepsRoute
Char45824Char54620Char48124Char44397Route: typeof Char45824Char54620Char48124Char44397Route
ParamsPsNonNestedRouteRoute: typeof ParamsPsNonNestedRouteRouteWithChildren
RelativeLinkRouteRoute: typeof RelativeLinkRouteRouteWithChildren
RelativeUseNavigateRouteRoute: typeof RelativeUseNavigateRouteRouteWithChildren
Expand All @@ -995,6 +1009,13 @@ export interface RootRouteChildren {

declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
'/대한민국': {
id: '/대한민국'
path: '/대한민국'
fullPath: '/대한민국'
preLoaderRoute: typeof Char45824Char54620Char48124Char44397RouteImport
parentRoute: typeof rootRouteImport
}
'/remountDeps': {
id: '/remountDeps'
path: '/remountDeps'
Expand Down Expand Up @@ -1884,6 +1905,8 @@ const rootRouteChildren: RootRouteChildren = {
NotRemountDepsRoute: NotRemountDepsRoute,
PostsRoute: PostsRouteWithChildren,
RemountDepsRoute: RemountDepsRoute,
Char45824Char54620Char48124Char44397Route:
Char45824Char54620Char48124Char44397Route,
ParamsPsNonNestedRouteRoute: ParamsPsNonNestedRouteRouteWithChildren,
RelativeLinkRouteRoute: RelativeLinkRouteRouteWithChildren,
RelativeUseNavigateRouteRoute: RelativeUseNavigateRouteRouteWithChildren,
Expand Down
9 changes: 9 additions & 0 deletions e2e/solid-router/basic-file-based/src/routes/대한민국.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createFileRoute } from '@tanstack/solid-router'

export const Route = createFileRoute('/대한민국')({
component: RouteComponent,
})

function RouteComponent() {
return <div>Hello "/대한민국"!</div>
}
203 changes: 203 additions & 0 deletions e2e/solid-router/basic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
createRootRoute,
createRoute,
createRouter,
redirect,
} from '@tanstack/solid-router'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
import { NotFoundError, fetchPost, fetchPosts } from './posts'
Expand Down Expand Up @@ -207,11 +208,213 @@ function LayoutBComponent() {
return <div>I'm layout B!</div>
}

const paramsPsRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/params-ps',
})

const paramsPsIndexRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/',
component: function ParamsIndex() {
return (
<div>
<h3 class="pb-2">Named path params</h3>
<ul class="grid mb-2">
<li>
<Link
data-testid="l-to-named-foo"
to="/params-ps/named/$foo"
params={{ foo: 'foo' }}
>
/params-ps/named/$foo
</Link>
</li>
<li>
<Link
data-testid="l-to-named-prefixfoo"
to="/params-ps/named/prefix{$foo}"
params={{ foo: 'foo' }}
>
/params-ps/named/{'prefix{$foo}'}
</Link>
</li>
<li>
<Link
data-testid="l-to-named-foosuffix"
to="/params-ps/named/{$foo}suffix"
params={{ foo: 'foo' }}
>
/params-ps/named/{'{$foo}suffix'}
</Link>
</li>
</ul>
<hr />
<h3 class="pb-2">Wildcard path params</h3>
<ul class="grid mb-2">
<li>
<Link
data-testid="l-to-wildcard-foo"
to="/params-ps/wildcard/$"
params={{ _splat: 'foo' }}
>
/params-ps/wildcard/$
</Link>
</li>
<li>
<Link
data-testid="l-to-wildcard-prefixfoo"
to="/params-ps/wildcard/prefix{$}"
params={{ _splat: 'foo' }}
>
/params-ps/wildcard/{'prefix{$}'}
</Link>
</li>
<li>
<Link
data-testid="l-to-wildcard-foosuffix"
to="/params-ps/wildcard/{$}suffix"
params={{ _splat: 'foo' }}
>
/params-ps/wildcard/{'{$}suffix'}
</Link>
</li>
</ul>
</div>
)
},
})

const paramsPsNamedRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/named',
})

Comment on lines +288 to +292
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Bug: Absolute child path breaks nesting under /params-ps.
Use a relative path so final URL is /params-ps/named, not /named.
Apply:

-  path: '/named',
+  path: 'named',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const paramsPsNamedRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/named',
})
const paramsPsNamedRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: 'named',
})
🤖 Prompt for AI Agents
In e2e/solid-router/basic/src/main.tsx around lines 288 to 292, the child route
paramsPsNamedRoute incorrectly uses an absolute path '/named' which breaks
nesting under /params-ps; change the path to a relative one (remove the leading
slash, e.g. 'named') so the final URL resolves to /params-ps/named and ensure
getParentRoute remains paramsPsRoute.

const paramsPsNamedIndexRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/',
beforeLoad: () => {
throw redirect({ to: '/params-ps' })
},
})

const paramsPsNamedFooRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/$foo',
component: function ParamsNamedFoo() {
const p = paramsPsNamedFooRoute.useParams()
return (
<div>
<h3>ParamsNamedFoo</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
Comment on lines +301 to +313
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Bug: Absolute path makes this route root-level (/ $foo) and conflicts.
Should be relative to /params-ps/named.

-  path: '/$foo',
+  path: '$foo',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const paramsPsNamedFooRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/$foo',
component: function ParamsNamedFoo() {
const p = paramsPsNamedFooRoute.useParams()
return (
<div>
<h3>ParamsNamedFoo</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
const paramsPsNamedFooRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '$foo',
component: function ParamsNamedFoo() {
const p = paramsPsNamedFooRoute.useParams()
return (
<div>
<h3>ParamsNamedFoo</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
🤖 Prompt for AI Agents
In e2e/solid-router/basic/src/main.tsx around lines 301-313, the route path is
defined as '/$foo' which makes it absolute and conflicts at the app root; change
the path to be relative by removing the leading slash (use '$foo') so this child
route resolves under its parent (/params-ps/named). Keep getParentRoute
unchanged and run the tests to verify nested routing works.


const paramsPsNamedFooPrefixRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/prefix{$foo}',
component: function ParamsNamedFooMarkdown() {
const p = paramsPsNamedFooPrefixRoute.useParams()
return (
<div>
<h3>ParamsNamedFooPrefix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
Comment on lines +315 to +327
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Two fixes: absolute path and component name typo.

  • Make path relative so it nests under /params-ps/named.
  • Rename component to match heading.
-  path: '/prefix{$foo}',
-  component: function ParamsNamedFooMarkdown() {
+  path: 'prefix{$foo}',
+  component: function ParamsNamedFooPrefix() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const paramsPsNamedFooPrefixRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/prefix{$foo}',
component: function ParamsNamedFooMarkdown() {
const p = paramsPsNamedFooPrefixRoute.useParams()
return (
<div>
<h3>ParamsNamedFooPrefix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
const paramsPsNamedFooPrefixRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: 'prefix{$foo}',
component: function ParamsNamedFooPrefix() {
const p = paramsPsNamedFooPrefixRoute.useParams()
return (
<div>
<h3>ParamsNamedFooPrefix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
🤖 Prompt for AI Agents
In e2e/solid-router/basic/src/main.tsx around lines 315 to 327, the route is
defined with an absolute path and the component function name doesn't match the
heading; change the path from '/prefix{$foo}' to a relative 'prefix{$foo}' so it
nests under /params-ps/named, and rename the component function from
ParamsNamedFooMarkdown to ParamsNamedFooPrefix (and update any references) so
the function name matches the rendered heading.


const paramsPsNamedFooSuffixRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/{$foo}suffix',
component: function ParamsNamedFooSuffix() {
const p = paramsPsNamedFooSuffixRoute.useParams()
return (
<div>
<h3>ParamsNamedFooSuffix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
Comment on lines +329 to +341
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Bug: Absolute path; should be relative to /params-ps/named.

-  path: '/{$foo}suffix',
+  path: '{$foo}suffix',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const paramsPsNamedFooSuffixRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '/{$foo}suffix',
component: function ParamsNamedFooSuffix() {
const p = paramsPsNamedFooSuffixRoute.useParams()
return (
<div>
<h3>ParamsNamedFooSuffix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
const paramsPsNamedFooSuffixRoute = createRoute({
getParentRoute: () => paramsPsNamedRoute,
path: '{$foo}suffix',
component: function ParamsNamedFooSuffix() {
const p = paramsPsNamedFooSuffixRoute.useParams()
return (
<div>
<h3>ParamsNamedFooSuffix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})
🤖 Prompt for AI Agents
In e2e/solid-router/basic/src/main.tsx around lines 329 to 341, the route path
is defined as an absolute path '/{$foo}suffix' but it should be relative to its
parent (/params-ps/named); change the path to a relative value (remove the
leading slash) so it becomes '{$foo}suffix' (or the router's relative-path form)
so the route resolves under paramsPsNamedRoute; leave getParentRoute as-is.


const paramsPsWildcardRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/wildcard',
})
Comment on lines +343 to +346
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Bug: Absolute child path prevents /params-ps/wildcard nesting.

-  path: '/wildcard',
+  path: 'wildcard',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const paramsPsWildcardRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/wildcard',
})
const paramsPsWildcardRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: 'wildcard',
})
🤖 Prompt for AI Agents
In e2e/solid-router/basic/src/main.tsx around lines 343 to 346, the child route
is defined with an absolute path '/wildcard' which prevents it from nesting
under the parent paramsPsRoute; change the path to a relative segment (remove
the leading slash, e.g. 'wildcard') so the router composes it as
/params-ps/wildcard and remains nested under the parent route.


const paramsPsWildcardIndexRoute = createRoute({
getParentRoute: () => paramsPsWildcardRoute,
path: '/',
beforeLoad: () => {
throw redirect({ to: '/params-ps' })
},
})

const paramsPsWildcardSplatRoute = createRoute({
getParentRoute: () => paramsPsWildcardRoute,
path: '$',
component: function ParamsWildcardSplat() {
const p = paramsPsWildcardSplatRoute.useParams()
return (
<div>
<h3>ParamsWildcardSplat</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})

const paramsPsWildcardSplatPrefixRoute = createRoute({
getParentRoute: () => paramsPsWildcardRoute,
path: 'prefix{$}',
component: function ParamsWildcardSplatPrefix() {
const p = paramsPsWildcardSplatPrefixRoute.useParams()
return (
<div>
<h3>ParamsWildcardSplatPrefix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})

const paramsPsWildcardSplatSuffixRoute = createRoute({
getParentRoute: () => paramsPsWildcardRoute,
path: '{$}suffix',
component: function ParamsWildcardSplatSuffix() {
const p = paramsPsWildcardSplatSuffixRoute.useParams()
return (
<div>
<h3>ParamsWildcardSplatSuffix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
},
})

const routeTree = rootRoute.addChildren([
postsRoute.addChildren([postRoute, postsIndexRoute]),
layoutRoute.addChildren([
layout2Route.addChildren([layoutARoute, layoutBRoute]),
]),
paramsPsRoute.addChildren([
paramsPsNamedRoute.addChildren([
paramsPsNamedFooPrefixRoute,
paramsPsNamedFooSuffixRoute,
paramsPsNamedFooRoute,
paramsPsNamedIndexRoute,
]),
paramsPsWildcardRoute.addChildren([
paramsPsWildcardSplatRoute,
paramsPsWildcardSplatPrefixRoute,
paramsPsWildcardSplatSuffixRoute,
paramsPsWildcardIndexRoute,
]),
paramsPsIndexRoute,
]),
Comment on lines +403 to +417
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Route tree wiring looks right; re-verify after path fixes.
Once child paths are made relative, this tree will reflect URLs under /params-ps as intended.
Run to confirm no stray leading slashes remain in params-ps children:


🏁 Script executed:

#!/usr/bin/env bash
# Check for accidental absolute child paths under params-ps subtree
rg -nP 'const\s+paramsPs(Named|Wildcard).*?path:\s*\"\/' -C2
rg -nP 'const\s+paramsPs(Named|Wildcard).*\n.*path:\s*\"\/' -C2

Length of output: 0



---

🏁 Script executed:

```shell
#!/bin/bash
# Examine the file and find route definitions for paramsPsNamed and paramsPsWildcard
rg -n 'const\s+(paramsPsNamed|paramsPsWildcard)' e2e/solid-router/basic/src/main.tsx -A 5

Length of output: 2200


🏁 Script executed:

#!/bin/bash
# Also search for the full route tree structure with path definitions
rg -n 'path:' e2e/solid-router/basic/src/main.tsx | grep -i 'params.*ps'

Length of output: 25


🏁 Script executed:

#!/bin/bash
# Get a broader view of the params-ps route section
rg -n 'const\s+paramsPsRoute' e2e/solid-router/basic/src/main.tsx -A 50 | head -100

Length of output: 1632


Remove leading slashes from paramsPsNamedRoute and paramsPsWildcardRoute child paths.

The route tree structure still contains absolute child paths that must be made relative:

  • paramsPsNamedRoute: change /namednamed
  • paramsPsNamedFooRoute: change /$foo$foo
  • paramsPsNamedFooPrefixRoute: change /prefix{$foo}prefix{$foo}
  • paramsPsNamedFooSuffixRoute: change /{$foo}suffix{$foo}suffix
  • paramsPsNamedIndexRoute: change / → `` (omit or use appropriate index marker per router spec)
  • paramsPsWildcardRoute: change /wildcardwildcard
  • paramsPsWildcardIndexRoute: change / → `` (omit or use appropriate index marker per router spec)

The wildcard splat routes (paramsPsWildcardSplatRoute, etc.) are already correct with relative paths.

🤖 Prompt for AI Agents
In e2e/solid-router/basic/src/main.tsx around lines 403 to 417, several child
route paths are incorrectly specified as absolute (leading slash) and must be
made relative: remove the leading '/' from paramsPsNamedRoute (`/named` →
`named`), paramsPsNamedFooRoute (`/$foo` → `$foo`), paramsPsNamedFooPrefixRoute
(`/prefix{$foo}` → `prefix{$foo}`), paramsPsNamedFooSuffixRoute (`/{$foo}suffix`
→ `{$foo}suffix`), and change paramsPsNamedIndexRoute from '/' to the router's
index representation (empty path or index marker); likewise change
paramsPsWildcardRoute (`/wildcard` → `wildcard`) and paramsPsWildcardIndexRoute
from '/' to the index representation; leave the wildcard splat child routes
as-is. Ensure all child routes use relative paths per the router spec so the
tree composes correctly.

indexRoute,
])

Expand Down
Loading
Loading