A lot of our e2e tests are querying external endpoints like
[typicode.com](https://jsonplaceholder.typicode.com) or
[example.com](https://example.com)
This is not ideal as it makes the e2e tests beholden to external factors
for example unavailability or rate limiting of these endpoints.
This PR addresses this by starting and stopping a local dummy server for
each test that needs to query external endpoints and mocks the results.
The setup and teardown have been implemented on each test package
individually so as to allow custom requirements where needed.
---------
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
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>
The original `@tanstack/router-devtools` package still work - it's not
touch by this PR in any way, apart from a migration note saying:
>[@tanstack/router-devtools] Warning: This package has moved to
@tanstack/react-router-devtools. Please switch to the new package, as
this package will be dropped soon.
This introduce three new packages
- @tanstack/router-devtools-core : This is a SolidJS port of the UI
And two adapters on top, that mount this solid app and forward
router/routerState into it.
- @tanstack/solid-router-devtools
- @tanstack/router-router-devtools
For use of devtools in production, a `TanStackRouterDevtoolsInProd` can
be imported instead of the standard `TanStackRouterDevtools` that'll be
tree shaken away in prod.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
* test(e2e): add the derivePort utility
* test(e2e): use the utility on start-basic and start-website
* test(e2e): use the utility on the remaining start sandboxes
* test(e2e): use the utility on the react-router sandboxes
* test(e2e): remove unneeded script from `basic-esbuild-file-based`
This minor is non-breaking for Router users, since it's undocumented to the public API, but **is breaking** for Start alpha users.
This changes the options signature for meta from this:
```tsx
createRoute({
meta: () => [
...
],
links: () => [
...
],
})
```
to this:
```tsx
createRoute({
head: () => ({
meta: [
...
],
links: [
...
],
})
})
```