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

1,257 commits

Author SHA1 Message Date
Daniel Guldberg Aaes
30ae443f14
docs: fix some mistakes in the example of the SSR guide (#1748)
The current docs has a conflicts with a local declaration of 'createRouter'. and the import for the routeTree.gen is missing a ./
2024-06-14 22:07:29 +12:00
Manuel Schiller
be3a410e46
docs: replace Meta with Static Data 2024-06-11 22:04:10 +02:00
reihwald
a1fb6417b8
feat(router-devtools): add shadowDOMTarget option to TanStackRouterDevtools and TanStackRouterDevtoolsPanel (#1709) (#1720)
* feat: add shadowDOMTarget option to TanStackRouterDevtools and TanStackRouterDevtoolsPanel (#1709)

* feat: add documentation for shadowDOMTarget (#1709)

---------

Co-authored-by: Liam Reihwald <liam.reihwald@worldline.com>
2024-06-11 17:52:08 +12:00
Golamrabbi Azad
6979e62d03
docs: spelling mistake in the filename of the _authenticated layout route in the authenticated routes guide (#1723) 2024-06-08 19:30:09 +12:00
Dima Hinev
871ba64a91
docs: spelling mistakes on the route-masking guide (#1717)
removed the the from page
2024-06-08 12:54:35 +12:00
Leonardo Montini
85f5e7be1b
docs: mention how to disable the plugin in tests (#1682)
* docs: mention how to disable the plugin in tests

* docs: improve phrasing
2024-05-30 20:07:30 +02:00
Tanner Linsley
0be110012c fix: no more weird streaming APIs, just use suspense + streaming 2024-05-26 22:56:02 -06:00
Leonardo Montini
28aa8fb04e
feat(react-router): improve the blocker functionality for use with custom UI (#1649)
* feat: return async resolver from useBlocker hook

* feat: pass async resolvers to children on Block component

* fix: types and always reset promise

* docs: update example with custom UI

* refactor: namings

* docs: toggle between custom ui and default

* feat: expose status and refactor hook props

* feat: support current API

* feat: custom blocker should take precendence over the manual promise blocker

* test: unit test on condition to avoid breaking changes with the new API

* docs: deprecate old syntax and update the docs

* docs: create useBlocker API reference

* fix: deprecated interface
2024-05-25 13:49:08 +02:00
Tanner Linsley
97edd010d1 Merge branch 'main' of https://github.com/TanStack/router
# Conflicts:
#	examples/react/start-basic/package.json
#	examples/react/vinxi-basic-ssr-streaming/package.json
#	examples/react/vinxi-basic-ssr/package.json
#	examples/react/vinxi-basic/package.json
#	pnpm-lock.yaml
2024-05-23 12:01:37 -06:00
Tanner Linsley
6d29cd7f64 fix(start): add experimental support for route manifest and ssr route manifest usage 2024-05-23 11:59:40 -06:00
Elia Maino
1ea92a3d79
docs: Update useBlocker function signature (#1639)
* docs: Update `useBlocker` function signature

* docs: update `message` to `blockerFn`
2024-05-21 21:28:00 +02:00
Sean Cassiere
d20a422160
docs: touchups to the reference pages for RouterState type, useRouterState, and useMatches (#1645)
* docs: better RouterState doc

* docs: useRouterState updates

* docs: useMatches

* docs: forgot to do that

* docs: and that
2024-05-21 20:40:38 +12:00
Sean Cassiere
59e3f52286
docs: update the content on the reference page for RouterEvents type (#1644)
* docs: update the content on the `RouterEvents type` reference page

* docs: verbiage

* docs: make it simpler
2024-05-21 17:57:04 +12:00
Sean Cassiere
ab02f3ebd3
docs: moving reference content out of the class files (#1633)
* RouterType

* RouteApiType

* RouteType

* ParsedLocation linking

* linking RouterType, RouteType, and RouteApiType

* reduce SearchParamOptionsType and PathParamOptionsType into ToOptionsType

* useLinkProps

* forgot to remove that

* more
2024-05-19 14:52:44 +12:00
Dominik Dorfmeister
099aa926ef
refactor: JsDoc for RouterOptions (#1631) 2024-05-18 23:43:29 +02:00
Sean Cassiere
62bf384972
docs: clearing up the internal types from the references (#1627)
* remove AnyParamsType

* remove AnyRedirectType

* AnyRouteMatchType

* AwaitOptionsType

* FileRoutesByPath

* FullSearchSchemaType

* ParseRouteType

* ParseRouteChildrenType

* RegisteredRouterType

* RouteByIdType

* RouteIdsType

* RouteByPath

* RoutePathsType

* RouterErrorSerializerType

* link RouterEventsType

* RouterTransformerType

* RoutesByIdType

* RoutesByPathType

* SearchSchemaInputType

* link to ToOptionsType

* DeferredPromiseStateType
2024-05-19 01:37:49 +12:00
Dominik Dorfmeister
6c1d831b27
feat: onCatch callback on routes and defaultOnCatch for router (#1623)
* feat: onCatch callback on routes and defaultOnCatch for router

to catch errors thrown by ErrorBoundaries

* docs: onCatch

* docs: add default
2024-05-18 14:49:25 +02:00
Sean Cassiere
9f0d4c76b5
docs: documented the the usage of hooks and context in the "Router Context" guide (#1609) 2024-05-17 21:35:19 +12:00
Manuel Schiller
45252f3d66 docs: fix links 2024-05-17 00:05:55 +02:00
Manuel Schiller
c38c02cc07 chore: fix doc formatting 2024-05-16 23:56:47 +02:00
simon-lund
f2ddae666f
docs: fix syntax error in example with loader and useSuspenseQuery (#1602)
This will fix the example with useSuspenseQuery for the Router loader. You cannot just write `const posts = useSuspenseQuery(...)` but have to resolve the data property as so `const  {data: {posts}} = useSuspenseQuery(...)`
2024-05-16 15:27:36 +02:00
Christopher Horobin
0898f2e12e
perf: new addChildren signature and generate more (#1564)
Be sure to re-run generator after upgrading

* perf: get lazy? do less?, generate more

* feat: add support for objects for children at runtime

- add type tests for objects with children
- add runtime support for objects with children
- add runtime tests for objects with children

* perf: apply similar optimisations for merging for code based

* perf: improve performance of LinkProps when passed to `Link`

* exmaples: add to large based file examples search, params and context

* docs: add TS performance recommendations to docs

* fix: remove route groups from id

* examples: update linkprops examples

* docs: update docs based on comments

* chore: remove export of `LinkComponentProps`

* chore: clean up PR

---------

Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2024-05-13 16:54:41 +02:00
Saiful Islam
a85970e2d7
docs: Update root file name and update root ID (#1585) 2024-05-12 22:45:45 +02:00
Sal Hasan
2a19b03d6b
feat(react-router): add a useLocation hook to get the current ParsedLocation (#1577) 2024-05-11 14:33:15 +02:00
Sean Cassiere
97d96befe3
docs: broken hyperlink on the "route-matching" guide (#1582) 2024-05-10 21:55:59 +12:00
David Birks
a89cb76fa0
docs: add missing comma to from an example in the router-context guide (#1579) 2024-05-10 19:49:24 +12:00
Tanner Linsley
e1f38f921f fix: rename react-router-server to start 😜 2024-05-08 16:51:45 -06:00
Manuel Schiller
64ae7c3998
docs: improve routeFileIgnorePattern description 2024-05-06 17:49:41 +02:00
Sean Cassiere
5035865f87
docs: add a callout in the file-based routing options about not conflicting with the naming conventions (#1519)
* docs: callouts in the file-based routing conventions

* docs: make the callouts related their properties/options

* docs: emojis!

* docs: add a callout in the "file-naming conventions" section

* docs: use a single callout in the "options" sections

* docs: better callout in the 'file-naming conventioned' section

* docs: missing words

* docs: that should be it

* docs: be a bit more obvious about the `-`
2024-04-25 22:04:27 +12:00
Sean Cassiere
00fb7a5a71
docs(examples): update the authenticated-routes example to use layout routes (#1505)
* docs: rename the authenticated-routes example

* docs: update the authenticated-routes example to use layouts

* docs: trim up the authenticated routes example

* docs: default navigation to `/dashboard`

* docs: add auth persistence
2024-04-22 14:35:22 +12:00
Sean Cassiere
94ffb85bc4
feat(router-generator): prepend and append header and footer content to the generated route-tree file as defined by the user (#1502)
* feat(router-generator): append and prepend lines to the generated route-tree

* test(router-generator): making sure it works!

* refactor(router-generator): rename the prepend and append properties

* docs: docs on the new prepend and append functionality

* refactor(router-generator): update configuration property names

* test(router-generator): update the tests with the new configuration property names

* docs: update file-based routing guide with the new property names

* refactor(router-generator): move to the defaults

* test(router-generator): updated test output

* docs: show what the defaults are on the docs
2024-04-21 14:02:14 +12:00
Sean Cassiere
052e940d47
docs: adding file-routes to the react-location migration guide (#1501) 2024-04-21 00:00:19 +12:00
Sean Cassiere
5d3c1f8b2c
docs: add an outlet on the posts.tsx page (#1498) 2024-04-20 17:53:51 +12:00
Sean Cassiere
bc616f1e62
docs: add migration guide for react-location (#1497)
* docs: add migration guide for react-location

* chore: show the react-location migration guide

* docs: remove the word "over"

* docs: make ssr a guide to feature
2024-04-20 17:10:23 +12:00
Manuel Schiller
e08b881358
feat: strong typing for onEnter, onStay and onLeave (#1479) 2024-04-19 22:28:28 +02:00
Tanner Linsley
7b173f5088 fix: always use React transitions around navigations, experimental view transitions API 2024-04-18 16:33:04 -06:00
Hugo Costa
23fbecb62a
fix: broken example link (#1485) 2024-04-18 13:56:16 -06:00
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