This PR addresses some flaky tests in the redirect e2e tests for
react-start and solid start.
Specifically, when testing external redirects use useServerFn it was
trying to reach out to http://example.com. This updates it to redirect
to the local dummy server.
This is a follow on from #4653
This PR resolves flaky E2E tests caused by port collisions when running
tests in parallel.
Instead of deriving ports from package names (which can collide), this
new approach assigns a random, available port to each test server
instance.
Key Changes:
- Random Port Allocation: Each test server (Playwright, dummy servers)
gets a unique, random port at startup.
- File-based Sync: The server writes its assigned port to a port.txt
file in its test project directory, this is kept unique through using
the package name or another input string for the file name.
- Test Runner Sync: The test runner reads the port from that file to
build the correct URL.
- Automatic Cleanup: All port files are deleted at the start of each
test:e2e run to ensure fresh ports.
Local parallel runs (up to 10) have shown this to be stable and free of
collisions.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.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>