From 2678a01fb93a927960b12321e6b6118610cc9f0a Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Wed, 9 Oct 2024 13:11:41 -0400 Subject: [PATCH] Stabilize APIs (#9980) --- .changeset/rare-shoes-enjoy.md | 14 +++++ docs/components/form.md | 8 +-- docs/components/link.md | 17 +++---- docs/components/nav-link.md | 16 +++--- docs/guides/single-fetch.md | 2 +- docs/hooks/use-fetcher.md | 4 +- docs/hooks/use-navigate.md | 6 +-- docs/hooks/use-submit.md | 6 +-- docs/hooks/use-view-transition-state.md | 16 +++--- docs/utils/data.md | 6 +-- integration/package.json | 2 +- integration/single-fetch-test.ts | 18 +++---- packages/remix-cloudflare/index.ts | 2 +- packages/remix-deno/index.ts | 2 +- packages/remix-dev/package.json | 2 +- packages/remix-node/index.ts | 2 +- packages/remix-react/browser.tsx | 4 +- packages/remix-react/fog-of-war.ts | 4 +- packages/remix-react/index.tsx | 4 +- packages/remix-react/package.json | 6 +-- packages/remix-react/single-fetch.tsx | 16 +++--- packages/remix-server-runtime/index.ts | 2 +- packages/remix-server-runtime/package.json | 2 +- packages/remix-server-runtime/single-fetch.ts | 10 ++-- packages/remix-testing/package.json | 4 +- pnpm-lock.yaml | 51 ++++++++++--------- 26 files changed, 114 insertions(+), 112 deletions(-) create mode 100644 .changeset/rare-shoes-enjoy.md diff --git a/.changeset/rare-shoes-enjoy.md b/.changeset/rare-shoes-enjoy.md new file mode 100644 index 00000000000..72b590f0be9 --- /dev/null +++ b/.changeset/rare-shoes-enjoy.md @@ -0,0 +1,14 @@ +--- +"@remix-run/dev": minor +"@remix-run/react": minor +"@remix-run/server-runtime": minor +--- + +Stabilize React Router APIs in Remix + - Adopt stabilized React Router APIs internally + - Single Fetch: `unstable_dataStrategy` -> `dataStrategy` + - Lazy Route Discovery: `unstable_patchRoutesOnNavigation` -> `patchRoutesOnNavigation` + - Stabilize public-facing APIs + - Single Fetch: `unstable_data()` -> `data()` + - `unstable_viewTransition` -> `viewTransition` (`Link`, `Form`, `navigate`, `submit`) + - `unstable_flushSync>` -> `` (`Link`, `Form`, `navigate`, `submit`, `useFetcher`) diff --git a/docs/components/form.md b/docs/components/form.md index ddf22f5abdd..a9f9c4b4a40 100644 --- a/docs/components/form.md +++ b/docs/components/form.md @@ -95,13 +95,9 @@ If true, it will submit the form with the browser instead of client side routing This is recommended over [`
`][form_element]. When the `action` prop is omitted, `` and `` will sometimes call different actions depending on what the current URL is since `` uses the current URL as the default, but `` uses the URL for the route the form is rendered in. -### `unstable_viewTransition` +### `viewTransition` -The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state]. - - -Please note that this API is marked unstable and may be subject to breaking changes without a major release. - +The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state]. ## Notes diff --git a/docs/components/link.md b/docs/components/link.md index 1e6ddb4f08e..fed084bad59 100644 --- a/docs/components/link.md +++ b/docs/components/link.md @@ -185,24 +185,23 @@ function SomeComp() { This state is inaccessible on the server as it is implemented on top of [`history.state`][history-state]. -## `unstable_viewTransition` +## `viewTransition` -The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]: +The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]: ```jsx - + Click me ``` -If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state]: +If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state]: ```jsx function ImageLink(to) { - const isTransitioning = - unstable_useViewTransitionState(to); + const isTransitioning = useViewTransitionState(to); return ( - +

-Please note that this API is marked unstable and may be subject to breaking changes without a major release. - - [scroll-restoration-component]: ./scroll-restoration [history-state]: https://developer.mozilla.org/en-US/docs/Web/API/History/state [view-transitions]: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API diff --git a/docs/components/nav-link.md b/docs/components/nav-link.md index 7cd2f9224dc..9d01e0aaa1a 100644 --- a/docs/components/nav-link.md +++ b/docs/components/nav-link.md @@ -55,10 +55,10 @@ a.pending { ### `.transitioning` -A `transitioning` class is added to a [``][view-transition-prop] component when it is transitioning during a navigation, so you can use CSS to style it. +A `transitioning` class is added to a [``][view-transition-prop] component when it is transitioning during a navigation, so you can use CSS to style it. ```tsx - + ``` ```css @@ -136,9 +136,9 @@ Adding the `caseSensitive` prop changes the matching logic to make it case-sensi | `` | `/sponge-bob` | true | | `` | `/sponge-bob` | false | -## `unstable_viewTransition` +## `viewTransition` -The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. By default, during the transition a [`transitioning` class][transitioning-class] will be added to the [`` element][a-element] that you can use to customize the view transition. +The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. By default, during the transition a [`transitioning` class][transitioning-class] will be added to the [`` element][a-element] that you can use to customize the view transition. ```css a.transitioning p { @@ -151,7 +151,7 @@ a.transitioning img { ``` ```tsx - +

Image Number {idx}

{`Img @@ -160,7 +160,7 @@ a.transitioning img { You may also use the [`className`][class-name-prop]/[`style`][style-prop] props or the render props passed to [`children`][children-prop] to further customize based on the `isTransitioning` value. ```tsx - + {({ isTransitioning }) => ( <>

``` - -Please note that this API is marked unstable and may be subject to breaking changes without a major release. - - ### `` props All other props of [``][link-component] are supported. diff --git a/docs/guides/single-fetch.md b/docs/guides/single-fetch.md index 7712b9ba3f2..9d7904d3214 100644 --- a/docs/guides/single-fetch.md +++ b/docs/guides/single-fetch.md @@ -277,7 +277,7 @@ For v2, you may still continue returning normal `Response` instances and their ` Over time, you should start eliminating returned Responses from your loaders and actions. - If your `loader`/`action` was returning `json`/`defer` without setting any `status`/`headers`, then you can just remove the call to `json`/`defer` and return the data directly -- If your `loader`/`action` was returning custom `status`/`headers` via `json`/`defer`, you should switch those to use the new [`unstable_data()`][data-utility] utility. +- If your `loader`/`action` was returning custom `status`/`headers` via `json`/`defer`, you should switch those to use the new [`data()`][data-utility] utility. ### Client Loaders diff --git a/docs/hooks/use-fetcher.md b/docs/hooks/use-fetcher.md index aa6cdbf2bb4..85998a34504 100644 --- a/docs/hooks/use-fetcher.md +++ b/docs/hooks/use-fetcher.md @@ -119,9 +119,9 @@ fetcher.load("/some/route?foo=bar"); `fetcher.load`'s revalidate by default after action submissions and explicit revalidation requests via [`useRevalidator`][userevalidator]. Because `fetcher.load` loads a specific URL they don't revalidate on changes to route param or URL search param. You can use [`shouldRevalidate`][shouldrevalidate] to optimize which data should be reloaded. -#### `options.unstable_flushSync` +#### `options.flushSync` -The `unstable_flushSync` option tells React Router DOM to wrap the initial state update for this `fetcher.load` in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition]. This allows you to perform synchronous DOM actions immediately after the update is flushed to the DOM. +The `flushSync` option tells React Router DOM to wrap the initial state update for this `fetcher.load` in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition]. This allows you to perform synchronous DOM actions immediately after the update is flushed to the DOM. `ReactDOM.flushSync` de-optimizes React and can hurt the performance of your app. diff --git a/docs/hooks/use-navigate.md b/docs/hooks/use-navigate.md index e5daa8b02c7..837d9d3b0ad 100644 --- a/docs/hooks/use-navigate.md +++ b/docs/hooks/use-navigate.md @@ -83,9 +83,9 @@ navigate(".", { - `"route"` will use the route hierarchy so `".."` will remove all URL segments of the current route pattern while `"path"` will use the URL path so `".."` will remove one URL segment - **state**: any - adds persistent client side routing state to the next location - **preventScrollReset**: boolean - if you are using [``][scroll-restoration], prevent the scroll position from being reset to the top of the window when navigating -- **unstable_flushSync**: boolean - wraps the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition] -- **unstable_viewTransition**: boolean - enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()` - - If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state] +- **flushSync**: boolean - wraps the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition] +- **viewTransition**: boolean - enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()` + - If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state] [redirect]: ../utils/redirect [flush-sync]: https://react.dev/reference/react-dom/flushSync diff --git a/docs/hooks/use-submit.md b/docs/hooks/use-submit.md index bdee83e828b..113f6010e9a 100644 --- a/docs/hooks/use-submit.md +++ b/docs/hooks/use-submit.md @@ -76,9 +76,9 @@ Options for the submission, the same as [``][form-component] props. All op - **preventScrollReset**: Prevents the scroll position from being reset to the top of the window when the data is submitted. Default is `false`. - **replace**: Replaces the current entry in the history stack, instead of pushing the new entry. Default is `false`. - **relative**: Defines relative route resolution behavior. Either `"route"` (relative to the route hierarchy) or `"path"` (relative to the URL). -- **unstable_flushSync**: Wraps the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition] -- **unstable_viewTransition**: Enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()` - - If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state] +- **flushSync**: Wraps the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition] +- **viewTransition**: Enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()` + - If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state] ```tsx submit(data, { diff --git a/docs/hooks/use-view-transition-state.md b/docs/hooks/use-view-transition-state.md index 3f20209f8c9..fd92b124308 100644 --- a/docs/hooks/use-view-transition-state.md +++ b/docs/hooks/use-view-transition-state.md @@ -1,20 +1,20 @@ --- -title: unstable_useViewTransitionState +title: useViewTransitionState toc: false --- -# `unstable_useViewTransitionState` +# `useViewTransitionState` -This hook returns `true` when there is an active [View Transition][view-transitions] to the specified location. This can be used to apply finer-grained styles to elements to further customize the view transition. This requires that view transitions have been enabled for the given navigation via the `unstable_viewTransition` prop on the [`Link`][link-component-view-transition] (or the [`Form`][form-component-view-transition], [`NavLink`][nav-link-component-view-transition], `navigate`, or `submit` call). +This hook returns `true` when there is an active [View Transition][view-transitions] to the specified location. This can be used to apply finer-grained styles to elements to further customize the view transition. This requires that view transitions have been enabled for the given navigation via the `viewTransition` prop on the [`Link`][link-component-view-transition] (or the [`Form`][form-component-view-transition], [`NavLink`][nav-link-component-view-transition], `navigate`, or `submit` call). Consider clicking on an image in a list that you need to expand into the hero image on the destination page: ```jsx function NavImage({ src, alt, id }) { const to = `/images/${idx}`; - const vt = unstable_useViewTransitionState(href); + const vt = useViewTransitionState(href); return ( - + {alt} { return data( diff --git a/integration/package.json b/integration/package.json index bd94ebf2813..a7071bbb80b 100644 --- a/integration/package.json +++ b/integration/package.json @@ -14,7 +14,7 @@ "@remix-run/dev": "workspace:*", "@remix-run/express": "workspace:*", "@remix-run/node": "workspace:*", - "@remix-run/router": "1.19.2", + "@remix-run/router": "1.20.0-pre.0", "@remix-run/server-runtime": "workspace:*", "@types/express": "^4.17.9", "@vanilla-extract/css": "^1.10.0", diff --git a/integration/single-fetch-test.ts b/integration/single-fetch-test.ts index 79d1a860d5e..c97a9fd1442 100644 --- a/integration/single-fetch-test.ts +++ b/integration/single-fetch-test.ts @@ -112,7 +112,7 @@ const files = { `, "app/routes/data-with-response.tsx": js` - import { useActionData, useLoaderData, unstable_data as data } from "@remix-run/react"; + import { useActionData, useLoaderData, data } from "@remix-run/react"; export function headers ({ actionHeaders, loaderHeaders, errorHeaders }) { if ([...actionHeaders].length > 0) { @@ -276,7 +276,7 @@ test.describe("single-fetch", () => { }); }); - test("loads proper data (via unstable_data) on single fetch loader requests", async () => { + test("loads proper data (via data) on single fetch loader requests", async () => { let fixture = await createFixture({ config: { future: { @@ -310,7 +310,7 @@ test.describe("single-fetch", () => { }); }); - test("loads proper data (via unstable_data) on single fetch action requests", async () => { + test("loads proper data (via data) on single fetch action requests", async () => { let fixture = await createFixture({ config: { future: { @@ -565,7 +565,7 @@ test.describe("single-fetch", () => { expect(urls).toEqual([]); }); - test("does not revalidate on 4xx/5xx action responses (via unstable_data)", async ({ + test("does not revalidate on 4xx/5xx action responses (via data)", async ({ page, }) => { let fixture = await createFixture({ @@ -577,21 +577,21 @@ test.describe("single-fetch", () => { files: { ...files, "app/routes/action.tsx": js` - import { Form, Link, useActionData, useLoaderData, useNavigation, unstable_data } from '@remix-run/react'; + import { Form, Link, useActionData, useLoaderData, useNavigation, data } from '@remix-run/react'; export async function action({ request }) { let fd = await request.formData(); if (fd.get('throw') === "5xx") { - throw unstable_data("Thrown 500", { status: 500 }); + throw data("Thrown 500", { status: 500 }); } if (fd.get('throw') === "4xx") { - throw unstable_data("Thrown 400", { status: 400 }); + throw data("Thrown 400", { status: 400 }); } if (fd.get('return') === "5xx") { - return unstable_data("Returned 500", { status: 500 }); + return data("Returned 500", { status: 500 }); } if (fd.get('return') === "4xx") { - return unstable_data("Returned 400", { status: 400 }); + return data("Returned 400", { status: 400 }); } return null; } diff --git a/packages/remix-cloudflare/index.ts b/packages/remix-cloudflare/index.ts index f79e1b9d3be..585798d7edc 100644 --- a/packages/remix-cloudflare/index.ts +++ b/packages/remix-cloudflare/index.ts @@ -12,7 +12,7 @@ export { export { createRequestHandler, createSession, - unstable_data, + data, defer, broadcastDevReady, logDevReady, diff --git a/packages/remix-deno/index.ts b/packages/remix-deno/index.ts index 3a16591712e..4ddc37dcbbc 100644 --- a/packages/remix-deno/index.ts +++ b/packages/remix-deno/index.ts @@ -27,7 +27,7 @@ export { replace, unstable_composeUploadHandlers, unstable_createMemoryUploadHandler, - unstable_data, + data, unstable_parseMultipartFormData, } from "@remix-run/server-runtime"; diff --git a/packages/remix-dev/package.json b/packages/remix-dev/package.json index 3d4d7294a2a..0c24f2f1cf5 100644 --- a/packages/remix-dev/package.json +++ b/packages/remix-dev/package.json @@ -32,7 +32,7 @@ "@mdx-js/mdx": "^2.3.0", "@npmcli/package-json": "^4.0.1", "@remix-run/node": "workspace:*", - "@remix-run/router": "1.19.2", + "@remix-run/router": "1.20.0-pre.0", "@remix-run/server-runtime": "workspace:*", "@types/mdx": "^2.0.5", "@vanilla-extract/integration": "^6.2.0", diff --git a/packages/remix-node/index.ts b/packages/remix-node/index.ts index bccdb246f7d..34f4fe9a092 100644 --- a/packages/remix-node/index.ts +++ b/packages/remix-node/index.ts @@ -24,7 +24,7 @@ export { export { createRequestHandler, createSession, - unstable_data, + data, defer, broadcastDevReady, logDevReady, diff --git a/packages/remix-react/browser.tsx b/packages/remix-react/browser.tsx index 39e27f11844..7ce8448b4de 100644 --- a/packages/remix-react/browser.tsx +++ b/packages/remix-react/browser.tsx @@ -303,14 +303,14 @@ export function RemixBrowser(_props: RemixBrowserProps): ReactElement { }, hydrationData, mapRouteProperties, - unstable_dataStrategy: window.__remixContext.future.unstable_singleFetch + dataStrategy: window.__remixContext.future.unstable_singleFetch ? getSingleFetchDataStrategy( window.__remixManifest, window.__remixRouteModules, () => router ) : undefined, - unstable_patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction( + patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction( window.__remixManifest, window.__remixRouteModules, window.__remixContext.future, diff --git a/packages/remix-react/fog-of-war.ts b/packages/remix-react/fog-of-war.ts index f2b47e48abb..83e5fb5086a 100644 --- a/packages/remix-react/fog-of-war.ts +++ b/packages/remix-react/fog-of-war.ts @@ -1,7 +1,7 @@ import type { Router } from "@remix-run/router"; import { matchRoutes } from "@remix-run/router"; import * as React from "react"; -import type { unstable_PatchRoutesOnNavigationFunction } from "react-router"; +import type { PatchRoutesOnNavigationFunction } from "react-router"; import type { AssetsManifest, FutureConfig } from "./entry"; import type { RouteModules } from "./routeModules"; @@ -70,7 +70,7 @@ export function getPatchRoutesOnNavigationFunction( future: FutureConfig, isSpaMode: boolean, basename: string | undefined -): unstable_PatchRoutesOnNavigationFunction | undefined { +): PatchRoutesOnNavigationFunction | undefined { if (!isFogOfWarEnabled(future, isSpaMode)) { return undefined; } diff --git a/packages/remix-react/index.tsx b/packages/remix-react/index.tsx index bd966bfcd79..b0bc6703bcd 100644 --- a/packages/remix-react/index.tsx +++ b/packages/remix-react/index.tsx @@ -56,8 +56,8 @@ export { useSearchParams, useSubmit, useBlocker, + useViewTransitionState, unstable_usePrompt, - unstable_useViewTransitionState, } from "react-router-dom"; export { // For use in clientLoader/clientAction @@ -66,7 +66,7 @@ export { redirect, redirectDocument, replace, - unstable_data, + data, } from "@remix-run/server-runtime"; export type { RemixBrowserProps } from "./browser"; diff --git a/packages/remix-react/package.json b/packages/remix-react/package.json index f67cd24c3ed..e7edc513902 100644 --- a/packages/remix-react/package.json +++ b/packages/remix-react/package.json @@ -19,10 +19,10 @@ "tsc": "tsc" }, "dependencies": { - "@remix-run/router": "1.19.2", + "@remix-run/router": "1.20.0-pre.0", "@remix-run/server-runtime": "workspace:*", - "react-router": "6.26.2", - "react-router-dom": "6.26.2", + "react-router": "6.27.0-pre.0", + "react-router-dom": "6.27.0-pre.0", "turbo-stream": "2.4.0" }, "devDependencies": { diff --git a/packages/remix-react/single-fetch.tsx b/packages/remix-react/single-fetch.tsx index f390413fcec..ca81746e004 100644 --- a/packages/remix-react/single-fetch.tsx +++ b/packages/remix-react/single-fetch.tsx @@ -1,22 +1,22 @@ import * as React from "react"; import type { - unstable_DataStrategyFunction as DataStrategyFunction, - unstable_DataStrategyResult as DataStrategyResult, - unstable_DataStrategyMatch, + DataStrategyFunction, + DataStrategyFunctionArgs, + DataStrategyResult, + DataStrategyMatch, Router as RemixRouter, } from "@remix-run/router"; import { UNSAFE_ErrorResponseImpl as ErrorResponseImpl, isRouteErrorResponse, redirect, - unstable_data, + data, } from "@remix-run/router"; import type { UNSAFE_SingleFetchResult as SingleFetchResult, UNSAFE_SingleFetchResults as SingleFetchResults, } from "@remix-run/server-runtime"; import { UNSAFE_SingleFetchRedirectSymbol as SingleFetchRedirectSymbol } from "@remix-run/server-runtime"; -import type { unstable_DataStrategyFunctionArgs as DataStrategyFunctionArgs } from "react-router-dom"; import { decode } from "turbo-stream"; import { createRequestInit, isResponse } from "./data"; @@ -170,12 +170,12 @@ async function singleFetchActionStrategy( return { [actionMatch.route.id]: result }; } - // For non-responses, proxy along the statusCode via unstable_data() + // For non-responses, proxy along the statusCode via data() // (most notably for skipping action error revalidation) return { [actionMatch.route.id]: { type: result.type, - result: unstable_data(result.result, actionStatus), + result: data(result.result, actionStatus), }, }; } @@ -344,7 +344,7 @@ async function singleFetchLoaderFetcherStrategy( function fetchSingleLoader( handler: Parameters< - NonNullable[0]> + NonNullable[0]> >[0], url: URL, init: RequestInit, diff --git a/packages/remix-server-runtime/index.ts b/packages/remix-server-runtime/index.ts index cb084d982f7..58ea5e3c6c1 100644 --- a/packages/remix-server-runtime/index.ts +++ b/packages/remix-server-runtime/index.ts @@ -8,7 +8,7 @@ export { defer, json, redirect, redirectDocument, replace } from "./responses"; export { SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, - data as unstable_data, + data, } from "./single-fetch"; export type { SingleFetchResult as UNSAFE_SingleFetchResult, diff --git a/packages/remix-server-runtime/package.json b/packages/remix-server-runtime/package.json index 98a0f5c7480..cc693edbb03 100644 --- a/packages/remix-server-runtime/package.json +++ b/packages/remix-server-runtime/package.json @@ -19,7 +19,7 @@ "tsc": "tsc" }, "dependencies": { - "@remix-run/router": "1.19.2", + "@remix-run/router": "1.20.0-pre.0", "@types/cookie": "^0.6.0", "@web3-storage/multipart-parser": "^1.0.0", "cookie": "^0.6.0", diff --git a/packages/remix-server-runtime/single-fetch.ts b/packages/remix-server-runtime/single-fetch.ts index 046201a0ea9..834fc012367 100644 --- a/packages/remix-server-runtime/single-fetch.ts +++ b/packages/remix-server-runtime/single-fetch.ts @@ -1,12 +1,12 @@ import type { StaticHandler, - unstable_DataStrategyFunctionArgs as DataStrategyFunctionArgs, - unstable_DataStrategyFunction as DataStrategyFunction, + DataStrategyFunctionArgs, + DataStrategyFunction, UNSAFE_DataWithResponseInit as DataWithResponseInit, } from "@remix-run/router"; import { isRouteErrorResponse, - unstable_data as routerData, + data as routerData, UNSAFE_ErrorResponseImpl as ErrorResponseImpl, stripBasename, } from "@remix-run/router"; @@ -102,7 +102,7 @@ export async function singleFetchAction( let result = await staticHandler.query(handlerRequest, { requestContext: loadContext, skipLoaderErrorBubbling: true, - unstable_dataStrategy: getSingleFetchDataStrategy({ + dataStrategy: getSingleFetchDataStrategy({ isActionDataRequest: true, }), }); @@ -190,7 +190,7 @@ export async function singleFetchLoaders( let result = await staticHandler.query(handlerRequest, { requestContext: loadContext, skipLoaderErrorBubbling: true, - unstable_dataStrategy: getSingleFetchDataStrategy({ + dataStrategy: getSingleFetchDataStrategy({ loadRouteIds, }), }); diff --git a/packages/remix-testing/package.json b/packages/remix-testing/package.json index f4cfe4cb8f1..8cd8a1e613e 100644 --- a/packages/remix-testing/package.json +++ b/packages/remix-testing/package.json @@ -21,8 +21,8 @@ "dependencies": { "@remix-run/node": "workspace:*", "@remix-run/react": "workspace:*", - "@remix-run/router": "1.19.2", - "react-router-dom": "6.26.2" + "@remix-run/router": "1.20.0-pre.0", + "react-router-dom": "6.27.0-pre.0" }, "devDependencies": { "@remix-run/server-runtime": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ae280ecfe1c..c8a81af7576 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -323,8 +323,8 @@ importers: specifier: workspace:* version: link:../packages/remix-node '@remix-run/router': - specifier: 1.19.2 - version: 1.19.2 + specifier: 1.20.0-pre.0 + version: 1.20.0-pre.0 '@remix-run/server-runtime': specifier: workspace:* version: link:../packages/remix-server-runtime @@ -871,8 +871,8 @@ importers: specifier: ^2.12.1 version: link:../remix-react '@remix-run/router': - specifier: 1.19.2 - version: 1.19.2 + specifier: 1.20.0-pre.0 + version: 1.20.0-pre.0 '@remix-run/server-runtime': specifier: workspace:* version: link:../remix-server-runtime @@ -1217,17 +1217,17 @@ importers: packages/remix-react: dependencies: '@remix-run/router': - specifier: 1.19.2 - version: 1.19.2 + specifier: 1.20.0-pre.0 + version: 1.20.0-pre.0 '@remix-run/server-runtime': specifier: workspace:* version: link:../remix-server-runtime react-router: - specifier: 6.26.2 - version: 6.26.2(react@18.2.0) + specifier: 6.27.0-pre.0 + version: 6.27.0-pre.0(react@18.2.0) react-router-dom: - specifier: 6.26.2 - version: 6.26.2(react-dom@18.2.0)(react@18.2.0) + specifier: 6.27.0-pre.0 + version: 6.27.0-pre.0(react-dom@18.2.0)(react@18.2.0) turbo-stream: specifier: 2.4.0 version: 2.4.0 @@ -1303,8 +1303,8 @@ importers: packages/remix-server-runtime: dependencies: '@remix-run/router': - specifier: 1.19.2 - version: 1.19.2 + specifier: 1.20.0-pre.0 + version: 1.20.0-pre.0 '@types/cookie': specifier: ^0.6.0 version: 0.6.0 @@ -1340,11 +1340,11 @@ importers: specifier: workspace:* version: link:../remix-react '@remix-run/router': - specifier: 1.19.2 - version: 1.19.2 + specifier: 1.20.0-pre.0 + version: 1.20.0-pre.0 react-router-dom: - specifier: 6.26.2 - version: 6.26.2(react-dom@18.2.0)(react@18.2.0) + specifier: 6.27.0-pre.0 + version: 6.27.0-pre.0(react-dom@18.2.0)(react@18.2.0) devDependencies: '@remix-run/server-runtime': specifier: workspace:* @@ -4206,8 +4206,8 @@ packages: - encoding dev: false - /@remix-run/router@1.19.2: - resolution: {integrity: sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==} + /@remix-run/router@1.20.0-pre.0: + resolution: {integrity: sha512-xFJySbWOaxjYP8QJy9f1TdW98H+tT8ykvuJN8Ew1J1En4v77ega3FMbFD2M8sXkCq43PKuSBPc8oZWDub6IQhA==} engines: {node: '>=14.0.0'} dev: false @@ -7804,6 +7804,7 @@ packages: /eslint@8.56.0: resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) @@ -12800,26 +12801,26 @@ packages: engines: {node: '>=0.10.0'} dev: false - /react-router-dom@6.26.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==} + /react-router-dom@6.27.0-pre.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-z8peFQxpWiqTBh18eWWBXiMMxWKJcqYSpHiP6s35zM7eh8s5TWKdhWsPSP3xVhHMIM6oYHVJCEawGsReFaI4PQ==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' dependencies: - '@remix-run/router': 1.19.2 + '@remix-run/router': 1.20.0-pre.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-router: 6.26.2(react@18.2.0) + react-router: 6.27.0-pre.0(react@18.2.0) dev: false - /react-router@6.26.2(react@18.2.0): - resolution: {integrity: sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==} + /react-router@6.27.0-pre.0(react@18.2.0): + resolution: {integrity: sha512-hJSLrLWzjsTvPiE91/54bRJ8gVzQpIT/yb8MBQWvmsd+5fFaemYr6I/6pCdAw/jpOHg+948WDyCgsxXa0XExRQ==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' dependencies: - '@remix-run/router': 1.19.2 + '@remix-run/router': 1.20.0-pre.0 react: 18.2.0 dev: false