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

470 commits

Author SHA1 Message Date
Tanner Linsley
d09db60415 fix: Refactored many things!
- Fixed an issue where preloads would redirect and not resolve to the correct location
- Removed the need for `getRenderedMatches`. The matches intended to be rendered are now always stored at `store.matches`
- Removed the experimental ability for async meta and headers. Loaders should be used to get async data into these functions
- Pending matches now take `beforeLoad` into account and properly start pendingMs timers.
- `pendingMinMs` is also more accurate now by only triggering its timers when the pending state is encountered during rendering
- Removed a logical path where the `pending` component could be directly rendered within a route instead of handled by suspense
- Matches that don't require loaders or beforeLoaders will start as "success".
- Meta and headers are now called and saved for matches that are cached or already in the "success" state
- Fixed an issue where redirects and not-found errors would get improperly swallowed
- Fixed an edge-case where outdated navigations were not ignored and created race-conditions
- Refactored isServer into the router so we can do some better mocking in tests
- Added tests around scripts, meta, and redirects
- Fixed issues with non-vinxi server envs
- Injected html now waits for <body>

Closes #1104 #1146 #1168
2024-04-15 16:11:22 -06:00
Albert Chang
3aa01dc32e
docs: fix incorrect naming of index.route.tsx to route.tsx on the code-splitting guide (#1465) 2024-04-13 22:45:18 +12:00
Manuel Schiller
3d3f91859e
feat: allow to configure trailing slash behavior (#1464) 2024-04-12 23:07:39 +02:00
Sean Cassiere
136477c3dd
deprecate: navigate function as an argument in the beforeLoad and loader callbacks (#1459)
* feat(react-router): mark the `navigate` function in the `beforeLoad` and `loader` callbacks as deprecated

* docs: mark the navigate function passed into the `beforeLoad` and `loader` functions as deprecated
2024-04-12 18:03:15 +02:00
Raphael Cunha
de62f894f1
Update routing-concepts.md (#1452)
Add outlet import from @tankstack/react-router
2024-04-09 15:38:37 -06:00
Sean Cassiere
7731bf1294
docs: fix broken links on top-level guides (#1448)
Investigation into the broken links found by @MarcoB-Ec lead me to discovered these were broken in the top-level docs as well.

Co-authored-by: Marco Brito <35307131+marcob-ec@users.noreply.github.com>
2024-04-09 10:50:46 +12:00
Dave Keen
43d08080c1
docs: fix a typo in the static-route-data guide (#1426) 2024-04-05 23:05:23 +13:00
Tanner Linsley
4ef78725af
docs: prep for migration of tanstack.com to TSR (#1419) 2024-04-02 16:46:22 -06:00
Kevin Herklotz
40af8ec334
docs: broken link to "using search params in loaders" in data-loading.md from search-params.md (#1416) 2024-04-03 06:12:40 +13:00
ajschlosser
d2c12172e6
Update quick-start.md to include installation of devtools cited throughout rest of document (#1403) 2024-03-31 19:35:17 -06:00
Leonardo Montini
e84815cdc0
docs: improve links to not found pages (#1396) 2024-03-31 00:56:55 +13:00
Dominik Dorfmeister
9f9b847ea7
feat: add reset prop to errorComponent (#1358)
* feat: add reset prop to errorComponent

* fix: types of defaultErrorComponent

* fix: put match into pending state when being invalidated if it was in error state

* docs: reset

* docs: error handling

* docs: integrate error handling into example

* chore: prettier on md files

* chore: fix wrong auto import

* fix: reset error boundaries from react-query in an effect

so that navigating away from a route will also re-trigger the query

* docs: error handling with TanStack Query

* chore: fix eslint

* fix: not all error components have a `preload`

* fix: merge conflict
2024-03-29 23:21:04 +01:00
Sean Cassiere
5eba66bb80
feat(react-router): implement the typed useNavigate hook onto the Route and LazyRoute class (#1385)
* feat(react-router): return the useNavigate hook

* docs(react-router): update verbiage on the RouteClass doc

* test(react-router): ensure the typed hooks are available across the shared surfaces
2024-03-28 19:06:16 +01:00
Sean Cassiere
9d099dd755
docs: add reference pages for createLazyFileRoute and createLazyRoute (#1379)
* docs: add createLazyFileRoute

* docs: broken link to the FileRouteClass

* docs: remove the word literal

* docs: update the source of its configuration options

* docs: add createLazyRoute
2024-03-27 21:38:59 +13:00
Sean Cassiere
c15f399e79
feat(router-generator): add option to format with semicolons in the generated route-tree (#1376)
* feat(router-generator): expose config to accept `semicolons` prop to prettier format with semicolons

* docs(router-generator): document the new `semicolons` configuration property
2024-03-27 05:54:07 +01:00
Valeriy Kobzar
9181cad9d7
docs: fix incorrect naming of parameters on the guide for not-found-errors (#1377)
Fixed a bug in the parameter name for the notFound function. Instead of 'route', it should use 'routeId'.
2024-03-27 17:16:05 +13:00
Dominik Dorfmeister
4972e945c5
ci: execute type checks against multiple TS versions (#1367)
* fix: peerDependencies

* docs: requirements

* ci: run type tests against multiple TS versions

* chore: newline

* chore: fix prettier

* fix: wrappers must return a JSX Element

* fix: have Explorer return JSX.Element

* fix: another one
2024-03-26 10:12:00 +01:00
Sean Cassiere
7d8b9e0b9c
docs: fixing the syntactically broken links within the documentation (#1369)
* docs: broken link linking to the SSR guide

* docs: broken link linking to the `RouterOptionsType#transformer-property`

* docs: fix broken link linking to code-splitting

* docs: fix broken link linking to the `RouterOptionsType`

* docs: fix broken link linking to external-data-loading
2024-03-26 10:44:17 +13:00
Sean Cassiere
cf5d136aa4
docs: include "layout" next to pathless routes and move "routing concepts" to its own page (#1362)
* docs: include layout as part of the pathless routes section

* docs: add links to the individual sections below

* docs: links for the route nesting stuff

* docs: move the routing concepts section to separate page
2024-03-26 09:45:55 +13:00
Leonardo Montini
59bb2604f2
docs: remove __404 mentions (#1341) 2024-03-25 16:34:49 +01:00
Sean Cassiere
876b887589
docs: remove references to @tanstack/loaders (#1357)
* docs: remove tanstack loaders in the navigation doc

* docs: remove tanstack loaders in the external-data-loading doc
2024-03-23 17:28:41 +01:00
Manuel Schiller
9687ebd90a
fix: loosen strict check in useMatch to allow accessing parent matches (#1356) 2024-03-22 23:52:27 +01:00
Sean Cassiere
58a15deb49
docs: add more missing reference pages (#1352)
* docs: add useNavigate to the RouteApiClass

* docs: add the useLoaderDeps hook

* docs: update RouteApi description

* docs: update getRouteApi description

* docs: add the useRouterState hook

* docs: add the useRouter hook

* docs: missing `hook` from title

* docs: add the useRouteContext hook

* docs: add the useSearch hook
2024-03-22 09:01:20 -06:00
GoldFrosch
03f82c6bb2
feat: add routeFileIgnorePattern option to generator (#1310) 2024-03-15 12:17:07 +01:00
Rui Saraiva
89bacc3341
docs: fix TanStack & TypeScript typos (#1291)
* docs: fix TanStack & TypeScript typos

* docs: fix TanStack & TypeScript typos

---------

Co-authored-by: Rui Saraiva <ruisaraiva@mbp-14.lan>
2024-03-12 22:41:15 +01:00
Efstratios Bektasiadis
74f570832e
docs: fixed broken authenticated routes example url (#1298) 2024-03-12 21:17:58 +01:00
Doug Richar
7b2b155d43
docs: fix router.invalidate() example in Data Mutations guide (#1299) 2024-03-12 21:16:40 +01:00
Lachlan Collins
7995d0a123
docs: Update docs/config.json (#1294)
* docs: Update docs/config.json

* Update schema
2024-03-12 20:42:45 +11:00
Sekamatte Soul Solomon
2094ca89c8
docs: Update decisions-on-dx.md (#1288)
Fix: Grammatical errors in docs
2024-03-11 17:38:54 +01:00
Nils Hartmann
734970aacc
docs: fix useMatchHook (#1282)
- options argument is not optional
- clarify opts.from/opts.strict dependency
2024-03-09 16:21:58 +01:00
Manuel Schiller
409b06dbb7 chore: fix doc formatting 2024-03-09 11:57:34 +01:00
Sean Cassiere
e4bc7d7e0a
docs: normalizing the hierarchy content in the reference pages (#1232)
* createFileRoute

* createRootRoute

* createRouteFunction

* createRouteFunction and RouteClass

* defer, awaitComponent, useAwaitedHook

* getRouteApiFunction and RouteApiClass

* isNotFoundFunction

* isRedirectFunction

* lazyRouteComponentFunction

* createRootRouteWithContext

* createRootRouteFunction

* new notFound conventions

* NotFoundRouteClass

* redirectFunction

* RedirectType

* catchBoundaryComponent

* catchNotFoundComponent

* DefaultGlobalNotFound

* useLinkPropsHook

* ActiveLinkOptions

* errorComponentComponent

* linkComponent

* LinkOptionsType

* LinkPropsType

* navigateComponent

* NavigateOptionsType

* outletComponent

* ToOptionsType

* FileRouteClass

* add the word type

* rootRouteWithContextFunction

* matchRouteComponent

* MatchRouteOptionsType

* useChildMatchesHook

* useLinkPropsHook

* UseLinkPropsOptionsType

* useLoaderDataHook

* useMatchesHook

* useMatchHook

* useMatchRouteHook

* UseMatchRouteOptionsType

* useNavigateHook

* useParamsHook

* useParentMatchesHook

* AllParamsType, RegisteredRouterType, RegisterType

* alphabetical sorting

* add link to the RouteMatchType

* useLoaderDataHook

* AnyRouteMatchType

* bulk for types

* consistency in page linking

* remove backticks from heading items that do not wrap inline-code-blocks
2024-03-08 11:37:02 +01:00
Seedy
4e78898280
docs: Update scroll-restoration.md (#1270) 2024-03-07 21:13:07 +01:00
Alejandra
2600d771f2
docs: Update authenticated-routes.md (#1267) 2024-03-06 21:27:13 +01:00
Alejandra
4422ed294c
focs: fix typos in route-trees.md (#1266)
* fix: minor typo in `route-trees.md`

* Update route-trees.md

* Update route-trees.md

* Update route-trees.md
2024-03-05 21:36:30 +01:00
Norbert Elter
1a95d98250
feat: optionally allow to disable logging in generator (#1256)
* feat: disableLogging

* feat: logging util
2024-03-04 21:34:03 +01:00
Tanner Linsley
3b559fc931
fix: ssr improvements (#1248)
* fix: ssr improvements

* fix: remove log

* fix: remove log

* fix: remove comments

* docs: root abstraction

* fix: remove commented code

* fix: remove old TLoaderData fix attempt

* fix: remove commented code

* fix: imports

* docs: format

* fix: deprecate and handle not found "global" option
2024-03-04 11:23:41 -07:00
Yiheng
1a37474f84
docs: Update file-based-routing.md (#1257)
* Update file-based-routing.md

* Update file-based-routing.md
2024-03-04 11:20:59 +01:00
Abdullah_Aleiti
aa3da31925
docs: Fix route-trees.md to use appropriate article. (#1254) 2024-03-03 19:54:13 +01:00
Pawel Fajfer
73fc10b195
docs: make loader function async in deferred-data-loading guide (#1258) 2024-03-03 19:50:11 +01:00
Manuel Schiller
419cb45975
fix: correct typing for route groups (#1245)
since we need to handle the path replacements in typescript as well, we cannot let the user configure the route group pattern
2024-03-01 14:58:31 -07:00
Manuel Schiller
7731a3926b
feat: add route grouping for file based routing (#1241) 2024-03-01 11:04:21 -07:00
Tomasz Wysocki
69072fd545
docs: fix links in Decisions on DX page (#1236) 2024-02-29 18:47:53 -07:00
Sean Cassiere
135b76453d
docs: fix queryKey to be compliant with the current tanstack-query v5 syntax (#1228)
* docs: fix `queryKey` to match the tanstack-query v5 syntax

* docs: actually call the `fetchPosts` fn
2024-02-29 18:47:24 -07:00
Makisuo
6b2d7ff28f
docs: fix context loader example (#1235) 2024-02-29 17:33:55 +01:00
Sean Cassiere
b2004cbbdc
docs: fixing some inconsistencies in the guides (#1229)
* fix: `routeTree` into the `createRouter` instance

* fix: switch to `Block/useBlocker` since react-router uses `useBlocker` instead of `Prompt/usePrompt`

* fix: rename RouteApi to getRouteApi and include useLoaderDeps

* feat: indicate `.lazy` suffix and mark deprecation suffixes being phased out

* fix: createRootRouteWithContext - `routeTree` into the `createRouter` instance

* fix: rootRouteWithContext - `routeTree` into the `createRouter` instance

* feat: `Function` keyword is redundant since its already nested under `Functions`

* feat: alphabetical sorting of functions

* feat: move `rootRouteWithContext` to the deprecated list

* feat: use backticks

* feat: alphabetical sorting of hooks
2024-02-27 11:55:10 -07:00
Boda
07bb8d2b16
docs: Update code-splitting.md (#1210) 2024-02-27 19:32:27 +01:00
Sean Cassiere
bf26037663
docs: new doc page on the dx design decisions (#1225)
* chore: initial set up to display the new docs page

* docs: introduction to the dx doc

* docs: how its done to the dx doc

* docs: rework the intro for the dx doc

* docs: some gramatical fixes

* docs: checkpoint

* docs: two big parts are done

* docs: some cleanup

* docs: the spacing stuff

* docs: more cleanup

* docs: ...

* docs: code-based routing section

* docs: file-based routing section

* docs: rename doc to "Decisions on DX"

* docs: add a TLDR since people are people and wont read all of this
2024-02-26 04:20:46 -07:00
Nikola Hristov
0fab06123b
fix: replace JSX.Element with React.ReactNode for children-like props (#1221) 2024-02-25 21:52:00 +01:00
Joseph Harkins
240121ad22
docs: Fix navigation.md typo (#1200) 2024-02-23 23:20:59 +01:00