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

fix(deps): update dependency history to version 5.x 🌟 (major) #1505

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 4, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
history 4.10.1 -> 5.3.0 age adoption passing confidence
react-router (source) 5.3.4 -> 7.4.1 age adoption passing confidence
react-router-dom (source) 5.3.4 -> 7.4.1 age adoption passing confidence

Release Notes

remix-run/history (history)

v5.3.0

Compare Source

This release provides support for native ESM consumption of all exports.

v5.2.0

Compare Source

🐛 Bug fixes

  • Fixed a few type declarations and deprecated the following types:
    • State (now set to unknown which will require consumer type narrowing)
    • PartialPath (use Partial<Path> instead)
    • PartialLocation (use Partial<Location> instead)
  • Fixed a regression related to the createPath return value (#​813)

✨ Features

  • We now use statically analyzable CJS exports. This enables named imports in Node ESM scripts (See the commit).

Full Changelog: remix-run/history@v5.1.0...v5.2.0

v5.1.0

Compare Source

Because the prior 5.0.2 release removed the State type parameter from Location, this was technically a breaking change. To correct for this, I'm bumping this as a minor release. It won't affect runtime code, but it may affect your development experience and tests if you were using that parameter.

The State type export is also restored, so you shouldn't have issues with installing React Router v6.

Oh, by the way, did you hear we released React Router v6?

Full Changelog: remix-run/history@v5.0.3...v5.1.0

v5.0.3

Compare Source

Fixed parsePath adding incorrectly adding search

v5.0.2

Compare Source

Just a couple fixes:

  • Fixed search params persisting on redirects
  • Changed the location.state type to any and removed the generic on Location

Full Changelog: remix-run/history@v5.0.1...v5.0.2

v5.0.1

Compare Source

This patch release contains a tiny TypeScript update to use the built-in Partial utility for PartialPath and PartialLocation. We always love it when we can ship just a little less code!

🙏 Credits

Thanks to @​liuhanqu, @​hanquliu, @​chaance and @​mjackson for your contributions!

v5.0.0

Compare Source

Today we are very pleased to announce the stable release of history version 5!

Overview

This version includes many enhancements and fixes a few important issues with the library.

New Features
  • Hash history now has support for location.state
  • Better history.block API, with support for retrying transitions
  • Full TypeScript declarations and IntelliSense docs
  • Adds development and production builds for <script type=module> users
  • Both browser and hash history have support for iframes (custom window objects)
  • About 50% smaller than v4 (and no dependencies)
Bugfixes
  • Fixed some long-standing encoding issues with location.pathname
  • Removed unfixable warnings about pushing the same path in hash history
  • Renamed browser global to HistoryLibrary so it doesn't conflict with window.History
Breaking Changes
  • Removed support for browsers that do not support the HTML5 history API (no pushState)
  • Removed relative pathname support in hash history and memory history
  • Removed getUserConfirmation, keyLength, and hashType APIs

Usage

Please refer to our installation guide for instructions about how to install the library.

There is also a getting started guide as well as a complete API reference in the docs folder.

We are very excited about this release, especially because it will serve as the foundation for the upcoming release of React Router version 6.

Thank you for your support. Enjoy! 😀

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

v7.4.1

Compare Source

Patch Changes
  • Fix types on unstable_MiddlewareFunction to avoid type errors when a middleware doesn't return a value (#​13311)

  • Dedupe calls to route.lazy functions (#​13260)

  • Add support for route.unstable_lazyMiddleware function to allow lazy loading of middleware logic. (#​13210)

    Breaking change for unstable_middleware consumers

    The route.unstable_middleware property is no longer supported in the return value from route.lazy. If you want to lazily load middleware, you must use route.unstable_lazyMiddleware.

v7.4.0

Compare Source

Patch Changes
  • Fix root loader data on initial load redirects in SPA mode (#​13222)
  • Load ancestor pathless/index routes in lazy route discovery for upwards non-eager-discoery routing (#​13203)
  • Fix shouldRevalidate behavior for clientLoader-only routes in ssr:true apps (#​13221)
  • UNSTABLE: Fix RequestHandler loadContext parameter type when middleware is enabled (#​13204)
  • UNSTABLE: Update Route.unstable_MiddlewareFunction to have a return value of Response | undefined instead of Response | void becaue you should not return anything if you aren't returning the Response (#​13199)
  • UNSTABLE(BREAKING): If a middleware throws an error, ensure we only bubble the error itself via next() and are no longer leaking the MiddlewareError implementation detail (#​13180)

v7.3.0

Compare Source

Minor Changes
  • Add fetcherKey as a parameter to patchRoutesOnNavigation (#​13061)

    • In framework mode, Lazy Route Discovery will now detect manifest version mismatches after a new deploy
    • On navigations to undiscovered routes, this mismatch will trigger a document reload of the destination path
    • On fetcher calls to undiscovered routes, this mismatch will trigger a document reload of the current path
Patch Changes
  • Skip resource route flow in dev server in SPA mode (#​13113)

  • Support middleware on routes (unstable) (#​12941)

    Middleware is implemented behind a future.unstable_middleware flag. To enable, you must enable the flag and the types in your react-router-config.ts file:

    import type { Config } from "@&#8203;react-router/dev/config";
    import type { Future } from "react-router";
    
    declare module "react-router" {
      interface Future {
        unstable_middleware: true; // 👈 Enable middleware types
      }
    }
    
    export default {
      future: {
        unstable_middleware: true, // 👈 Enable middleware
      },
    } satisfies Config;

    ⚠️ Middleware is unstable and should not be adopted in production. There is at least one known de-optimization in route module loading for clientMiddleware that we will be addressing this before a stable release.

    ⚠️ Enabling middleware contains a breaking change to the context parameter passed to your loader/action functions - see below for more information.

    Once enabled, routes can define an array of middleware functions that will run sequentially before route handlers run. These functions accept the same parameters as loader/action plus an additional next parameter to run the remaining data pipeline. This allows middlewares to perform logic before and after handlers execute.

    // Framework mode
    export const unstable_middleware = [serverLogger, serverAuth]; // server
    export const unstable_clientMiddleware = [clientLogger]; // client
    
    // Library mode
    const routes = [
      {
        path: "/",
        // Middlewares are client-side for library mode SPA's
        unstable_middleware: [clientLogger, clientAuth],
        loader: rootLoader,
        Component: Root,
      },
    ];

    Here's a simple example of a client-side logging middleware that can be placed on the root route:

    const clientLogger: Route.unstable_ClientMiddlewareFunction = async (
      { request },
      next
    ) => {
      let start = performance.now();
    
      // Run the remaining middlewares and all route loaders
      await next();
    
      let duration = performance.now() - start;
      console.log(`Navigated to ${request.url} (${duration}ms)`);
    };

    Note that in the above example, the next/middleware functions don't return anything. This is by design as on the client there is no "response" to send over the network like there would be for middlewares running on the server. The data is all handled behind the scenes by the stateful router.

    For a server-side middleware, the next function will return the HTTP Response that React Router will be sending across the wire, thus giving you a chance to make changes as needed. You may throw a new response to short circuit and respond immediately, or you may return a new or altered response to override the default returned by next().

    const serverLogger: Route.unstable_MiddlewareFunction = async (
      { request, params, context },
      next
    ) => {
      let start = performance.now();
    
      // 👇 Grab the response here
      let res = await next();
    
      let duration = performance.now() - start;
      console.log(`Navigated to ${request.url} (${duration}ms)`);
    
      // 👇 And return it here (optional if you don't modify the response)
      return res;
    };

    You can throw a redirect from a middleware to short circuit any remaining processing:

    import { sessionContext } from "../context";
    const serverAuth: Route.unstable_MiddlewareFunction = (
      { request, params, context },
      next
    ) => {
      let session = context.get(sessionContext);
      let user = session.get("user");
      if (!user) {
        session.set("returnTo", request.url);
        throw redirect("/login", 302);
      }
    };

    Note that in cases like this where you don't need to do any post-processing you don't need to call the next function or return a Response.

    Here's another example of using a server middleware to detect 404s and check the CMS for a redirect:

    const redirects: Route.unstable_MiddlewareFunction = async ({
      request,
      next,
    }) => {
      // attempt to handle the request
      let res = await next();
    
      // if it's a 404, check the CMS for a redirect, do it last
      // because it's expensive
      if (res.status === 404) {
        let cmsRedirect = await checkCMSRedirects(request.url);
        if (cmsRedirect) {
          throw redirect(cmsRedirect, 302);
        }
      }
    
      return res;
    };

    context parameter

    When middleware is enabled, your application will use a different type of context parameter in your loaders and actions to provide better type safety. Instead of AppLoadContext, context will now be an instance of ContextProvider that you can use with type-safe contexts (similar to React.createContext):

    import { unstable_createContext } from "react-router";
    import { Route } from "./+types/root";
    import type { Session } from "./sessions.server";
    import { getSession } from "./sessions.server";
    
    let sessionContext = unstable_createContext<Session>();
    
    const sessionMiddleware: Route.unstable_MiddlewareFunction = ({
      context,
      request,
    }) => {
      let session = await getSession(request);
      context.set(sessionContext, session);
      //                          ^ must be of type Session
    };
    
    // ... then in some downstream middleware
    const loggerMiddleware: Route.unstable_MiddlewareFunction = ({
      context,
      request,
    }) => {
      let session = context.get(sessionContext);
      //  ^ typeof Session
      console.log(session.get("userId"), request.method, request.url);
    };
    
    // ... or some downstream loader
    export function loader({ context }: Route.LoaderArgs) {
      let session = context.get(sessionContext);
      let profile = await getProfile(session.get("userId"));
      return { profile };
    }

    If you are using a custom server with a getLoadContext function, the return value for initial context values passed from the server adapter layer is no longer an object and should now return an unstable_InitialContext (Map<RouterContext, unknown>):

    let adapterContext = unstable_createContext<MyAdapterContext>();
    
    function getLoadContext(req, res): unstable_InitialContext {
      let map = new Map();
      map.set(adapterContext, getAdapterContext(req));
      return map;
    }
  • Fix types for loaderData and actionData that contained Records (#​13139)

    UNSTABLE(BREAKING):

    unstable_SerializesTo added a way to register custom serialization types in Single Fetch for other library and framework authors like Apollo.
    It was implemented with branded type whose branded property that was made optional so that casting arbitrary values was easy:

    // without the brand being marked as optional
    let x1 = 42 as unknown as unstable_SerializesTo<number>;
    //          ^^^^^^^^^^
    
    // with the brand being marked as optional
    let x2 = 42 as unstable_SerializesTo<number>;

    However, this broke type inference in loaderData and actionData for any Record types as those would now (incorrectly) match unstable_SerializesTo.
    This affected all users, not just those that depended on unstable_SerializesTo.
    To fix this, the branded property of unstable_SerializesTo is marked as required instead of optional.

    For library and framework authors using unstable_SerializesTo, you may need to add as unknown casts before casting to unstable_SerializesTo.

  • [REMOVE] Remove middleware depth logic and always call middlware for all matches (#​13172)

  • Fix single fetch _root.data requests when a basename is used (#​12898)

  • Add context support to client side data routers (unstable) (#​12941)

    Your application loader and action functions on the client will now receive a context parameter. This is an instance of unstable_RouterContextProvider that you use with type-safe contexts (similar to React.createContext) and is most useful with the corresponding middleware/clientMiddleware API's:

    import { unstable_createContext } from "react-router";
    
    type User = {
      /*...*/
    };
    
    let userContext = unstable_createContext<User>();
    
    function sessionMiddleware({ context }) {
      let user = await getUser();
      context.set(userContext, user);
    }
    
    // ... then in some downstream loader
    function loader({ context }) {
      let user = context.get(userContext);
      let profile = await getProfile(user.id);
      return { profile };
    }

    Similar to server-side requests, a fresh context will be created per navigation (or fetcher call). If you have initial data you'd like to populate in the context for every request, you can provide an unstable_getContext function at the root of your app:

    • Library mode - createBrowserRouter(routes, { unstable_getContext })
    • Framework mode - <HydratedRouter unstable_getContext>

    This function should return an value of type unstable_InitialContext which is a Map<unstable_RouterContext, unknown> of context's and initial values:

    const loggerContext = unstable_createContext<(...args: unknown[]) => void>();
    
    function logger(...args: unknown[]) {
      console.log(new Date.toISOString(), ...args);
    }
    
    function unstable_getContext() {
      let map = new Map();
      map.set(loggerContext, logger);
      return map;
    }

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

No changes

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

No changes

v7.0.0

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.30.0: v6.30.0

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

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

Compare Source

Minor Changes
  • Stabilize unstable_patchRoutesOnNavigation (#​11973)
    • Add new PatchRoutesOnNavigationFunctionArgs type for convenience (#​11967)
  • Stabilize unstable_dataStrategy (#​11974)
  • Stabilize the unstable_flushSync option for navigations and fetchers (#​11989)
  • Stabilize the unstable_viewTransition option for navigations and the corresponding unstable_useViewTransitionState hook (#​11989)
Patch Changes
  • Fix bug when submitting to the current contextual route (parent route with an index child) when an ?index param already exists from a prior submission (#​12003)

  • Fix useFormAction bug - when removing ?index param it would not keep other non-Remix index params (#​12003)

  • Fix types for RouteObject within PatchRoutesOnNavigationFunction's patch method so it doesn't expect agnostic route objects passed to patch (#​11967)

  • Updated dependencies:

v6.26.2

Compare Source

Patch Changes

v6.26.1

Compare Source

Patch Changes
  • Rename unstable_patchRoutesOnMiss to unstable_patchRoutesOnNavigation to match new behavior (#​11888)
  • Updated dependencies:

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

Compare Source

No significant changes to this package were made in this release. See the repo CHANGELOG.md for an overview of all changes in v6.25.1.

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

Compare Source

Patch Changes
  • Fix encoding/decoding issues with pre-encoded dynamic parameter values (#​11199)
  • Updated dependencies:

v6.22.0

Compare Source

Patch Changes

v6.21.3

Compare Source

Patch Changes
  • Remove leftover unstable_ prefix from Blocker/BlockerFunction types ([#​11187](https:

Configuration

📅 Schedule: Branch creation - "before 3am on the first day of the month" in timezone America/New_York, Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


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

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

@cypress-app-bot
Copy link

See the guidelines for reviewing dependency updates for info on how to review dependency update PRs.

@renovate renovate bot force-pushed the renovate/major-react-router branch from 8250c78 to 8837686 Compare June 1, 2024 05:05
@renovate renovate bot force-pushed the renovate/major-react-router branch from 8837686 to a7293cc Compare July 1, 2024 04:40
@renovate renovate bot force-pushed the renovate/major-react-router branch from a7293cc to b8366f3 Compare August 1, 2024 06:49
@renovate renovate bot force-pushed the renovate/major-react-router branch from b8366f3 to 23e1b5b Compare October 1, 2024 06:28
@renovate renovate bot force-pushed the renovate/major-react-router branch from 23e1b5b to 2833aa7 Compare December 1, 2024 06:42
@renovate renovate bot force-pushed the renovate/major-react-router branch from 2833aa7 to 45b303a Compare March 1, 2025 06:16
@renovate renovate bot force-pushed the renovate/major-react-router branch from 45b303a to 2972643 Compare April 1, 2025 06:57
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.

1 participant