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

173 commits

Author SHA1 Message Date
Joshua Knauber
72b7c82ac5
refactor(react-router): expose scrollBehavior on the ScrollRestoration component (#3053)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-12-22 12:49:06 +13:00
AlexisPin
38702a8994
docs: minor typo in code-based-routing.md (#3043) 2024-12-19 18:03:08 +01:00
autofix-ci[bot]
253284a196
ci: apply automated fixes 2024-12-18 21:20:21 +00:00
Youssef Benlemlih
8a09e261bf
docs: add custom link example for mantine (#3033) 2024-12-18 22:19:11 +01:00
Anton Kuznetsov
96a7beebd1
docs: Update file-based-routing.md (#3026) 2024-12-17 01:46:59 +01:00
akhmadshin
02a4957b64
feat(react-router): allow to preload route chunk (#3016)
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-16 23:42:34 +01:00
reihwald
f063b49b41
docs: Slightly improve navigation-blocking.md to avoid confusion (#3015) 2024-12-15 14:42:24 +01:00
Manuel Schiller
437fb7457a docs(react-router): fix blocker doc 2024-12-15 11:21:21 +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
54dad5f872
fix(start): fix usage of use() with React 19 (#2963)
both router and react 19 were modifying the Promise object in a similar manner which caused a conflict.

See https://github.com/facebook/react/blob/v19.0.0/packages/react-reconciler/src/ReactFiberThenable.js#L162-L228 for how React 19 modifies the Promise object.

Both used an additional `status` property to track the Promise status, but router was using the value "success" and React was using the value "fulfilled" to mark a fulfilled Promise.

This change stores the router specific Promise tracking values using a symbol to avoid any potential collision.

fixes #2953
2024-12-09 18:24:04 +01:00
Sean Cassiere
cebb221438
docs(router): update deferred data loading guide when using external libraries (#2940)
* docs(router): update deferred data loading guide when using external libraries
2024-12-07 12:11:48 +13:00
Sean Cassiere
a0ac5ed3b0
feat(router-generator): define virtual routes using a route.ts file (#2933)
* feat(router-generator): define virtual routes using a `route.ts` file

* refactor(router-generator): passing in the root

* feat(router-cli): passing in the root

* feat(router-plugin): passing in the root

* test(router-generator): check the functionality

* test(e2e): end-to-end test for named exports

* docs(router): update the docs

* docs(router): add file paths to the virtual guide

* docs: forgot to add this path

* Update docs/framework/react/guide/virtual-file-routes.md
2024-12-06 22:58:18 +13:00
autofix-ci[bot]
e1381491b7
ci: apply automated fixes 2024-12-02 20:59:22 +00:00
Vince
dbc2b91140
Update file-based-routing.md (#2908) 2024-12-02 21:58:18 +01:00
Adam Rackis
a0c294c0c7
docs(router): usage of accessing the loaderData on the data-loading guide (#2864)
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-11-26 16:55:22 +13:00
Julia Passynkova
aceca1cf0f
docs: clarification for Route object (#2838)
* 2821: Doc clarification for Route object

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-24 13:46:18 +01:00
Julia Passynkova
24fb41e1e4
docs(router): typo in the usage of route masks (#2812)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-21 21:36:07 +13:00
聪小陈
c991304380
docs(router): usage of imports for auth on authentication guide (#2813) 2024-11-21 21:17:29 +13:00
Leonardo Montini
a97f37ec0d
docs(start): explicitly set POST method updateCount server function examples (#2806) 2024-11-21 01:50:27 +13: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
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
Nick Mackenzie
d13de07230
docs: revise wording in TanStack Router documentation (#2697) 2024-11-04 23:37:35 +01:00
Sean Cassiere
563e5d168c
feat(router-generator): remove prettier ignore comment blocks (#2679) 2024-11-01 14:22:12 +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
NekoChan
7dc50e6e0f
docs(react-router): remove arkTypeSearchValidator (#2657) 2024-10-27 19:30:55 +01:00
Sean Cassiere
ae10503cf0
feat(react-router): add preload='render' support (#2644) 2024-10-27 14:00:55 +13:00
Ben McGinnis
cea5a11527
feat(router-plugin): add esbuild plugin (#2578)
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-10-22 13:21:07 +13:00
Christopher Horobin
5d62c032f7
feat(react-router): implement standard schema into router core (#2602)
* feat: implement standard schema into router core

* docs: update docs to exclude valibot adapter

* chore

* tests: add tests for valibot

* chore: update docs and tests for arktype

* docs: update docs
2024-10-21 23:23:29 +02:00
Christoffer Berg Jensen
5cc2f9f1b0
docs: add to createLink documentation (#2506)
* Refactor `createLink` documentation

Revise the text and examples in the `createLink` guide for better clarity and completeness. Added sections for React Aria Components, Chakra UI, and MUI with detailed code examples to illustrate the usage of third-party libraries.

* Improve clarity in custom-link.md

* Replace createLink implementation for ButtonLink component

* Remove redundant explanation in MUI example of custom-link guide

* Rename and simplify component creation in CustomLink guide

* Rename and streamline custom link components

* Fix consistency in prop quoting and remove unused import

* Small consistency improvements between examples

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-21 10:07:10 +02:00
Manuel Schiller
30730a383d
feat(react-router): allow to explicitly check if a search prop is not set (#2592) 2024-10-20 02:35:42 +02:00
Manuel Schiller
ac7171c7e1
feat(react-router): execute search middlewares also upon navigation (#2581) 2024-10-18 22:47:18 +02:00
Manuel Schiller
8d56157b07
feat(react-router): add stripSearchParams middleware (#2579) 2024-10-18 22:33:18 +02:00
Leonardo Juriolli
d9a97e2693
docs: add missing import for retainSearchParams (#2545) 2024-10-15 01:03:30 +02:00
Manuel Schiller
60b3f37e32
feat(react-router) add search middleware (#2521)
* feat(react-router) add search middleware

* add `retainSearchParams` middleware

* simplified types

* added docs
2024-10-14 20:34:35 +02:00
Manuel Schiller
6b52c3689c docs: remove outdated section 2024-10-12 22:09:33 +02:00
Manuel Schiller
a82bfa1e11
feat(router-generator): allow virtual file routes without file names (#2500) 2024-10-09 22:17:19 +02:00
Sean Cassiere
ac39caa8db
docs: less disruptive file-based routing guide regarding virtual routes (#2497) 2024-10-09 22:09:05 +13:00
Christopher Horobin
f48dd37b35
feat: add linkOptions for re-usable props (#2486)
* feat: add `linkOptions` for re-usable props

* chore: change examples

* docs: add docs for `linkOptions`

* tests: add type tests for `linkOptions`

* chore: fix spelling

* chore: update docs and make `const`
2024-10-07 23:22:47 +02:00
Manuel Schiller
83bda81793
docs: correct API for route-masking (#2466) 2024-10-04 10:42:33 +02:00
Danya Olekh
8804d8b6f0
Examples: remove unnecessary <Suspense> (#2458)
Co-authored-by: Dan <Dan>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-03 17:38:54 +02:00
Dominic Garms
ed8cdfb63e
fix outdated navigation hint inside the docs (#2455) 2024-10-03 12:11:16 +02:00
Miro Rauhala
6691b77346
docs: fix pathless route link (#2444) 2024-10-01 20:34:37 +02:00
Miro Rauhala
286b25b918
docs: update pathless route wording (#2445)
Removing a dot in a sentence (maybe it should've been a comma?) and create a lead for the list of uses for a pathless route.
2024-10-01 20:34:13 +02:00
Lalu Arman Rozika
a42deba776
docs(router): typo about the CLI in the file-based routing guide (#2424) 2024-09-27 16:34:43 +12:00
Christopher Horobin
61cd473b0e
docs(router): fix MUI button in "custom links" guide (#2420) 2024-09-27 08:20:43 +12:00
Christopher Horobin
63c211cc91
docs: fix size of headings (#2411) 2024-09-24 21:16:06 +02:00
Christopher Horobin
f76bb37bb0
fix: allow activeProps to infer component props (#2347)
* fix: allow activeProps to infer component props

* test

* fix: make active props partial

* default props shall not override active/inactive props

* fix test

* docs: add createLink docs

* fix: make `search` optional when `to` or `from` not specified

* chore: add type tests fro `createLink`

* docs: update docs

* docs: update typo

* docs: add imports

* feat: add CreateLinkProps

* chore: fix build

---------

Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
2024-09-24 20:47:38 +02:00
Sean Cassiere
89f136784b
docs(router): broken gfm alert on "search params" guide (#2397) 2024-09-23 20:22:34 +12:00