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>
Basically my understanding is that the `load` function gets called once
during SSR but right now our `Transitioner` calls it again as it appears
`createRenderEffect` run on the server too where as the `useEffect` in
React doesn't.
The fix is just to bail out if its running on the server. Feels kinda
hacky but it works.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>