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 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>
Currently Route HeadContent don't have support to inline style tags.
After a contribution proposition made by @schiller-manuel in the Discord
Group I have decided to implement this.
I also have used this in the basic example for react-start and
solid-start and added style and style w/loader test cases to both
modules.
---------
Co-authored-by: Flo <fpellet@ensc.fr>
Using the below setting, the examples and e2e projects opt into the
future behavior of using `./src` as the app directory, rather than
'./app':
```ts
tsr: {
appDirectory: 'src',
},
```
The `./src` directory is typically used for pure-TS Router projects, as
well as CRA. Thus this reduces the churn for a TS Router SPA to opt into
server features with TS Start.
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>
Follow up to
- https://github.com/TanStack/router/pull/3611
Port this test suite from react-start to solid-start
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This PR introduce support for Solid to be used with TanStack Start.
There are several ongoing refactors that can influence the timing of
when it's most feasible to merge this.
### Status (build and run e2e/solid-start/basic)
- [X] SSR
- [x] API Routes
- [x] Server Functions
- [x] HMR
- [x] Streaming (/stream route)
- [X] Timely hydration
### Ongoing refactors
Refactor to make router packages (aka. client-only features) more
agnostic:
- #3552
- #3540
- #3538
- #3171
Refactor to make start packages (aka. server features) more agnostic:
- #3546
- #3563
- #3565
### Upstream changes to solid-router
- #3592
- #3591
- #3589
- #3616
### Passing E2E test suites
- [x] basic
- [x] website
- [x] scroll-restoration
- [x] server-functions
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: Iha Shin <me@xiniha.dev>
Co-authored-by: Brenley Dueck <brenley@crowdbotics.com>