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

315 commits

Author SHA1 Message Date
Matt Peck
16a112fbc9
docs: Add install line to Manual Setup code block on Quick Start page (#3072) 2024-12-26 18:58:05 +01:00
Minh-Phuc Tran
20cb387523
docs(start): notFound should be imported from Router instead of Start (#3065) 2024-12-26 12:23:11 +01:00
Tanner Linsley
3808c6e7ad update docs 2024-12-24 12:15:11 -07:00
Tanner Linsley
8ac15ca190 Add Netlify callouts 2024-12-24 10:49:18 -07:00
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
Arnaud Kleinpeter
6d810d7f58
docs: Minor typo in middleware.md (#3042) 2024-12-20 11:53:13 +01: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
Chris Hudson
fb016b8115
docs: clarify server functions cannot be called from Api Routes; capitalize API Routes as they are a noun and consistency with API Routes page. (#3021) 2024-12-16 23:26:06 +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
Josh Slate
92147140c8
feat(react-router): implement hash change "Scroll Into View" option (#2996)
* feat: implement hash change scrollIntoView option

* e2e tests for hash change scroll behavior

* update e2e tests to use data-testId

* address feedback

* remove accidental change to package.json

* add anchor link to example navigation

* ci: apply automated fixes

* handle when location transitions without commitLocation running

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-14 08:58:03 +01:00
Josh Kelley
e5f7a8cc16
Update React Router 7 bundle size (#3006)
As of React Router 7, [everything is in the `react-router` package](https://reactrouter.com/upgrading/v6#upgrade-to-v7), and `react-router-dom` just re-exports `react-router` for compatibility.
2024-12-13 21:06:08 +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
Tanner Linsley
41ee340f24
Update comparison.md 2024-12-10 10:24:12 -07: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
Adam Rackis
29619bfec8
docs: tweak server functions docs (#2951)
* start

* tweaks

* work

* work

* last tweak
2024-12-08 01:27:49 +01:00
Adam Rackis
ef99aaba7b
docs: server function docs tweaks (#2948)
* start

* tweaks

* work

* work
2024-12-07 23:23:52 +01:00
강지영
a97729f76c
docs(devtools): update installation instructions (#2944) 2024-12-07 18:33:23 +01:00
autofix-ci[bot]
bfd590a2cf
ci: apply automated fixes 2024-12-07 05:21:06 +00:00
Tanner Linsley
8950ab2313 fix: add registerGlobalMiddleware
# Conflicts:
#	packages/start/src/client/createServerFn.ts
2024-12-06 22:20:10 -07: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
SeanCassiere
f0a04a2f79
docs(router): set officially minimum supported version of typescript to 5.3 2024-12-03 22:04:22 +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
Ephraim Duncan
953e7b6b32
docs(start): broken link to "preloading" from "getting started" (#2898) 2024-12-02 13:28:55 +13:00
Phil Hawksworth
69b2606bac
docs: Add instructions for using Deno for install and quickstart (#2888) 2024-11-29 23:05:17 +01:00
Manuel Schiller
67b3175720
fix(react-router): correctly react to search param changes (#2883)
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-28 23:31:37 +01:00
Roberto De Lucia
70df20a53c
feat(react-router): add support for ViewTransition types (#2862)
Co-authored-by: Roberto De Lucia <roberto.delucia@sinnefo.eu>
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-28 09:43:35 +13:00
Sean Cassiere
2cf38ac6fe
feat(start): change the variable export for API Routes (#2873) 2024-11-27 21:24:42 +13:00
Jaga Santagostino
ceb36209ed
docs(start): add typings to JSON Parameters example (#2868) 2024-11-26 19:17:17 +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
Antanas Misiūnas
5f3d99be6d
docs(start): FormData to use e.currentTarget instead of e.target (#2843) 2024-11-26 15:12:59 +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
Naoki Takashima
2ba715790a
docs: removal of unused import variables in the examples (#2831) 2024-11-22 22:10:53 +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
Steven Yung
82996980ab
docs(start): update cloudflare-pages deployment instructions (#2744)
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-11-18 14:57:29 +13:00
Sean Cassiere
3281f52575
docs(start): markdown linking to the middleware guide (#2791) 2024-11-18 12:30:35 +13:00
Sean Cassiere
4ae6ca9d6b
feat(start): move scripts,links, and meta to the head (#2571)
This minor is non-breaking for Router users, since it's undocumented to the public API, but **is breaking** for Start alpha users. 

This changes the options signature for meta from this:
```tsx
createRoute({
  meta: () => [
    ...
  ],
  links: () => [
    ...
  ],
})
```

to this:

```tsx
createRoute({
  head: () => ({
    meta: [
      ...
    ],
    links: [
      ...
    ],
  })
})
```
2024-11-17 15:19:18 -07:00
Jakob Norlin
94347ae78a
Fix updateCount payload in getting-started guide (#2775) 2024-11-15 21:25:59 +01:00
AlexGaudon
a4cf335392
various doc fixes (#2760)
* Fixed typescript error in Basic Validation

* Added validator call for basic example

* added more inference to doc examples
2024-11-15 20:14:53 +01:00
Jonathan Hutchison
12283041a6
Update getting started docs (#2757) 2024-11-14 21:34:12 +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