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

322 commits

Author SHA1 Message Date
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
Birk Skyum
d2b3fa184b
test(vue-start, solid-start): temp remove flaky raw stream tests (#6254) 2025-12-30 11:51:26 +01:00
Birk Skyum
325c35624a
test(vue-start, solid-start): raw sync tests (#6234) 2025-12-30 02:05:43 +01:00
Caleb Cox
337b740cb9
feat: enable async serverFn validation (#5583) 2025-12-27 17:25:08 +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
Tanner Linsley
a289d71f3d
fix: refactor middleware (#5517)
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2025-12-27 01:06:32 +01:00
Manuel Schiller
af9ef262a9
fix: revert rewrite fix (#6211) 2025-12-25 00:21:29 +01:00
Manuel Schiller
7f0b79cb83
refactor: consolidate start compiler (#6210) 2025-12-24 23:39:46 +01:00
Nico Lynzaad
6ea81b47f7
fix(router-core): make navigate publicHref Aware (#6205)
* update navigate to use publicHref when reload document

* resolve codeRabbit nitpick

* mark publicHref prop as internal
2025-12-24 01:41:22 +02:00
Manuel Schiller
17c07d9369
fix: rewrite causes infinite redirects (#6201) 2025-12-23 12:37:09 +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
Manuel Schiller
c1d6c33aed
fix: compile factories (#6188) 2025-12-23 00:47:47 +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
Manuel Schiller
770a26535f
fix: compiler plugin (#6177)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-22 14:57:50 +01:00
Manuel Schiller
c05572ebbe
fix: streaming (#6175) 2025-12-22 00:13:49 +01:00
Birk Skyum
6839bfb1a0
docs: move to tailwind 4 w/ vite (#6168) 2025-12-21 04:13:49 +01:00
Manuel Schiller
e8f2174902
fix: trace nested server function factory re-export chain (#6166) 2025-12-21 02:14:46 +01:00
Manuel Schiller
92333c9319
fix: properly track re-exports of server function factories (#6164) 2025-12-21 00:04:10 +01:00
Manuel Schiller
a727225ae7
fix: correct compiler plugin order, only handle createMiddleware in a … (#6163)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-20 23:51:04 +01:00
Manuel Schiller
4ec65aec8a
fix: restructure server function environment handling (#6160) 2025-12-20 22:42:27 +01:00
Manuel Schiller
c9a19a2e60
feat(router-generator): allow escaping any special string in file-based routing (#6156)
* feat(router-generator): allow escaping any special string in file-based routing

This change extends the router-generator's escaping mechanism to allow ANY
special string to be escaped using square bracket syntax, not just dots.

## Problem

Previously, the router-generator only supported escaping dots using [.]
syntax (e.g., script[.]js.tsx -> /script.js). However, special strings
like 'index', 'route', 'lazy', and underscores ('_') could not be escaped,
making it impossible to create routes with literal paths like /index,
/route, /lazy, or paths containing literal underscores.

## Solution

Extended the escaping mechanism to support:

1. **Escaped special suffixes**: [index], [route], [lazy], [component], etc.
   - [index].tsx -> /index (literal path, NOT treated as index route)
   - [route].tsx -> /route (literal path, NOT treated as layout config)
   - [lazy].tsx -> /lazy (literal path, NOT treated as lazy-loaded route)

2. **Escaped underscores in any position**:
   - Leading: [_]layout.tsx -> /_layout (literal, NOT pathless layout)
   - Trailing: blog[_].tsx -> /blog_ (literal, NOT escaping parent layout)
   - Middle: foo[_]bar.tsx -> /foo_bar (literal underscore preserved)
   - Multiple: api[_]v2[_]users.tsx -> /api_v2_users
   - Fully escaped: [_prefix_middle_suffix].tsx -> /_prefix_middle_suffix

3. **Custom token escaping**: Works with custom indexToken and routeToken
   - [_1nd3x].tsx with indexToken='_1nd3x' -> /_1nd3x (literal path)
   - posts.[_r0ut3_].tsx with routeToken='_r0ut3_' -> /posts/_r0ut3_

## Implementation Details

### src/utils.ts
- Removed '_' from DISALLOWED_ESCAPE_CHARS to allow underscore escaping
- Added isSegmentEscaped() to check if a segment was bracket-escaped
- Added hasEscapedLeadingUnderscore() to detect [_] prefix or [_...] patterns
- Added hasEscapedTrailingUnderscore() to detect [_] suffix or [..._] patterns
- Added removeUnderscoresWithEscape() to preserve escaped underscores
- Added removeLayoutSegmentsWithEscape() to preserve escaped layout segments
- Added isSegmentPathless() to check for non-escaped leading underscores
- Updated inferFullPath() to use escape-aware functions

### src/filesystem/physical/getRouteNodes.ts
- Added escape checking for special suffixes (route, lazy, component, etc.)
- Updated isValidPathlessLayoutRoute() to check for escaped underscores
- Updated getRouteMeta() to accept originalRoutePath and check escaping

### src/generator.ts
- Updated handleNode() to use escape-aware path processing functions
- Compute trimmedOriginalPath alongside trimmedPath for escape detection

## Tests Added

- escaped-special-strings: Tests escaping of index, route, lazy, and
  underscores in various positions (leading, trailing, middle, multiple)
- escaped-custom-tokens: Tests escaping with custom indexToken and
  routeToken configurations

* simplify

* fix test

* add utils unit tests

* add e2e test

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-20 14:51:09 +01:00
Nico Lynzaad
27d1c5ef04
refactor(router-generator): remove experimental nonnested paths (#6154)
* remove experimental non-nested from tests

* remove experimental non-nested from router-generator

* add underscore to list of disallowed escaped characters

* update docs

* fix tests
2025-12-20 14:24:43 +02:00
Birk Skyum
05408f83b4
test(vue-router): sentry integration with tanstackRouterBrowserTracingIntegration (#6139)
vue-router  tanstackRouterBrowserTracingIntegration sentry
2025-12-18 14:15:14 +01:00
Birk Skyum
c68aff71d1
test(vue-start): basic-cloudflare, basic-auth (#6137) 2025-12-18 12:10:37 +01:00
Birk Skyum
6b11401913
test(vue-start): e2e test suites (#6132) 2025-12-18 00:39:50 +01:00
Birk Skyum
abac5ceac7
test(vue-start): custom-basepath (#6130) 2025-12-17 22:59:39 +01:00
Birk Skyum
ede47af1fa
test(vue-start): server-functions (#6129) 2025-12-17 22:32:21 +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
Birk Skyum
d5a7aee5f5
test(vue-start): server-routes (#6127) 2025-12-17 20:16:13 +01:00
Birk Skyum
d476a8b0e9
test(vue-start): serialization-adapters e2e suite (#6126) 2025-12-17 19:20:21 +01:00
Birk Skyum
751f0ff68b
test(vue-start): selective-ssr suite (#6124) 2025-12-17 18:07:16 +01:00
Manuel Schiller
16a359bfb6
fix: don't create virtual routes for pathless layouts (#6120) 2025-12-17 03:17:59 +01:00
Birk Skyum
8628d01894
test(vue-router): rsbuild suites (#6117) 2025-12-16 22:10:42 +01:00
Birk Skyum
a6134ffe64
e2e(vue-router): scroll restoration sandbox vite (#6116)
* vue-router js-only

* esbuild

* basic-esbuild-file-based

* remove esbuild-plugin-vue-jsx

* reset js-only0-file

* add scroll restoration

* ci: apply automated fixes

* install zod

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 21:18:22 +01:00
Birk Skyum
91b26b1577
test(vue-router): basic-esbuild-file-based (#6115)
* vue-router js-only

* esbuild

* disable tailwind

* basic-esbuild-file-based

* remove esbuild-plugin-vue-jsx

* reset js-only0-file

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 21:03:55 +01:00
Birk Skyum
a13d10291a
test(vue-router): js-only-file-based (#6114)
* vue-basic-scroll-restoration

* vue-router js-only

* lockfile

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 19:10:50 +01:00
Birk Skyum
0385e650fa
test(vue-router): basic-scroll-restoration (#6113)
* vue-basic-scroll-restoration

* scroll restoration

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 19:05:06 +01:00
Birk Skyum
d27e202c74
test(vue-router): generator cli only (#6112)
* sentry integration vue

* vue-router-generator-cli-only

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 18:32:52 +01:00
Birk Skyum
7e9c2f0662
test(vue-router) sentry integration (#6111)
* sentry integration vue

* ci: apply automated fixes

* naming

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 18:19:02 +01:00
Birk Skyum
8e3c1bc3a6
test(vue-router) basepath file based (#6110)
* test(vue-router) basepath file based

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-16 17:53:20 +01:00
Birk Skyum
949c3f40d3
test(vue-router): virtual routes (#6109) 2025-12-16 17:32:02 +01:00
Birk Skyum
77c75085e7
test(vue-router): view transitions e2e (#6108) 2025-12-16 17:07:37 +01:00
Manuel Schiller
20aac85d7f
fix: compare rewritten url to decide if server needs to redirect (#6072) 2025-12-12 20:28:58 +01:00
Birk Skyum
eccfd26988
e2e(vue-router): vue-query suites (#6083)
* e2e(vue-router): vue-query suites

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-12 17:40:57 +01:00
Birk Skyum
4f64ab97e1
Vue start (#6055) 2025-12-11 15:55:28 +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
3d6aa41f58
Vue router (#5997) 2025-12-06 19:41:15 +01:00
Hakan Shehu
24ff8955ab
fix(router-core): correctly resolve custom params from declarative masks when building the masked url (#5756)
* Use params from declarative masks

* Add tests for masks

* Include the necessary changes

* Update mask tests

* Add e2e tests

* minor nitpicks

---------

Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
2025-12-02 18:31:16 +02:00