fix(router-core): Non nested paths - only strip trailing underscore on route segments #5182
main fromrefs/pull/5182/head·merged by nlynzaad(GitHub profile, opens in a new tab) as part of #5169 we made changes to strip underscores from the paths to ensure it is dealt with correctly during parsing.
inadvertently this stripped it from not only the route segments but also the base segments. This PR resolves that issue by making baseParsePathName aware which type of segments it is parsing.
a new optional boolean paramater, basePathValues, is introduced in baseParsePathName and parsePathname to allow this distinction between routeSegments and/or basesegments to be passed on to baseParsePathName.
2 new functions are introduced parseBasePathSegments and parseRoutePathSegments, which is just wrapper functions around parsePathname, but ensures clearer understanding of what set of parsing instructions is applied and basePathValues is set correctly based on the requirement.
updated the unit tests to take into account the need not to strip the base values and also enhanced the e2e tests as well to ensure more through testing with different usages.
Summary by CodeRabbit#
- New Features
- Added non-nested route demos (named, prefix, suffix, path) with index/foo/bar pages and updated navigation in React and Solid examples.
- Bug Fixes
- Improved path parsing/matching to handle non-nested segments, prefixes/suffixes and trailing underscores; refined route sorting/resolution.
- Tests
- Added comprehensive E2E coverage for non-nested paths; removed obsolete baz-based tests.
- Expanded unit tests for path interpolation and matching (underscore, prefix/suffix cases).
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core
View your CI Pipeline Execution ↗ for commit 5aa2f1d3bbe20760b3b2b948627e04a035051231
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 2m 22s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 2s View ↗
☁️ Nx Cloud last updated this comment at
2025-09-22 01:10:20UTCMore templates
- 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-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-react-query
- tanstack-start-example-basic-rsc
- tanstack-start-example-basic-static
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-example-large
- tanstack-start-example-material-ui
- 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-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-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-static
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5182@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5182@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5182@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5182@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5182@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5182@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5182@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5182@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5182@tanstack/react-start-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@5182@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5182@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5182@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5182@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5182@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5182@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5182@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5182@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5182@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5182@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5182@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5182@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5182@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5182@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5182@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5182@tanstack/solid-start-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@5182@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5182@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5182@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5182@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5182@tanstack/start-server-functions-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@5182@tanstack/start-server-functions-fetcher
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@5182@tanstack/start-server-functions-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@5182@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5182@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5182@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5182@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5182commit:
5aa2f1dnlynzaad(GitHub profile, opens in a new tab) changed the title
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx (1)
1-21: Replace lingering "nested" headings with "non-nested" Update the visible headings to "Hello non-nested suffix index" and "Hello non-nested suffix foo page" in:- e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx:12
- e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx:13
- e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx:12
- e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx:13
packages/router-core/src/path.ts (3)
589-596: Pre-check for basepath ignores caseSensitive=false.This can incorrectly return undefined when basepath differs only by case. Make the check case-aware or remove it and rely on removeBasepath.
- if (basepath !== '/' && !from.startsWith(basepath)) { + if ( + basepath !== '/' && + (caseSensitive + ? !from.startsWith(basepath) + : !from.toLowerCase().startsWith(basepath.toLowerCase())) + ) { return undefined }
463-468: Wrong key used when leaveParams=true (named params).encodeParam expects the param key (e.g., 'id'), but segment.value includes the '$' prefix. This yields undefined interpolation.
- if (leaveParams) { - const value = encodeParam(segment.value) + if (leaveParams) { + const value = encodeParam(key) return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}` }
491-499: Same bug for optional params with leaveParams=true.Use the decoded key.
- if (leaveParams) { - const value = encodeParam(segment.value) + if (leaveParams) { + const value = encodeParam(key) return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}` }🧹 Nitpick comments (32)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
11-16: Verify test-id naming vs. path semantics (baz vs. baz_).Data-testids omit the underscore (
bazinstead ofbaz_). If test selectors or docs rely on reflecting the exact path semantics, consider aligning the id or confirm tests intentionally normalize it.e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx (1)
14-14: Wrap links in a nav for basic a11y semantics. Use a with an aria-label around the link block.- <div> + <nav aria-label="Non-nested suffix links"> @@ - </div> + </nav>Also applies to: 54-54
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx (1)
11-13: Fix copy: “nested” vs “non‑nested”. Heading says “nested” but this route family is “non‑nested”.- Hello nested suffix index + Hello non-nested suffix indexe2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx (1)
12-16: Fix copy: “nested” vs “non‑nested”. Align with the rest of the non‑nested suffix routes.- Hello nested suffix foo page + Hello non-nested suffix foo pagee2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
13-13: Use a nav landmark for the links block. Improves semantics; no behavior change.- <div> + <nav aria-label="Non-nested path links"> @@ - </div> + </nav>Also applies to: 29-29
e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
13-13: Mirror the React a11y nav wrapper here too.- <div> + <nav aria-label="Non-nested path links"> @@ - </div> + </nav>Also applies to: 29-29
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
11-12: Inconsistent heading text.The heading shows "Hello nested path baz index" but this is a non-nested route. The text should be consistent with the route type.
Apply this diff to fix the heading text:
- Hello nested path baz index + Hello non-nested path baz indexe2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
12-13: Inconsistent heading text.Similar to the index route, the heading shows "Hello nested path baz foo page" but this is a non-nested route.
Apply this diff to fix the heading text:
- Hello nested path baz foo page + Hello non-nested path baz foo pagee2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
10-12: Use a semantic heading element for the layout titlePrefer an h* tag over a div for better semantics and a11y.
Apply:
- <div data-testid="non-nested-path-baz-route-heading"> - Hello non-nested path baz route layout - </div> + <h3 data-testid="non-nested-path-baz-route-heading"> + Hello non-nested path baz route layout + </h3>e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
12-14: Microcopy: “nested” → “non-nested”The page text conflicts with the route family name and other files.
Apply:
- <div data-testid="non-nested-named-baz-foo-heading"> - Hello nested named baz foo page - </div> + <div data-testid="non-nested-named-baz-foo-heading"> + Hello non-nested named baz foo page + </div>e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
16-17: Consistency: make relative “to” paths explicit with./(optional)Not required functionally, but matches the React examples and improves readability.
Apply:
- to="prefix{$baz}" + to="./prefix{$baz}" - to="prefix{$baz}/foo" + to="./prefix{$baz}/foo" - to="prefix{$baz}/foo" + to="./prefix{$baz}/foo" - to="prefix{$baz}/bar" + to="./prefix{$baz}/bar" - to="prefix{$baz}/bar" + to="./prefix{$baz}/bar"Also applies to: 24-25, 32-33, 40-41, 48-49
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
11-13: Microcopy: “nested” → “non-nested”Align heading text with the non-nested route family.
Apply:
- <div data-testid="non-nested-prefix-baz-index-heading"> - Hello nested prefix index - </div> + <div data-testid="non-nested-prefix-baz-index-heading"> + Hello non-nested prefix index + </div>e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
14-53: Reduce duplication in Link blocks (optional)You can map over a small config array to avoid repeating nearly identical Link elements.
Example:
const links = [ { to: "./$baz", testId: "to-named-index" }, { to: "./$baz/foo", testId: "to-named-foo" }, { to: "./$baz/foo", testId: "to-named-foo-2", params: { baz: "baz_" } }, { to: "./$baz/bar", testId: "to-named-bar" }, { to: "./$baz/bar", testId: "to-named-bar-2", params: { baz: "baz_" } }, ]e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx (1)
11-13: Microcopy: “nested” → “non-nested”Match the rest of the non-nested suite.
Apply:
- <div data-testid="non-nested-suffix-baz-index-heading"> - Hello nested suffix index - </div> + <div data-testid="non-nested-suffix-baz-index-heading"> + Hello non-nested suffix index + </div>e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
11-13: Adjust copy to avoid confusion with "non-nested" contextUse “non-nested” in the heading to match the route group’s intent.
- Hello nested prefix index + Hello non-nested prefix indexe2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
12-14: Nit: align heading with "non-nested" terminologySmall copy tweak for consistency across the suite.
- Hello nested path baz foo page + Hello non-nested path baz foo pagee2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
11-13: Nit: align heading with "non-nested" terminologyKeep naming consistent with folder/route purpose.
- Hello nested named baz index + Hello non-nested named baz indexe2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
12-14: Nit: align heading with "non-nested" terminologyMinor copy update.
- Hello nested prefix foo page + Hello non-nested prefix foo pagee2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
11-13: Nit: align heading with "non-nested" terminologyMinor copy consistency.
- Hello nested path baz index + Hello non-nested path baz indexe2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts (4)
107-107: Remove noisy console logThis adds noise to CI logs without aiding assertions.
- console.log(await indexLink.getAttribute('href'))
108-110: Make href assertions tolerant to optional trailing slashPrevents flakiness if link generation normalizes slashes.
- await expect(indexLink).toHaveAttribute('href', indexPath) - await expect(fooLink).toHaveAttribute('href', fooPath) - await expect(foo2Link).toHaveAttribute('href', foo2Path) + await expect(indexLink).toHaveAttribute('href', new RegExp(`^${indexPath}/?$`)) + await expect(fooLink).toHaveAttribute('href', new RegExp(`^${fooPath}/?$`)) + await expect(foo2Link).toHaveAttribute('href', new RegExp(`^${foo2Path}/?$`))
113-114: Wait for URL using regex to handle optional trailing slashReduces brittleness across environments or future router changes.
- await page.waitForURL(indexPath) + await page.waitForURL(new RegExp(`^${indexPath}/?$`)) - await page.waitForURL(fooPath) + await page.waitForURL(new RegExp(`^${fooPath}/?$`)) - await page.waitForURL(foo2Path) + await page.waitForURL(new RegExp(`^${foo2Path}/?$`)) - await page.waitForURL(barPath) + await page.waitForURL(new RegExp(`^${barPath}/?$`)) - await page.waitForURL(bar2Path) + await page.waitForURL(new RegExp(`^${bar2Path}/?$`))Also applies to: 121-122, 129-130, 174-175, 182-183
176-176: Prefer absence checks over visibility for non-nested assertionUse count=0 to assert the element isn’t rendered at all (stronger than not visible).
- await expect(pathRouteHeading).not.toBeVisible() + await expect(pathRouteHeading).toHaveCount(0)Also applies to: 184-184
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
11-13: Heading copy looks inconsistent with route shape.This route tests a prefix param, not a wildcard. Consider tightening the copy to avoid confusion in e2e assertions and future readers.
Apply this diff:
- Hello non-nested wildcard bar + Hello non-nested prefix bare2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx (1)
12-14: Minor copy nit: “nested” vs “non-nested”.This lives under non-nested tests; align the heading.
- Hello nested suffix foo page + Hello non-nested suffix foo pagepackages/router-core/tests/path.test.ts (2)
1167-1383: Consider adding a regression test for parse cache base-vs-route semantics.Current cache keying in src/path.ts ignores the basePathValues flag (see separate comment). A focused test will catch regressions.
+import { parseBasePathSegments, parseRoutePathSegments } from '../src/path' + +describe('parsePathname cache behavior', () => { + it('distinguishes base vs route parsing for the same pathname', () => { + // Shared cache simulates production usage + const cache = new Map() as unknown as import('../src/path').ParsePathnameCache + const routeParsed = parseRoutePathSegments('/a_', cache) + expect(routeParsed.at(-1)?.value).toBe('a') // underscore trimmed for route + const baseParsed = parseBasePathSegments('/a_', cache) + expect(baseParsed.at(-1)?.value).toBe('a_') // must NOT be trimmed for base + }) +})
586-866: Add a basepath case-insensitive match test.matchByPath has a pre-check that currently ignores caseSensitive=false. Add a test to prevent regressions after the fix in src/path.ts.
+describe('matchPathname basepath case-insensitive', () => { + it('matches when basepath differs only by case', () => { + expect(matchPathname('/App', '/app/abc', { to: '/abc', caseSensitive: false })).toStrictEqual({}) + }) +})e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
11-13: Minor copy nit: “nested” vs “non-nested”.Align heading with the non-nested route family.
- Hello nested named baz index + Hello non-nested named baz indexe2e/solid-router/basic-file-based/tests/non-nested-paths.spec.ts (1)
107-107: Remove leftover debug logging.Console noise slows CI and obscures failures.
- console.log(await indexLink.getAttribute('href'))packages/router-core/src/path.ts (3)
365-371: Trailing-slash branch mutates the wrong slice (likely a no-op/bug).substring(1) removes a leading char, not the trailing slash. Since pathname isn’t used after this, drop the mutation for clarity.
- if (pathname.slice(-1) === '/') { - pathname = pathname.substring(1) + if (pathname.slice(-1) === '/') { segments.push({ type: SEGMENT_TYPE_PATHNAME, value: '/', }) }
283-286: Comment accuracy/wording.“strip tailing underscore for non-nested paths” is misleading and has a typo. It’s about route segments when basePathValues=false.
- // strip tailing underscore for non-nested paths + // strip trailing underscore for route segments (non-nested shorthand)
651-662: Micro-cleanup: avoid property existence checks on optional props.in-operator is always true for optional keys; gate on actual prefix/suffix values.
- if ('prefixSegment' in routeSegment) { - if (!baseValue.startsWith(prefix)) { - return false - } - } - if ('suffixSegment' in routeSegment) { - if ( - !baseSegments[baseSegments.length - 1]?.value.endsWith(suffix) - ) { - return false - } - } + if (prefix && !baseValue.startsWith(prefix)) return false + if (suffix && !baseSegments[baseSegments.length - 1]?.value.endsWith(suffix)) return false📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 0d00f2862a6bab68e012fdd0eadd2cef4812644d and 91705d67c5fc78f51469a6171a9705307de202d0.
📒 Files selected for processing (58)
e2e/react-router/basic-file-based/src/routeTree.gen.ts(25 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx(0 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/baz.tsx(0 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx(0 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx(1 hunks)e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx(1 hunks)e2e/react-router/basic-file-based/tests/app.spec.ts(0 hunks)e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts(1 hunks)e2e/solid-router/basic-file-based/src/routeTree.gen.ts(25 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx(0 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/baz.tsx(0 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx(0 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx(1 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/named/route.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.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/path/route.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.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/prefix/route.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/route.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx(1 hunks)e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.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/tests/app.spec.ts(0 hunks)e2e/solid-router/basic-file-based/tests/non-nested-paths.spec.ts(1 hunks)packages/router-core/src/path.ts(6 hunks)packages/router-core/src/process-route-tree.ts(2 hunks)packages/router-core/tests/match-by-path.test.ts(4 hunks)packages/router-core/tests/path.test.ts(4 hunks)
💤 Files with no reviewable changes (8)
- e2e/solid-router/basic-file-based/tests/app.spec.ts
- e2e/react-router/basic-file-based/tests/app.spec.ts
- e2e/react-router/basic-file-based/src/routes/non-nested/baz.tsx
- e2e/react-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx
- e2e/solid-router/basic-file-based/src/routes/non-nested/baz.tsx
- e2e/solid-router/basic-file-based/src/routes/non-nested/baz.$bazid.tsx
- e2e/react-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx
- e2e/solid-router/basic-file-based/src/routes/non-nested/baz_.$bazid.edit.tsx
🧰 Additional context used
🧬 Code graph analysis (40)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (3)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.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/prefix/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
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 (5)
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}.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx (1)
e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx (1)
e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (3)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/react-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.route.tsx (3)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.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/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.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/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.foo.tsx (2)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
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/named/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.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}.index.tsx (5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.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/prefix/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
packages/router-core/src/process-route-tree.ts (1)
packages/router-core/src/path.ts (1)
parseRoutePathSegments(215-218)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.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/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx (3)
e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
e2e/react-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 (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
Route(3-5)
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/named/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/route.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/non-nested/path/baz.foo.tsx (4)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz.route.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/path/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.index.tsx (1)
Route(3-5)
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/named/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (4)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
Route(3-5)
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.index.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.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/prefix/route.tsx (1)
Route(3-5)
e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (1)
Route(3-5)
⏰ 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 (50)
e2e/solid-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (2)
3-5: Route path correctly preserves base underscore (matches PR intent).Using
/non-nested/path/baz_/barensures the base segment’s underscore is preserved, aligning with the “don’t strip underscores from base segments” fix.Please confirm there’s an e2e that navigates to
/non-nested/path/baz_/barand asserts both the heading and params output so this path specifically exercises the new parsing logic.
7-19: Solid params accessor usage is correct.Route.useParams()returns an accessor; callingparams()beforeJSON.stringifyis the right pattern.e2e/react-router/basic-file-based/src/routes/non-nested/path/baz_.bar.tsx (1)
3-5: LGTM: route wiring and params rendering look correct. Matches the non‑nested path patterns and test IDs.Also applies to: 7-19
e2e/react-router/basic-file-based/src/routes/non-nested/path/baz.route.tsx (1)
3-5: LGTM: layout route + Outlet are correctly set up. No issues spotted.Also applies to: 7-15
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (1)
3-5: LGTM. Copy and test IDs consistent with non‑nested suffix bar.Also applies to: 7-19
e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
17-27: Confirm duplicate links are needed — no tests reference their test IDs. Search forto-path-(foo|bar)-2in e2e/solid-router returned only:- e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx:20,26 (the duplicate Link elements). No test files reference those testIDs. Remove duplicates, add tests that target them, or confirm the duplicates are intentional.
e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (1)
17-27: Duplicates confirmed — no change required. to-path-foo-2 and to-path-bar-2 appear in both e2e/react-router/basic-file-based/src/routes/non-nested/path/route.tsx (lines 20, 26) and e2e/solid-router/basic-file-based/src/routes/non-nested/path/route.tsx (lines 20, 26).e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx (1)
1-19: Verified — no tests assert the exact heading text. Only the route files contain the literal "Hello nested suffix index": e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx, e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.index.tsx.e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx (1)
1-19: LGTM! Proper non-nested route implementation with underscore handling.The route correctly implements the
/non-nested/named/$baz_/barpath, demonstrating the PR's focus on proper underscore handling in non-nested paths. The component structure follows the established pattern with proper test IDs and parameter display.e2e/solid-router/basic-file-based/src/routes/non-nested/route.tsx (1)
15-26: Navigation structure expanded correctly.The links properly navigate to the new non-nested route variants (named, prefix, suffix, path) that replace the previous baz-centric approach. The use of
Route.fullPathand relative paths is consistent and correct.e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx (1)
1-19: LGTM! Suffix pattern with underscore correctly implemented.The route path
/non-nested/suffix/{$baz}suffix_/barproperly demonstrates the suffix pattern with trailing underscore handling, which is central to this PR's underscore stripping fix.e2e/solid-router/basic-file-based/src/routes/non-nested/named/route.tsx (1)
14-54: Comprehensive test coverage for underscore parameter variants.The links test both regular (
baz: 'baz') and underscore-containing (baz: 'baz_') parameters across different route variants. This directly validates the PR's fix for proper underscore handling in route segments vs. base segments.e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx (1)
14-54: Well-structured prefix route navigation with underscore parameter testing.The component properly demonstrates prefix route patterns with both regular and underscore-containing parameters. The navigation structure validates the PR's core functionality for handling underscores in route segments.
e2e/solid-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
1-16: LGTM! Clean layout route implementation.The route correctly implements the prefix pattern layout with proper test ID and outlet structure for nested routes.
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.route.tsx (1)
3-5: LGTM: route path and layout look correct for prefix param container.- Correct package import and Outlet usage.
- Path string exercises the prefix+param shape used by the underscore fix.
Also applies to: 7-16
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}_.bar.tsx (1)
3-5: LGTM: bar child renders params; good coverage of trailing underscore in base segment.- Using Route.useParams() is correct for React.
- Test ids match the pattern used elsewhere.
Also applies to: 7-19
e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx (1)
3-5: LGTM: suffix container route matches intended{$param}suffixshape.- Import/source are correct; Outlet placed for nested children.
Also applies to: 7-16
e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.foo.tsx (1)
3-5: LGTM: foo child uses typed params and stable test ids.- JSON.stringify(params) is fine for the E2E assertion style used here.
Also applies to: 7-20
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.foo.tsx (1)
1-5: LGTM: Solid version correctly usesparams()accessor.- Path and test ids align with React counterparts.
Also applies to: 7-20
packages/router-core/src/process-route-tree.ts (2)
6-9: Switch toparseRoutePathSegmentshere is correct and aligns with underscore semantics.- Sorting should parse route segments (not base values), so using
parseRoutePathSegmentsonfullPathis appropriate. - Leading-slash stripping loop remains intact; no regressions spotted.
Also applies to: 72-81
1-11: No remaining production parsePathname usages — only tests call parsePathname.Production code has been migrated to parseBasePathSegments / parseRoutePathSegments (e.g., packages/router-core/src/process-route-tree.ts:73 and multiple sites in packages/router-core/src/path.ts); the only direct parsePathname calls are in tests under packages/router-core/tests/* and its internal definition in packages/router-core/src/path.ts.
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix.route.tsx (1)
3-5: LGTM: Solid suffix container mirrors React; good parity across frameworks.Also applies to: 7-16
e2e/solid-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
3-5: LGTM: named param container with Outlet is consistent and correct.Also applies to: 7-16
e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx (1)
15-25: LGTM: clear nav to the four non-nested suites — verifiedConfirmed e2e/react-router/basic-file-based/src/routes/non-nested/route.tsx links target ./named, ./prefix, ./suffix, and ./path and the corresponding child routes exist.
e2e/solid-router/basic-file-based/src/routes/non-nested/suffix/route.tsx (1)
1-58: LGTM: route wiring and linksRoute layout, Link usage with Route.fullPath, params, and Outlet look correct.
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz.route.tsx (1)
3-14: LGTM: route layout and OutletMatches test IDs and expected nesting; no issues.
packages/router-core/tests/path.test.ts (1)
341-356: Great additions covering underscore preservation.New interpolatePath cases with trailing underscores and suffix params look good and align with the PR intent.
Also applies to: 527-532
packages/router-core/tests/match-by-path.test.ts (1)
23-33: LGTM: non-nested coverage is thorough.The added underscore scenarios across default/case-insensitive/fuzzy paths look solid and reflect the intended behavior.
Also applies to: 110-126, 204-218, 219-229, 231-247, 252-266, 332-347, 349-359, 361-379, 381-391
packages/router-core/src/path.ts (1)
164-166: Nice: clear split between base vs route parsing.Using parseBasePathSegments/parseRoutePathSegments here removes ambiguity and fixes the underscore regression.
If you have any external callers using parsePathname directly, confirm they don’t rely on the old underscore-trimming semantics. I can scan the repo with a script if helpful.
e2e/react-router/basic-file-based/src/routeTree.gen.ts (1)
7-11: Generated file — no manual edits.Types and wiring reflect the new non-nested families; looks consistent with source routes.
Also applies to: 574-592
e2e/solid-router/basic-file-based/src/routeTree.gen.ts (20)
41-44: Additions of non-nested route imports look correct and consistent.New imports align with the new route families and referenced files; names match downstream usages.
Also applies to: 63-66, 73-76, 78-85
351-372: Dynamic child routes for named/prefix/path/suffix families — OK.Curly-brace placeholders propagate correctly in ids/paths.
407-428: Index routes for dynamic children — OK.Index child mapping to each dynamic segment is correct.
434-477: Sibling foo/bar routes for each family — OK.“id” keeps file underscore markers; “path”/“fullPath” omit them as intended by the fix.
525-529: FileRoutesByFullPath unions updated completely.New full paths cover base, dynamic, child, and index variants.
Also applies to: 543-547, 566-573, 575-578
600-604: FileRoutesByTo unions mirror navigation targets correctly.Base routes point to WithChildren; dynamic paths map to their index targets.
Also applies to: 636-644, 646-649
674-678: FileRoutesById unions include underscored ids for non-nested markers.Consistent with generator conventions; matches created constants.
Also applies to: 695-699, 718-726, 727-731
756-760: FileRouteTypes.fullPaths union extended correctly.All new public paths are enumerated.
Also applies to: 774-778, 797-805, 806-810
831-835: FileRouteTypes.to union extended correctly.Matches FileRoutesByTo additions.
Also applies to: 867-875, 876-880
904-908: FileRouteTypes.id union extended correctly.Underscored ids captured as expected.
Also applies to: 925-929, 948-956, 957-961
1201-1228: Module augmentation entries for new routes — OK.preLoaderRoute/parentRoute/path/fullPath are coherent across base, dynamic, index, and child routes.
Please ensure the React e2e routeTree.gen.ts received the same expansions to keep cross-framework parity.
Also applies to: 1355-1382, 1425-1452, 1460-1515
1561-1589: NonNestedNamed: children + WithChildren wiring — OK.
1590-1604: NonNestedPathBaz: children + WithChildren wiring — OK.
1605-1617: NonNestedPath: children + WithChildren wiring — OK.
1618-1635: NonNestedPrefix{$baz}: children + WithChildren wiring — OK.
1636-1650: NonNestedPrefix: children + WithChildren wiring — OK.
1651-1668: NonNested{$baz}suffix: children + WithChildren wiring — OK.
1669-1683: NonNestedSuffix: children + WithChildren wiring — OK.
1685-1696: /non-nested aggregate children registered — OK.All four families are present under NonNestedRouteRoute.
Also applies to: 1698-1700
235-254: Approve: Top-level NonNested route family nodes are wired correctly under /non-nested.Verification: fullPath values contain no underscores; id values include the expected underscores (examples in e2e/solid-router/basic-file-based/src/routeTree.gen.ts at lines 1461, 1475, 1489, 1503).
Resolvedby nlynzaad(GitHub profile, opens in a new tab)@@ -0,0 +1,5 @@1+import { createFileRoute } from '@tanstack/react-router'2+3+export const Route = createFileRoute('/non-nested/named/$baz_/bar')({4+ component: RouteComponent,5+})⚠️ Potential issue
🧩 Analysis chain
Verify param typing for
$baz_in generated route typesEnsure routeTree.gen.ts preserves the trailing underscore in the param key (baz_) so Route.useParams() types align.
Run:
🏁 Script executed:
#!/bin/bash # Verify generated types include a `baz_` param for this route. set -euo pipefail fd -a -t f routeTree.gen.ts e2e/react-router/basic-file-based | while read -r f; do echo "Scanning $f" rg -nC2 '\$baz_\/bar' "$f" || true rg -nC3 '\bbaz_\b' "$f" || true doneLength of output: 3592
Preserve trailing underscore in generated param key
baz_routeTree.gen.ts shows id '/$baz_/bar' but path/fullPath use '/$baz/bar' (so generated types will expose 'baz' instead of 'baz_'); update the generator to retain the trailing underscore in the param key.
Locations: e2e/react-router/basic-file-based/src/routeTree.gen.ts — update() block (
lines 528–532); route mapping (lines 1688–1692); route list (~803–808); union/type list (~1062–1065).🤖 Prompt for AI Agents
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx lines 3-5: the generated route types drop the trailing underscore from the dynamic param key (id shows '/$baz_/bar' but path/fullPath/use expose 'baz'), so update the routeTree.gen.ts generator to preserve trailing underscores in parameter keys; specifically change the logic in the update() block (~lines 528–532), the route mapping (~1688–1692), route list (~803–808), and union/type list (~1062–1065) so that when deriving a param key you only strip the leading '$' (and any surrounding separators) but do not remove a trailing '_' — keep the exact token used in the file id ('baz_') for generated keys while still using '/$baz/bar' for runtime paths if desired, and adjust any key-normalization helpers to retain trailing underscores.this is intended as the _ is removed from the paths
@nlynzaad, thank you for the clarification! I understand now that the underscore removal from route segments like
$baz_→bazin the generated types is the intended behavior. This aligns with the PR's objective of ensuring underscores are properly stripped from route segments while preserving them in base segments.I appreciate you taking the time to explain this - it helps me better understand TanStack Router's path parsing behavior.
🐰 curious ears perk up, taking mental notes
✏️ Learnings added
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.211Z 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.Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
Resolvedby nlynzaad(GitHub profile, opens in a new tab)@@ -0,0 +152,21 @@152+ const pathRouteHeading = page.getByTestId(153+ `non-nested-${testPathDesc}-${paramNameDesc}-route-heading`,154+ )155+156+ const barHeading = page.getByTestId(157+ `non-nested-${testPathDesc}-${paramNameDesc}-bar-heading`,158+ )159+160+ const barParams = page.getByTestId(161+ `non-nested-${testPathDesc}-${paramNameDesc}-bar-param`,162+ )163+164+ const barLink = page.getByTestId(`to-${testPathDesc}-bar`)165+ const bar2Link = page.getByTestId(`to-${testPathDesc}-bar-2`)166+167+ const barPath = `${path}/${testPathPrefix}${paramValue[paramNameDesc] ?? 'baz'}${testPathSuffix}/bar`168+ const bar2Path = `${path}/${testPathPrefix}${paramValue2[paramNameDesc] ?? 'baz'}${testPathSuffix}/bar`169+ await expect(barLink).toHaveAttribute('href', barPath)170+171+ await expect(bar2Link).toHaveAttribute('href', bar2Path)172+⚠️ Potential issue
🧩 Analysis chain
Verify “bar” route paths match route files (underscore vs. no underscore)
Some non-nested “bar” routes use an underscore in file-based paths (e.g.,
prefix{$baz}_/bar,{$baz}suffix_/bar). Ensure the computedbarPath/bar2Pathhere align with actual route definitions to avoid href mismatches.
🏁 Script executed:
#!/bin/bash # Inspect React file-based "bar" routes for prefix/suffix and confirm underscores rg -nP -C2 --glob "e2e/react-router/basic-file-based/src/routes/**" \ "createFileRoute\\('/non-nested/(prefix|suffix)/[^']*bar'" # Show hrefs rendered in the app index for non-nested prefix/suffix (if available) rg -nP -C3 --glob "e2e/react-router/basic-file-based/src/routes/**" \ "data-testid=\"to-(prefix|suffix)-bar(-2)?\"|to=\"[^\"]+bar\""Length of output: 10156
Mismatch — route files append '_' before
/barbut Links/tests omit itcreateFileRoute defines:
- e2e/react-router/basic-file-based/src/routes/non-nested/prefix/prefix{$baz}.bar.tsx -> '/non-nested/prefix/prefix{$baz}/bar'
- e2e/react-router/basic-file-based/src/routes/non-nested/suffix/{$baz}suffix_.bar.tsx -> '/non-nested/suffix/{$baz}suffix_/bar'
Parent Links use:
- e2e/react-router/basic-file-based/src/routes/non-nested/prefix/route.tsx -> to="prefix{$baz}/bar"
- e2e/react-router/basic-file-based/src/routes/non-nested/suffix/route.tsx -> to="{$baz}suffix/bar"
This produces href mismatches (tests: e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts). Make the Link
tovalues and the route path patterns consistent (add or remove the underscore) so the computedbarPathmatches the actual routes.this is intended as the _ is removed from the paths
@nlynzaad, thank you for the clarification! I understand now that the underscore removal from route paths is the intended behavior of this PR. This helps clarify the distinction between how underscores are handled in route segments (where they should be stripped) versus base path segments (where they should be preserved).
(\ /) ( ..) o(")(") Understanding achieved!
✏️ Learnings added
Learnt from: nlynzaad PR: TanStack/router#5182 File: e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts:167-172 Timestamp: 2025-09-22T00:56:53.407Z Learning: In TanStack Router, underscores are intentionally stripped from route segments during path parsing, but preserved in base path segments. This is the expected behavior implemented in PR #5182.Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
Resolvedby nlynzaad(GitHub profile, opens in a new tab)@@ -209,11 +212,20 @@212+ cache?: ParsePathnameCache,213+): ReadonlyArray<Segment> => parsePathname(pathname, cache, true)214+215+export const parseRoutePathSegments = (216+ pathname?: string,217+ cache?: ParsePathnameCache,218+): ReadonlyArray<Segment> => parsePathname(pathname, cache, false)219+209220 export const parsePathname = (210221 pathname?: string,211222 cache?: ParsePathnameCache,223+ basePathValues?: boolean,212224 ): ReadonlyArray<Segment> => {213225 if (!pathname) return []214226 const cached = cache?.get(pathname)215227 if (cached) return cached216- const parsed = baseParsePathname(pathname)228+ const parsed = baseParsePathname(pathname, basePathValues)217229 cache?.set(pathname, parsed)218230 return parsed219231 }⚠️ Potential issue
Cache key ignores parsing mode (base vs route) — leads to incorrect reuse.
parsePathname caches only by pathname; the same string parsed as base (no underscore trim) vs route (underscore trim) will collide, causing subtle, order-dependent bugs.
export const parsePathname = ( pathname?: string, cache?: ParsePathnameCache, basePathValues?: boolean, ): ReadonlyArray<Segment> => { if (!pathname) return [] - const cached = cache?.get(pathname) + const cacheKey = `${basePathValues ? 'B' : 'R'}|${pathname}` + const cached = cache?.get(cacheKey) if (cached) return cached - const parsed = baseParsePathname(pathname, basePathValues) - cache?.set(pathname, parsed) + const parsed = baseParsePathname(pathname, basePathValues) + cache?.set(cacheKey, parsed) return parsed }📝 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.
export const parsePathname = ( pathname?: string, cache?: ParsePathnameCache, basePathValues?: boolean, ): ReadonlyArray<Segment> => { if (!pathname) return [] const cacheKey = `${basePathValues ? 'B' : 'R'}|${pathname}` const cached = cache?.get(cacheKey) if (cached) return cached const parsed = baseParsePathname(pathname, basePathValues) cache?.set(cacheKey, parsed) return parsed }🤖 Prompt for AI Agents
In packages/router-core/src/path.ts around lines 220 to 231, the parsePathname cache currently keys only on the pathname string which causes collisions when the same pathname is parsed in different modes (basePathValues true vs false); update the caching to include the parsing mode in the cache key (for example concatenate or serialize pathname + '|' + String(basePathValues)) or use separate caches per mode so that parsed results for base vs route parsing are stored and retrieved distinctly, then use that composite key when calling cache.get and cache.set.outside the scope of this PR
@nlynzaad Understood! You're absolutely right that this cache collision issue is separate from the main underscore stripping fix being addressed in this PR. The current changes are focused and well-scoped.
Would you like me to create a follow-up issue to track the cache key collision concern for future consideration? This way it won't be forgotten but can be addressed independently when appropriate.
🐰 /| /| ( :v: ) |(_)|
🧠 Learnings used
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.211Z 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.nlynzaad(GitHub profile, opens in a new tab)replied on
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsxlines 3 to 5this is intended as the _ is removed from the paths
nlynzaad(GitHub profile, opens in a new tab)replied on
e2e/react-router/basic-file-based/tests/non-nested-paths.spec.tslines 167 to 172this is intended as the _ is removed from the paths
coderabbitai[bot](GitHub profile, opens in a new tab)replied on
e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsxlines 3 to 5@nlynzaad, thank you for the clarification! I understand now that the underscore removal from route segments like
$baz_→bazin the generated types is the intended behavior. This aligns with the PR's objective of ensuring underscores are properly stripped from route segments while preserving them in base segments.I appreciate you taking the time to explain this - it helps me better understand TanStack Router's path parsing behavior.
🐰 curious ears perk up, taking mental notes
✏️ Learnings added
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.211Z 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.Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
coderabbitai[bot](GitHub profile, opens in a new tab)replied on
e2e/react-router/basic-file-based/tests/non-nested-paths.spec.tslines 167 to 172@nlynzaad, thank you for the clarification! I understand now that the underscore removal from route paths is the intended behavior of this PR. This helps clarify the distinction between how underscores are handled in route segments (where they should be stripped) versus base path segments (where they should be preserved).
(\ /) ( ..) o(")(") Understanding achieved!
✏️ Learnings added
Learnt from: nlynzaad PR: TanStack/router#5182 File: e2e/react-router/basic-file-based/tests/non-nested-paths.spec.ts:167-172 Timestamp: 2025-09-22T00:56:53.407Z Learning: In TanStack Router, underscores are intentionally stripped from route segments during path parsing, but preserved in base path segments. This is the expected behavior implemented in PR #5182.Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
nlynzaad(GitHub profile, opens in a new tab)replied on
packages/router-core/src/path.tslines 220 to 231outside the scope of this PR
coderabbitai[bot](GitHub profile, opens in a new tab)replied on
packages/router-core/src/path.tslines 220 to 231@nlynzaad Understood! You're absolutely right that this cache collision issue is separate from the main underscore stripping fix being addressed in this PR. The current changes are focused and well-scoped.
Would you like me to create a follow-up issue to track the cache key collision concern for future consideration? This way it won't be forgotten but can be addressed independently when appropriate.
🐰 /| /| ( :v: ) |(_)|
🧠 Learnings used
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.211Z 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.nlynzaad(GitHub profile, opens in a new tab) changed the title
nlynzaad(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Walkthrough#
Adds four new non-nested route families (named, path, prefix, suffix) across React and Solid e2e apps and removes legacy baz routes. Regenerates route trees and types. Introduces parseBasePathSegments/parseRoutePathSegments and adjusts internal parsing/matching callers; updates tests to cover underscore/non-nested behavior.
Changes#
packages/router-core/src/path.ts,packages/router-core/src/process-route-tree.tsparseBasePathSegmentsandparseRoutePathSegments, addedbasePathValuesflag to parsing functions, updated signatures, and switched internal callers (resolvePath, interpolatePath, matchByPath, sortRoutes) to the new helpers.packages/router-core/tests/path.test.ts,packages/router-core/tests/match-by-path.test.tse2e/react-router/basic-file-based/src/routeTree.gen.ts/non-nested/{named,path,prefix,suffix}families, new child routes, and updated public maps/types; removed baz-based entries.e2e/react-router/basic-file-based/src/routes/non-nested/...named/*,path/*,prefix/*,suffix/*(route/.route.tsx, index, foo, .bar variants), and updatednon-nested/route.tsxlinks.e2e/react-router/basic-file-based/src/routes/non-nested/baz.tsx,.../baz.$bazid.tsx,.../baz_.$bazid.edit.tsxe2e/react-router/basic-file-based/tests/app.spec.ts,e2e/react-router/basic-file-based/tests/non-nested-paths.spec.tse2e/solid-router/basic-file-based/src/routeTree.gen.ts/non-nestedfamilies and updated public route/type surfaces; removed baz-based entries.e2e/solid-router/basic-file-based/src/routes/non-nested/...named/*,path/*,prefix/*,suffix/*routes mirroring React set; updatednon-nested/route.tsxlinks.e2e/solid-router/basic-file-based/src/routes/non-nested/baz.tsx,.../baz.$bazid.tsx,.../baz_.$bazid.edit.tsxe2e/solid-router/basic-file-based/tests/app.spec.ts,e2e/solid-router/basic-file-based/tests/non-nested-paths.spec.tsSequence Diagram(s)#
Estimated code review effort#
🎯 4 (Complex) | ⏱️ ~45–60 minutes
Possibly related PRs#
Suggested reviewers#
Poem#
Pre-merge checks and finishing touches#
❌ Failed checks (1 warning)
@coderabbitai generate docstringsto improve docstring coverage.✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip
👮 Agentic pre-merge checks are now available in preview!
Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information.
Example:
Please share your feedback with us on this Discord post.
Comment `@coderabbitai help` to get the list of available commands and usage tips.