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

187 commits

Author SHA1 Message Date
Christopher Horobin
844b66c795
refactor(router-core): migrate matches and route options to core (#3552)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-24 23:17:58 +01:00
Lee
4d35542f98
fix(router-core): allow %25 in path params (#3419)
fixes #3402

---------

Signed-off-by: leesb971204 <leesb971204@gmail.com>
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-02-25 11:13:27 +13:00
Christopher Horobin
72b505c5d3
refactor(router-core): begin migrating types from react-router and solid-router to router-core (#3538)
Migrates many types over but there is still a lot to do D:

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-23 23:18:16 +01:00
Manuel Schiller
cca6a806ee
fix(react-router, solid-router): do not strip search params if search validation fails (#3496) 2025-02-21 00:32:45 +01:00
Manuel Schiller
4e8cc040c9 tests(react-router): import locally in test 2025-02-18 19:19:27 +01:00
Manuel Schiller
0277309b1b
fix(react-router): only navigate once in StrictMode (#3465) 2025-02-18 02:10:05 +01:00
Manuel Schiller
4c7caeba94
feat: replace <Meta /> by <HeadContent /> and add dedicated headScripts (#3439) 2025-02-14 23:19:01 +01:00
Manuel Schiller
8dbbe938ca
fix: only call head() when loaderData is available (#3410)
if no loader exists, `head()` will be called with `loaderData: undefined`

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2025-02-13 13:06:13 -07:00
Manuel Schiller
b8165abf91
fix(react-router): fix path param handling with relative navigation (#3423)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-13 19:39:15 +01:00
Manuel Schiller
6346365b1f
fix(react-router): exclude props from state equality check to prevent history push for equal url and state (#3373)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-09 14:47:46 +01:00
Manuel Schiller
3b158d0ab0
feat(react-router): add shouldThrow option to useParams and useSearch (#3368) 2025-02-08 22:36:40 +01:00
Manuel Schiller
fdaefc035d
fix: Fix scroll restoration (#3191)
* fix: scroll-restoration (especially on hydration mismatch)

* fix: more fixes

* fix canGoBack

* release: v1.97.25

* chore(root): upgrade `vitest` to `3.0.4` (#3257)

* chore(root): upgrade `nx` to `20.4.0` (#3259)

* fix(react-router): improve error handling for module loading failures in lazyRouteComponent (#3262)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix(start-server): remove debugging timeout (#3258)

* fix(start-plugin): invoke server implementation of createIsomorphicFn during SSR (#3268)

* feat(react-router): add `remountDeps` (#3269)

* fix: RELEASE_ALL

RELEASE_ALL

* examples: remove dep (#3270)

* release: v1.98.0

* checkpoint

* fix tests

* tests: fix

* fix: back to old onRendered

* fix: scroll-restoration (especially on hydration mismatch)

* fix: more fixes

* fix canGoBack

* checkpoint

* fix tests

* tests: fix

* fix: back to old onRendered

* Move utils to core

* fix: backwards compat ScrollRestoration

* fix: better versioning

* fix: reenable hash scrolling and window reset even without scroll restoration

* test(e2e): renable tests for router

* fix: backwards compat and docs

---------

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Flo <fpellet@ensc.fr>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Grant <1670902+djgrant@users.noreply.github.com>
2025-01-29 14:50:54 -07:00
Manuel Schiller
34d03505ef
feat(react-router): add remountDeps (#3269) 2025-01-29 01:03:33 +01:00
Birk Skyum
a3e0899e2d
refactor(router-core): move router-core into a separate package (#3171)
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-01-26 14:06:35 +13:00
Christopher Horobin
5b0a82bbe8
fix(react-router): use intersections for search param merging (#3220)
* fix(react-router): use intersections for search param merging

* chore: add type tests and refactor

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-25 22:44:29 +01:00
renovate[bot]
b9f44bc038
chore(deps): update all non-major dependencies (#3018)
* chore(deps): update all non-major dependencies

* fix eslint issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2025-01-25 17:52:11 +01:00
Kuba Jastrzębski
ad0e9de7b4
fix(react-router): Pass SearchParamError#cause in validateSearch (#3155) 2025-01-25 13:17:39 +01:00
Manuel Schiller
55505a114a
fix: make react-19 the default (#3226)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-25 03:16:46 +01:00
Tanner Linsley
bb1a14ae82
fix: router stream injection (#3216)
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-24 23:47:41 +01:00
Christopher Horobin
0cc3e14f7c
chore: update zod and arktype (#3178)
* chore: update zod and arktype

* ci: apply automated fixes

* chore: fix tests

* chore: remove ts ignore

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-15 23:17:28 +01:00
Ben Durrant
72fbd4c99a
fix(start): preserve multiple values for same key in FormData serialization (#3140)
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-01-13 12:55:58 +13:00
Sean Cassiere
40f9f49e4b
test(react-router): check FormData serialization in transformer (#3139) 2025-01-11 00:13:09 +13:00
Christopher Horobin
04802fb65a
fix: make to required if from is not set (#3099)
* fix: make `to` required if `from` is not set

* chore: fix build
2025-01-04 18:48:57 +01:00
Tom Rehnström
366848eb0e
feat(react-router): add useCanGoBack (#3017)
also fixes that history does not notify twice for certain actions
2025-01-03 21:09:58 +01:00
Christopher Horobin
446f033755
feat: allow arrays for linkOptions and add ValidateLinkOptions (#3098)
* feat: allow arrays for `linkOptions` and add `ValidateLinkOptions`

* chore: fix build
2025-01-02 23:08:46 +01:00
Manuel Schiller
d16fb426f6
fix(react-router): ensure updated context in beforeLoad when returning same properties (#3095)
fixes #3051
2025-01-01 13:24:51 +01:00
Christopher Horobin
b0e9d1a1ba
fix: fix types for relative routing (#3084)
* fix: improve relative routing types

* chore: add typechecking for generator

* chore: reverse peer dep

* fix: further improve relative routing

* chore: fix build and further improve types

* chore: fix typo in package.json
2024-12-29 15:16:42 +01:00
Christopher Horobin
e2a7fec91b
fix: use const type parameters (#3085)
* fix: use const type parameters

* chore: fix build
2024-12-28 15:13:13 +01:00
Tanner Linsley
ebf67cab35
fix: allow serverFn errors to also have context (#3037)
* fix: allow serverFn errors to also have context

* fix: allow errors, undefined from server functions

* remove logs

* fix: transformer and tests

* ci: apply automated fixes

* no logs

* fix conficts

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-22 23:25:53 -07:00
Manuel Schiller
6b3703feb6 tests: disable flaky test 2024-12-17 11:51:14 +01:00
Manuel Schiller
f85edf2e87 fix(react-router): do not preload links with reloadDocument: true 2024-12-17 11:39:25 +01:00
Manuel Schiller
7b66844bbd fix(react-router): do not treat internal link with reloadDocument: true as external 2024-12-17 11:04:01 +01:00
Christopher Horobin
cb1b65e2b3
perf(react-router): improve resolve relative route and use intersections for checking path (#2425)
* perf(react-router): improve resolve relative route and use intersections for checking path

* perf(react-router): use a few more intersections

* fix: allow string to

* chore: work in progress

* chore: fix tests

* feat: add type primitives

* feat: add more type primitives

* ci: apply automated fixes

* chore: fix build

* refactor: rename to paths

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-16 23:41:29 +01:00
Tom Rehnström
f420670bf2
feat(react-router): update useBlocker hook to provide current and next location when conditionally blocking (#1790)
* chore: clean up changes

* feat: clean up work and address feedback

* feat: add backwards compat

* ci: apply automated fixes

* feat: give history action to subscribers via notify

* fix: provide go index to history subscribers

* docs: updated docs accourding to feedback

* fix: changed valid notify call

* rename to `type`

* remove non existing `pushstate`event

* cleanup

* typesafe API for shouldBlockFn

* feat: added blocking state to resolver and updated examples

* docs: updated useBlocker and navigation-blocking docs

* test: added type tests to blocker and changed type implementation of blocker

* test: added better unit tests for useBlocker hook

* test: added e2e tests for blocker and legacy blocker

* wip: stash files before merge

* fix: unstashed e2e file after merge

* fix lockfile

* docs

* typesafety for `<Block>`

* always return resolver to not break backwards compatibility

* fix: removed zod from navigation blocking example to fix build problem

* chore: update lock file

* finishing touches

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2024-12-15 10:32:16 +01:00
Manuel Schiller
f355ae1ed4
fix(react-router): useMatch returns union of matches when strict = false (#3013) 2024-12-14 22:46:14 +01:00
Manuel Schiller
5ad95cf3f7
feat(react-router): allow to redirect to external targets, add reloadDocument option (#3004)
* feat(react-router): allow to redirect to external targets, add `reloadDocument` option

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-13 12:29:33 +01:00
Christopher Horobin
ec50a80237
fix(react-router): allow union when assigning (#2994) 2024-12-12 19:58:09 +01:00
Manuel Schiller
52e9d4fec7
fix(react-router): when ongoing beforeLoad failed, retry next time (#2949) 2024-12-08 19:13:46 +01:00
Tanner Linsley
941ff2d131
fix(react-router): preloads (#2945)
* tests(react-router): add test for `preload` flag of `beforeLoad` and `loader`

* fix: preloads

* fix: simplify preload resolution

* fix missing !

---------

Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2024-12-07 23:24:29 +01:00
Gregory Collett
d44912aa74
fix(react-router): ensure links and scripts are available on routes created with createRoute (#2854)
* ensure that links and scripts are available on route, routes created with createFileRoute work routes created with createRoute did not

* test(react-router): check for head fn update

---------

Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-12-06 18:28:54 +01:00
Matthias Schwarz
742c0ed541
feat(react-router): generic router history (#2782)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-29 00:10:17 +01:00
Tanner Linsley
4d5d25bc08
Chained Server Fn Syntax, ServerFn Middleware (#2513)
* init

* Refactor createServerFn, add createServerMiddleware

* checkpoint

* checkpoint

* checkpoint

* update docs and examples to use new server function syntax

* fix: compilers, and update examples

* refactor: added merging of context and some type tests

* feat: createServerMiddleware context and input validation types

* checkpoint

* Server function middleware

* checkpoint

* checkpoint

* fix: return types from handlers, merging inputs etc

* checkpoint

* checkpoint

* checkpoint

* checkpoint

* feat: add types for client context and server context

* fix: merge server context

* checkpoint

* docs

* fix: better compilation of server functions

* fix: deferred example

* Html, Head, Body... be GONE!

* fix: API Routes

* checkpoint

* fix: support optional input types

* checkpoint

* fix lossy merge

* ci: fix build

* ci: fix start examples

* checkpoint

* feat: add client after context types

* test: add type tests

* checkpoint

* checkpoint

* Remove now-unnecessary data type headers

* checkpoint

* fix e2e test

* fix up merge conflicts

* ci: apply automated fixes

* fix: a few tests and a runtime bug

* chore: pnpm dedupe
except the search-validator-adapters example, everything else builds fine

* fix merge conflict

---------

Co-authored-by: chorobin <chrishorobin@hotmail.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-11-14 09:43:20 -07:00
Manuel Schiller
418f4ce3e1
fix(react-router): populate URL with default search params (#2747) 2024-11-13 19:19:51 +01:00
Manuel Schiller
0873c1f0c9
feat(react-router): add support for structural sharing for finegrained selectors (#2647)
Co-authored-by: chorobin <chrishorobin@hotmail.com>
2024-11-09 22:41:12 +01:00
alma-lp
cc05ad8205
feat(react-router): allow unencoded characters in dynamic path segments (#2677) 2024-11-05 22:08:21 +13:00
Manuel Schiller
0e3fae1edd
fix(react-router): improve types for parentMatchPromise (#2669) 2024-10-29 18:52:57 +01:00
Manuel Schiller
019f9d1824
fix(react-router): parentMatchPromiseresolves to parent match (#2666) 2024-10-28 22:16:03 +01:00
xiaohai-huang
335fdede6a
fix(react-router): remove flashes caused by <ScrollRestoration /> (#2645)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-27 23:04:30 +01:00
Manuel Schiller
a872d4c2bd
fix(react-router): correctly narrow in router.invalidate and router.clearCache (#2659) 2024-10-27 22:29:20 +01:00
Sean Cassiere
ae10503cf0
feat(react-router): add preload='render' support (#2644) 2024-10-27 14:00:55 +13:00