Skip to content

Commit 7618a23

Browse files
Update dependency react-router to v7.8.0 (#24632)
This PR contains the following updates: | Package | Change | Age | 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.7.1` -> `7.8.0`](https://renovatebot.com/diffs/npm/react-router/7.7.1/7.8.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/react-router/7.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-router/7.7.1/7.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>remix-run/react-router (react-router)</summary> ### [`v7.8.0`](https://redirect.github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#780) [Compare Source](https://redirect.github.com/remix-run/react-router/compare/[email protected]@7.8.0) ##### Minor Changes - Add `nonce` prop to `Links` & `PrefetchPageLinks` ([#&#8203;14048](https://redirect.github.com/remix-run/react-router/pull/14048)) - Add `loaderData` arguments/properties alongside existing `data` arguments/properties to provide consistency and clarity between `loaderData` and `actionData` across the board ([#&#8203;14047](https://redirect.github.com/remix-run/react-router/pull/14047)) - Updated types: `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch` - `@deprecated` warnings have been added to the existing `data` properties to point users to new `loaderData` properties, in preparation for removing the `data` properties in a future major release ##### Patch Changes - Prevent *"Did not find corresponding fetcher result"* console error when navigating during a `fetcher.submit` revalidation ([#&#8203;14114](https://redirect.github.com/remix-run/react-router/pull/14114)) - Bubble client-side middleware errors prior to `next` to the appropriate ancestor error boundary ([#&#8203;14138](https://redirect.github.com/remix-run/react-router/pull/14138)) - Switch Lazy Route Discovery manifest URL generation to usea standalone `URLSearchParams` instance instead of `URL.searchParams` to avoid a major performance bottleneck in Chrome ([#&#8203;14084](https://redirect.github.com/remix-run/react-router/pull/14084)) - Adjust internal RSC usage of `React.use` to avoid Webpack compilation errors when using React 18 ([#&#8203;14113](https://redirect.github.com/remix-run/react-router/pull/14113)) - Remove dependency on `@types/node` in TypeScript declaration files ([#&#8203;14059](https://redirect.github.com/remix-run/react-router/pull/14059)) - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#&#8203;12206](https://redirect.github.com/remix-run/react-router/pull/12206)) - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios. ```tsx // app/root.tsx export function loader() { someFunctionThatThrows(); // ❌ Throws an Error return { title: "My Title" }; } export function Layout({ children }: { children: React.ReactNode }) { let matches = useMatches(); let rootMatch = matches[0] as UIMatch<Awaited<ReturnType<typeof loader>>>; // ^ rootMatch.data is incorrectly typed here, so TypeScript does not // complain if you do the following which throws an error at runtime: let { title } = rootMatch.data; // 💥 return <html>...</html>; } ``` - \[UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#&#8203;14078](https://redirect.github.com/remix-run/react-router/pull/14078)) - \[UNSTABLE] Propagate returned Response from server middleware if next wasn't called ([#&#8203;14093](https://redirect.github.com/remix-run/react-router/pull/14093)) - \[UNSTABLE] Allow server middlewares to return `data()` values which will be converted into a `Response` ([#&#8203;14093](https://redirect.github.com/remix-run/react-router/pull/14093)) - \[UNSTABLE] Update middleware error handling so that the `next` function never throws and instead handles any middleware errors at the proper `ErrorBoundary` and returns the `Response` up through the ancestor `next` function ([#&#8203;14118](https://redirect.github.com/remix-run/react-router/pull/14118)) - \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#&#8203;14097](https://redirect.github.com/remix-run/react-router/pull/14097)) - \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#&#8203;14103](https://redirect.github.com/remix-run/react-router/pull/14103)) - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity - The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>` - The `queryRoute` version of the API now has a signature of `(queryRoute: (r: Request) => Promise<Response>) => Promise<Response>` - This allows for more advanced usages such as running logic before/after calling `query` and direct error handling of errors thrown from query - ⚠️ This is a breaking change if you've adopted the `staticHandler` `unstable_respond` API ```tsx let response = await staticHandler.query(request, { requestContext: new unstable_RouterContextProvider(), async unstable_generateMiddlewareResponse(query) { try { // At this point we've run middleware top-down so we need to call the // handlers and generate the Response to bubble back up the middleware let result = await query(request); if (isResponse(result)) { return result; // Redirects, etc. } return await generateHtmlResponse(result); } catch (error: unknown) { return generateErrorResponse(error); } }, }); ``` - \[UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API ([#&#8203;14103](https://redirect.github.com/remix-run/react-router/pull/14103)) - \[UNSTABLE] Change `getLoadContext` signature (`type GetLoadContextFunction`) when `future.unstable_middleware` is enabled so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#&#8203;14097](https://redirect.github.com/remix-run/react-router/pull/14097)) - This also removes the `type unstable_InitialContext` export - ⚠️ This is a breaking change if you have adopted middleware and are using a custom server with a `getLoadContext` function - \[UNSTABLE] Run client middleware on client navigations even if no loaders exist ([#&#8203;14106](https://redirect.github.com/remix-run/react-router/pull/14106)) - \[UNSTABLE] Change the `unstable_getContext` signature on `RouterProvider`/`HydratedRouter`/`unstable_RSCHydratedRouter` so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#&#8203;14097](https://redirect.github.com/remix-run/react-router/pull/14097)) - ⚠️ This is a breaking change if you have adopted the `unstable_getContext` prop - \[UNSTABLE] proxy server action side-effect redirects from actions for document and callServer requests ([#&#8203;14131](https://redirect.github.com/remix-run/react-router/pull/14131)) - \[UNSTABLE] Fix RSC Data Mode issue where routes that return `false` from `shouldRevalidate` would be replaced by an `<Outlet />` ([#&#8203;14071](https://redirect.github.com/remix-run/react-router/pull/14071)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - Between 05:00 PM and 11:59 PM, only on Friday ( * 17-23 * * 5 ), Only on Sunday and Saturday ( * * * * 0,6, ), Between 12:00 AM and 12:59 PM, only on Monday ( * 0-12 * * 1 ) (UTC). 🚦 **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:eyJjcmVhdGVkSW5WZXIiOiI0MS41MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuNTEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 97c5c34 commit 7618a23

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/admin-x-framework/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"@tryghost/shade": "0.0.0",
9898
"react": "18.3.1",
9999
"react-dom": "18.3.1",
100-
"react-router": "7.7.1"
100+
"react-router": "7.8.0"
101101
},
102102
"peerDependencies": {
103103
"react": "^18.2.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27922,10 +27922,10 @@ react-remove-scroll@^2.6.3:
2792227922
use-callback-ref "^1.3.3"
2792327923
use-sidecar "^1.1.3"
2792427924

27925-
react-router@7.7.1:
27926-
version "7.7.1"
27927-
resolved "https://registry.yarnpkg.com/react-router/-/react-router-7.7.1.tgz#c12ebbad162da655951dd79325f205f7238d609e"
27928-
integrity sha512-jVKHXoWRIsD/qS6lvGveckwb862EekvapdHJN/cGmzw40KnJH5gg53ujOJ4qX6EKIK9LSBfFed/xiQ5yeXNrUA==
27925+
react-router@7.8.0:
27926+
version "7.8.0"
27927+
resolved "https://registry.yarnpkg.com/react-router/-/react-router-7.8.0.tgz#2bc07e0a9ff74d88ee38c2f27897e968b8f59170"
27928+
integrity sha512-r15M3+LHKgM4SOapNmsH3smAizWds1vJ0Z9C4mWaKnT9/wD7+d/0jYcj6LmOvonkrO4Rgdyp4KQ/29gWN2i1eg==
2792927929
dependencies:
2793027930
cookie "^1.0.1"
2793127931
set-cookie-parser "^2.6.0"

0 commit comments

Comments
 (0)