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

75 commits

Author SHA1 Message Date
Philippe Serhal
6ff1190bdc
chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 01:49:12 +01:00
Manuel Schiller
2d9193c25c
chore: bump deps (#6408)
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
2026-01-18 02:14:48 +01:00
Manuel Schiller
b42f84a4f6
fix: fullpath handling (#6404)
* fix: fullpath handling

fixes #6403
fixes #2675
fixes #4892

* add type test

* preserve / for index routes

* fix  #3005

* fix tests
2026-01-17 17:21:10 +01:00
Jakob Norlin
a1324bb155
fix: navigate() with href containing basepath (#6335)
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2026-01-08 23:33:41 +01:00
Birk Skyum
6839bfb1a0
docs: move to tailwind 4 w/ vite (#6168) 2025-12-21 04:13:49 +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
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
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
Shreyas Sarkar
8f5d93b58c
fix: Links always scroll to URL hash on hover (#5930) (#5944) 2025-11-23 01:05:34 +01:00
Birk Skyum
6f06558afa
chore: use "preview" instead of "serve" to refer to "vite preview" (#5917) 2025-11-20 05:08:43 +01:00
Birk Skyum
f830dffb74
test(router): remove flaky query transition test (#5883) 2025-11-16 19:27:33 +01:00
Birk Skyum
559856b7bf
test(router): add view-transition e2e suites (#5869)
* test(router): add view-transition e2e suites

* ci: apply automated fixes

* setup suites

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-14 23:10:31 +01:00
Flo
043e57656d
refactor(router-core): simplify matchId (#5807)
* refactor(router-core): simplify matchId

* ci: apply automated fixes

* update tests

* matchId !== routeId

* nitpicks

* missed in solid router Match

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
2025-11-11 00:55:46 +01:00
Birk Skyum
1b75808f37
test(router, start): query navigation transitions (#5802)
* test(router): test query transitions

* ci: apply automated fixes

* test start

* ci: apply automated fixes

* dim double click test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-10 00:17:53 +01:00
Birk Skyum
fcf1a82412
test: restructure transition e2e tests (#5800) 2025-11-09 19:26:55 +01:00
Nico Lynzaad
23d8ed7715
fix(router-generator): handle deep multi-level non-nested paths with experimental non-nested paths (#5779)
* fix generation of deep non-nested paths

* add router-generator unit tests

* add react-router e2e tests

* add solid-router e2e tests

* resolve typo in heading
2025-11-07 01:53:50 +02:00
Nico Lynzaad
26f23faf13
refactor(router-core): consistent Unicode handling (#5736)
* add router-core fixes and update tests

* update react-router unit tests

* update react-router e2e tests

* update solid-router unit tests

* update solid-router e2e tests

* update test description

* rename function

* rename test as per codeRabbit nitpick

* test cleanup
2025-11-06 03:35:59 +02:00
Birk Skyum
6baffebbce
test(solid-router): enhance transition test suite (#5753) 2025-11-04 17:22:55 +01:00
Birk Skyum
76c4f614f2
fix(solid-router): implement navigation transitions (#5691) 2025-11-04 03:51:16 +01:00
Birk Skyum
d558b67239
fix(solid-router-ssr-query): allow redirect inside server function ssr (#5668) 2025-11-03 17:24:25 +01:00
Birk Skyum
04f137e0a8
fix(solid-router): allow creating link for client-side-routing in SVG (#5667)
* add test

* fix svg links in solid router

---------

Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
2025-11-01 10:54:36 +01:00
Birk Skyum
a282b9714d
fix(solid-router): Should not remount deps when remountDeps does not change (#5693) 2025-10-30 04:13:48 +01:00
Birk Skyum
1ec38819b6
test(router): make the remount test more thorough (#5684)
test(router): make the remount test more clear if there's extra mount initially
2025-10-29 04:13:54 +01:00
Birk Skyum
f9bf3a5eea
fix(router): bump tanstack store to ^0.8 (#5680) 2025-10-29 02:09:55 +01:00
Nico Lynzaad
915de641cd
refactor(router-core): more stable url decoding (#5663)
* add decode path segment util

* ensure navigation and browsing to path has same encoding/decoding

* add e2e tests

* add test recommendations

* nitpick

* minor enhancements

* build array once

* add additional unit and e2e tests

* remove react import from solid test

* nitpicks

* final nitpicks

* use history.push
2025-10-28 23:33:50 +02:00
Nico Lynzaad
e2be32a9b5
test(solid-router): use default generated values in basic file based (#5662)
use default generated values
2025-10-28 02:00:26 +02:00
Birk Skyum
818a4ee8c8
chore(solid): bump solid to 1.9.10 (#5661) 2025-10-27 23:02:49 +01:00
Birk Skyum
a2aaf1f73f
test(solid-router): add params test for basic file based (#5642)
add params test for basic file based
2025-10-26 23:43:18 +01:00
Birk Skyum
645de2353a
chore: update query to consistent 5.90 (#5634)
* chore: update query to consistent 5.90

* update to 5.90.0

* save bump

* bump root

* use 5.90

* update query integration for solid

* update query integration for solid

* ci: apply automated fixes

* align solid-query versions

* data-only

* lockfile

* lcokfile

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-26 19:29:46 +01:00
Birk Skyum
aefd20f917
test(solid-router): update basic-file-based (#5633) 2025-10-26 15:00:23 +01:00
Birk Skyum
00efd13e9c
test(solid-router): js-only-file-based e2e suite (#5626) 2025-10-26 01:32:27 +02:00
Birk Skyum
9bc2969bd7
test(solid-router): generator-cli-only e2e suite (#5625)
test(solid-router): generator-cli-only
2025-10-26 01:21:05 +02:00
Birk Skyum
54e0be8422
test(solid-router): add basepath-file-based e2e suite (#5623) 2025-10-26 00:36:00 +02:00
Birk Skyum
3ce120b377
test(solid): add params.spec.ts to start/router (#5617) 2025-10-25 22:01:24 +02:00
Birk Skyum
a068c4318e
test(solid-router): add sentry e2e (#5612) 2025-10-25 17:57:12 +02:00
Nico Lynzaad
d293e1b15a
fix(route-core, router-generator): resolve non-nested routes correctly in generator (#5402)
* revert router-core changes

* add experimental nonnested path changes to generator

* update router-generator unit tests

* update basic-file-based-e2e

* cleanup

* cleanup

* add tests for isValidNonNestedPaths

* resolve eslint issues

* align naming to documentation

* cleanup

* update solidjs basic-file-based tests

* update documentation

* ci: apply automated fixes

* resolve test issues

* code rabbit suggestions

* ci: apply automated fixes

* fix excess period in routeTree path

* restore snapshot again

* ci: apply automated fixes

* resolve nitpick

* resolve removeTrailingUnderscore issue

* fix routeTree path

* final nitpicks

* better test description

* exclude snapshots from prettier

* minor cleanup

* resolve change in snapshots due to changes from main

* update prettierignore

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-24 10:29:24 +02:00
Birk Skyum
47bc1c3b65
chore(solid): bump solid-js to ^1.9.9 to align seroval versions (#5586) 2025-10-23 02:09:52 +02:00
Birk Skyum
eab8a9941c
chore: bump tailwind from v3 to v4 with postcss (#5580) 2025-10-22 03:42:26 +02:00
Birk Skyum
7f809a8c35
chore(solid): bump vite plugin solid to 2.11.10 (#5572)
* bump vite-plugin-solid to 2.11.10

* update lockfile

* fix lint
2025-10-21 22:19:03 +02:00
Nico Lynzaad
afaecfc3e5
fix(router-generator): remove trailing slash from pathless route group paths (#5491) 2025-10-16 20:25:48 +02:00
Birk Skyum
581941a86a
tests(solid-router): Enable e2e scroll restoration test (#5298)
* enabled solid-rotuer e2e scroll restoration test

* fix solid-router e2e scroll restoration test
2025-09-29 22:34:03 +02:00
Magnus May
2ff5bc20f7
docs: add Bun production server guide for TanStack Start (#5237)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-27 01:01:49 +02: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
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
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
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
Nico Lynzaad
2b6789baa6
fix(router-core): _strictParams and path defining characters (#5135)
This PR resolves #5133 by making the _strictParams more conscious of
path defining characters and other wildcards. It also adds e2e tests for
react and solid

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

- **New Features**
- Added “Non-nested path params” pages and links in React and Solid
basic-file-based e2e tests at /params-ps/non-nested, plus nested dynamic
routes to view single and combined params; UI links and outlets
included.

- **Bug Fixes**
- Improved internal path-parameter resolution so strict param extraction
uses the full route path for more accurate matching.

- **Tests**
- Added end-to-end tests verifying navigation to
/params-ps/non-nested/foo/bar and correct partial vs. full param values.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-11 23:27:28 +02:00
Nico Lynzaad
22c9888857
fix(react-router, solid-router) - useParams should only be concerned about the relevant params (#5097)
#5020 highlighted an issue where when using useParams in parent route
(that has its own path param) with child routes that also use path
params this can cause excessive re-rendering of the parent route when
the params for the child routes changes.

The root cause for this is that the child params are available to the
parent route, even when strict=false was not specified and this also
does not match to the types that is being returned in this case. This
can be worked around by using select inside the useParams hook/function
but results in unnecessary boilerplate.

This PR attempts to resolve the issue by dealing with the two distinct
cases, one where we are only concerned about the path params of the
current route and prior routes (strict=true/undefined) and the second
where we want access in the parent route to the path params of the child
routes (strict=false).

In the strict case we use the match id to return the params of the
specific match, which is constant and results in stable rendering, while
in the strict=false case we fallback to the initial implementation of
returning params from the useMatch result which can be variable and
requires re-rendering to be done.

Changes were done on useParams for both react and solid, in solid's case
this wasn't causing re-renders but did return unexpected child params,
the change for solid is more toward keeping the API and expected outputs
consistent between the two frameworks. existing unit tests for react was
updated and e2e tests for both frameworks was added to ensure rendering
and results match the expected.

A separate merge has been prepared for Alpha and will be merged on
signoff of this one.

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

- **New Features**
- Added nested named-parameter routes (three-level: foo → bar → baz) in
example apps with nested navigation, outlets, links and render-count
displays.
- Added a small render-counter component to visualize component
re-renders.

- **Bug Fixes**
- Improved params selection to respect strict vs non-strict modes,
reducing excess renders and producing stable param values.

- **Tests**
- Added E2E tests for React and Solid examples covering param navigation
and render-counts; expanded router unit tests for nested-route stability
and remount behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-07 11:35:09 +02:00
Nico Lynzaad
fb04dafb21
fix(react-router, solid-router): reduce useNavigate reactivity on path changes (#5037)
This is a follow-up to #4978.

As picked up by @Sheraff the changes made caused useNavigate to
negatively impact performance specifically with useNavigate being too
reactive to path changes.

This reverts the use of useActiveLocation, that acted as a single
implementation of the logic to determine the from location, and moves
the determination of the from path back to each of Link and useNavigate.
While the core logic is still the same across the implementations the
implication of how it's used and the sources of the required inputs are
different enough that it warrants separate implementations.

This PR does not revert the full change set and still applies to core
reasons and changes for the previous commit in keeping the logic for
determining the from clause the same, i.e. the order of determining the
from path for navigation remains: from clause => current location =>
rendered location.

@Sheraff to advise if this implementation resolves the issues he picked
up.



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

* Breaking Changes
* Removed active-location hooks and their associated types from React
and Solid packages.
* Refactor
* Link and navigation now accept an explicit "from" option instead of
deriving it from active-location state.
* New Features
* Added a programmatic Navigate helper for Solid to trigger navigation
on mount.
* Bug Fixes
* More predictable fallback behavior when no explicit "from" is
provided.
* Performance
  * Reduced state subscriptions for minor efficiency gains.
<!-- 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-08-31 13:48:25 +02:00