Skip to content

fix(deps): update dependency react-router to v7.7.0 #31

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 15, 2025

This PR contains the following updates:

Package Change Age Confidence
react-router (source) 7.5.3 -> 7.7.0 age confidence

Release Notes

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

v7.7.0

Compare Source

Minor Changes
Patch Changes
  • Handle InvalidCharacterError when validating cookie signature (#​13847)

  • Pass a copy of searchParams to the setSearchParams callback function to avoid muations of the internal searchParams instance. This was an issue when navigations were blocked because the internal instance be out of sync with useLocation().search. (#​12784)

  • Support invalid Date in turbo-stream v2 fork (#​13684)

  • In Framework Mode, clear critical CSS in development after initial render (#​13872)

  • Strip search parameters from patchRoutesOnNavigation path param for fetcher calls (#​13911)

  • Skip scroll restoration on useRevalidator() calls because they're not new locations (#​13671)

  • Support unencoded UTF-8 routes in prerender config with ssr set to false (#​13699)

  • Do not throw if the url hash is not a valid URI component (#​13247)

  • Fix a regression in createRoutesStub introduced with the middleware feature. (#​13946)

    As part of that work we altered the signature to align with the new middleware APIs without making it backwards compatible with the prior AppLoadContext API. This permitted createRoutesStub to work if you were opting into middleware and the updated context typings, but broke createRoutesStub for users not yet opting into middleware.

    We've reverted this change and re-implemented it in such a way that both sets of users can leverage it.

    // If you have not opted into middleware, the old API should work again
    let context: AppLoadContext = {
      /*...*/
    };
    let Stub = createRoutesStub(routes, context);
    
    // If you have opted into middleware, you should now pass an instantiated `unstable_routerContextProvider` instead of a `getContext` factory function.
    let context = new unstable_RouterContextProvider();
    context.set(SomeContext, someValue);
    let Stub = createRoutesStub(routes, context);

    ⚠️ This may be a breaking bug for if you have adopted the unstable Middleware feature and are using createRoutesStub with the updated API.

  • Remove Content-Length header from Single Fetch responses (#​13902)

v7.6.3

Compare Source

Patch Changes
  • Do not serialize types for useRouteLoaderData<typeof clientLoader> (#​13752)

    For types to distinguish a clientLoader from a serverLoader, you MUST annotate clientLoader args:

    //                                   👇 annotation required to skip serializing types
    export function clientLoader({}: Route.ClientLoaderArgs) {
      return { fn: () => "earth" };
    }
    
    function SomeComponent() {
      const data = useRouteLoaderData<typeof clientLoader>("routes/this-route");
      const planet = data?.fn() ?? "world";
      return <h1>Hello, {planet}!</h1>;
    }

v7.6.2

Compare Source

Patch Changes
  • Avoid additional with-props chunk in Framework Mode by moving route module component prop logic from the Vite plugin to react-router (#​13650)
  • Slight refactor of internal headers() function processing for use with RSC (#​13639)

v7.6.1

Compare Source

Patch Changes
  • Update Route.MetaArgs to reflect that data can be potentially undefined (#​13563)

    This is primarily for cases where a route loader threw an error to it's own ErrorBoundary. but it also arises in the case of a 404 which renders the root ErrorBoundary/meta but the root loader did not run because not routes matched.

  • Partially revert optimization added in 7.1.4 to reduce calls to matchRoutes because it surfaced other issues (#​13562)

  • Fix typegen when same route is used at multiple paths (#​13574)

    For example, routes/route.tsx is used at 4 different paths here:

    import { type RouteConfig, route } from "@&#8203;react-router/dev/routes";
    export default [
      route("base/:base", "routes/base.tsx", [
        route("home/:home", "routes/route.tsx", { id: "home" }),
        route("changelog/:changelog", "routes/route.tsx", { id: "changelog" }),
        route("splat/*", "routes/route.tsx", { id: "splat" }),
      ]),
      route("other/:other", "routes/route.tsx", { id: "other" }),
    ] satisfies RouteConfig;

    Previously, typegen would arbitrarily pick one of these paths to be the "winner" and generate types for the route module based on that path.
    Now, typegen creates unions as necessary for alternate paths for the same route file.

  • Better types for params (#​13543)

    For example:

    // routes.ts
    import { type RouteConfig, route } from "@&#8203;react-router/dev/routes";
    
    export default [
      route("parent/:p", "routes/parent.tsx", [
        route("layout/:l", "routes/layout.tsx", [
          route("child1/:c1a/:c1b", "routes/child1.tsx"),
          route("child2/:c2a/:c2b", "routes/child2.tsx"),
        ]),
      ]),
    ] satisfies RouteConfig;

    Previously, params for the routes/layout.tsx route were calculated as { p: string, l: string }.
    This incorrectly ignores params that could come from child routes.
    If visiting /parent/1/layout/2/child1/3/4, the actual params passed to routes/layout.tsx will have a type of { p: string, l: string, c1a: string, c1b: string }.

    Now, params are aware of child routes and autocompletion will include child params as optionals:

    params.|
    //     ^ cursor is here and you ask for autocompletion
    // p: string
    // l: string
    // c1a?: string
    // c1b?: string
    // c2a?: string
    // c2b?: string

    You can also narrow the types for params as it is implemented as a normalized union of params for each page that includes routes/layout.tsx:

    if (typeof params.c1a === 'string') {
      params.|
      //     ^ cursor is here and you ask for autocompletion
      // p: string
      // l: string
      // c1a: string
      // c1b: string
    }

    UNSTABLE: renamed internal react-router/route-module export to react-router/internal
    UNSTABLE: removed Info export from generated +types/* files

  • Avoid initial fetcher execution 404 error when Lazy Route Discovery is interrupted by a navigation (#​13564)

  • href replaces splats * (#​13593)

    const a = href("/products/*", { "*": "/1/edit" });
    // -> /products/1/edit

v7.6.0

Compare Source

Minor Changes
  • Added a new react-router.config.ts routeDiscovery option to configure Lazy Route Discovery behavior. (#​13451)

    • By default, Lazy Route Discovery is enabled and makes manifest requests to the /__manifest path:
      • routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }
    • You can modify the manifest path used:
      • routeDiscovery: { mode: "lazy", manifestPath: "/custom-manifest" }
    • Or you can disable this feature entirely and include all routes in the manifest on initial document load:
      • routeDiscovery: { mode: "initial" }
  • Add support for route component props in createRoutesStub. This allows you to unit test your route components using the props instead of the hooks: (#​13528)

    let RoutesStub = createRoutesStub([
      {
        path: "/",
        Component({ loaderData }) {
          let data = loaderData as { message: string };
          return <pre data-testid="data">Message: {data.message}</pre>;
        },
        loader() {
          return { message: "hello" };
        },
      },
    ]);
    
    render(<RoutesStub />);
    
    await waitFor(() => screen.findByText("Message: hello"));
Patch Changes
  • Fix react-router module augmentation for NodeNext (#​13498)

  • Don't bundle react-router in react-router/dom CJS export (#​13497)

  • Fix bug where a submitting fetcher would get stuck in a loading state if a revalidating loader redirected (#​12873)

  • Fix hydration error if a server loader returned undefined (#​13496)

  • Fix initial load 404 scenarios in data mode (#​13500)

  • Stabilize useRevalidator's revalidate function (#​13542)

  • Preserve status code if a clientAction throws a data() result in framework mode (#​13522)

  • Be defensive against leading double slashes in paths to avoid Invalid URL errors from the URL constructor (#​13510)

    • Note we do not sanitize/normalize these paths - we only detect them so we can avoid the error that would be thrown by new URL("//", window.location.origin)
  • Remove Navigator declaration for navigator.connection.saveData to avoid messing with any other types beyond saveData in userland (#​13512)

  • Fix handleError params values on .data requests for routes with a dynamic param as the last URL segment (#​13481)

  • Don't trigger an ErrorBoundary UI before the reload when we detect a manifest verison mismatch in Lazy Route Discovery (#​13480)

  • Inline turbo-stream@2.4.1 dependency and fix decoding ordering of Map/Set instances (#​13518)

  • Only render dev warnings in DEV mode (#​13461)

  • UNSTABLE: Fix a few bugs with error bubbling in middleware use-cases (#​13538)

  • Short circuit post-processing on aborted dataStrategy requests (#​13521)

    • This resolves non-user-facing console errors of the form Cannot read properties of undefined (reading 'result')

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 this update 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 requested a review from rodet as a code owner June 15, 2025 07:42
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch 2 times, most recently from 88b60c7 to 63b6ea7 Compare June 27, 2025 19:42
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.6.2 fix(deps): update dependency react-router to v7.6.3 Jun 27, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 63b6ea7 to 3ddd0e0 Compare July 16, 2025 20:36
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.6.3 fix(deps): update dependency react-router to v7.7.0 Jul 16, 2025
@rodet rodet merged commit e869ceb into main Jul 17, 2025
4 checks passed
@rodet rodet deleted the renovate/react-router-monorepo branch July 17, 2025 12:56
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