0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e/react-start
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>
History 2026-02-14 16:45:18 +01:00
..
basic chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
basic-auth chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
basic-cloudflare chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
basic-react-query chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
basic-rsc chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
basic-tsr-config chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
clerk-basic chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
csp chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
css-modules chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
custom-basepath chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
flamegraph-bench test(react-start): new profiling scenario for search/loader/redirect (#6511) 2026-01-25 19:17:13 +01:00
i18n-paraglide chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
query-integration chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
scroll-restoration chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
selective-ssr chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
serialization-adapters chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
server-functions chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
server-functions-global-middleware fix: pass pathname to global request middleware in createStartHandler (#6648) 2026-02-14 16:45:18 +01:00
server-routes chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
server-routes-global-middleware chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
spa-mode chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459) 2026-01-24 01:49:12 +01:00
streaming-ssr chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
transform-asset-urls chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
virtual-routes chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00
website chore: update srvx to 0.11.2 and h3-v2 to rc.14 (#6608) 2026-02-07 03:28:50 +01:00