Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update react-router monorepo to v7 (major) #903

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 19, 2022

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-router (source) 5.3.3 -> 7.2.0 age adoption passing confidence
react-router-dom (source) 5.3.3 -> 7.2.0 age adoption passing confidence

Release Notes

remix-run/react-router (react-router)

v7.2.0

Compare Source

Minor Changes
  • New type-safe href utility that guarantees links point to actual paths in your app (#​13012)

    import { href } from "react-router";
    
    export default function Component() {
      const link = href("/blog/:slug", { slug: "my-first-post" });
      return (
        <main>
          <Link to={href("/products/:id", { id: "asdf" })} />
          <NavLink to={href("/:lang?/about", { lang: "en" })} />
        </main>
      );
    }
Patch Changes
  • Fix typegen for repeated params (#​13012)

    In React Router, path parameters are keyed by their name.
    So for a path pattern like /a/:id/b/:id?/c/:id, the last :id will set the value for id in useParams and the params prop.
    For example, /a/1/b/2/c/3 will result in the value { id: 3 } at runtime.

    Previously, generated types for params incorrectly modeled repeated params with an array.
    So /a/1/b/2/c/3 generated a type like { id: [1,2,3] }.

    To be consistent with runtime behavior, the generated types now correctly model the "last one wins" semantics of path parameters.
    So /a/1/b/2/c/3 now generates a type like { id: 3 }.

  • Don't apply Single Fetch revalidation de-optimization when in SPA mode since there is no server HTTP request (#​12948)

  • Properly handle revalidations to across a prerender/SPA boundary (#​13021)

    • In "hybrid" applications where some routes are pre-rendered and some are served from a SPA fallback, we need to avoid making .data requests if the path wasn't pre-rendered because the request will 404
    • We don't know all the pre-rendered paths client-side, however:
      • All loader data in ssr:false mode is static because it's generated at build time
      • A route must use a clientLoader to do anything dynamic
      • Therefore, if a route only has a loader and not a clientLoader, we disable revalidation by default because there is no new data to retrieve
      • We short circuit and skip single fetch .data request logic if there are no server loaders with shouldLoad=true in our single fetch dataStrategy
      • This ensures that the route doesn't cause a .data request that would 404 after a submission
  • Error at build time in ssr:false + prerender apps for the edge case scenario of: (#​13021)

    • A parent route has only a loader (does not have a clientLoader)
    • The parent route is pre-rendered
    • The parent route has children routes which are not prerendered
    • This means that when the child paths are loaded via the SPA fallback, the parent won't have any loaderData because there is no server on which to run the loader
    • This can be resolved by either adding a parent clientLoader or pre-rendering the child paths
    • If you add a clientLoader, calling the serverLoader() on non-prerendered paths will throw a 404
  • Add unstable support for splitting route modules in framework mode via future.unstable_splitRouteModules (#​11871)

  • Add unstable_SerializesTo brand type for library authors to register types serializable by React Router's streaming format (turbo-stream) (ab5b05b02)

  • Align dev server behavior with static file server behavior when ssr:false is set (#​12948)

    • When no prerender config exists, only SSR down to the root HydrateFallback (SPA Mode)
    • When a prerender config exists but the current path is not prerendered, only SSR down to the root HydrateFallback (SPA Fallback)
    • Return a 404 on .data requests to non-pre-rendered paths
  • Improve prefetch performance of CSS side effects in framework mode (#​12889)

  • Disable Lazy Route Discovery for all ssr:false apps and not just "SPA Mode" because there is no runtime server to serve the search-param-configured __manifest requests (#​12894)

    • We previously only disabled this for "SPA Mode" which is ssr:false and no prerender config but we realized it should apply to all ssr:false apps, including those prerendering multiple pages
    • In those prerender scenarios we would prerender the /__manifest file assuming the static file server would serve it but that makes some unneccesary assumptions about the static file server behaviors
  • Properly handle interrupted manifest requests in lazy route discovery (#​12915)

v7.1.5

Compare Source

Patch Changes
  • Fix regression introduced in 7.1.4 via #​12800 that caused issues navigating to hash routes inside splat routes for applications using Lazy Route Discovery (patchRoutesOnNavigation) (#​12927)

v7.1.4

Compare Source

Patch Changes
  • Internal reorg to clean up some duplicated route module types (#​12799)
  • Properly handle status codes that cannot have a body in single fetch responses (204, etc.) (#​12760)
  • Stop erroring on resource routes that return raw strings/objects and instead serialize them as text/plain or application/json responses (#​12848)
    • This only applies when accessed as a resource route without the .data extension
    • When accessed from a Single Fetch .data request, they will still be encoded via turbo-stream
  • Optimize Lazy Route Discovery path discovery to favor a single querySelectorAll call at the body level instead of many calls at the sub-tree level (#​12731)
  • Properly bubble headers as errorHeaders when throwing a data() result (#​12846)
    • Avoid duplication of Set-Cookie headers could be duplicated if also returned from headers
  • Optimize route matching by skipping redundant matchRoutes calls when possible (#​12800)

v7.1.3

Compare Source

No changes

v7.1.2

Compare Source

Patch Changes
  • Fix issue with fetcher data cleanup in the data layer on fetcher unmount (#​12681)

  • Do not rely on symbol for filtering out redirect responses from loader data (#​12694)

    Previously, some projects were getting type checking errors like:

    error TS4058: Return type of exported function has or is using name 'redirectSymbol' from external module "node_modules/..." but cannot be named.

    Now that symbols are not used for the redirect response type, these errors should no longer be present.

v7.1.1

Compare Source

v7.1.0

Compare Source

Patch Changes
  • Throw unwrapped single fetch redirect to align with pre-single fetch behavior (#​12506)
  • Ignore redirects when inferring loader data types (#​12527)
  • Remove <Link prefetch> warning which suffers from false positives in a lazy route discovery world (#​12485)

v7.0.2

Compare Source

Patch Changes
  • temporarily only use one build in export map so packages can have a peer dependency on react router (#​12437)

  • Generate wide matches and params types for current route and child routes (#​12397)

    At runtime, matches includes child route matches and params include child route path parameters.
    But previously, we only generated types for parent routes in matches; for params, we only considered the parent routes and the current route.
    To align our generated types more closely to the runtime behavior, we now generate more permissive, wider types when accessing child route information.

v7.0.1

Compare Source

v7.0.0

Compare Source

Major Changes
  • Remove the original defer implementation in favor of using raw promises via single fetch and turbo-stream. This removes these exports from React Router: (#​11744)

    • defer
    • AbortedDeferredError
    • type TypedDeferredData
    • UNSAFE_DeferredData
    • UNSAFE_DEFERRED_SYMBOL,
    • Collapse @remix-run/router into react-router (#​11505)
    • Collapse react-router-dom into react-router
    • Collapse @remix-run/server-runtime into react-router
    • Collapse @remix-run/testing into react-router
  • Remove single_fetch future flag. (#​11522)

  • Drop support for Node 16, React Router SSR now requires Node 18 or higher (#​11391)

  • Remove future.v7_startTransition flag (#​11696)

    • Expose the underlying router promises from the following APIs for compsition in React 19 APIs: (#​11521)
      • useNavigate()
      • useSubmit
      • useFetcher().load
      • useFetcher().submit
      • useRevalidator.revalidate
  • Remove future.v7_normalizeFormMethod future flag (#​11697)

  • For Remix consumers migrating to React Router, the crypto global from the Web Crypto API is now required when using cookie and session APIs. This means that the following APIs are provided from react-router rather than platform-specific packages: (#​11837)

    • createCookie
    • createCookieSessionStorage
    • createMemorySessionStorage
    • createSessionStorage

    For consumers running older versions of Node, the installGlobals function from @remix-run/node has been updated to define globalThis.crypto, using Node's require('node:crypto').webcrypto implementation.

    Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:

    • createCookieFactory
    • createSessionStorageFactory
    • createCookieSessionStorageFactory
    • createMemorySessionStorageFactory
  • Imports/Exports cleanup (#​11840)

    • Removed the following exports that were previously public API from @remix-run/router
      • types
        • AgnosticDataIndexRouteObject
        • AgnosticDataNonIndexRouteObject
        • AgnosticDataRouteMatch
        • AgnosticDataRouteObject
        • AgnosticIndexRouteObject
        • AgnosticNonIndexRouteObject
        • AgnosticRouteMatch
        • AgnosticRouteObject
        • TrackedPromise
        • unstable_AgnosticPatchRoutesOnMissFunction
        • Action -> exported as NavigationType via react-router
        • Router exported as DataRouter to differentiate from RR's <Router>
      • API
        • getToPathname (@private)
        • joinPaths (@private)
        • normalizePathname (@private)
        • resolveTo (@private)
        • stripBasename (@private)
        • createBrowserHistory -> in favor of createBrowserRouter
        • createHashHistory -> in favor of createHashRouter
        • createMemoryHistory -> in favor of createMemoryRouter
        • createRouter
        • createStaticHandler -> in favor of wrapper createStaticHandler in RR Dom
        • getStaticContextFromError
    • Removed the following exports that were previously public API from react-router
      • Hash
      • Pathname
      • Search
  • update minimum node version to 18 (#​11690)

  • Remove future.v7_prependBasename from the ionternalized @remix-run/router package (#​11726)

  • Migrate Remix type generics to React Router (#​12180)

    • These generics are provided for Remix v2 migration purposes
    • These generics and the APIs they exist on should be considered informally deprecated in favor of the new Route.* types
    • Anyone migrating from React Router v6 should probably not leverage these new generics and should migrate straight to the Route.* types
    • For React Router v6 users, these generics are new and should not impact your app, with one exception
      • useFetcher previously had an optional generic (used primarily by Remix v2) that expected the data type
      • This has been updated in v7 to expect the type of the function that generates the data (i.e., typeof loader/typeof action)
      • Therefore, you should update your usages:
        • useFetcher<LoaderData>()
        • useFetcher<typeof loader>()
  • Remove future.v7_throwAbortReason from internalized @remix-run/router package (#​11728)

  • Add exports field to all packages (#​11675)

  • node package no longer re-exports from react-router (#​11702)

  • renamed RemixContext to FrameworkContext (#​11705)

  • updates the minimum React version to 18 (#​11689)

  • PrefetchPageDescriptor replaced by PageLinkDescriptor (#​11960)

    • Consolidate types previously duplicated across @remix-run/router, @remix-run/server-runtime, and @remix-run/react now that they all live in react-router (#​12177)
      • Examples: LoaderFunction, LoaderFunctionArgs, ActionFunction, ActionFunctionArgs, DataFunctionArgs, RouteManifest, LinksFunction, Route, EntryRoute
      • The RouteManifest type used by the "remix" code is now slightly stricter because it is using the former @remix-run/router RouteManifest
        • Record<string, Route> -> Record<string, Route | undefined>
      • Removed AppData type in favor of inlining unknown in the few locations it was used
      • Removed ServerRuntimeMeta* types in favor of the Meta* types they were duplicated from
    • Remove the future.v7_partialHydration flag (#​11725)
      • This also removes the <RouterProvider fallbackElement> prop
        • To migrate, move the fallbackElement to a hydrateFallbackElement/HydrateFallback on your root route
      • Also worth nothing there is a related breaking changer with this future flag:
        • Without future.v7_partialHydration (when using fallbackElement), state.navigation was populated during the initial load
        • With future.v7_partialHydration, state.navigation remains in an "idle" state during the initial load
  • Remove v7_relativeSplatPath future flag (#​11695)

  • Drop support for Node 18, update minimum Node vestion to 20 (#​12171)

    • Remove installGlobals() as this should no longer be necessary
  • Remove remaining future flags (#​11820)

    • React Router v7_skipActionErrorRevalidation
    • Remix v3_fetcherPersist, v3_relativeSplatPath, v3_throwAbortReason
  • rename createRemixStub to createRoutesStub (#​11692)

  • Remove @remix-run/router deprecated detectErrorBoundary option in favor of mapRouteProperties (#​11751)

  • Add react-router/dom subpath export to properly enable react-dom as an optional peerDependency (#​11851)

    • This ensures that we don't blindly import ReactDOM from "react-dom" in <RouterProvider> in order to access ReactDOM.flushSync(), since that would break createMemoryRouter use cases in non-DOM environments
    • DOM environments should import from react-router/dom to get the proper component that makes ReactDOM.flushSync() available:
      • If you are using the Vite plugin, use this in your entry.client.tsx:
        • import { HydratedRouter } from 'react-router/dom'
      • If you are not using the Vite plugin and are manually calling createBrowserRouter/createHashRouter:
        • import { RouterProvider } from "react-router/dom"
  • Remove future.v7_fetcherPersist flag (#​11731)

  • Update cookie dependency to ^1.0.1 - please see the release notes for any breaking changes (#​12172)

Minor Changes
    • Add support for prerender config in the React Router vite plugin, to support existing SSG use-cases (#​11539)
      • You can use the prerender config to pre-render your .html and .data files at build time and then serve them statically at runtime (either from a running server or a CDN)
      • prerender can either be an array of string paths, or a function (sync or async) that returns an array of strings so that you can dynamically generate the paths by talking to your CMS, etc.
    // react-router.config.ts
    import type { Config } from "@&#8203;react-router/dev/config";
    
    export default {
      async prerender() {
        let slugs = await fakeGetSlugsFromCms();
        // Prerender these paths into `.html` files at build time, and `.data`
        // files if they have loaders
        return ["/", "/about", ...slugs.map((slug) => `/product/${slug}`)];
      },
    } satisfies Config;
    
    async function fakeGetSlugsFromCms() {
      await new Promise((r) => setTimeout(r, 1000));
      return ["shirt", "hat"];
    }
  • Params, loader data, and action data as props for route component exports (#​11961)

    export default function Component({ params, loaderData, actionData }) {}
    
    export function HydrateFallback({ params }) {}
    export function ErrorBoundary({ params, loaderData, actionData }) {}
  • Remove duplicate RouterProvider impliementations (#​11679)

  • Typesafety improvements (#​12019)

    React Router now generates types for each of your route modules.
    You can access those types by importing them from ./+types.<route filename without extension>.
    For example:

    // app/routes/product.tsx
    import type * as Route from "./+types.product";
    
    export function loader({ params }: Route.LoaderArgs) {}
    
    export default function Component({ loaderData }: Route.ComponentProps) {}

    This initial implementation targets type inference for:

    • Params : Path parameters from your routing config in routes.ts including file-based routing
    • LoaderData : Loader data from loader and/or clientLoader within your route module
    • ActionData : Action data from action and/or clientAction within your route module

    In the future, we plan to add types for the rest of the route module exports: meta, links, headers, shouldRevalidate, etc.
    We also plan to generate types for typesafe Links:

    <Link to="/products/:id" params={{ id: 1 }} />
    //        ^^^^^^^^^^^^^          ^^^^^^^^^
    // typesafe `to` and `params` based on the available routes in your app

    Check out our docs for more:

  • Stabilize unstable_dataStrategy (#​11969)

  • Stabilize unstable_patchRoutesOnNavigation (#​11970)

Patch Changes

v6.29.0: v6.29.0

Compare Source

See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6290

v6.28.2: v6.28.2

Compare Source

See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6282

v6.28.1: v6.28.1

Compare Source

See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6281

v6.28.0

Compare Source

Minor Changes
    • Log deprecation warnings for v7 flags (#​11750)
    • Add deprecation warnings to json/defer in favor of returning raw objects
      • These methods will be removed in React Router v7
Patch Changes

v6.27.0: v6.27.0

Compare Source

See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6270

v6.26.2

Compare Source

Patch Changes

v6.26.1

Compare Source

v6.26.0

Compare Source

Minor Changes
  • Add a new replace(url, init?) alternative to redirect(url, init?) that performs a history.replaceState instead of a history.pushState on client-side navigation redirects (#​11811)
Patch Changes
  • Fix initial hydration behavior when using future.v7_partialHydration along with unstable_patchRoutesOnMiss (#​11838)
    • During initial hydration, router.state.matches will now include any partial matches so that we can render ancestor HydrateFallback components
  • Updated dependencies:

v6.25.1: v6.25.1

Compare Source

See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6251

v6.25.0

Compare Source

Minor Changes
  • Stabilize future.unstable_skipActionErrorRevalidation as future.v7_skipActionErrorRevalidation (#​11769)

    • When this flag is enabled, actions will not automatically trigger a revalidation if they return/throw a Response with a 4xx/5xx status code
    • You may still opt-into revalidation via shouldRevalidate
    • This also changes shouldRevalidate's unstable_actionStatus parameter to actionStatus
Patch Changes
  • Fix regression and properly decode paths inside useMatch so matches/params reflect decoded params (#​11789)
  • Updated dependencies:

v6.24.1

Compare Source

Patch Changes
  • When using future.v7_relativeSplatPath, properly resolve relative paths in splat routes that are children of pathless routes (#​11633)
  • Updated dependencies:

v6.24.0

Compare Source

Minor Changes
Patch Changes

v6.23.1

Compare Source

Patch Changes

v6.23.0

Compare Source

Minor Changes
  • Add a new unstable_dataStrategy configuration option (#​11098)
    • This option allows Data Router applications to take control over the approach for executing route loaders and actions
    • 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, middleware/context APIs, automatic loader caching, and more
Patch Changes

v6.22.3

Compare Source

Patch Changes

v6.22.2

Compare Source

Patch Changes

v6.22.1: v6.22.1

Compare Source

See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6221

v6.22.0

Compare Source

Patch Changes

v6.21.3

Compare Source

Patch Changes
  • Remove leftover unstable_ prefix from Blocker/BlockerFunction types (#​11187)

v6.21.2

Compare Source

v6.21.1

Compare Source

Patch Changes
  • Fix bug with route.lazy not working correctly on initial SPA load when v7_partialHydration is specified (#​11121)
  • Updated dependencies:

v6.21.0

Compare Source

Minor Changes
  • Add a new future.v7_relativeSplatPath flag to implement a breaking bug fix to relative routing when inside a splat route. (#​11087)

    This fix was originally added in #​10983 and was later reverted in #​11078 because it was determined that a large number of existing applications were relying on the buggy behavior (see #​11052)

    The Bug
    The buggy behavior is that without this flag, the default behavior when resolving relative paths is to ignore any splat (*) portion of the current route path.

    The Background
    This decision was originally made thinking that it would make the concept of nested different sections of your apps in <Routes> easier if relative routing would replace the current splat:

    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="dashboard/*" element={<Dashboard />} />
      </Routes>
    </BrowserRouter>

    Any paths like /dashboard, /dashboard/team, /dashboard/projects will match the Dashboard route. The dashboard component itself can then render nested <Routes>:

    function Dashboard() {
      return (
        <div>
          <h2>Dashboard</h2>
          <nav>
            <Link to="/">Dashboard Home</Link>
            <Link to="team">Team</Link>
            <Link to="projects">Projects</Link>
          </nav>
    
          <Routes>
            <Route path="/" element={<DashboardHome />} />
            <Route path="team" element={<DashboardTeam />} />
            <Route path="projects" element={<DashboardProjects />} />
          </Routes>
        </div>
      );
    }

    Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the Dashboard as its own independent app, or embed it into your large app without making any changes to it.

    The Problem

    The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that "." always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using ".":

    // If we are on URL /dashboard/team, and we want to link to /dashboard/team:
    function DashboardTeam() {
      // ❌ This is broken and results in <a href="/dashboard">
      return <Link to=".">A broken link to the Current URL</Link>;
    
      // ✅ This is fixed but super unintuitive since we're already at /dashboard/team!
      return <Link to="./team">A broken link to the Current URL</Link>;
    }

    We've also introduced an issue that we can no longer move our DashboardTeam component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as /dashboard/:widget. Now, our "." links will, properly point to ourself inclusive of the dynamic param value so behavior will break from it's corresponding usage in a /dashboard/* route.

    Even worse, consider a nested splat route configuration:

    <BrowserRouter>
      <Routes>
        <Route path="dashboard">
          <Route path="*" element={<Dashboard />} />
        </Route>
      </Routes>
    </BrowserRouter>

    Now, a <Link to="."> and a <Link to=".."> inside the Dashboard component go to the same place! That is definitely not correct!

    Another common issue arose in Data Routers (and Remix) where any <Form> should post to it's own route action if you the user doesn't specify a form action:

    let router = createBrowserRouter({
      path: "/dashboard",
      children: [
        {
          path: "*",
          action: dashboardAction,
          Component() {
            // ❌ This form is broken!  It throws a 405 error when it submits because
            // it tries to submit to /dashboard (without the splat value) and the parent
            // `/dashboard` route doesn't have an action
            return <Form method="post">...</Form>;
          },
        },
      ],
    });

    This is just a compounded issue from the above because the default location for a Form to submit to is itself (".") - and if we ignore the splat portion, that now resolves to the parent route.

    The Solution
    If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage ../ for any links to "sibling" pages:

    <BrowserRouter>
      <Routes>
        <Route path="dashboard">
          <Route index path="*" element={<Dashboard />} />
        </Route>
      </Routes>
    </BrowserRouter>
    
    function Dashboard() {
      return (
        <div>
          <h2>Dashboard</h2>
          <nav>
            <Link to="..">Dashboard Home</Link>
            <Link to="../team">Team</Link>
            <Link to="../projects">Projects</Link>
          </nav>
    
          <Routes>
            <Route path="/" element={<DashboardHome />} />
            <Route path="team" element={<DashboardTeam />} />
            <Route path="projects" element={<DashboardProjects />} />
          </Router>
        </div>
      );
    }

    This way, . means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and .. always means "my parents pathname".

Patch Changes

v6.20.1

Compare Source

Patch Changes

v6.20.0

Compare Source

Minor Changes
  • Export the PathParam type from the public API (#​10719)
Patch Changes
  • Fix bug with resolveTo in splat routes (#​11045)
    • This is a follow up to #​10983 to handle the few other code paths using getPathContributingMatches
    • This removes the UNSAFE_getPathContributingMatches export from @remix-run/router since we no longer need this in the react-router/react-router-dom layers
  • Updated dependencies:

v6.19.0

Compare Source

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)
  • Remove the unstable_ prefix from the useBlocker 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)
Patch Changes
  • Fix useActionData so it returns proper contextual action data and not any action data in the tree (#​11023)

  • Fix bug in useResolvedPath that would cause useResolvedPath(".") in a splat route to lose the splat portion of the URL path. (#​10983)

    • ⚠️ This fixes a quite long-standing bug specifically for "." paths inside a splat route which incorrectly dropped the splat portion of the URL. If you are relative routing via "." inside a splat route in your application you should double check that your logic is not relying on this buggy behavior and update accordingly.
  • Updated dependencies:

v6.18.0

Compare Source

Patch Changes
  • Fix the future prop on BrowserRouter, HashRouter and MemoryRouter so that it accepts a Partial<FutureConfig> instead of requiring all flags to be included. (#​10962)
  • Updated dependencies:

v6.17.0

Compare Source

Patch Changes
  • Fix RouterProvider future prop type to be a Partial<FutureConfig> so that not all flags must be specified (#​10900)
  • Updated dependencies:

v6.16.0

Compare Source

Minor Changes
  • In order to move towards stricter TypeScript support in the future, we're aiming to replace current usages of any with unknown on exposed typings for user-provided data. To do this in Remix v2 without introducing breaking changes in React Router v6, we have added generics to a number of shared types. These continue to default to any in React Router and are overridden with unknown in Remix. In React Router v7 we plan to move these to unknown as a breaking change. (#​10843)
    • Location now accepts a generic for the location.state value
    • ActionFunctionArgs/ActionFunction/LoaderFunctionArgs/LoaderFunction now accept a generic for the context parameter (only used in SSR usages via createStaticHandler)
    • The return type of useMatches (now exported as UIMatch) accepts generics for match.data and match.handle - both of which were already set to unknown
  • Move the @private class export ErrorResponse to an UNSAFE_ErrorResponseImpl export since it is an implementation detail and there should be no construction of ErrorResponse instances in userland. This frees us up to export a type ErrorResponse which correlates to an instance of the class via InstanceType. Userland code should only ever be using ErrorResponse as a type and should be type-narrowing via isRouteErrorResponse. (#​10811)
  • Export ShouldRevalidateFunctionArgs interface (#​10797)
  • Removed private/internal APIs only required for the Remix v1 backwards compatibility layer and no longer needed in Remix v2 (_isFetchActionRedirect, _hasFetcherDoneAnything) (#​10715)
Patch Changes

v6.15.0

Compare Source

Minor Changes
  • Add's a new redirectDocument() function which allows users to specify that a redirect from a loader/action should trigger a document reload (via window.location) instead of attempting to navigate to the redirected location via React Router (#​10705)
Patch Changes
  • Ensure useRevalidator is referentially stable across re-renders if revalidations are not actively occurring (#​10707)
  • Updated dependencies:

v6.14.2

Compare Source

Patch Changes

v6.14.1

Compare Source

Patch Changes
  • Fix loop in unstable_useBlocker when used with an unstable blocker function (#​10652)
  • Fix issues with reused blockers on subsequent navigations (#​10656)
  • Updated dependencies:

v6.14.0

Compare Source

Patch Changes
  • Strip basename from locations provided to unstable_useBlocker functions to match useLocation (#​10573)
  • Fix generatePath when passed a numeric 0 value parameter (#​10612)
  • Fix unstable_useBlocker key issues in StrictMode (#​10573)
  • Fix tsc --skipLibCheck:false issues on React 17 (#​10622)
  • Upgrade typescript to 5.1 (#​10581)
  • Updated dependencies:

v6.13.0

Compare Source

Minor Changes
  • Move React.startTransition usage behind a future flag 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)

    Existing behavior will no longer include React.startTransition:

    <BrowserRouter>
      <Routes>{/*...*/}</Routes>
    </BrowserRouter>
    
    <RouterProvider router={router} />

    If you wish to enable React.startTransition, pass the future flag to your component:

    <BrowserRouter future={{ v7_startTransition: true }}>
      <Routes>{/*...*/}</Routes>
    </BrowserRouter>
    
    <RouterProvider router={router} future={{ v7_startTransition: true }}/>
Patch Changes
  • Work around webpack/terser React.startTransition minification bug in production mode (#​10588)

v6.12.1

Compare Source

Warning
Please use version 6.13.0 or later instead of 6.12.1. This version suffers from a webpack/terser minification issue resulting in invalid minified code in your resulting production bundles which can cause issues in your application. See #​10579 for more details.

Patch Changes
  • Adjust feature detection of React.startTransition to fix webpack + react 17 compilation error (#​10569)

v6.12.0

Compare Source

Minor Changes
  • Wrap internal router state updates with React.startTransition if it exists (#​10438)
Patch Changes

v6.11.2

Compare Source

Patch Changes
  • Fix basename duplication in descendant <Routes> inside a <RouterProvider> (#​10492)
  • Updated dependencies:

v6.11.1

Compare Source

Patch Changes
  • Fix usage of Component API within descendant <Routes> (#​10434)
  • Fix bug when calling useNavigate from <Routes> inside a <RouterProvider> (#​10432)
  • Fix usage of <Navigate> in strict mode when using a data router (#​10435)
  • Updated dependencies:

v6.11.0

Compare Source

Patch Changes
  • Log loader/action errors to the console in dev for easier stack trace evaluation (#​10286)
  • Fix bug preventing rendering of descendant <Routes> when RouterProvider errors existed (#​10374)
  • Fix inadvertent re-renders when using Component i

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 251eb11 to 1097545 Compare June 19, 2022 19:45
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 4 times, most recently from 66dd3da to 128de44 Compare July 6, 2022 09:27
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 128de44 to 3fc1cd5 Compare September 25, 2022 17:53
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 3fc1cd5 to 19d67b8 Compare November 20, 2022 13:43
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from e6d1c95 to 943e0e9 Compare March 30, 2023 00:00
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 943e0e9 to 5913da2 Compare May 28, 2023 11:59
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from b92ca9d to 1b70489 Compare June 8, 2023 18:28
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 1b70489 to 7b6e96a Compare June 14, 2023 16:38
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from 0e87ec6 to 1d810ee Compare June 30, 2023 19:46
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 1d810ee to 64d13b5 Compare July 17, 2023 22:48
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 64d13b5 to 1d2af38 Compare August 10, 2023 17:27
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 1d2af38 to c68f173 Compare September 13, 2023 20:23
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from c68f173 to be3f934 Compare October 16, 2023 17:00
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from be3f934 to dcfa83d Compare October 31, 2023 14:42
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from 91984e4 to b2be209 Compare November 22, 2023 20:12
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from b2be209 to 76ace03 Compare December 1, 2023 22:12
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 76ace03 to d17333c Compare December 14, 2023 01:55
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from d17333c to 77fcb3b Compare December 21, 2023 18:01
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 77fcb3b to 90824f5 Compare January 11, 2024 17:22
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 90824f5 to b93e450 Compare January 18, 2024 19:59
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from b93e450 to 6b6c6b2 Compare February 1, 2024 21:38
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 6b6c6b2 to c717660 Compare February 16, 2024 21:13
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from c717660 to b3fd6d8 Compare February 28, 2024 20:30
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from b3fd6d8 to 85200cf Compare March 7, 2024 15:59
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 85200cf to c5deacd Compare April 23, 2024 16:02
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from c5deacd to 871cc11 Compare May 10, 2024 18:55
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 871cc11 to b93e379 Compare June 24, 2024 20:04
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from b93e379 to 5530fb1 Compare July 3, 2024 14:50
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from abf2405 to a941f2a Compare July 17, 2024 17:28
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from a941f2a to b1a51a9 Compare August 1, 2024 16:29
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from b1a51a9 to af5f6b5 Compare August 15, 2024 16:10
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from af5f6b5 to 12576db Compare September 9, 2024 15:52
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 12576db to 67328c3 Compare October 11, 2024 19:03
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 67328c3 to 03a1402 Compare November 7, 2024 01:49
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from 1638350 to d95016e Compare November 23, 2024 11:46
@renovate renovate bot changed the title Update react-router monorepo to v6 (major) Update react-router monorepo to v7 (major) Nov 23, 2024
Copy link
Contributor Author

renovate bot commented Nov 23, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"16.12.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=18" from [email protected]
npm ERR! node_modules/react-router
npm ERR!   react-router@"7.2.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /tmp/renovate/cache/others/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/renovate/cache/others/npm/_logs/2025-02-18T23_28_43_627Z-debug-0.log

@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from d95016e to d60c189 Compare December 3, 2024 04:57
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from ab1b793 to 7fb1075 Compare December 23, 2024 18:56
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from d70b8c1 to 2d19328 Compare January 18, 2025 00:50
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch 2 times, most recently from 52ac006 to 8e6e325 Compare February 1, 2025 21:00
@renovate renovate bot force-pushed the renovate/major-react-router-monorepo branch from 8e6e325 to b9db34a Compare February 18, 2025 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants