0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
Commit graph

60 commits

Author SHA1 Message Date
Manuel Schiller
9c81d5ac57
fix: handle beforeLoad throwing notFound correctly (#6811) 2026-03-04 21:34:28 +01:00
Birk Skyum
965d95f3b8
chore: bump srvx 0.11.2 -> 0.11.7 (#6705)
srvx 0.11.7
2026-02-19 21:41:56 +01:00
Manuel Schiller
5d667aa436 fix test 2026-02-16 20:17:27 +01:00
Manuel Schiller
27a563ea1d
fix: script hydration (#6681) 2026-02-16 19:22:09 +01:00
홍규진
067951fcf0
fix(react-router): remove async/defer attributes during hydration to prevent warnings (#6479)
* fix(react-router): prevent hydration warning for async/defer scripts

Strip async, defer, and src attributes from script tags during client-side hydration to match the server-rendered output and prevent React hydration mismatch warnings.

* test(react-router): add unit and e2e tests for async script hydration

Adds unit tests to verify server output includes async/defer attributes, and e2e tests to verify no hydration warnings occur on the client.

---------

Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2026-02-15 02:31:46 +01:00
Birk Skyum
88161bd480
chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
Nico Lynzaad
40ed6832c6
fix(start-server-core): redirect misinterpreted protocol-relative URLs (#6600)
* add test to verify redirect

* handle redirect

* update tests

* cleanup unused code in decodePath

* use 308 instead of 302

* redirect is not relevant in spa mode
2026-02-07 02:00:19 +02:00
Philippe Serhal
6ff1190bdc
chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 01:49:12 +01:00
Birk Skyum
19a92c5d87
update h3 nitro srvx seroval (#6449) 2026-01-22 02:14:13 +01:00
Nico Lynzaad
60a30fc59a
fix(react-start): Apply Link active properties correctly on SSR when including hash (#6421)
* react: fix link active hash reactivity on SSR

* update and align tests

* remove unnecessary change

* better address react re-renders and update tests

* add tests for vue

* react: add comment on reason for useSyncExternalStore usage

* solid: revert prior fix and update tests

* react: revert unnecessary change

* react: use useHydrated

* react: cleanup
2026-01-22 00:55:28 +02:00
Nico Lynzaad
3da0227067
fix: encoded url hash fragment matching (#6416)
* decode hash

* ci: apply automated fixes

* cleanup

* revert change to basic-rsc

* add note in docs about hash fragment

* ci: apply automated fixes

* code rabbit suggestion

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-01-19 16:39:48 +02:00
Nico Lynzaad
9196ae45b7
fix(start): normalize path encoding (#6389)
* fix encoding and update tests

rework fix and tests

* refine solution

* revert unnecessary change

* fix tests

* resolve pre-render test issues

* refine comment on normalization requirement

* cleanup: remove unnecessary imports

* code rabbit suggestions

* revert merge issues in createStartHandler.ts

* Avoid decoding query/hash

* apply solution to router-ssr also

* add test for getNormalizedURL to handle URLs correctly

* enhance getNormalizedURL tests

* handle malformed paths

* build pathname using url parts

* handle backslash encoding in URL normalization

* additional tests

* refine match error handling
2026-01-18 20:10:11 +02:00
Manuel Schiller
2d9193c25c
chore: bump deps (#6408)
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
2026-01-18 02:14:48 +01:00
Manuel Schiller
b42f84a4f6
fix: fullpath handling (#6404)
* fix: fullpath handling

fixes #6403
fixes #2675
fixes #4892

* add type test

* preserve / for index routes

* fix  #3005

* fix tests
2026-01-17 17:21:10 +01:00
Manuel Schiller
538285cb79
fix: dev style with non runnable dev environments and basepath support (#6348) 2026-01-10 14:51:33 +01:00
Manuel Schiller
04e6d7b064
fix: open redirect (#6309) 2026-01-05 20:07:19 +01:00
Nico Lynzaad
fb88aadd63
tests(react-start-basic): wait for results to be available before validating raw stream results (#6307)
wait for results to be available before testing
2026-01-05 19:50:12 +02:00
Birk Skyum
5438653d7e
bump srvx 0.10.0 (#6257)
* bump srvx 0.10.0

* adjust types

* lint
2025-12-30 17:36:17 +01:00
Manuel Schiller
680671cce8
feat: RawStream (#6231)
* feat: RawStream

* framed json response is not newline split

* avoid code duplication in tests

* actually defer promise

* fix empty stream

* hardening

* optimization

* stream counter

* fix cancellation

* lint

* fix test

* stabilize tests

* stabilize tests

* fix(e2e): add hydration delay for SSR mixed stream test

In CI, hydration takes longer so reader.read() can hang if called
before seroval's stream factory connects callbacks. 100ms delay
ensures stream is ready to be consumed.

* skip test when prerendering
2025-12-27 15:57:16 +01:00
Manuel Schiller
7f0b79cb83
refactor: consolidate start compiler (#6210) 2025-12-24 23:39:46 +01:00
Manuel Schiller
c504bd2c4d
fix: compiler handles type-only exports (#6199) 2025-12-23 08:53:47 +01:00
Manuel Schiller
97d9f30c69
feat: remove ClientOnly children from server build (#6193) 2025-12-23 08:40:43 +01:00
Manuel Schiller
3c994c47a8
fix: serial head execution (#6093) 2025-12-23 03:21:30 +01:00
Ulrich Stark
948c4fb045
refactor(router-core): deprecate json function in favor of standard Response.json function (#6181) 2025-12-22 19:44:04 +01:00
Birk Skyum
6839bfb1a0
docs: move to tailwind 4 w/ vite (#6168) 2025-12-21 04:13:49 +01:00
Manuel Schiller
11d26ad0f5
fix: bump srvx (#6128)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-17 21:04:54 +01:00
Manuel Schiller
16a359bfb6
fix: don't create virtual routes for pathless layouts (#6120) 2025-12-17 03:17:59 +01:00
Lachlan Collins
43fd1328c5
fix: full npm registry URLs, sync package versions (#6035)
* Update repository URLs

* Start sherif fixes

* Fic CI
2025-12-07 11:37:18 +11:00
Birk Skyum
430f268e50
test(start): test that multiple Set-Cookie headers are not lost during redirect (#5978) 2025-11-26 21:37:56 +01:00
Edmund Hung
0dcc20ebac
feat(start-plugin-core): vite preview support (#5910)
* feat: add vite preview support

* test: vite preview with react and solid

---------

Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
2025-11-20 04:03:54 +01:00
Birk Skyum
eda2254a69
example: add srvx start command for launching prod build (#5915) 2025-11-20 00:37:46 +01:00
Remi
37eb416963
fix(router-core): Catch errors thrown during hydrate (#5686) 2025-11-19 21:06:05 +01:00
Manuel Schiller
03595c8701
fix: memory leaks (#5896) 2025-11-19 01:17:39 +01:00
Flo
043e57656d
refactor(router-core): simplify matchId (#5807)
* refactor(router-core): simplify matchId

* ci: apply automated fixes

* update tests

* matchId !== routeId

* nitpicks

* missed in solid router Match

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
2025-11-11 00:55:46 +01:00
Birk Skyum
3eeeb881f0
test(start): fix search-params tests (#5643) 2025-10-27 23:44:57 +01:00
FatahChan
475707e448
fix: auto discover static routes for prerendering
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2025-10-26 01:31:14 +02:00
Birk Skyum
eab8a9941c
chore: bump tailwind from v3 to v4 with postcss (#5580) 2025-10-22 03:42:26 +02:00
Nico Lynzaad
58e8a940e1
tests(start): update spa mode e2e to use production build (#5284)
* make use of prod setup for spa-mode e2e test

* ci: apply automated fixes

* nitpick

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-28 23:48:36 +02:00
Nico Lynzaad
16eacb3d68
fix(router-core): consider __root__ in path parsing of trailing underscores (#5262)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-28 00:07:31 +02:00
Magnus May
2ff5bc20f7
docs: add Bun production server guide for TanStack Start (#5237)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-27 01:01:49 +02:00
Manuel Schiller
e6ef21809c
fix: opt into SSR type level serializability check (#5233)
default `false` was not working for plain router

fixes #5222
2025-09-25 17:28:40 +02:00
Manuel Schiller
32faee22da
feat: Start RC (#5189)
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: chorobin <chrishorobin@hotmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: hokkyss <hokkyss2@gmail.com>
Co-authored-by: Philippe Serhal <philippe.serhal@gmail.com>
Co-authored-by: Jack Herrington <jherr@pobox.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
2025-09-23 11:34:54 -06:00
wookhyung
b0ea8de91d
fix(router): prevent script tag duplication in SSR and client-side navigation (#5095)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-18 20:09:15 +02:00
Nico Lynzaad
f0a60cbb71
test(e2e): use locally hosted api over an external provider (#4725)
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>
2025-07-22 00:15:28 +02:00
Nico Lynzaad
e90171ab38
fix: resolve flaky e2e tests on useServerFn redirect tests (#4688)
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.
2025-07-18 00:02:28 +02:00
Nico Lynzaad
3854370bdf
fix: assign random ports for e2e tests (#4676)
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>
2025-07-17 07:24:59 +02:00
wookhyung
f9b5a5a4a8
fix(start): support SSR for non-Latin character route paths (#4611) 2025-07-10 15:33:18 +12:00
Felipe Stanzani
ceec4f2102
feat: Add style to HeadContent (#4559)
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>
2025-07-02 00:28:12 +02:00
Manuel Schiller
7e257df6bf
tests: wait for scripts route to be loaded before evaluating script (#4465) 2025-06-19 02:04:14 +02:00
wookhyung
adc5d5ce94
fix(react-router, solid-router): make head function scripts load properly (#4323) 2025-06-18 22:03:06 +02:00