0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Update dependency react-router to v7.2.0 (#22098)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [react-router](https://redirect.github.com/remix-run/react-router)
([source](https://redirect.github.com/remix-run/react-router/tree/HEAD/packages/react-router))
| [`7.1.4` ->
`7.2.0`](https://renovatebot.com/diffs/npm/react-router/7.1.4/7.2.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-router/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-router/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-router/7.1.4/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-router/7.1.4/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>remix-run/react-router (react-router)</summary>

###
[`v7.2.0`](https://redirect.github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#720)

[Compare
Source](https://redirect.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://redirect.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://redirect.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://redirect.github.com/remix-run/react-router/pull/12948))

- Properly handle revalidations to across a prerender/SPA boundary
([#&#8203;13021](https://redirect.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://redirect.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://redirect.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`](ab5b05b02f))

- Align dev server behavior with static file server behavior when
`ssr:false` is set
([#&#8203;12948](https://redirect.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://redirect.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://redirect.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://redirect.github.com/remix-run/react-router/pull/12915))

###
[`v7.1.5`](https://redirect.github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#715)

[Compare
Source](https://redirect.github.com/remix-run/react-router/compare/react-router@7.1.4...react-router@7.1.5)

##### Patch Changes

- Fix regression introduced in `7.1.4` via
[#&#8203;12800](https://redirect.github.com/remix-run/react-router/pull/12800)
that caused issues navigating to hash routes inside splat routes for
applications using Lazy Route Discovery (`patchRoutesOnNavigation`)
([#&#8203;12927](https://redirect.github.com/remix-run/react-router/pull/12927))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* * * * 1-5" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNDUuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2025-02-20 16:20:16 +00:00 committed by GitHub
parent 2914108819
commit 467e31c084
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -91,7 +91,7 @@
"@vitejs/plugin-react": "4.2.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router": "7.1.4",
"react-router": "7.2.0",
"vite": "4.5.3",
"vite-plugin-css-injected-by-js": "^3.3.0",
"vite-plugin-svgr": "3.3.0",

View file

@ -4818,7 +4818,7 @@
dependencies:
"@radix-ui/react-compose-refs" "1.1.0"
"@radix-ui/react-slot@1.1.1", "@radix-ui/react-slot@^1.1.0":
"@radix-ui/react-slot@1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.1.1.tgz#ab9a0ffae4027db7dc2af503c223c978706affc3"
integrity sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==
@ -27617,10 +27617,10 @@ react-remove-scroll@^2.6.1:
use-callback-ref "^1.3.3"
use-sidecar "^1.1.2"
react-router@7.1.4:
version "7.1.4"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-7.1.4.tgz#dcac613c1acd623f8aa314e7ea54db88c7968b1e"
integrity sha512-aJWVrKoLI0nIK1lfbTU3d5al1ZEUiwtSus/xjYL8K5sv2hyPesiOIojHM7QnaNLVtroOB1McZsWk37fMQVoc6A==
react-router@7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-7.2.0.tgz#a8f2729d39f634a7a870d14dd906a1b406f39d6f"
integrity sha512-fXyqzPgCPZbqhrk7k3hPcCpYIlQ2ugIXDboHUzhJISFVy2DEPsmHgN588MyGmkIOv3jDgNfUE3kJi83L28s/LQ==
dependencies:
"@types/cookie" "^0.6.0"
cookie "^1.0.1"