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

306 commits

Author SHA1 Message Date
Manuel Schiller
6c36ddf2e2 implementation and tests 2025-12-22 10:20:08 +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
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
Manuel Schiller
369a09b850
fix: no remounting with ssr:false (#5964) 2025-11-25 21:05:23 +01:00
Birk Skyum
6e0de0a6cd
format: add missing .prettierignore files (#5951)
* format: worker-configuration

* cleanup

* ci: apply automated fixes

* delete generated files

* add worker-configuration.d.ts to gitignore

* prettierignore

* revert

* add missing prettier ignore files

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-24 11:29:31 +01:00
Tanner Linsley
a8b23bf742 release: v1.139.3 2025-11-23 00:39:36 +00:00
Shreyas Sarkar
8f5d93b58c
fix: Links always scroll to URL hash on hover (#5930) (#5944) 2025-11-23 01:05:34 +01:00
Manuel Schiller
2fd4cbaa18
fix: allow to override serverfn method when using factories (#5938)
* fix: allow to override serverfn method when using factories

fixes: #5872

* solid e2e test

* format unrelated file
2025-11-22 10:53:50 +01:00
Tanner Linsley
ab676cb44f release: v1.139.2 2025-11-22 00:54:59 +00:00
autofix-ci[bot]
03e718b3cf
ci: apply automated fixes 2025-11-22 00:39:30 +00:00
Ethan Potts
2df807e43c
fix(start-server-core): deserialize tss context when using formdata (#5935)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-22 01:38:21 +01:00
Tanner Linsley
c347f78511 release: v1.139.1 2025-11-21 23:05:44 +00:00
autofix-ci[bot]
c3af4b8433
ci: apply automated fixes 2025-11-21 03:20:32 +00:00
Tanner Linsley
3e6e9e79cc release: v1.139.0 2025-11-20 21:01:48 +00:00
autofix-ci[bot]
e59d8cd2b8
ci: apply automated fixes 2025-11-20 20:35:34 +00:00
Birk Skyum
d2e9e396ac
chore: bump seroval 1.4.0 (#5924) 2025-11-20 21:34:38 +01:00
Tanner Linsley
282cefb7e1 release: v1.138.0 2025-11-20 18:59:28 +00:00
Edmund Hung
9da55170e9
feat: prerender with vite preview server (#5921) 2025-11-20 19:46:52 +01:00