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

6,634 commits

Author SHA1 Message Date
Manuel Schiller
5c6eed67ce fix: exclude start and router from optimizeDeps for solid as well 2025-09-24 22:33:11 +02:00
Tanner Linsley
9d3bbbd812 release: v1.132.4 v1.132.4 2025-09-24 20:24:21 +00:00
Manuel Schiller
c7213749df fix: export fake startInstance 2025-09-24 22:18:27 +02:00
Christoffer Bjelke
4f62cfaf1e
docs(Start): Revise migration guide for TanStack Start (#5211)
Update installation instructions and routing configurations for TanStack
Start.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Updated React migration guide from Next.js with current routing
conventions and defaults.
* Adjusted installation guidance to reflect updated tooling and plugin
placement.
* Clarified new project layout defaults (explicit src directory and
routes location).
  * Renamed and simplified example entry file and setup steps.
* Refreshed examples to use the new routing, link and server-function
patterns for parity with Next.js App Router.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-24 22:03:44 +02:00
Tanner Linsley
956d5f27e0 release: v1.132.3 v1.132.3 2025-09-24 19:45:30 +00:00
Manuel Schiller
e4d5671ba9
fix: various fixes (#5215)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 21:42:56 +02:00
Nico Lynzaad
06839407b9
Docs(Start): remove target from hosting docs (#5204)
This removes reference to the target property from the hosting docs as
this is now defined through vite plugins
2025-09-24 10:42:11 +02:00
Nico Lynzaad
065722ab29
docs(start): fix broken links (#5197)
corrects broken links in the start docs

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Updated numerous cross‑reference links across React start guides
(authentication, execution model, server functions, environment
variables, middleware, router guides, migration) to point to correct
locations.
* Hosting guide: added a Netlify section with setup example; updated
Cloudflare Workers and Railway/Node.js anchors for clarity.
  * Authentication docs: minor formatting tweaks.
  * Server routes: removed merge conflict markers and cleaned content.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 03:18:36 +02:00
Tanner Linsley
c2f732d30f release: v1.132.2 v1.132.2 2025-09-23 22:38:18 +00:00
Manuel Schiller
bd5557613a
fix: deps (#5195) 2025-09-24 00:33:48 +02:00
John Colvin
0aa36667e5
Fix typo in error message for server rendering (#5161) 2025-09-24 00:28:41 +02:00
Manuel Schiller
70d2989546 docs: update to RC 2025-09-24 00:16:51 +02:00
Sarah
0c069fb66f
docs: Fix README images (#5162)
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>
2025-09-23 23:42:59 +02:00
Tanner Linsley
f5ac86a045 release: v1.132.1 v1.132.1 2025-09-23 21:40:21 +00:00
autofix-ci[bot]
ba84c91df5
ci: apply automated fixes 2025-09-23 21:34:36 +00:00
Manuel Schiller
6f87bc8dcd fix: correctly handle undefined serializationAdapters 2025-09-23 23:33:12 +02:00
Manuel Schiller
f955b5d732 docs: remove registerGlobalMiddleware 2025-09-23 23:19:09 +02:00
Tanner Linsley
0b33aa5cb4 docs: RC callout 2025-09-23 14:06:46 -06:00
Tanner Linsley
e317020ddd docs: middleware header 2025-09-23 13:46:19 -06:00
Tanner Linsley
657fe59332 docs: middleware 2025-09-23 13:43:34 -06:00
autofix-ci[bot]
29493cb5ba
ci: apply automated fixes 2025-09-23 19:35:21 +00:00
Tanner Linsley
e6475dac20 docs: Start overhaul
# Conflicts:
#	docs/start/config.json
#	docs/start/framework/react/hosting.md
#	docs/start/framework/react/learn-the-basics.md
#	docs/start/framework/react/middleware.md
#	docs/start/framework/react/overview.md
#	docs/start/framework/react/server-functions.md
#	docs/start/framework/react/server-routes.md
#	docs/start/framework/solid/build-from-scratch.md
#	docs/start/framework/solid/hosting.md
#	docs/start/framework/solid/learn-the-basics.md
#	docs/start/framework/solid/selective-ssr.md
2025-09-23 13:34:03 -06:00
autofix-ci[bot]
0a28b17b9e
ci: apply automated fixes 2025-09-23 18:14:14 +00:00
Jaime R.
8c0f8d439f
[Docs] Fix two dots in method call (#5190)
Tiny fix 😊

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Corrected middleware chaining in the React static server functions
example, replacing an erroneous double-dot with proper single-dot method
chaining.
* Example now compiles and accurately reflects the fluent API, improving
clarity for readers.
* No changes to public APIs or runtime behavior; this is a documentation
fix to prevent developer confusion.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-23 20:13:06 +02:00
Tanner Linsley
04176ecee7 docs: funded by 2025-09-23 11:45:10 -06:00
Tanner Linsley
a5909a45ab release: v1.132.0 v1.132.0 2025-09-23 17:36:29 +00:00
Manuel Schiller
32faee22da
feat: Start RC (#5189)
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: chorobin <chrishorobin@hotmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: hokkyss <hokkyss2@gmail.com>
Co-authored-by: Philippe Serhal <philippe.serhal@gmail.com>
Co-authored-by: Jack Herrington <jherr@pobox.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
2025-09-23 11:34:54 -06:00
Tanner Linsley
4a6dcd09cf release: v1.131.50 v1.131.50 2025-09-22 01:13:50 +00:00
Nico Lynzaad
ecd79d2b63
fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182)
as part of #5169 we made changes to strip underscores from the paths to
ensure it is dealt with correctly during parsing.

inadvertently this stripped it from not only the route segments but also
the base segments. This PR resolves that issue by making
`baseParsePathName` aware which type of segments it is parsing.

a new optional boolean paramater, ```basePathValues```, is introduced in
`baseParsePathName` and `parsePathname` to allow this distinction
between routeSegments and/or basesegments to be passed on to
`baseParsePathName`.

2 new functions are introduced `parseBasePathSegments` and
`parseRoutePathSegments`, which is just wrapper functions around
`parsePathname`, but ensures clearer understanding of what set of
parsing instructions is applied and `basePathValues `is set correctly
based on the requirement.

updated the unit tests to take into account the need not to strip the
base values and also enhanced the e2e tests as well to ensure more
through testing with different usages.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- New Features
- Added non-nested route demos (named, prefix, suffix, path) with
index/foo/bar pages and updated navigation in React and Solid examples.
- Bug Fixes
- Improved path parsing/matching to handle non-nested segments,
prefixes/suffixes and trailing underscores; refined route
sorting/resolution.
- Tests
- Added comprehensive E2E coverage for non-nested paths; removed
obsolete baz-based tests.
- Expanded unit tests for path interpolation and matching (underscore,
prefix/suffix cases).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-22 03:12:27 +02:00
Tanner Linsley
0d00f2862a release: v1.131.49 v1.131.49 2025-09-19 23:36:55 +00:00
Manuel Schiller
1d5c5f7776
fix: tell router that rendering finished when rendering to string (#5174)
fixes #5155

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved server-side rendering stability by correctly finalizing the
initial render before injecting additional HTML, preventing rare hangs
or incomplete pages.
  * Applies to both React and Solid router SSR paths.

* **Performance**
* Slightly reduces SSR latency by signaling render completion earlier in
the pipeline.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-20 01:34:03 +02:00
Tanner Linsley
f5872dfef7 release: v1.131.48 v1.131.48 2025-09-18 23:06:58 +00:00
Nico Lynzaad
cf2346ba42
fix(router-core): Non-nested paths (#5169)
This PR continues on from #5165 and primarily adds additional tests to
path resolution and matchByPath for non-nested paths in additiona to e2e
test for both react and solid router to verify non-nesting
functionality.

One additional issue was picked up for handling of normal path segments.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- New Features
- Added non-nested demo routes and navigation examples (including
dynamic and edit paths) for React and Solid, with headings, links, and
parameter displays.
- Bug Fixes
- Improved path parsing/decoding for non-nested segments to prevent
unintended nesting and ensure correct parameter values.
- Tests
- Added broad unit tests for non-nested path parsing/matching/resolution
(case-sensitive/insensitive, wildcards, optional/fuzzy).
- Added e2e tests validating non-nested navigation and params; reduced
e2e flakiness by awaiting network idle.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-19 01:05:26 +02:00
Tanner Linsley
3b69de0f41 release: v1.131.47 v1.131.47 2025-09-18 18:29:36 +00:00
Nico Lynzaad
ab12c06634
fix(router-core): parse non-nested path params correctly (#5165)
When parsing path params to interpolate the path non-nested path params
```/path/$param_``` was being parsed in the same manner as regular path
params ```/path/$param```.

This PR adds consideration for the trailing underscore when parsing the
path for non-nested path params as well as unit tests on path
interpolation and e2e tests for useParams to ensure this is parsed
correctly and updates correctly when params change.

This resolves #5164

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- New Features
- Support trailing-underscore non-nested path params (e.g., /users/$id_
→ /users/123).
- UI shows an additional navigation link for the non-nested route
(/params-ps/non-nested/foo2/bar2) and improved link display text.

- Tests
- Expanded React and Solid e2e tests to cover the new link, navigation,
and param parsing for foo2/bar2.
- Added unit tests validating interpolation/matching for the $param_
syntax.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-18 20:28:01 +02:00
Tanner Linsley
a8714cdb15 release: v1.131.46 v1.131.46 2025-09-18 18:16:05 +00:00
wookhyung
b0ea8de91d
fix(router): prevent script tag duplication in SSR and client-side navigation (#5095)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-18 20:09:15 +02:00
Lee
2c8d5ce61e
fix(router): respect target attribute on inner component (#5115) 2025-09-18 20:06:37 +02:00
Tanner Linsley
d49b20459c release: v1.131.45 v1.131.45 2025-09-18 17:31:08 +00:00
Flo
c77dbc34f7
refactor(react-router): Link component composeHandler performance (#5168)
I noticed a slight performance dip during some navigations and the
bottom-up call list of the flame graph seemed to point to the
`composeHandler`. This seems (surprising and) pretty minor, but I'm
measuring a consistent 3ms self-time when the resulting handler is
actually being called.

This PR proposes ditching array methods and using a `for-of` loop. This
is good-enough™ and preserves the generality and DX of this function for
a 25% perf improvement.

```sh
 ✓  @tanstack/react-router  tests/foo.bench.tsx > composeHandlers 10064ms
     name                      hz     min     max    mean     p75     p99    p995    p999     rme   samples
   · array methods  37,152,711.10  0.0000  0.1624  0.0000  0.0000  0.0000  0.0000  0.0002  ±0.14%  18576357
   · for-of         47,029,751.81  0.0000  0.0236  0.0000  0.0000  0.0000  0.0000  0.0001  ±0.07%  23514876   fastest

 BENCH  Summary

   @tanstack/react-router  for-of - tests/foo.bench.tsx > composeHandlers
    1.27x faster than array methods
```

A slightly more performant (~30%) version would be to handle *exactly* 2
handlers instead of an arbitrary number (since `composeHandlers` is only
used w/ 2 callbacks) but this does affect the generality and DX of this
function.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Updated link event handling to short-circuit when an action is
prevented, maintaining existing behavior.
- Streamlined internal logic for handling user interactions with links
for improved efficiency.
- **Performance**
- Minor efficiency improvements in link interaction handling without
altering the public API or user-facing behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-18 19:29:39 +02:00
Shruti Kapoor
fb4c6a1b82
docs: Tutorial: Fetching data from an external API (#5050)
Adding a new tutorial to Docs -> Tutorials 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* Documentation
* Added a step-by-step tutorial showing server-side route-loader
fetching from an external API into a TanStack Start React app (TMDB
example), covering project setup, env token usage, data flow (SSR),
loading/error states, UI samples, and testing instructions
(/fetch-movies).
* Chores
* Added a Tutorials entry linking the new guide into the React
documentation navigation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-16 20:30:48 -06:00
Shruti Kapoor
e4a3e74a29
docs: Moving images inline and changing urls to relative (#5072)
Incorporating feedback from PR -
https://github.com/TanStack/router/pull/4089. Changes made -
1. Moved images to `assets` folder on suggestion
2. Changed URLs from absolute to relative. 
3. Adding an in-line sequence diagram

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Newly added jokes now receive unique identifiers, improving
reliability when creating new entries.

* **Documentation**
* Updated links to internal paths for SSR, router concepts, and React
Query sections.
* Switched images to repository-hosted assets for consistency and
availability.
* Replaced the data flow image with an inline Mermaid sequence diagram
covering home-page loading and add-joke flows, including data refresh
behavior.
  * Minor formatting cleanup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-16 20:29:49 -06:00
Prateek Karki
1405da71ed
docs: Fix grammatical error (#5148) 2025-09-16 20:12:24 +02:00
Sarah
8a15c49e5d
Update README (#5152)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-16 20:12:10 +02:00
Tanner Linsley
5566ada217 release: v1.131.44 v1.131.44 2025-09-15 10:58:54 +00:00
Vedant Pahune
bfc466ffd3
fix: restore InferStructuralSharing and handleHashScroll in published .d.ts files (#5134)
Fixes #5116

### Root Cause
In PR #4907, the TypeScript compiler option `stripInternal` was enabled
in tsconfig.json, which causes TypeScript to remove any declarations
marked with `@internal` from the published `.d.ts` files.

This resulted in TypeScript compilation errors for library users who
have set the TypeScript compiler option `skipLibCheck` to `false`,
because the following members were missing:

- `InferStructuralSharing` type in `react-router`
- `handleHashScroll` function in `router-core > scrollRestoration`

### Fix
- This PR replaces the `@internal` annotation with the `@private`
annotation.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated internal API annotations in routing packages to mark certain
items as private, improving the accuracy of generated developer
documentation.
  * No changes to public APIs, behavior, or performance.
  * No user-facing impact.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-15 12:52:34 +02:00
Tanner Linsley
f65072eef1 release: v1.131.43 v1.131.43 2025-09-13 00:48:33 +00:00
Sean Cassiere
96bde26a90
fix(router-plugin): show warning for non-splittable items (#5145) 2025-09-13 12:47:02 +12:00
autofix-ci[bot]
9a728b67b6
ci: apply automated fixes 2025-09-12 22:00:41 +00:00
Pavel Rakhmanov
ff07b8135f
docs: fix invalid JSX on selective-ssr documentation page (#5142) 2025-09-12 23:59:50 +02:00