fix(deps): update react-router monorepo to v7.2.0 #128

Merged
kjuulh merged 1 commits from renovate/react-router-monorepo into main 2025-02-19 06:04:22 +01:00
Owner

This PR contains the following updates:

Package Type Update Change
react-router (source) dependencies minor 7.1.5 -> 7.2.0
react-router-dom (source) dependencies minor 7.1.5 -> 7.2.0

Release Notes

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

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)

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

v7.2.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@7.2.0

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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 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 | minor | [`7.1.5` -> `7.2.0`](https://renovatebot.com/diffs/npm/react-router/7.1.5/7.2.0) | | [react-router-dom](https://github.com/remix-run/react-router) ([source](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom)) | dependencies | minor | [`7.1.5` -> `7.2.0`](https://renovatebot.com/diffs/npm/react-router-dom/7.1.5/7.2.0) | --- ### Release Notes <details> <summary>remix-run/react-router (react-router)</summary> ### [`v7.2.0`](https://github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#720) [Compare Source](https://github.com/remix-run/react-router/compare/react-router@7.1.5...react-router@7.2.0) ##### Minor Changes - New type-safe `href` utility that guarantees links point to actual paths in your app ([#&#8203;13012](https://github.com/remix-run/react-router/pull/13012)) ```tsx 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 ([#&#8203;13012](https://github.com/remix-run/react-router/pull/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 ([#&#8203;12948](https://github.com/remix-run/react-router/pull/12948)) - Properly handle revalidations to across a prerender/SPA boundary ([#&#8203;13021](https://github.com/remix-run/react-router/pull/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: ([#&#8203;13021](https://github.com/remix-run/react-router/pull/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` ([#&#8203;11871](https://github.com/remix-run/react-router/pull/11871)) - Add `unstable_SerializesTo` brand type for library authors to register types serializable by React Router's streaming format (`turbo-stream`) ([`ab5b05b02`](https://github.com/remix-run/react-router/commit/ab5b05b02f99f062edb3c536c392197c88eb6c77)) - Align dev server behavior with static file server behavior when `ssr:false` is set ([#&#8203;12948](https://github.com/remix-run/react-router/pull/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 ([#&#8203;12889](https://github.com/remix-run/react-router/pull/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 ([#&#8203;12894](https://github.com/remix-run/react-router/pull/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 ([#&#8203;12915](https://github.com/remix-run/react-router/pull/12915)) </details> <details> <summary>remix-run/react-router (react-router-dom)</summary> ### [`v7.2.0`](https://github.com/remix-run/react-router/blob/HEAD/packages/react-router-dom/CHANGELOG.md#720) [Compare Source](https://github.com/remix-run/react-router/compare/react-router-dom@7.1.5...react-router-dom@7.2.0) ##### Patch Changes - Updated dependencies: - `react-router@7.2.0` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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. --- - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjQuMyIsInVwZGF0ZWRJblZlciI6IjM3LjQyNC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
kjuulh added 1 commit 2025-02-19 06:04:08 +01:00
fix(deps): update react-router monorepo to v7.2.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
01266dc21e
kjuulh scheduled this pull request to auto merge when all checks succeed 2025-02-19 06:04:08 +01:00
kjuulh merged commit 01266dc21e into main 2025-02-19 06:04:22 +01: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: kjuulh/backstage#128
No description provided.