mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
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
|
|
|---|---|---|
| .. | ||
| e2e-utils | ||
| react-router | ||
| react-start | ||
| solid-router | ||
| solid-start | ||