mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

Bump react-router to ^7.6.1

Open renovate[bot] opened this issue 7 months ago • 2 comments

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-router (source) ^7.6.0 -> ^7.6.1 age adoption passing confidence

Release Notes

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

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 "@​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 "@​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
    

Configuration

📅 Schedule: Branch creation - "on sunday before 6:00am" in timezone UTC, 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[bot] avatar Jun 01 '25 01:06 renovate[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jun 01 '25 18:06 github-actions[bot]

Deploy preview: https://deploy-preview-18162--material-ui-x.netlify.app/

Bundle size report

Total Size Change: 0B(0.00%) - Total Gzip Change: 0B(0.00%) Files: 120 total (0 added, 0 removed, 0 changed)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against b738a780ec5ee0742556fab3ca7fedc4c596ff62

mui-bot avatar Jun 01 '25 18:06 mui-bot