test(solid-router): add params test for basic file based #5642
main fromrefs/pull/5642/head·merged by birkskyum(GitHub profile, opens in a new tab) Summary by CodeRabbit#
Release Notes#
New Features
- Added new parameterized route examples showcasing named and wildcard path parameter patterns
- Expanded navigation demo with links for various parameter combinations
Tests
- Added comprehensive test coverage for parameterized routing variations
- Added Unicode path encoding test coverage
Chores
- Standardized route naming conventions across examples
- 1
View your CI Pipeline Execution ↗ for commit 2cacf82263f5fadca516b300c9a134b2403f92ef
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 4m 32s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 1s View ↗
☁️ Nx Cloud last updated this comment at
2025-10-26 22:42:58UTCMore templates
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5642@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5642@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5642@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5642@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5642@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5642@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5642@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5642@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5642@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5642@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5642@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5642@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5642@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5642@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5642@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5642@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5642@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5642@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5642@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5642@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5642@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5642@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5642@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5642@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5642@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5642@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5642@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5642@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5642@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5642@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5642@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5642@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5642@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5642@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5642commit:
2cacf82Actionable comments posted: 5
🧹 Nitpick comments (5)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx (1)
1-2: Add a blank line after the import statement.ESLint requires a blank line between imports and other code for better readability.
Apply this diff:
import { createFileRoute } from '@tanstack/solid-router' + export const Route = createFileRoute('/params-ps/wildcard/{$}suffix')({e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx (1)
1-2: Combine duplicate imports from the same module.ESLint flags duplicate imports from
@tanstack/solid-router. Consolidate them into a single import statement for better code organization.Apply this diff:
-import { createFileRoute } from '@tanstack/solid-router' -import { redirect } from '@tanstack/solid-router' +import { createFileRoute, redirect } from '@tanstack/solid-router'e2e/solid-router/basic-file-based/tests/params.spec.ts (1)
272-343: Consider consolidating render stability tests.The render stability test (lines 272-343) appears nearly identical to the existing test at lines 59-132. If both tests cover the same behavior, consider consolidating them or clearly documenting what additional aspect the second test verifies for prefix/suffix routes.
e2e/solid-router/basic-file-based/src/routeTree.gen.ts (2)
1338-1351: Minor: trailing-slash/path fields for index entries. declare module maps id ‘…/’ while path/fullPath omit trailing slash. This matches existing pattern (e.g., /params-ps/), so fine. Just flagging for awareness.
266-275: Review comment is accurate; optional refactoring suggestion stands.The structure analysis confirms the review comment's observation. The
params-psroutes (wildcard and named index routes) are mounted directly at/params-ps/wildcard/and/params-ps/named/, whereas theredirectpattern uses explicit container route files ($target.tsx) with index routes nested underneath. The suggestion to add container routes (wildcard.tsxandnamed.tsx) at theparams-pslevel for architectural parity is valid but optional, and the generated code is correctly structured for the current source layout.📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 3a0cfa9477924644207fd4f618be80bac9575092 and 2cacf82263f5fadca516b300c9a134b2403f92ef.
📒 Files selected for processing (17)
e2e/solid-router/basic-file-based/src/routeTree.gen.ts(30 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/posts_.$postId.edit.tsx(1 hunks)e2e/solid-router/basic-file-based/tests/params.spec.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/index.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsxe2e/solid-router/basic-file-based/src/routes/posts_.$postId.edit.tsxe2e/solid-router/basic-file-based/tests/params.spec.tse2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.ts
**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Place file-based routes under src/routes/ directories
Files:
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/index.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsxe2e/solid-router/basic-file-based/src/routes/posts_.$postId.edit.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/index.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsxe2e/solid-router/basic-file-based/src/routes/posts_.$postId.edit.tsxe2e/solid-router/basic-file-based/tests/params.spec.tse2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsxe2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.ts
🧠 Learnings (1)
📚 Learning: 2025-09-22T00:56:49.237Z
Learnt from: nlynzaad PR: TanStack/router#5182 File: e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx:3-5 Timestamp: 2025-09-22T00:56:49.237Z Learning: In TanStack Router, underscores are intentionally stripped from route segments (e.g., `$baz_` becomes `baz` in generated types) but should be preserved in base path segments. This is the correct behavior as of the fix in PR #5182.Applied to files:
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsxe2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx
🧬 Code graph analysis (13)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx (4)
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx (1)
Route(4-8)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx (5)
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx (1)
Route(3-7)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx (4)
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx (1)
Route(4-8)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (3)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (3)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx (3)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx (1)
Route(4-8)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx (4)
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx (1)
Route(3-7)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsx (3)
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx (1)
Route(4-6)
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsx (1)
Route(3-3)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx (4)
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx (1)
Route(3-7)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx (4)
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx (1)
Route(4-8)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx (1)
Route(2-4)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (3)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (3)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx (2)
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsx (1)
Route(3-3)
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/route.tsx (1)
Route(3-5)
🪛 ESLint
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx
[error] 1-1: '@tanstack/solid-router' imported multiple times.
(import/no-duplicates)
[error] 2-2: '@tanstack/solid-router' imported multiple times.
(import/no-duplicates)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
⏰ 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: Test
- GitHub Check: Preview
🔇 Additional comments (26)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
3-3: Path normalization looks correct.The removal of the trailing underscore from the route path aligns with TanStack Router's behavior where underscores are intentionally stripped from route segments. This change is consistent with similar normalizations across the PR.
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx (1)
4-4: Path normalization correctly applied.The updated route path removes the trailing underscore from
$foo, aligning with the framework's normalization behavior. The backward compatibility logic on lines 10-11 appropriately handles both the old and new path formats during the migration.e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
3-3: Path normalization looks correct.The removal of the trailing underscore from the route path aligns with TanStack Router's behavior. This change is consistent with the broader route path normalization effort in this PR.
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
3-3: Path normalization looks correct.The removal of the trailing underscore from the route path maintains consistency with the route path normalization effort across this PR.
e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsx (1)
3-3: Path normalization looks good.The removal of the trailing underscore from the route path aligns with the broader normalization effort across parameterized routes in this PR.
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (1)
3-3: Path normalization looks good.Consistent with the broader effort to remove trailing underscores from route paths.
e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx (1)
1-7: LGTM!The imports are correctly combined and the redirect logic is consistent with related index routes.
e2e/solid-router/basic-file-based/src/routes/posts_.$postId.edit.tsx (1)
4-4: Path normalization looks good.The updated path removes the trailing underscore, aligning with the broader normalization effort. The conditional logic in the file appropriately handles the transition for backward compatibility.
e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx (1)
21-70: LGTM! Well-structured UI additions.The new links for prefix and suffix parameter variants are consistent with existing patterns. Good separation between named and wildcard parameter sections, and test IDs follow the established naming convention.
e2e/solid-router/basic-file-based/tests/params.spec.ts (2)
197-417: Comprehensive test coverage for parameterized routes.The data-driven test approach with
NAMED_PARAMS_PAIRSandWILDCARD_PARAM_PAIRSeffectively covers href interpolation, navigation, and first-load parameter handling for prefix and suffix variants.
419-427: Good coverage for Unicode route handling.The test properly validates non-Latin character rendering and URL encoding for internationalized routes.
e2e/solid-router/basic-file-based/src/routeTree.gen.ts (15)
45-46: LGTM: new params-ps named/wildcard imports are correctly added and used below.Also applies to: 58-63
327-330: Path normalization confirmed for post edit. id/path now '/posts/$postId/edit'. Good.
336-364: LGTM: new wildcard/named variants are wired with consistent ids/paths.
387-390: LGTM: non-nested $foo route id normalized.
599-604: FileRoutesByFullPath additions look consistent. New params-ps named/wildcard mappings and normalized non-nested entries align with route constants.Also applies to: 615-616, 620-626
677-681: FileRoutesByTo updated appropriately. Routes resolve to the new constants; no issues spotted.Also applies to: 693-694, 698-704
853-858: FileRouteTypes: union types extended correctly. Full path and “to” unions reflect new route surface. Looks good.Also applies to: 869-871, 874-881, 931-936, 947-949, 952-959
1091-1103: RootRouteChildren includes new index and variant routes. Wiring is complete and consistent.Also applies to: 1101-1103
1415-1421: LGTM: /posts/$postId/edit mapping in declaration block.
1429-1463: LGTM: declared params-ps named/wildcard leaf routes. preLoaderRoute and parentRoute are consistent.
1492-1498: LGTM: non-nested and params-ps/non-nested mappings updated. Paths/parents align with earlier constants.Also applies to: 1604-1610, 1618-1624, 1632-1638, 1646-1652, 1660-1666
2067-2076: Root route registry exports for new routes look correct. No gaps detected.Also applies to: 2081-2083
85-92: All imported files with trailing underscores exist as intended.Verification confirms all eight imports in the code snippet reference existing files in the routes directory. The trailing underscores (e.g.,
$baz_.bar.tsx,baz_.bar.tsx,{$baz}suffix_.bar.tsx) are intentional test fixtures for validating the router generator's handling of various file naming patterns.
558-643: Test coverage is complete for all new routes.The params.spec.ts file includes comprehensive testing for all routes mentioned:
/params-ps/wildcard/$,/params-ps/wildcard/prefix{$},/params-ps/wildcard/{$}suffixare tested via WILDCARD_PARAM_PAIRS with concrete values (foo, prefixfoo, foosuffix)/params-ps/named/prefix{$foo},/params-ps/named/{$foo}suffixare tested via NAMED_PARAMS_PAIRS with matching variants/params-ps/non-nested/$foo/$baris tested with foo/bar and foo2/bar2 parameter values
Tests validate link interpolation, navigation success, pathname accuracy, and parameter object correctness.
485-503: Remove concern about route shadowing; routes with identical paths but different parents are distinct.Verification confirms the duplicate route IDs (e.g., multiple
/fooentries) are intentional test matrix coverage. Each route's identity is determined by its path within the routing tree and its position (parent/child). The/fooroutes found at lines 481, 493, 504, and 514 each have different parent routes, making them distinct routes in the tree—not shadowing conflicts. This is correct behavior for testing route paths across different parent contexts.Likely an incorrect or invalid review comment.
e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx lines 1 to 2@@ -0,0 +1,2 @@1+import { createFileRoute } from '@tanstack/solid-router'2+export const Route = createFileRoute('/params-ps/named/{$foo}suffix')({⚠️ Potential issue | 🟡 Minor
Add blank line after import statement.
The import statement should be followed by a blank line per project conventions.
Apply this diff:
import { createFileRoute } from '@tanstack/solid-router' + export const Route = createFileRoute('/params-ps/named/{$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.
import { createFileRoute } from '@tanstack/solid-router' export const Route = createFileRoute('/params-ps/named/{$foo}suffix')({🧰 Tools
🪛 ESLint
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx around lines 1 to 2, the import statement is not followed by a blank line as required by project conventions; insert a single blank line immediately after the import statement so the file begins with the import, one empty line, then the export/createFileRoute call.e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx lines 1 to 2@@ -0,0 +1,2 @@1+import { createFileRoute } from '@tanstack/solid-router'2+export const Route = createFileRoute('/params-ps/named/prefix{$foo}')({⚠️ Potential issue | 🟡 Minor
Add blank line after import statement.
The import statement should be followed by a blank line per project conventions.
Apply this diff:
import { createFileRoute } from '@tanstack/solid-router' + export const Route = createFileRoute('/params-ps/named/prefix{$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.
import { createFileRoute } from '@tanstack/solid-router' export const Route = createFileRoute('/params-ps/named/prefix{$foo}')({🧰 Tools
🪛 ESLint
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx lines 1-2, add a blank line after the import statement; modify the file so the import line is followed by an empty line before the export statement to match project conventions.e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx lines 1 to 2@@ -0,0 +1,2 @@1+import { createFileRoute } from '@tanstack/solid-router'2+export const Route = createFileRoute('/params-ps/wildcard/$')({⚠️ Potential issue | 🟡 Minor
Add blank line after import statement.
The import statement should be followed by a blank line per project conventions.
Apply this diff:
import { createFileRoute } from '@tanstack/solid-router' + export const Route = createFileRoute('/params-ps/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.
import { createFileRoute } from '@tanstack/solid-router' export const Route = createFileRoute('/params-ps/wildcard/$')({🧰 Tools
🪛 ESLint
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx around lines 1 to 2, the import statement is not followed by a blank line per project conventions; insert a single blank line immediately after the import statement so there is an empty line between the import and the subsequent export/createFileRoute call.e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx lines 1 to 2@@ -0,0 +1,2 @@1+import { createFileRoute } from '@tanstack/solid-router'2+export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({⚠️ Potential issue | 🟡 Minor
Add blank line after import statement.
The import statement should be followed by a blank line per project conventions.
Apply this diff:
import { createFileRoute } from '@tanstack/solid-router' + export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({📝 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.
import { createFileRoute } from '@tanstack/solid-router' export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({🧰 Tools
🪛 ESLint
[error] 1-1: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx around lines 1 to 2, the import statement is not followed by a blank line as required by project conventions; insert a single blank line immediately after the import statement so there is an empty line between the import and the following export/createFileRoute call.e2e/solid-router/basic-file-based/src/routeTree.gen.ts line 761@@ -698,4 +758,4 @@698758 '/non-nested/prefix/prefix{$baz}': typeof NonNestedPrefixPrefixChar123bazChar125RouteRouteWithChildren699759 '/non-nested/suffix/{$baz}suffix': typeof NonNestedSuffixChar123bazChar125suffixRouteRouteWithChildren700760 '/params-ps/named/$foo': typeof ParamsPsNamedFooRouteRouteWithChildren701- '/params-ps/non-nested/$foo_': typeof ParamsPsNonNestedFooRouteRouteWithChildren761+ '/params-ps/non-nested/$foo': typeof ParamsPsNonNestedFooRouteRouteWithChildren⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
FileRoutesById: ids normalized and new entries added. Entries for named/wildcard and post edit look correct. Ensure no duplicate ids remain after normalization.
Also applies to: 766-770, 772-772, 782-784, 786-786, 789-789, 791-791, 793-793, 795-795
🏁 Script executed:
#!/bin/bash # Detect duplicate keys within FileRoutesById export block rg -nP "^\s*'/.*': typeof" e2e/solid-router/basic-file-based/src/routeTree.gen.ts \ | sed -E "s/.*'(.+)'.*/\1/" | sort | uniq -dLength of output: 1868
FileRoutesById contains duplicate route IDs—fix required.
Verification found 82 duplicate route identifiers in FileRoutesById (lines 761+). Duplicate keys in object literals cause only the last value to persist, breaking route resolution. Remove or consolidate duplicates to ensure each route ID is unique.
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routeTree.gen.ts around line 761, FileRoutesById contains duplicate route ID keys (82 duplicates starting at this region) which causes later entries to overwrite earlier ones; locate the duplicate object keys inside the FileRoutesById literal, remove or consolidate duplicate entries so every route ID is unique (either merge route metadata/children from duplicates into a single entry or remove the unintended duplicates), and if duplicates originate from your route generator fix the generator to produce unique IDs (e.g., include path or parent context) so the emitted FileRoutesById no longer contains repeated keys.birkskyum(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Walkthrough#
This PR normalizes parameterized route paths in the Solid Router e2e test suite by removing trailing underscores and introduces new wildcard and named parameter route variants under
/params-ps. Updates include modified route definitions, a regenerated route tree with expanded mappings, and additional e2e tests.Changes#
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx,e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx,e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx,e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/$bar.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/non-nested/$foo_/route.tsx,e2e/solid-router/basic-file-based/src/routes/posts_.$postId.edit.tsxcreateFileRoute()calls (e.g.,/params-ps/non-nested/$foo_→/params-ps/non-nested/$foo,/posts_/$postId/edit→/posts/$postId/edit).e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/{$}suffix.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/index.tsx/params-ps/wildcard/with various path shapes (bare wildcard, prefix, suffix). Index route redirects to parent.e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx,e2e/solid-router/basic-file-based/src/routes/params-ps/named/index.tsx/params-ps/named/with prefix and suffix path shapes. Index route redirects to parent.e2e/solid-router/basic-file-based/src/routeTree.gen.tsFileRoutesByFullPath,FileRoutesByTo,FileRoutesByIdmappings, and public type exports for all new and renamed routes includingParamsPsWildcardIndexRoute,ParamsPsNamedIndexRoute, and related variants.e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsxe2e/solid-router/basic-file-based/tests/params.spec.tsSequence Diagram(s)#
Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~25 minutes
Areas requiring extra attention:
FileRoutesByFullPath,FileRoutesByTo,FileRoutesById), and module augmentation. Verify consistency between route IDs, paths, and fullPath fields across all new/renamed entries.ParamsPsNamedIndexRoute,ParamsPsWildcardIndexRoute, and variants) are properly wired in public interfaces andRootRouteChildren.Possibly related PRs#
__root__when stripping underscores.params-psnamed/wildcard file-based route files.routeTree.gen.tsby adding new route constants and updatingFileRoutesmappings/types, mirroring the route tree changes in this PR.Suggested labels#
package: solid-routerSuggested reviewers#
Poem#
Pre-merge checks and finishing touches#
❌ Failed checks (1 warning)
@coderabbitai generate docstringsto improve docstring coverage.✅ Passed checks (2 passed)
e2e/solid-router/basic-file-based/tests/params.spec.tscontaining test suites for named and wildcard parameters. While the title focuses on the testing aspect, the supporting implementation changes—including new route files for different parameter patterns (prefix, suffix, wildcard variants) and path normalization updates—are integral to enabling these tests and align with the overall objective of working on basic file-based routing.✨ Finishing touches
🧪 Generate unit tests (beta)
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