-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
test(solid): add params.spec.ts to start/router #5617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Absolute path makes this route root-level (/ $foo) and conflicts. - path: '/$foo',
+ path: '$foo',📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two fixes: absolute path and component name typo.
- path: '/prefix{$foo}',
- component: function ParamsNamedFooMarkdown() {
+ path: 'prefix{$foo}',
+ component: function ParamsNamedFooPrefix() {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Absolute path; should be relative to /params-ps/named. - path: '/{$foo}suffix',
+ path: '{$foo}suffix',📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const paramsPsWildcardRoute = createRoute({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getParentRoute: () => paramsPsRoute, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: '/wildcard', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+343
to
+346
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Absolute child path prevents /params-ps/wildcard nesting. - path: '/wildcard',
+ path: 'wildcard',📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainRoute tree wiring looks right; re-verify after path fixes. 🏁 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*\"\/' -C2Length of output: 0 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 -100Length 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:
The wildcard splat routes ( 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| indexRoute, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Absolute child path breaks nesting under /params-ps.
Use a relative path so final URL is /params-ps/named, not /named.
Apply:
📝 Committable suggestion
🤖 Prompt for AI Agents