Skip to content

fix(deps): update dependency react-router to v7.6.2 #221

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 2 commits into from
Jun 6, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 6, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-router (source) 7.5.2 -> 7.6.2 age adoption passing confidence

Release Notes

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

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)
  • [INTERNAL] 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 "@​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

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 [email protected] 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')

v7.5.3

Compare Source

Patch Changes
  • Fix bug where bubbled action errors would result in loaderData being cleared at the handling ErrorBoundary route (#​13476)
  • Handle redirects from clientLoader.hydrate initial load executions (#​13477)

Configuration

📅 Schedule: Branch creation - "after 7am and before 9am" in timezone Europe/Istanbul, 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 a team as a code owner May 6, 2025 05:46
Copy link

changeset-bot bot commented May 6, 2025

🦋 Changeset detected

Latest commit: ec21c95

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@commencis/starter-react-vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.5.3 fix(deps): update dependency react-router to v7.6.0 May 8, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 667f622 to 4f0d556 Compare May 8, 2025 15:26
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 4f0d556 to 7e8da73 Compare May 25, 2025 14:32
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.6.0 fix(deps): update dependency react-router to v7.6.1 May 25, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 7e8da73 to 7ae17f7 Compare June 4, 2025 08:32
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.6.1 fix(deps): update dependency react-router to v7.6.2 Jun 4, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 7ae17f7 to 2117b2d Compare June 5, 2025 08:34
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 2117b2d to 9793bdf Compare June 6, 2025 12:28
@baturtulek baturtulek merged commit 066c74d into main Jun 6, 2025
3 checks passed
@baturtulek baturtulek deleted the renovate/react-router-monorepo branch June 6, 2025 12:31
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