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

6,696 commits

Author SHA1 Message Date
Rudolf Halas
bfd9858146
fix: only show pending component for routes with a loader (#1370)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-26 10:02:13 +01:00
Tanner Linsley
72f18683e2 release: v1.22.6 v1.22.6 2024-03-26 08:10:13 +00:00
Dominik Dorfmeister
41391cdd4a
refactor: eslint (#1365)
* feat: eslint

bring over the configs from the query repo

* refactor: auto fix history package

* refactor: manually fix history package

* refactor(react-cross-context): eslint

* refactor(react-router-server): eslint auto fix

* refactor(react-router-server): eslint manual fixes

* refactor(react-cli): auto fix eslint

* refactor(react-cli): manual fix eslint

* refactor(router-devtools): auto fix eslint

* refactor(router-devtools): manual fix eslint

* chore: prettier --write

* refactor(router-generator): auto fix eslint

* refactor(router-generator): manual fix eslint

* refactor(router-vite-plugin): auto fix eslint

* refactor(react-router): auto fix eslint

* refactor(react-router): manual fix eslint

* fix: revert some destructive changes

* refactor: fix remaining errors

* some more disables

* fix: eslint
2024-03-26 09:08:49 +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
Tanner Linsley
1b35e57c6b release: v1.22.5 v1.22.5 2024-03-25 14:44:19 +00:00
Dominik Dorfmeister
5d619890c0
fix: make restKey reactive (#1363)
accessing `router.state` is an imperative way of reading something from the router - it does not re-render the component; with this fix, we will always re-render the match if the `resetKey` changes, so that the `CatchBoundary` can reset accordingly.

This should fix cases where navigating away from a route did not reset errors correctly
2024-03-25 08:37:11 -06:00
Tanner Linsley
9f99fe9b9f release: v1.22.4 v1.22.4 2024-03-25 14:34:37 +00:00
Dominik Dorfmeister
6a854b0ea7
fix: useNavigate subscriptions (#1359)
* fix: useNavigate subscriptions

there shouldn't be a need to subscribe useNavigate to useMatch to read the pathname, because we just need it inside the callback, we can read it imperatively

also, there was likely a stale closure problem if `location` changed, as `useMatch` would re-render the component, but `useCallback` wouldn't see the fresh value

* fix: depend on whole router class, because `.state` is an imperative getter

* fix: use resolvedLocation

* fix: useMatchRoute should not subscribe to router state

because we only access it imperatively in the callback, which will always read the latest values from router.state
2024-03-25 08:28:10 -06: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
Tanner Linsley
c50fb3de34 release: v1.22.3 v1.22.3 2024-03-22 22:55:28 +00:00
Manuel Schiller
c5c325d817
fix: do not use CatchBoundary if neither route nor router default error component is configured (#1355) 2024-03-22 23:52:55 +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
Tanner Linsley
a1030ef24d release: v1.22.2 v1.22.2 2024-03-22 06:35:29 +00:00
Tanner Linsley
c9ef457610 fix: safe header augmentation, add serialized error stacks in dev 2024-03-22 00:32:55 -06:00
Tanner Linsley
f90bdff8b0 release: v1.22.1 v1.22.1 2024-03-22 05:09:52 +00:00
Tanner Linsley
2862eaaf8d fix: use jsesc for dehydrated data 2024-03-21 23:07:00 -06:00
Tanner Linsley
a542861cf4 release: v1.22.0 v1.22.0 2024-03-21 10:26:37 +00:00
Dominik Dorfmeister
8d9ad6dec9
feat: add useNavigate to RouteApi (#1350) 2024-03-21 11:25:28 +01:00
Tanner Linsley
bc4d3c71a0 release: v1.21.1 v1.21.1 2024-03-21 09:08:08 +00:00
Dominik Dorfmeister
a96713532c
fix: make sure useMatch errors with a better error message (#1345)
* fix(react): make sure useMatch errors with a proper message when using `strict`

before this fix, it was dying with a ReferenceError when accessing match!.route

* refactor(react): build `useParams` on top of `useMatch`

so that we get the same error reporting from useMatch

* fix: more generic error message
2024-03-21 10:07:02 +01:00
Tanner Linsley
a6b7cfef53 release: v1.21.0 v1.21.0 2024-03-20 21:40:48 +00:00
Christopher Horobin
e8aef4e868
tests: add basic type tests for Link (#1346) 2024-03-20 15:37:55 -06:00
Tanner Linsley
3bf1bef84e feat: move createServerFn to react-router-server, add headers to redirects 2024-03-20 15:36:23 -06:00
Tanner Linsley
98f6dfc9a7 release: v1.20.6 v1.20.6 2024-03-20 21:31:11 +00:00
Tanner Linsley
b0dbc36eac fix: bring back abort controller
Fixes #1339
2024-03-20 15:27:58 -06:00
Tanner Linsley
4b443d04db release: v1.20.5 v1.20.5 2024-03-20 05:53:13 +00:00
Christopher Horobin
67e6aafab4
fix: allow '..' aswell as string for Link (#1340)
* fix: allow '..' aswell as string for Link

* fix: type error in react router
2024-03-20 06:52:01 +01:00
Sean Cassiere
f84848f5a1
test(router-generator): add tests to check the generated output of the router-generator (#1337)
* chore: ignore the `*.gen.ts` outputs from the `tests` folder in `packges/router-generator`

* chore: add the test script

* test: add tests for 'single-level' routing

* test: add tests for 'flat' routing

* test: amend the 'flat' routing test to include a `route`-level config

* test: add tests for 'nested' routing

* test: match the dir structure between the 'flat' and 'nested' test cases

* test: add tests for complex 'nested-layouts' routing

* chore: disable logging from the `router-generator` package when testing

* chore: space that wasn't supposed to be there

* test: use `routeTree.expected.ts` for storing the expected outputs

* chore: remove comment

* test: run all the generator tests against all its subfolders
2024-03-19 13:09:58 +01:00
Tanner Linsley
b09caf4b5e release: v1.20.4 v1.20.4 2024-03-19 08:45:34 +00:00
Christopher Horobin
195fc8dacc
fix: allow 'to' to be a string (#1334) 2024-03-19 09:43:30 +01:00
Tanner Linsley
0b6c5ad6ad release: v1.20.3 v1.20.3 2024-03-19 08:21:52 +00:00
Sean Cassiere
b8c6fd0236
fix(router-devtools): non-nested usage of TanStackRouterDevtools and missing context with the usage of TanStackRouterDevtoolsPanel (#1336)
* fix: `<TanStackRouterDevtools>` not working when not nested in `<RouterProvider>`

the `<TanStackRouterDevtools` component threw errors when it wasn't rendered inside the `<RouterProvider>` due to some of its calls that relied on this nesting.

* fix: `<TanStackRouterDevtoolsPanel>` not working because of the reliance on `DevtoolsOnCloseContext`

the `<TanStackRouterDevtoolsPanel>` component threw errors on render due to its reliance on the `DevtoolsOnCloseContext` which it wasn't wrapped with
2024-03-19 09:20:44 +01:00
Tanner Linsley
b016d32dd6 release: v1.20.2 v1.20.2 2024-03-18 10:00:27 +00:00
kinqdos
c636b5ce60
fix: root path to line up with router-generator (#1259) 2024-03-18 10:58:25 +01:00
Tanner Linsley
5f97b660e8 release: v1.20.1 v1.20.1 2024-03-17 05:41:46 +00:00
Christopher Horobin
de79ca3083
fix: improve performance of Link when navigating to unique routes (#1326) 2024-03-17 06:40:40 +01:00
Tanner Linsley
3ab40f98c0 release: v1.20.0 v1.20.0 2024-03-15 11:28:18 +00:00
Manuel Schiller
e35e72e4de chore: fix lockfile 2024-03-15 12:24:07 +01:00
Ryan Staniforth
8aee08b530
fix: Type error when passing props to Link via destructured LinkProps. (#1316)
* fix: Type error when passing props to Link via destructed LinkOptions.

* Swap LinkOptions for LinkProps.

* Rename variable.
2024-03-15 12:20:07 +01:00
GoldFrosch
03f82c6bb2
feat: add routeFileIgnorePattern option to generator (#1310) 2024-03-15 12:17:07 +01:00
Tanner Linsley
dfe1e0f313 release: v1.19.15 v1.19.15 2024-03-14 19:57:30 +00:00
Nirjhor Nath
b0619d58ac
fix: add to path when syncing url (#1314) 2024-03-14 20:56:16 +01:00
Tanner Linsley
9a7b568249 release: v1.19.14 v1.19.14 2024-03-14 18:38:12 +00:00
Ryan Staniforth
af2b7dcbcc
fix: Fix Link children type when passing a function. (#1307) 2024-03-14 12:36:28 -06:00
Christopher Horobin
5b64be47d3
examples: add example to generate large routes for typescript diagnostics (#1308)
* chore: add large file based routing example to test peformance

- ensure each Link points to a different route to make test realistic
- support absolute and relative pathing for now

* chore: remove posts

* chore: update pnpm lock file

* chore: rename to relative and absolute

* chore: add content to README
2024-03-14 19:07:03 +01:00
Tanner Linsley
443ead202d release: v1.19.13 v1.19.13 2024-03-13 17:04:32 +00:00
Nirjhor Nath
ff47268e2f
fix: use transformer to parse data (#1306) 2024-03-13 18:03:18 +01:00