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

386 commits

Author SHA1 Message Date
Flo
cc12980e16
test: fix vue viewTransition e2e flakiness (#6830) 2026-03-06 00:06:20 +01:00
Manuel Schiller
9c81d5ac57
fix: handle beforeLoad throwing notFound correctly (#6811) 2026-03-04 21:34:28 +01:00
Flo
1acc8eaf3a
test: add cross-framework client navigation benchmarks (#6800) 2026-03-02 21:23:53 +01:00
Manuel Schiller
816d0d1a08
feat: allow to configure dev ssr style injection (#6797) 2026-03-02 00:45:49 +01:00
Manuel Schiller
d445986542
feat: support split base and basepath in TanStack Start dev server (#6792) 2026-03-01 18:35:46 +01:00
Julius Marminge
e979285ebb
fix: throw 405 response instead of 500 internal error on method mismatch (#6091)
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2026-03-01 14:44:40 +01:00
Manuel Schiller
b2a71ee211
fix: alias and namespace import support for import protection (#6784) 2026-03-01 01:32:50 +01:00
Manuel Schiller
c099ebf204
fix: don't rely on syntheticNamedExports in import protection (#6758) 2026-02-25 02:08:23 +01:00
Manuel Schiller
95761bc4e3
feat: add excludeFiles to import-protection (#6757)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-25 00:50:40 +01:00
Manuel Schiller
851967c8b0
fix: import protection robustness (#6746)
* fix: import protection robustness

* handle onViolation in prod, make it potentially async

* review
2026-02-23 21:43:49 +01:00
Manuel Schiller
d6af3a28c3
chore: cleanup unused exports (#6735) 2026-02-23 00:19:06 +01:00
Manuel Schiller
53eb52abda
fix: avoid false positives in import protection (#6732) 2026-02-22 22:21:17 +01:00
Manuel Schiller
996e182844
fix(start): prevent false positives for transitively resolved imports… (#6722)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-21 22:11:03 +01:00
Flo
d8171c3994
feat(benchmarks): add file-based bundle-size suite + PR trend reporting (#6723) 2026-02-21 19:28:30 +01:00
Birk Skyum
4def459cb6
testing(vite-ecosystem-ci): add vite as direct dev depencency (#6709) 2026-02-20 01:58:27 +01:00
Manuel Schiller
4ec6f50d3b
chore: stabilize tests (#6492) 2026-02-20 01:11:21 +01:00
Manuel Schiller
f453943df5
fix: avoid false positives in import-protection plugin (#6708) 2026-02-20 00:50:05 +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
711f3b858e
feat: import protection (#6688) 2026-02-18 01:16:30 +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
Manuel Schiller
227dfaf21b
fix: prevent var name clash in generated route for escaped strings (#6680) 2026-02-16 19:10:54 +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
Yuki Kakazu kekezun kkzn
426c2b54fe
fix: pass pathname to global request middleware in createStartHandler (#6648)
* fix: pass pathname to global request middleware in createStartHandler

The two `executeMiddleware` calls for global request middleware in
`createStartHandler` were missing the `pathname` property, causing it
to be `undefined` at runtime despite `RequestServerOptions` declaring
it as `pathname: string`.

- Add `pathname: url.pathname` to server function middleware execution
- Add `pathname: url.pathname` to page request middleware execution

The route-level middleware in `handleServerRoutes` already passes
`pathname` correctly.

Closes TanStack/router#6647

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add regression test for pathname in global request middleware (#6647)

Add e2e tests to server-functions-global-middleware verifying that
pathname is correctly passed to global request middleware in
createStartHandler.

- Add pathnameMiddleware that captures pathname from server callback
- Add dedicated pathname-middleware route and test page
- Verify pathname value on both SSR and client-side navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: remove unnecessary `as any` cast from pathname middleware test

The middleware type system correctly infers `requestMiddlewarePathname`
on the context, so the explicit cast is not needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: apply automated fixes

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-14 16:45:18 +01:00
Manuel Schiller
523972e0df
fix: shared virtual module for code-split routes (#6659)
* fix: shared virtual module for code-split routes

When a route file has module-level bindings (variables, functions, classes) referenced by **both** split and non-split route properties, the bindings are duplicated — initialized independently in the reference file and in each virtual split file. This breaks singletons, causes double side effects, and wastes bundle size.

```tsx
const collection = { name: 'todos', preload: async () => {} }
export const Route = createFileRoute('/todos')({
  loader: async () => {
    await collection.preload()
  }, // stays in reference
  component: () => <div>{collection.name}</div>, // split to virtual
})
```
In this example, `collection` is initialized in **both** the reference file (because `loader` references it) and the `?tsr-split=component` virtual file (because the component references it). Two separate instances exist at runtime.

To solve this issue, this PR introduces a third virtual module `route.tsx?tsr-shared=1` that contains shared bindings. Both the reference and virtual files import from it.

When `sharedBindings` is empty (the common case — component-only helpers, loader-only code), no shared module exists and the system works exactly as today.

The reference transform runs first and will emit a static import of `?tsr-shared=1` **only when needed**. Since split chunks are only discovered via the reference file's emitted `import('...?tsr-split=...')`, the bundler will always process/evaluate the reference module first. Result: the shared module is evaluated once and then reused by any later-loaded split chunk.
2026-02-14 13:10:54 +01:00
Lee Jong Kyung
5c923e45c3
fix(router): ensure useParams returns parsed params when strict is false (#6387)
* fix: optimize match retrieval by using a Map for previous matches

* feat: add strict false parameter handling and related routes

* replace params only when routeParams is fully parsed

---------

Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
2026-02-09 02:44:30 +02: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
972d347b8e
fix(solid-start): make Link active class reactive for include hash (#6607)
solid-start: make Link active class reactive for include hash
2026-02-07 04:06:41 +02:00
Manuel Schiller
06f3aeca0f
feat: add transformAssetUrls (#6606)
* feat: add transformAssetUrls

* fix docs

* stringify safely

* fix test

* fix
2026-02-07 02:01:46 +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
Manuel Schiller
b5b4079ded
fix: do not pass signal into server function (#5470)
* fix: do not pass signal into server function

* fix test

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-05 22:48:04 +01:00
Flo
3b61ca2090
test(react-start): new profiling scenario for search/loader/redirect (#6511) 2026-01-25 19:17:13 +01:00
Flo
db94c3147e
test(react-start): add new flame+autocannon benchmark for nested routes + useParams (#6501) 2026-01-25 09:54:09 +01:00
Manuel Schiller
ba47d4db6e
refactor: streaming perf (#6496) 2026-01-24 23:33:20 +01:00
Manuel Schiller
3e48ef7fc9
chore: stabilize tests (#6486) 2026-01-24 13:08:29 +01: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
Flo
e190d8dbb9
test(react-start): more reliable autocannon config (#6476) 2026-01-24 00:36:42 +01:00
Flo
f054c0c921
fix: revert "refactor: don't reparse upon navigation (#6398)" (#6468)
Revert "refactor: don't reparse upon navigation (#6398)"

This reverts commit 6cbd96e357.
2026-01-23 16:50:10 +01:00
Flo
a3c4854c4c
test(react-start): flame perf setup uses pure nitro, no express layer (#6463) 2026-01-23 12:08:49 +01:00
Flo
d0b472e469
test(react-start): benchmarking setup w/ platformatic/flame and autocannon (#6457) 2026-01-22 21:55:39 +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
Manuel Schiller
6cbd96e357
refactor: don't reparse upon navigation (#6398) 2026-01-19 23:00:21 +01: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
Manuel Schiller
1d99170163
feat: custom fetch impl via createStart (#6417) 2026-01-19 01:35:38 +01:00
Manuel Schiller
5f6ae58d8b
feat: allow custom fetch impl for server functions (#6327)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-18 20:29:01 +01: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
Jose Cantu
02839b3132
fix(start-client-core): allow middleware to catch server function handler errors (#6392)
fix(start-client-core): allow middleware to catch server function handler errors (#6381)
2026-01-18 09:08:10 +01: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
114f53b7ef
fix: make nonce accessible in headers (#6359) 2026-01-18 00:55:41 +01:00