From 6194e6a5db3f1930032e9ed2b0085026cdffc619 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Thu, 17 Oct 2024 09:58:19 -0400 Subject: [PATCH 1/2] Update jsdoc links to add new v6 segment --- .changeset/beige-otters-fold.md | 7 +++++++ .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- CHANGELOG.md | 12 ++++++------ packages/react-router-dom/index.tsx | 2 +- packages/react-router/lib/components.tsx | 14 +++++++------- packages/react-router/lib/hooks.tsx | 24 ++++++++++++------------ packages/router/utils.ts | 8 ++++---- 7 files changed, 39 insertions(+), 32 deletions(-) create mode 100644 .changeset/beige-otters-fold.md diff --git a/.changeset/beige-otters-fold.md b/.changeset/beige-otters-fold.md new file mode 100644 index 0000000000..b150fe1686 --- /dev/null +++ b/.changeset/beige-otters-fold.md @@ -0,0 +1,7 @@ +--- +"react-router-dom": patch +"react-router": patch +"@remix-run/router": patch +--- + +Update JSDoc URLs for new website structure (add /v6/ segment) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index cb560db202..4575379a12 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -16,8 +16,8 @@ body: Before you ask a question, here are some resources to get help first: - Read the docs: https://reactrouter.com - - Check out the list of frequently asked questions: https://reactrouter.com/start/faq - - Explore examples: https://reactrouter.com/start/examples + - Check out the list of frequently asked questions: https://reactrouter.com/v6/start/faq + - Explore examples: https://reactrouter.com/v6/start/examples - Ask in chat: https://rmx.as/discord - Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/react-router diff --git a/CHANGELOG.md b/CHANGELOG.md index eb859e858c..99ba143c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -331,7 +331,7 @@ Date: 2024-07-16 #### Stabilized `v7_skipActionErrorRevalidation` -This release stabilizes the `future.unstable_skipActionErrorRevalidation` flag into [`future.v7_skipActionErrorRevalidation`](https://reactrouter.com/upgrading/future#v7_skipactionstatusrevalidation) in preparation for the upcoming React Router v7 release. +This release stabilizes the `future.unstable_skipActionErrorRevalidation` flag into [`future.v7_skipActionErrorRevalidation`](https://reactrouter.com/v6/upgrading/future#v7_skipactionstatusrevalidation) in preparation for the upcoming React Router v7 release. - When this flag is enabled, actions that return/throw a `4xx/5xx` `Response` will not trigger a revalidation by default - This also stabilizes `shouldRevalidate`'s `unstable_actionStatus` parameter to `actionStatus` @@ -431,7 +431,7 @@ Date: 2024-04-23 #### Data Strategy (unstable) -The new `unstable_dataStrategy` API is a low-level API designed for advanced use-cases where you need to take control over the data strategy for your `loader`/`action` functions. The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix ["Single Fetch"](https://remix.run/docs/guides/single-fetch), user-land middleware/context APIs, automatic loader caching, and more. Please see the [docs](https://reactrouter.com/routers/create-browser-router#unstable_datastrategy) for more information. +The new `unstable_dataStrategy` API is a low-level API designed for advanced use-cases where you need to take control over the data strategy for your `loader`/`action` functions. The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix ["Single Fetch"](https://remix.run/docs/guides/single-fetch), user-land middleware/context APIs, automatic loader caching, and more. Please see the [docs](https://reactrouter.com/v6/routers/create-browser-router#unstable_datastrategy) for more information. **Note:** This is a low-level API intended for advanced use-cases. This overrides React Router's internal handling of `loader`/`action` execution, and if done incorrectly will break your app code. Please use with caution and perform the appropriate testing. @@ -557,7 +557,7 @@ We fixed a splat route path-resolution bug in `6.19.0`, but later determined a l The buggy behavior is that the default behavior when resolving relative paths inside a splat route would _ignore_ any splat (`*`) portion of the current route path. When the future flag is enabled, splat portions are included in relative path logic within splat routes. -For more information, please refer to the [`useResolvedPath` docs](https://reactrouter.com/hooks/use-resolved-path#splat-paths) and/or the [detailed changelog entry](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md#6210). +For more information, please refer to the [`useResolvedPath` docs](https://reactrouter.com/v6/hooks/use-resolved-path#splat-paths) and/or the [detailed changelog entry](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md#6210). #### Partial Hydration @@ -719,9 +719,9 @@ Date: 2023-10-16 We're excited to release experimental support for the [View Transitions API](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition) in React Router! You can now trigger navigational DOM updates to be wrapped in `document.startViewTransition` to enable CSS animated transitions on SPA navigations in your application. -The simplest approach to enabling a View Transition in your React Router app is via the new [``](https://reactrouter.com/components/link#unstable_viewtransition) prop. This will cause the navigation DOM update to be wrapped in `document.startViewTransition` which will enable transitions for the DOM update. Without any additional CSS styles, you'll get a basic cross-fade animation for your page. +The simplest approach to enabling a View Transition in your React Router app is via the new [``](https://reactrouter.com/v6/components/link#unstable_viewtransition) prop. This will cause the navigation DOM update to be wrapped in `document.startViewTransition` which will enable transitions for the DOM update. Without any additional CSS styles, you'll get a basic cross-fade animation for your page. -If you need to apply more fine-grained styles for your animations, you can leverage the [`unstable_useViewTransitionState`](https://reactrouter.com/hooks/use-view-transition-state) hook which will tell you when a transition is in progress and you can use that to apply classes or styles: +If you need to apply more fine-grained styles for your animations, you can leverage the [`unstable_useViewTransitionState`](https://reactrouter.com/v6/hooks/use-view-transition-state) hook which will tell you when a transition is in progress and you can use that to apply classes or styles: ```jsx function ImageLink(to, src, alt) { @@ -740,7 +740,7 @@ function ImageLink(to, src, alt) { } ``` -You can also use the [``](https://reactrouter.com/components/nav-link#unstable_viewtransition) shorthand which will manage the hook usage for you and automatically add a `transitioning` class to the `` during the transition: +You can also use the [``](https://reactrouter.com/v6/components/nav-link#unstable_viewtransition) shorthand which will manage the hook usage for you and automatically add a `transitioning` class to the `` during the transition: ```css a.transitioning img { diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 668487539e..1c7e6f766e 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -1381,7 +1381,7 @@ enum DataRouterStateHook { function getDataRouterConsoleError( hookName: DataRouterHook | DataRouterStateHook ) { - return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`; + return `${hookName} must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.`; } function useDataRouterContext(hookName: DataRouterHook) { diff --git a/packages/react-router/lib/components.tsx b/packages/react-router/lib/components.tsx index 958cb5a773..3900c1fc22 100644 --- a/packages/react-router/lib/components.tsx +++ b/packages/react-router/lib/components.tsx @@ -213,7 +213,7 @@ export interface MemoryRouterProps { /** * A `` that stores all entries in memory. * - * @see https://reactrouter.com/router-components/memory-router + * @see https://reactrouter.com/v6/router-components/memory-router */ export function MemoryRouter({ basename, @@ -274,7 +274,7 @@ export interface NavigateProps { * able to use hooks. In functional components, we recommend you use the * `useNavigate` hook instead. * - * @see https://reactrouter.com/components/navigate + * @see https://reactrouter.com/v6/components/navigate */ export function Navigate({ to, @@ -327,7 +327,7 @@ export interface OutletProps { /** * Renders the child route's element, if there is one. * - * @see https://reactrouter.com/components/outlet + * @see https://reactrouter.com/v6/components/outlet */ export function Outlet(props: OutletProps): React.ReactElement | null { return useOutlet(props.context); @@ -380,7 +380,7 @@ export type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps; /** * Declares an element that should be rendered at a certain URL path. * - * @see https://reactrouter.com/components/route + * @see https://reactrouter.com/v6/components/route */ export function Route(_props: RouteProps): React.ReactElement | null { invariant( @@ -407,7 +407,7 @@ export interface RouterProps { * router that is more specific to your environment such as a `` * in web browsers or a `` for server rendering. * - * @see https://reactrouter.com/router-components/router + * @see https://reactrouter.com/v6/router-components/router */ export function Router({ basename: basenameProp = "/", @@ -498,7 +498,7 @@ export interface RoutesProps { * A container for a nested tree of `` elements that renders the branch * that best matches the current location. * - * @see https://reactrouter.com/components/routes + * @see https://reactrouter.com/v6/components/routes */ export function Routes({ children, @@ -658,7 +658,7 @@ function ResolveAwait({ * either a `` element or an array of them. Used internally by * `` to create a route config from its children. * - * @see https://reactrouter.com/utils/create-routes-from-children + * @see https://reactrouter.com/v6/utils/create-routes-from-children */ export function createRoutesFromChildren( children: React.ReactNode, diff --git a/packages/react-router/lib/hooks.tsx b/packages/react-router/lib/hooks.tsx index 486b7fbcaf..3a40c3b15c 100644 --- a/packages/react-router/lib/hooks.tsx +++ b/packages/react-router/lib/hooks.tsx @@ -52,7 +52,7 @@ import { * Returns the full href for the given "to" value. This is useful for building * custom links that are also accessible and preserve right-click behavior. * - * @see https://reactrouter.com/hooks/use-href + * @see https://reactrouter.com/v6/hooks/use-href */ export function useHref( to: To, @@ -85,7 +85,7 @@ export function useHref( /** * Returns true if this component is a descendant of a ``. * - * @see https://reactrouter.com/hooks/use-in-router-context + * @see https://reactrouter.com/v6/hooks/use-in-router-context */ export function useInRouterContext(): boolean { return React.useContext(LocationContext) != null; @@ -99,7 +99,7 @@ export function useInRouterContext(): boolean { * "routing" in your app, and we'd like to know what your use case is. We may * be able to provide something higher-level to better suit your needs. * - * @see https://reactrouter.com/hooks/use-location + * @see https://reactrouter.com/v6/hooks/use-location */ export function useLocation(): Location { invariant( @@ -116,7 +116,7 @@ export function useLocation(): Location { * Returns the current navigation action which describes how the router came to * the current location, either by a pop, push, or replace on the history stack. * - * @see https://reactrouter.com/hooks/use-navigation-type + * @see https://reactrouter.com/v6/hooks/use-navigation-type */ export function useNavigationType(): NavigationType { return React.useContext(LocationContext).navigationType; @@ -127,7 +127,7 @@ export function useNavigationType(): NavigationType { * This is useful for components that need to know "active" state, e.g. * ``. * - * @see https://reactrouter.com/hooks/use-match + * @see https://reactrouter.com/v6/hooks/use-match */ export function useMatch< ParamKey extends ParamParseKey, @@ -176,7 +176,7 @@ function useIsomorphicLayoutEffect( * Returns an imperative method for changing the location. Used by ``s, but * may also be used by other elements to change the location. * - * @see https://reactrouter.com/hooks/use-navigate + * @see https://reactrouter.com/v6/hooks/use-navigate */ export function useNavigate(): NavigateFunction { let { isDataRoute } = React.useContext(RouteContext); @@ -263,7 +263,7 @@ const OutletContext = React.createContext(null); /** * Returns the context (if provided) for the child route at this level of the route * hierarchy. - * @see https://reactrouter.com/hooks/use-outlet-context + * @see https://reactrouter.com/v6/hooks/use-outlet-context */ export function useOutletContext(): Context { return React.useContext(OutletContext) as Context; @@ -273,7 +273,7 @@ export function useOutletContext(): Context { * Returns the element for the child route at this level of the route * hierarchy. Used internally by `` to render child routes. * - * @see https://reactrouter.com/hooks/use-outlet + * @see https://reactrouter.com/v6/hooks/use-outlet */ export function useOutlet(context?: unknown): React.ReactElement | null { let outlet = React.useContext(RouteContext).outlet; @@ -289,7 +289,7 @@ export function useOutlet(context?: unknown): React.ReactElement | null { * Returns an object of key/value pairs of the dynamic params from the current * URL that were matched by the route path. * - * @see https://reactrouter.com/hooks/use-params + * @see https://reactrouter.com/v6/hooks/use-params */ export function useParams< ParamsOrKey extends string | Record = string @@ -304,7 +304,7 @@ export function useParams< /** * Resolves the pathname of the given `to` value against the current location. * - * @see https://reactrouter.com/hooks/use-resolved-path + * @see https://reactrouter.com/v6/hooks/use-resolved-path */ export function useResolvedPath( to: To, @@ -335,7 +335,7 @@ export function useResolvedPath( * elements in the tree must render an `` to render their child route's * element. * - * @see https://reactrouter.com/hooks/use-routes + * @see https://reactrouter.com/v6/hooks/use-routes */ export function useRoutes( routes: RouteObject[], @@ -862,7 +862,7 @@ enum DataRouterStateHook { function getDataRouterConsoleError( hookName: DataRouterHook | DataRouterStateHook ) { - return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`; + return `${hookName} must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.`; } function useDataRouterContext(hookName: DataRouterHook) { diff --git a/packages/router/utils.ts b/packages/router/utils.ts index 2097f62777..e1771c1d6c 100644 --- a/packages/router/utils.ts +++ b/packages/router/utils.ts @@ -510,7 +510,7 @@ export function convertRoutesToDataRoutes( /** * Matches the given routes to a location and returns the match data. * - * @see https://reactrouter.com/utils/match-routes + * @see https://reactrouter.com/v6/utils/match-routes */ export function matchRoutes< RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject @@ -863,7 +863,7 @@ function matchRouteBranch< /** * Returns a path with params interpolated. * - * @see https://reactrouter.com/utils/generate-path + * @see https://reactrouter.com/v6/utils/generate-path */ export function generatePath( originalPath: Path, @@ -969,7 +969,7 @@ type Mutable = { * Performs pattern matching on a URL pathname and returns information about * the match. * - * @see https://reactrouter.com/utils/match-path + * @see https://reactrouter.com/v6/utils/match-path */ export function matchPath< ParamKey extends ParamParseKey, @@ -1129,7 +1129,7 @@ export function stripBasename( /** * Returns a resolved path object relative to the given pathname. * - * @see https://reactrouter.com/utils/resolve-path + * @see https://reactrouter.com/v6/utils/resolve-path */ export function resolvePath(to: To, fromPathname = "/"): Path { let { From 3539449cca99e642142b47fef1ffb25b008c16ae Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Thu, 17 Oct 2024 10:36:50 -0400 Subject: [PATCH 2/2] More links --- CHANGELOG.md | 8 ++++---- README.md | 2 +- docs/guides/ssr.md | 2 +- packages/react-router-dom/CHANGELOG.md | 8 ++++---- packages/react-router-dom/README.md | 2 +- packages/react-router-native/README.md | 2 +- packages/react-router/CHANGELOG.md | 10 +++++----- packages/router/CHANGELOG.md | 6 +++--- packages/router/README.md | 2 +- tutorial/README.md | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99ba143c3b..7be95039ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -375,7 +375,7 @@ We're really excited to release our new API for "Lazy Route Discovery" in `v6.24 With "Fog of War", you can now load portions of the route tree lazily via the new `unstable_patchRoutesOnMiss` option passed to `createBrowserRouter` (and it's memory/hash counterparts). This gives you a way to hook into spots where React Router is unable to match a given path and patch new routes into the route tree during the navigation (or fetcher call). -Here's a very small example, but please refer to the [documentation](https://reactrouter.com/en/main/routers/create-browser-router#optsunstable_patchroutesonmiss) for more information and use cases: +Here's a very small example, but please refer to the [documentation](https://reactrouter.com/v6/routers/create-browser-router#optsunstable_patchroutesonmiss) for more information and use cases: ```js const router = createBrowserRouter( @@ -632,7 +632,7 @@ function handleClick() { ### Minor Changes - Add `unstable_flushSync` option to `useNavigate`/`useSubmit`/`fetcher.load`/`fetcher.submit` to opt-out of `React.startTransition` and into `ReactDOM.flushSync` for state updates ([#11005](https://github.com/remix-run/react-router/pull/11005)) -- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/en/main/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API ([#10991](https://github.com/remix-run/react-router/pull/10991)) +- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/v6/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API ([#10991](https://github.com/remix-run/react-router/pull/10991)) - We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior ### Patch Changes @@ -939,7 +939,7 @@ Date: 2023-06-14 #### `future.v7_startTransition` -The **tl;dr;** is that `6.13.0` is the same as [`6.12.0`](https://github.com/remix-run/react-router/releases/tag/react-router%406.12.0) bue we've moved the usage of `React.startTransition` behind an opt-in `future.v7_startTransition` [future flag](https://reactrouter.com/en/main/guides/api-development-strategy) because we found that there are applications in the wild that are currently using `Suspense` in ways that are incompatible with `React.startTransition`. +The **tl;dr;** is that `6.13.0` is the same as [`6.12.0`](https://github.com/remix-run/react-router/releases/tag/react-router%406.12.0) bue we've moved the usage of `React.startTransition` behind an opt-in `future.v7_startTransition` [future flag](https://reactrouter.com/v6/guides/api-development-strategy) because we found that there are applications in the wild that are currently using `Suspense` in ways that are incompatible with `React.startTransition`. Therefore, in `6.13.0` the default behavior will no longer leverage `React.startTransition`: @@ -1212,7 +1212,7 @@ export function ErrorBoundary() { } ``` -An example of this in action can be found in the [`examples/lazy-loading-router-provider`](https://github.com/remix-run/react-router/tree/main/examples/lazy-loading-router-provider) directory of the repository. For more info, check out the [`lazy` docs](https://reactrouter.com/en/main/route/lazy). +An example of this in action can be found in the [`examples/lazy-loading-router-provider`](https://github.com/remix-run/react-router/tree/main/examples/lazy-loading-router-provider) directory of the repository. For more info, check out the [`lazy` docs](https://reactrouter.com/v6/route/lazy). 🙌 Huge thanks to @rossipedia for the [Initial Proposal](https://github.com/remix-run/react-router/discussions/9826) and [POC Implementation](https://github.com/remix-run/react-router/pull/9830). diff --git a/README.md b/README.md index fa131202e2..33d1ef140e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ React Router is a lightweight, fully-featured routing library for the [React](https://reactjs.org) JavaScript library. React Router runs everywhere that React runs; on the web, on the server (using node.js), and on React Native. -If you're new to React Router, we recommend you start with [the tutorial](https://reactrouter.com/en/main/start/tutorial). +If you're new to React Router, we recommend you start with [the tutorial](https://reactrouter.com/v6/start/tutorial). If you're migrating to v6 from v5 (or v4, which is the same as v5), check out [the migration guide](/docs/upgrading/v5.md). If you're migrating from Reach Router, check out [the migration guide for Reach Router](/docs/upgrading/reach.md). If you need to find the code for v5, [it is on the `v5` branch](https://github.com/remix-run/react-router/tree/v5). diff --git a/docs/guides/ssr.md b/docs/guides/ssr.md index eaf5dc8fe8..2db18d9b60 100644 --- a/docs/guides/ssr.md +++ b/docs/guides/ssr.md @@ -326,4 +326,4 @@ Again, we recommend you give [Remix](https://remix.run) a look. It's the best wa [partialhydration]: ../routers/create-browser-router#partial-hydration-data [rendertostring]: https://react.dev/reference/react-dom/server/renderToString [rendertopipeablestream]: https://react.dev/reference/react-dom/server/renderToPipeableStream -[defer]: https://reactrouter.com/en/main/utils/defer +[defer]: ../utils/defer diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index 3e21a1bc03..4272602e6e 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -91,7 +91,7 @@ - Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626)) - RFC: - - `unstable_patchRoutesOnMiss` docs: + - `unstable_patchRoutesOnMiss` docs: ### Patch Changes @@ -557,7 +557,7 @@ ### Minor Changes -- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/en/main/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596)) +- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/v6/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596)) Existing behavior will no longer include `React.startTransition`: @@ -648,7 +648,7 @@ ### Minor Changes -- Added support for [**Future Flags**](https://reactrouter.com/en/main/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207)) +- Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207)) - When `future.v7_normalizeFormMethod === false` (default v6 behavior), - `useNavigation().formMethod` is lowercase @@ -922,7 +922,7 @@ ## 6.4.0 -Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial). +Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial). **New APIs** diff --git a/packages/react-router-dom/README.md b/packages/react-router-dom/README.md index 9d8e478eda..2b0ed0817c 100644 --- a/packages/react-router-dom/README.md +++ b/packages/react-router-dom/README.md @@ -2,4 +2,4 @@ The `react-router-dom` package contains bindings for using [React Router](https://github.com/remix-run/react-router) in web applications. -Please see [the Getting Started guide](https://reactrouter.com/en/main/start/tutorial) for more information on how to get started with React Router. +Please see [the Getting Started guide](https://reactrouter.com/v6/start/tutorial) for more information on how to get started with React Router. diff --git a/packages/react-router-native/README.md b/packages/react-router-native/README.md index eb1f98536d..c61243a18c 100644 --- a/packages/react-router-native/README.md +++ b/packages/react-router-native/README.md @@ -3,4 +3,4 @@ The `react-router-native` package contains bindings for using [React Router](https://github.com/remix-run/react-router) in [React Native](https://facebook.github.io/react-native/) applications. -Please see [the Getting Started guide](https://reactrouter.com/en/main/start/tutorial) for more information on how to get started with React Router. +Please see [the Getting Started guide](https://reactrouter.com/v6/start/tutorial) for more information on how to get started with React Router. diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 1058ba9cd0..e9d2bcea53 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -80,7 +80,7 @@ No significant changes to this package were made in this release. [See the repo - Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626)) - RFC: - - `unstable_patchRoutesOnMiss` docs: + - `unstable_patchRoutesOnMiss` docs: ### Patch Changes @@ -326,7 +326,7 @@ No significant changes to this package were made in this release. [See the repo ### Minor Changes - Add `unstable_flushSync` option to `useNavigate`/`useSumbit`/`fetcher.load`/`fetcher.submit` to opt-out of `React.startTransition` and into `ReactDOM.flushSync` for state updates ([#11005](https://github.com/remix-run/react-router/pull/11005)) -- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/en/main/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior. ([#10991](https://github.com/remix-run/react-router/pull/10991)) +- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/v6/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior. ([#10991](https://github.com/remix-run/react-router/pull/10991)) ### Patch Changes @@ -416,7 +416,7 @@ No significant changes to this package were made in this release. [See the repo ### Minor Changes -- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/en/main/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596)) +- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/v6/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596)) Existing behavior will no longer include `React.startTransition`: @@ -499,7 +499,7 @@ No significant changes to this package were made in this release. [See the repo ### Minor Changes -- Added support for [**Future Flags**](https://reactrouter.com/en/main/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207)) +- Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207)) - When `future.v7_normalizeFormMethod === false` (default v6 behavior), - `useNavigation().formMethod` is lowercase @@ -776,7 +776,7 @@ function Comp() { ## 6.4.0 -Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial). +Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial). **New APIs** diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index cd603d8fda..8add3c2ef4 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -104,7 +104,7 @@ - Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626)) - RFC: - - `unstable_patchRoutesOnMiss` docs: + - `unstable_patchRoutesOnMiss` docs: ## 1.16.1 @@ -581,7 +581,7 @@ ### Minor Changes -- Added support for [**Future Flags**](https://reactrouter.com/en/main/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207)) +- Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207)) - When `future.v7_normalizeFormMethod === false` (default v6 behavior), - `useNavigation().formMethod` is lowercase @@ -839,6 +839,6 @@ function Comp() { This is the first stable release of `@remix-run/router`, which provides all the underlying routing and data loading/mutation logic for `react-router`. You should _not_ be using this package directly unless you are authoring a routing library similar to `react-router`. -For an overview of the features provided by `react-router`, we recommend you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial). +For an overview of the features provided by `react-router`, we recommend you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial). For an overview of the features provided by `@remix-run/router`, please check out the [`README`](./README.md). diff --git a/packages/router/README.md b/packages/router/README.md index 1c8536de0d..6361232606 100644 --- a/packages/router/README.md +++ b/packages/router/README.md @@ -131,5 +131,5 @@ We use _Future Flags_ in the router to help us introduce breaking changes in an [remix]: https://remix.run [react-router-repo]: https://github.com/remix-run/react-router [remix-routers-repo]: https://github.com/brophdawg11/remix-routers -[api-development-strategy]: https://reactrouter.com/en/main/guides/api-development-strategy +[api-development-strategy]: https://reactrouter.com/v6/guides/api-development-strategy [future-flags-post]: https://remix.run/blog/future-flags diff --git a/tutorial/README.md b/tutorial/README.md index d6f97ea072..8246c94006 100644 --- a/tutorial/README.md +++ b/tutorial/README.md @@ -1,3 +1,3 @@ # React Router v6 Tutorial -To complete this tutorial, we recommend following along with our guide in our [Getting Started documentation](https://reactrouter.com/en/main/start/tutorial). +To complete this tutorial, we recommend following along with our guide in our [Getting Started documentation](https://reactrouter.com/v6/start/tutorial).