Update dependency react-router to ^7.6.1 #15

Merged
renovate merged 1 commits from renovate/react-router-7.x into main 2025-05-27 00:07:13 +00:00
Collaborator

This PR contains the following updates:

Package Type Update Change
react-router (source) dependencies patch ^7.6.0 -> ^7.6.1

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 - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, 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 has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [react-router](https://github.com/remix-run/react-router) ([source](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router)) | dependencies | patch | [`^7.6.0` -> `^7.6.1`](https://renovatebot.com/diffs/npm/react-router/7.6.0/7.6.1) | --- ### Release Notes <details> <summary>remix-run/react-router (react-router)</summary> ### [`v7.6.1`](https://github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#761) [Compare Source](https://github.com/remix-run/react-router/compare/react-router@7.6.0...react-router@7.6.1) ##### Patch Changes - Update `Route.MetaArgs` to reflect that `data` can be potentially `undefined` ([#&#8203;13563](https://github.com/remix-run/react-router/pull/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 ([#&#8203;13562](https://github.com/remix-run/react-router/pull/13562)) - Fix typegen when same route is used at multiple paths ([#&#8203;13574](https://github.com/remix-run/react-router/pull/13574)) For example, `routes/route.tsx` is used at 4 different paths here: ```ts 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` ([#&#8203;13543](https://github.com/remix-run/react-router/pull/13543)) For example: ```ts // 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: ```ts 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`: ```ts 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 ([#&#8203;13564](https://github.com/remix-run/react-router/pull/13564)) - href replaces splats `*` ([#&#8203;13593](https://github.com/remix-run/react-router/pull/13593)) ```ts const a = href("/products/*", { "*": "/1/edit" }); // -> /products/1/edit ``` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDAuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
renovate added 1 commit 2025-05-26 00:07:41 +00:00
Update dependency react-router to ^7.6.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
f38482757e
renovate merged commit f38482757e into main 2025-05-27 00:07:13 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pierre/MoneyMgr#15
No description provided.