Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Oct 25, 2025

Summary by CodeRabbit

  • New Features
    • Added a Unicode route/page at "/대한민국" that displays Hello "/대한민국"!.
    • Added a new params demo section with pages demonstrating named and wildcard parameter routes and sample navigation.
  • Tests
    • Added end-to-end tests for parameter interpolation, navigation, and initial rendering for named and wildcard params.
    • Added end-to-end tests validating Unicode route handling and proper URL encoding for non-Latin paths.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2025

Walkthrough

Adds E2E Playwright tests for named and wildcard route parameters and a Unicode route, plus new route files and generated route-tree entries registering the Unicode path "/대한민국" in two e2e fixtures.

Changes

Cohort / File(s) Summary
Solid Router E2E tests
e2e/solid-router/basic/tests/params.spec.ts
New Playwright suite validating named and wildcard (splat) param interpolation, link hrefs, navigation, and initial-rendered params JSON across parameterized cases.
Solid Start E2E tests (Unicode path)
e2e/solid-start/basic/tests/params.spec.ts
New Playwright test visiting /대한민국, asserting rendered text and that the URL is percent-encoded as expected.
Generated route trees (file-based & solid-start)
e2e/solid-router/basic-file-based/src/routeTree.gen.ts, e2e/solid-start/basic/src/routeTree.gen.ts
Generated additions registering a new import/constant for /대한민국, updating FileRoutesByFullPath/FileRoutesByTo/FileRoutesById unions, RootRouteChildren, module augmentation and wiring the route into the root children map.
Route component files (new routes)
e2e/solid-router/basic-file-based/src/routes/대한민국.tsx, e2e/solid-start/basic/src/routes/대한민국.tsx
New route files exporting a Route via createFileRoute('/대한민국') and a RouteComponent rendering Hello "/대한민국"!.
Router params subtree
e2e/solid-router/basic/src/main.tsx
Adds a params-ps subtree with named and wildcard routes, index pages, redirects (using redirect), and components using useParams to render params and params-output.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant T as Playwright Test
  participant B as Browser
  participant A as App/Router
  rect rgb(230,247,255)
    T->>B: navigate to /params-ps or /대한민국
  end
  B->>A: request route
  A->>A: resolve route (named/splat params or Unicode path)
  alt params tests
    A->>B: render listing, links, and `params-output`
    T->>B: click link or visit href
    B->>A: route transition -> update URL and render destination
    A->>B: update DOM with params JSON and heading
    T->>B: assert pathname, heading visible, params JSON
  else unicode test
    A->>B: render Hello "/대한민국"!
    T->>B: assert body text and percent-encoded URL
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Heterogeneous edits: new E2E tests, new route files, generated route-tree updates, and params subtree wiring.
  • Pay special attention to:
    • Generated routeTree identifiers and Unicode encoding for /대한민국.
    • Param shape expectations in tests (named vs _splat/* mappings).
    • Redirects and beforeLoad behavior added in the params subtree.

Possibly related PRs

Suggested labels

package: solid-router

Suggested reviewers

  • schiller-manuel
  • Sheraff
  • nlynzaad

Poem

🐰
I hopped through paths both near and far,
Named params, splats, and Unicode star,
Links clicked true, URLs aligned,
Params printed neat and kind,
A rabbit cheers: hooray for every route we find!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "test(solid): add params.spec.ts to start/router" directly corresponds to the addition of two new test files: e2e/solid-router/basic/tests/params.spec.ts and e2e/solid-start/basic/tests/params.spec.ts. The title accurately identifies these test files as the primary focus. However, the changeset also includes substantial supporting implementation work, including a comprehensive params route subtree in e2e/solid-router/basic/src/main.tsx (estimated HIGH code review effort) and Unicode route support files. While the supporting code is necessary infrastructure for the tests, the title focuses narrowly on the test file additions and does not reflect the significant route structure implementation work also included in this PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test(solid)--add-params.spec.ts-to-start/router

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Oct 25, 2025

View your CI Pipeline Execution ↗ for commit 3459ec0

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 53s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-25 19:59:43 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 25, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5617

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5617

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5617

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5617

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5617

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5617

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5617

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5617

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5617

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5617

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5617

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5617

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5617

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5617

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5617

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5617

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5617

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5617

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5617

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5617

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5617

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5617

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5617

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5617

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5617

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5617

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5617

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5617

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5617

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5617

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5617

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5617

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5617

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5617

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5617

commit: 3459ec0

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
e2e/solid-start/basic/tests/params.spec.ts (1)

5-7: Consider removing the redundant beforeEach navigation.

Since the test immediately navigates to /대한민국, the initial navigation to / in beforeEach adds no value and slightly increases test execution time.

Apply this diff to streamline the test:

-test.beforeEach(async ({ page }) => {
-  await page.goto('/')
-})
-
 test.use({
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4a544f and a69214e.

📒 Files selected for processing (2)
  • e2e/solid-router/basic/tests/params.spec.ts (1 hunks)
  • e2e/solid-start/basic/tests/params.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • e2e/solid-start/basic/tests/params.spec.ts
  • e2e/solid-router/basic/tests/params.spec.ts
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/solid-start/basic/tests/params.spec.ts
  • e2e/solid-router/basic/tests/params.spec.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: FatahChan
PR: TanStack/router#5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
🧬 Code graph analysis (1)
e2e/solid-router/basic/tests/params.spec.ts (1)
e2e/solid-router/basic-file-based/tests/params.spec.ts (3)
  • test (134-195)
  • page (59-132)
  • page (139-194)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (8)
e2e/solid-start/basic/tests/params.spec.ts (2)

1-3: LGTM!

The imports are appropriate for e2e testing with Playwright and TanStack Router utilities.


14-22: LGTM!

The test properly validates both Unicode route rendering and URL percent-encoding. The assertions correctly verify the page content displays the Unicode characters while the URL uses the percent-encoded form.

e2e/solid-router/basic/tests/params.spec.ts (6)

1-2: Verify the test import is correct.

The solid-start test file imports test from @tanstack/router-e2e-utils, while this file imports directly from @playwright/test. Ensure this difference is intentional, as the custom test utility may provide additional features like error whitelisting or baseURL fixtures that could be beneficial here.

If the custom test utility should be used, apply this diff:

-import { expect, test } from '@playwright/test'
+import { expect } from '@playwright/test'
+
+import { test } from '@tanstack/router-e2e-utils'

3-6: LGTM!

The test suite setup is appropriate. The beforeEach navigation to /params-ps provides a consistent starting point for all nested tests.


8-34: LGTM!

Excellent use of TypeScript's satisfies operator for type-safe test data. The parameterized test cases provide good coverage for named parameter scenarios including prefix and suffix variations.


36-76: LGTM!

The named params tests are well-structured with proper parameterization. The tests comprehensively cover link interpolation, navigation, and initial load scenarios with appropriate assertions.


79-105: LGTM!

The wildcard parameter test data follows the same well-structured pattern as the named params. The inclusion of both '*' and '_splat' keys correctly models the expected wildcard parameter behavior.


107-148: LGTM!

The wildcard parameter tests maintain excellent structural consistency with the named params tests, making the test suite easy to maintain and understand.

@birkskyum birkskyum merged commit 3ce120b into main Oct 25, 2025
5 of 6 checks passed
@birkskyum birkskyum deleted the test(solid)--add-params.spec.ts-to-start/router branch October 25, 2025 20:01
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8e2a6a and 3459ec0.

📒 Files selected for processing (1)
  • e2e/solid-router/basic/src/main.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • e2e/solid-router/basic/src/main.tsx
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/solid-router/basic/src/main.tsx
🧬 Code graph analysis (1)
e2e/solid-router/basic/src/main.tsx (1)
packages/solid-router/src/index.tsx (3)
  • createRoute (263-263)
  • Link (229-229)
  • redirect (257-257)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (8)
e2e/solid-router/basic/src/main.tsx (8)

11-12: Importing redirect is correct and necessary for beforeLoad redirects.


211-214: Good: params-ps parent route anchor.
Path '/params-ps' as the parent is fine. Children must be relative to nest correctly.


216-286: Params index looks good and matches the test intents.
Links and testids are clear; JSON output target is consistent.


293-299: Redirect-on-index is fine.
Throwing redirect to '/params-ps' is correct here.


348-354: Redirect-on-index for wildcard is correct.


356-368: Wildcard splat route is correct and relative.
Path '$' and params usage via useParams() look good.


370-382: Wildcard prefix variant is correct.
Relative path and rendering look good.


384-396: Wildcard suffix variant is correct.
Relative path and testid output are consistent.

Comment on lines +288 to +292
const paramsPsNamedRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/named',
})

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.

Comment on lines +301 to +313
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>
)
},
})
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.

Comment on lines +315 to +327
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>
)
},
})
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.

Comment on lines +329 to +341
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>
)
},
})
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.

Comment on lines +343 to +346
const paramsPsWildcardRoute = createRoute({
getParentRoute: () => paramsPsRoute,
path: '/wildcard',
})
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.

Comment on lines +403 to +417
paramsPsRoute.addChildren([
paramsPsNamedRoute.addChildren([
paramsPsNamedFooPrefixRoute,
paramsPsNamedFooSuffixRoute,
paramsPsNamedFooRoute,
paramsPsNamedIndexRoute,
]),
paramsPsWildcardRoute.addChildren([
paramsPsWildcardSplatRoute,
paramsPsWildcardSplatPrefixRoute,
paramsPsWildcardSplatSuffixRoute,
paramsPsWildcardIndexRoute,
]),
paramsPsIndexRoute,
]),
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants