0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e
Nico Lynzaad ecd79d2b63
fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182)
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.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
History 2025-09-22 03:12:27 +02:00
..
e2e-utils test(e2e): use locally hosted api over an external provider (#4725) 2025-07-22 00:15:28 +02:00
react-router fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182) 2025-09-22 03:12:27 +02:00
react-start fix(router): prevent script tag duplication in SSR and client-side navigation (#5095) 2025-09-18 20:09:15 +02:00
solid-router fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182) 2025-09-22 03:12:27 +02:00
solid-start fix(router): prevent script tag duplication in SSR and client-side navigation (#5095) 2025-09-18 20:09:15 +02:00