- Created new e2e test app at e2e/react-start/optional-params/
- Tests realistic optional parameter usage patterns:
- Blog category filtering: /blog/{-}
- User profile tabs: /users//{-}
- API versioning: /api/v{-}/{-}
- Comprehensive test coverage for:
- Single and mixed optional parameters
- SSR compatibility with optional parameters
- File-based routing with optional parameters
- TypeScript integration and type safety
- Navigation, URL generation, and edge cases
- Built with TanStack Start + Router for real-world testing similar to TanStack.com
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Co-authored-by: Indrek Ardel <indrek@ardel.eu>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
There's absolutely no reason not to use TanStack Start for purely static
sites - it works great, and it means that if you then want to transition
a codebase to being dynamically SSR, it requires zero work!
Added a note on using the `enableBeforeUnload` option in `useBlocker` +
example in the "Component-based blocking" section.
@schiller-manuel I wasn't sure if there should be an entire section for
this or just a note with 1-2 examples in the existing sections (I did
the latter).
Also thanks for pushing me to contribute even if it's a small one :)
Fixes#4599
# Previous behavior
```
$param
(group)
route.tsx
index.tsx
```
when router-generator processes the `route.tsx` node, the `split`
variable
8df504c3a4/packages/router-generator/src/generator.ts (L1258)
will be `[ '$param', '(group)' ]`, and because the last part is a group
8df504c3a4/packages/router-generator/src/generator.ts (L1263)
the whole route will be generated as pathless, i.e.
```ts
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const ParamgroupRouteRoute = ParamgroupRouteRouteImport.update({
id: '/$param/(group)',
////////////////
path: '/$param/', // <---- This will NOT be here without the fix
////////////////
getParentRoute: () => rootRouteImport,
} as any)
const ParamgroupIndexRoute = ParamgroupIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => ParamgroupRouteRoute,
} as any)
```
therefore the `$param` part of the path will be lost, and it won't be
included in `index.tsx`'s path resolution algorithm (in this case its
path would be `/`)
# Current behavior
When processing a route node, its path is skipped when all nodes between
it and the higher route are groups.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This PR closes#4623 by considering routeFileIgnorePattern when checking
for routeFilePrefix
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>