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

6,221 commits

Author SHA1 Message Date
Tanner Linsley
51925a2b9e release: v1.142.4 v1.142.4 2025-12-21 00:45:53 +00:00
Birk Skyum
fe0d3d31bd
fix(start-server-core): bump h3 from v2.0.1-rc.2 to v2.0.1-rc.6 (#6161) 2025-12-21 01:43:25 +01:00
Tanner Linsley
75e1387159 release: v1.142.3 v1.142.3 2025-12-20 23:20:47 +00:00
Birk Skyum
82ac628b2c
fix(start-server-core): use public h3-v2 api event.res (#6162) 2025-12-21 00:09:11 +01:00
Manuel Schiller
92333c9319
fix: properly track re-exports of server function factories (#6164) 2025-12-21 00:04:10 +01:00
Tanner Linsley
5eb250ad72 release: v1.142.2 v1.142.2 2025-12-20 22:54:29 +00: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
Tanner Linsley
8a205211c5 release: v1.142.1 v1.142.1 2025-12-20 21:46:42 +00:00
Manuel Schiller
4ec65aec8a
fix: restructure server function environment handling (#6160) 2025-12-20 22:42:27 +01:00
Birk Skyum
22d1b4a3cf
chore(start-server-core): update to h3 v2.0.1-rc.2 (#6159) 2025-12-20 21:11:59 +01:00
Tanner Linsley
c906682102 release: v1.142.0 v1.142.0 2025-12-20 13:58:55 +00: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
Tanner Linsley
6c5fdb143a release: v1.141.9 v1.141.9 2025-12-20 12:30:29 +00: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
Tanner Linsley
090d8bd672 release: v1.141.8 v1.141.8 2025-12-19 23:51:29 +00:00
Manuel Schiller
7798b0a92f
fix: bump deps (#6153) 2025-12-20 00:49:28 +01:00
Tanner Linsley
5ae9461be0
docs: Create markdown import and rendering guide (#6150)
* docs(start): add guide for rendering markdown content

Add comprehensive guide covering two methods for importing and rendering
markdown in TanStack Start applications:
- Static markdown with content-collections for build-time loading
- Dynamic markdown fetched from GitHub or remote sources at runtime

Includes setup for unified/remark/rehype pipeline, code highlighting with
Shiki, and practical examples for blog posts and documentation pages.

* ci: apply automated fixes

* docs(start): add rendering-markdown to navigation config

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-19 11:55:20 -07: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
Manuel Schiller
41dba10a8d
chore: rename _types to '~types' (#6133) 2025-12-18 08:20:01 +01:00
Birk Skyum
6b11401913
test(vue-start): e2e test suites (#6132) 2025-12-18 00:39:50 +01:00
Tanner Linsley
4a1b12f245 release: v1.141.7 v1.141.7 2025-12-17 23:26:35 +00:00
Manuel Schiller
4171b868c6
fix: generator perf and pathless routes relative to parent (#6121)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-18 00:24:21 +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
Tanner Linsley
43a36e9a0e release: v1.141.6 v1.141.6 2025-12-17 20:07:13 +00: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
Tanner Linsley
3c77213f0b
chore: remove extra comments (#5946)
---------

Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2025-12-17 13:04:54 +01:00
Tanner Linsley
12817c6450 release: v1.141.5 v1.141.5 2025-12-17 02:22:07 +00:00
Manuel Schiller
16a359bfb6
fix: don't create virtual routes for pathless layouts (#6120) 2025-12-17 03:17:59 +01:00
Tanner Linsley
bffccb0d30 release: v1.141.4 v1.141.4 2025-12-17 00:20:51 +00:00
Manuel Schiller
f330532e08
fix: generalize hydration cleanup (#6118)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-17 01:18:47 +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
Tanner Linsley
8a791e229b Merge branch 'main' of https://github.com/tanstack/router 2025-12-16 12:37:37 -07:00
Tanner Linsley
03aa67f106 docs: add comparison to sidebar 2025-12-16 12:37:35 -07:00
autofix-ci[bot]
df5d76c66a
ci: apply automated fixes 2025-12-16 19:33:15 +00:00
Tanner Linsley
1f29107609 Merge branch 'main' of https://github.com/tanstack/router 2025-12-16 12:32:13 -07:00
Tanner Linsley
3f1c2bbcb1 docs: add comparison 2025-12-16 12:32:05 -07: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