From c2eb2896350acdf6edb32e2bc2f12f9648346535 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 6 Mar 2023 14:11:11 -0500 Subject: [PATCH 1/6] Add type deprecations for types now in React Router --- .changeset/flat-boxes-brake.md | 6 ++ packages/remix-react/components.tsx | 17 ++---- packages/remix-react/data.ts | 7 --- packages/remix-react/errors.ts | 4 ++ packages/remix-react/index.tsx | 4 +- packages/remix-react/routeData.ts | 5 -- packages/remix-react/routeModules.ts | 14 +++-- packages/remix-react/transition.ts | 55 +------------------ packages/remix-server-runtime/data.ts | 2 + packages/remix-server-runtime/errors.ts | 5 +- packages/remix-server-runtime/responses.ts | 42 +++++--------- packages/remix-server-runtime/routeData.ts | 5 -- packages/remix-server-runtime/routeModules.ts | 20 ++++++- 13 files changed, 63 insertions(+), 123 deletions(-) create mode 100644 .changeset/flat-boxes-brake.md delete mode 100644 packages/remix-react/routeData.ts delete mode 100644 packages/remix-server-runtime/routeData.ts diff --git a/.changeset/flat-boxes-brake.md b/.changeset/flat-boxes-brake.md new file mode 100644 index 00000000000..f58aa8c5c56 --- /dev/null +++ b/.changeset/flat-boxes-brake.md @@ -0,0 +1,6 @@ +--- +"@remix-run/react": patch +"@remix-run/server-runtime": patch +--- + +Add type deprecations for types now in React Router diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index e05cce6d42d..4fdd8467564 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -108,19 +108,6 @@ function useRemixContext(): RemixContextObject { return context; } -//////////////////////////////////////////////////////////////////////////////// -// RemixEntry - -export function RemixEntry(props: { - context: EntryContext; - action: NavigationType; - location: Location; - navigator: Navigator; - static?: boolean; -}) { - return

Not Implemented!

; -} - //////////////////////////////////////////////////////////////////////////////// // RemixRoute @@ -743,6 +730,8 @@ export function Meta() { return future?.v2_meta ? : ; } +// TODO: The RR version is just missing the generic and resolve is +// `TrackedPromise | any`. Should we add the generic in RR? export interface AwaitProps { children: React.ReactNode | ((value: Awaited) => React.ReactNode); errorElement?: React.ReactNode; @@ -1103,6 +1092,8 @@ function dedupe(array: any[]) { } // TODO: Can this be re-exported from RR? +// Yes, but data -> unknown and handle -> unknown. Is handle forced to +// be an object in remix? export interface RouteMatch { /** * The id of the matched route diff --git a/packages/remix-react/data.ts b/packages/remix-react/data.ts index 8b22febb006..0b72e5c9e7d 100644 --- a/packages/remix-react/data.ts +++ b/packages/remix-react/data.ts @@ -2,16 +2,9 @@ import { AbortedDeferredError, UNSAFE_DeferredData as DeferredData, } from "@remix-run/router"; -import type { FormMethod as FormMethodRR } from "react-router-dom"; export type AppData = any; -export type FormMethod = FormMethodRR; - -export type FormEncType = - | "application/x-www-form-urlencoded" - | "multipart/form-data"; - export function isCatchResponse(response: any): boolean { return ( response instanceof Response && diff --git a/packages/remix-react/errors.ts b/packages/remix-react/errors.ts index d4fc56d3738..04788c58665 100644 --- a/packages/remix-react/errors.ts +++ b/packages/remix-react/errors.ts @@ -3,6 +3,10 @@ import { ErrorResponse } from "@remix-run/router"; import type { AppData } from "./data"; +/** + * @deprecated in favor of React Router `ErrorResponse` + * TODO: Need to add generics in RR + */ export interface ThrownResponse< Status extends number = number, Data = AppData diff --git a/packages/remix-react/index.tsx b/packages/remix-react/index.tsx index e0f3498362c..01a6a52ed7a 100644 --- a/packages/remix-react/index.tsx +++ b/packages/remix-react/index.tsx @@ -1,6 +1,8 @@ export type { RemixBrowserProps } from "./browser"; export { RemixBrowser } from "./browser"; export type { + FormEncType, + FormMethod, FormProps, Location, NavigateFunction, @@ -63,8 +65,6 @@ export { RemixContext as UNSAFE_RemixContext, } from "./components"; -export type { FormMethod, FormEncType } from "./data"; - export type { ThrownResponse } from "./errors"; export { useCatch } from "./errorBoundaries"; diff --git a/packages/remix-react/routeData.ts b/packages/remix-react/routeData.ts deleted file mode 100644 index a147435e7f9..00000000000 --- a/packages/remix-react/routeData.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AppData } from "./data"; - -export interface RouteData { - [routeId: string]: AppData; -} diff --git a/packages/remix-react/routeModules.ts b/packages/remix-react/routeModules.ts index 785add903db..1621eccb602 100644 --- a/packages/remix-react/routeModules.ts +++ b/packages/remix-react/routeModules.ts @@ -1,4 +1,5 @@ import type { ComponentType } from "react"; +import type { RouterState } from "@remix-run/router"; import type { DataRouteMatch, Params, @@ -9,7 +10,8 @@ import type { import type { AppData } from "./data"; import type { LinkDescriptor } from "./links"; import type { EntryRoute } from "./routes"; -import type { RouteData } from "./routeData"; + +type RouteData = RouterState["loaderData"]; export interface RouteModules { [routeId: string]: RouteModule; @@ -174,9 +176,9 @@ export interface ShouldReloadFunction { } interface Submission { - action: string; - method: string; - formData: FormData; - encType: string; - key: string; + action: string; + method: string; + formData: FormData; + encType: string; + key: string; } diff --git a/packages/remix-react/transition.ts b/packages/remix-react/transition.ts index eea748ff79e..713162e7767 100644 --- a/packages/remix-react/transition.ts +++ b/packages/remix-react/transition.ts @@ -1,10 +1,4 @@ -import type { Location, NavigationType as Action } from "react-router-dom"; - -export interface CatchData { - status: number; - statusText: string; - data: T; -} +import type { Location } from "react-router-dom"; export interface Submission { action: string; @@ -81,29 +75,6 @@ export type TransitionStates = { export type Transition = TransitionStates[keyof TransitionStates]; -export type Redirects = { - Loader: { - isRedirect: true; - type: "loader"; - setCookie: boolean; - }; - Action: { - isRedirect: true; - type: "action"; - setCookie: boolean; - }; - LoaderSubmission: { - isRedirect: true; - type: "loaderSubmission"; - setCookie: boolean; - }; - FetchAction: { - isRedirect: true; - type: "fetchAction"; - setCookie: boolean; - }; -}; - // TODO: keep data around on resubmission? export type FetcherStates = { Idle: { @@ -181,30 +152,6 @@ export type FetcherStates = { export type Fetcher = FetcherStates[keyof FetcherStates]; -export class CatchValue { - constructor( - public status: number, - public statusText: string, - public data: any - ) {} -} - -export type NavigationEvent = { - type: "navigation"; - action: Action; - location: Location; - submission?: Submission; -}; - -export type FetcherEvent = { - type: "fetcher"; - key: string; - submission?: Submission; - href: string; -}; - -export type DataEvent = NavigationEvent | FetcherEvent; - export const IDLE_TRANSITION: TransitionStates["Idle"] = { state: "idle", submission: undefined, diff --git a/packages/remix-server-runtime/data.ts b/packages/remix-server-runtime/data.ts index eead955c4ab..e8362abae5f 100644 --- a/packages/remix-server-runtime/data.ts +++ b/packages/remix-server-runtime/data.ts @@ -21,6 +21,8 @@ export interface AppLoadContext { /** * Data for a route that was returned from a `loader()`. + * + * @deprecated */ export type AppData = any; diff --git a/packages/remix-server-runtime/errors.ts b/packages/remix-server-runtime/errors.ts index 85f98407f8c..e8eb28c63eb 100644 --- a/packages/remix-server-runtime/errors.ts +++ b/packages/remix-server-runtime/errors.ts @@ -43,7 +43,10 @@ import { isRouteErrorResponse } from "@remix-run/router"; * line. */ -// TODO Re-export as ErrorResponse? +/** + * @deprecated in favor of the `ErrorResponse` class in React Router. + * TODO: Need to add generics in RR + */ export interface ThrownResponse { status: number; statusText: string; diff --git a/packages/remix-server-runtime/responses.ts b/packages/remix-server-runtime/responses.ts index 967c10eb24f..f577e22de49 100644 --- a/packages/remix-server-runtime/responses.ts +++ b/packages/remix-server-runtime/responses.ts @@ -1,5 +1,7 @@ import { defer as routerDefer, + json as routerJson, + redirect as routerRedirect, type UNSAFE_DeferredData as DeferredData, type TrackedPromise, } from "@remix-run/router"; @@ -13,11 +15,15 @@ export type TypedDeferredData> = Pick< data: Data; }; +// TODO: The RR version of this is the same minus the generic. Should we add +// that over there and remove this? export type DeferFunction = >( data: Data, init?: number | ResponseInit ) => TypedDeferredData; +// TODO: The RR version of this is identical except it's generic doesn't +// `extends unknown`. Should we add that over there and remove this? export type JsonFunction = ( data: Data, init?: number | ResponseInit @@ -39,28 +45,18 @@ export type TypedResponse = Omit< * @see https://remix.run/utils/json */ export const json: JsonFunction = (data, init = {}) => { - let responseInit = typeof init === "number" ? { status: init } : init; - - let headers = new Headers(responseInit.headers); - if (!headers.has("Content-Type")) { - headers.set("Content-Type", "application/json; charset=utf-8"); - } - - return new Response(JSON.stringify(data), { - ...responseInit, - headers, - }); + return routerJson(data, init); }; /** - * This is a shortcut for creating `application/json` responses. Converts `data` - * to JSON and sets the `Content-Type` header. + * This is a shortcut for creating Remix deferred responses * - * @see https://remix.run/api/remix#json + * @see https://remix.run/docs/utils/defer */ export const defer: DeferFunction = (data, init = {}) => { let responseInit = typeof init === "number" ? { status: init } : init; + // TODO: Do we need this or is this copy/paste from json()? let headers = new Headers(responseInit.headers); if (!headers.has("Content-Type")) { headers.set("Content-Type", "application/json; charset=utf-8"); @@ -72,6 +68,8 @@ export const defer: DeferFunction = (data, init = {}) => { }) as TypedDeferredData; }; +// TODO: The RR version is identical minus `TypedResponse` and it just returns +// a `Response`. Should we add that over there? export type RedirectFunction = ( url: string, init?: number | ResponseInit @@ -84,20 +82,7 @@ export type RedirectFunction = ( * @see https://remix.run/utils/redirect */ export const redirect: RedirectFunction = (url, init = 302) => { - let responseInit = init; - if (typeof responseInit === "number") { - responseInit = { status: responseInit }; - } else if (typeof responseInit.status === "undefined") { - responseInit.status = 302; - } - - let headers = new Headers(responseInit.headers); - headers.set("Location", url); - - return new Response(null, { - ...responseInit, - headers, - }) as TypedResponse; + return routerRedirect(url, init) as TypedResponse; }; export function isDeferredData(value: any): value is DeferredData { @@ -122,6 +107,7 @@ export function isResponse(value: any): value is Response { ); } +//TODO(v2): Can we leverage this stuff from RR? const redirectStatusCodes = new Set([301, 302, 303, 307, 308]); export function isRedirectStatusCode(statusCode: number): boolean { return redirectStatusCodes.has(statusCode); diff --git a/packages/remix-server-runtime/routeData.ts b/packages/remix-server-runtime/routeData.ts deleted file mode 100644 index a147435e7f9..00000000000 --- a/packages/remix-server-runtime/routeData.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AppData } from "./data"; - -export interface RouteData { - [routeId: string]: AppData; -} diff --git a/packages/remix-server-runtime/routeModules.ts b/packages/remix-server-runtime/routeModules.ts index 380b2549d1f..854d972710d 100644 --- a/packages/remix-server-runtime/routeModules.ts +++ b/packages/remix-server-runtime/routeModules.ts @@ -1,18 +1,23 @@ -import type { Location, Params } from "@remix-run/router"; +import type { Location, Params, RouterState } from "@remix-run/router"; import type { ComponentType } from "react"; import type { AppLoadContext, AppData } from "./data"; import type { LinkDescriptor } from "./links"; -import type { RouteData } from "./routeData"; import type { Route } from "./routes"; import type { SerializeFrom } from "./serialize"; +type RouteData = RouterState["loaderData"]; + export interface RouteModules { [routeId: string]: RouteModule; } /** * The arguments passed to ActionFunction and LoaderFunction. + * + * @deprecated in favor of React Router `LoaderFunctionArgs` and `ActionFunctionArgs` + * TODO: In RR context is optional and typed as `any` - can we drop this in v2 + * in favor of that? */ export interface DataFunctionArgs { request: Request; @@ -20,11 +25,20 @@ export interface DataFunctionArgs { params: Params; } +/** + * @deprecated in favor of React Router `LoaderFunctionArgs` + */ export type LoaderArgs = DataFunctionArgs; + +/** + * @deprecated in favor of React Router `ActionFunctionArgs` + */ export type ActionArgs = DataFunctionArgs; /** * A function that handles data mutations for a route. + * + * @deprecated in favor of React Router `ActionFunction` */ export interface ActionFunction { (args: DataFunctionArgs): @@ -66,6 +80,8 @@ export interface LinksFunction { /** * A function that loads data for a route. + * + * @deprecated in favor of React Router `LoaderFunction` */ export interface LoaderFunction { (args: DataFunctionArgs): From 94f9bcfb5725a8a63cf7238789e4ff964fddcf35 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 6 Mar 2023 14:43:32 -0500 Subject: [PATCH 2/6] Fix indentation --- packages/remix-react/routeModules.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/remix-react/routeModules.ts b/packages/remix-react/routeModules.ts index 1621eccb602..d1edb316fc6 100644 --- a/packages/remix-react/routeModules.ts +++ b/packages/remix-react/routeModules.ts @@ -176,9 +176,9 @@ export interface ShouldReloadFunction { } interface Submission { - action: string; - method: string; - formData: FormData; - encType: string; - key: string; + action: string; + method: string; + formData: FormData; + encType: string; + key: string; } From f6d40929edcfc1c2a0b2a926075006cbeb993df4 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 14 Mar 2023 17:06:27 -0400 Subject: [PATCH 3/6] Revert changes that should go to v2 --- packages/remix-react/components.tsx | 4 ---- packages/remix-react/errors.ts | 3 +-- packages/remix-server-runtime/errors.ts | 1 - packages/remix-server-runtime/responses.ts | 9 --------- packages/remix-server-runtime/routeModules.ts | 2 -- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index 4fdd8467564..5b37a6a21cd 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -730,8 +730,6 @@ export function Meta() { return future?.v2_meta ? : ; } -// TODO: The RR version is just missing the generic and resolve is -// `TrackedPromise | any`. Should we add the generic in RR? export interface AwaitProps { children: React.ReactNode | ((value: Awaited) => React.ReactNode); errorElement?: React.ReactNode; @@ -1092,8 +1090,6 @@ function dedupe(array: any[]) { } // TODO: Can this be re-exported from RR? -// Yes, but data -> unknown and handle -> unknown. Is handle forced to -// be an object in remix? export interface RouteMatch { /** * The id of the matched route diff --git a/packages/remix-react/errors.ts b/packages/remix-react/errors.ts index 04788c58665..0f3622fce4e 100644 --- a/packages/remix-react/errors.ts +++ b/packages/remix-react/errors.ts @@ -4,8 +4,7 @@ import { ErrorResponse } from "@remix-run/router"; import type { AppData } from "./data"; /** - * @deprecated in favor of React Router `ErrorResponse` - * TODO: Need to add generics in RR + * @deprecated in favor of the `ErrorResponse` class in React Router. */ export interface ThrownResponse< Status extends number = number, diff --git a/packages/remix-server-runtime/errors.ts b/packages/remix-server-runtime/errors.ts index e8eb28c63eb..5bc4479aa7b 100644 --- a/packages/remix-server-runtime/errors.ts +++ b/packages/remix-server-runtime/errors.ts @@ -45,7 +45,6 @@ import { isRouteErrorResponse } from "@remix-run/router"; /** * @deprecated in favor of the `ErrorResponse` class in React Router. - * TODO: Need to add generics in RR */ export interface ThrownResponse { status: number; diff --git a/packages/remix-server-runtime/responses.ts b/packages/remix-server-runtime/responses.ts index f577e22de49..2b84151f38e 100644 --- a/packages/remix-server-runtime/responses.ts +++ b/packages/remix-server-runtime/responses.ts @@ -15,22 +15,16 @@ export type TypedDeferredData> = Pick< data: Data; }; -// TODO: The RR version of this is the same minus the generic. Should we add -// that over there and remove this? export type DeferFunction = >( data: Data, init?: number | ResponseInit ) => TypedDeferredData; -// TODO: The RR version of this is identical except it's generic doesn't -// `extends unknown`. Should we add that over there and remove this? export type JsonFunction = ( data: Data, init?: number | ResponseInit ) => TypedResponse; -// must be a type since this is a subtype of response -// interfaces must conform to the types they extend export type TypedResponse = Omit< Response, "json" @@ -68,8 +62,6 @@ export const defer: DeferFunction = (data, init = {}) => { }) as TypedDeferredData; }; -// TODO: The RR version is identical minus `TypedResponse` and it just returns -// a `Response`. Should we add that over there? export type RedirectFunction = ( url: string, init?: number | ResponseInit @@ -107,7 +99,6 @@ export function isResponse(value: any): value is Response { ); } -//TODO(v2): Can we leverage this stuff from RR? const redirectStatusCodes = new Set([301, 302, 303, 307, 308]); export function isRedirectStatusCode(statusCode: number): boolean { return redirectStatusCodes.has(statusCode); diff --git a/packages/remix-server-runtime/routeModules.ts b/packages/remix-server-runtime/routeModules.ts index 854d972710d..46d394c3091 100644 --- a/packages/remix-server-runtime/routeModules.ts +++ b/packages/remix-server-runtime/routeModules.ts @@ -16,8 +16,6 @@ export interface RouteModules { * The arguments passed to ActionFunction and LoaderFunction. * * @deprecated in favor of React Router `LoaderFunctionArgs` and `ActionFunctionArgs` - * TODO: In RR context is optional and typed as `any` - can we drop this in v2 - * in favor of that? */ export interface DataFunctionArgs { request: Request; From 6b184f2bc0e8acdd32e35883082aee2a06398d2b Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 20 Mar 2023 13:12:55 -0400 Subject: [PATCH 4/6] Updates --- packages/remix-react/data.ts | 5 +++++ packages/remix-react/errors.ts | 3 ++- packages/remix-server-runtime/data.ts | 2 +- packages/remix-server-runtime/errors.ts | 3 ++- packages/remix-server-runtime/responses.ts | 13 +------------ 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/remix-react/data.ts b/packages/remix-react/data.ts index 0b72e5c9e7d..4991ec8720d 100644 --- a/packages/remix-react/data.ts +++ b/packages/remix-react/data.ts @@ -3,6 +3,11 @@ import { UNSAFE_DeferredData as DeferredData, } from "@remix-run/router"; +/** + * Data for a route that was returned from a `loader()`. + * + * Note: This moves to unknown in ReactRouter and eventually likely in Remix + */ export type AppData = any; export function isCatchResponse(response: any): boolean { diff --git a/packages/remix-react/errors.ts b/packages/remix-react/errors.ts index 0f3622fce4e..d8605ccbd4a 100644 --- a/packages/remix-react/errors.ts +++ b/packages/remix-react/errors.ts @@ -4,7 +4,8 @@ import { ErrorResponse } from "@remix-run/router"; import type { AppData } from "./data"; /** - * @deprecated in favor of the `ErrorResponse` class in React Router. + * @deprecated in favor of the `ErrorResponse` class in React Router. Please + * enable the `future.v2_errorBoundary` flag to ease your migration to Remix v2. */ export interface ThrownResponse< Status extends number = number, diff --git a/packages/remix-server-runtime/data.ts b/packages/remix-server-runtime/data.ts index e8362abae5f..6237b8643d9 100644 --- a/packages/remix-server-runtime/data.ts +++ b/packages/remix-server-runtime/data.ts @@ -22,7 +22,7 @@ export interface AppLoadContext { /** * Data for a route that was returned from a `loader()`. * - * @deprecated + * Note: This moves to unknown in ReactRouter and eventually likely in Remix */ export type AppData = any; diff --git a/packages/remix-server-runtime/errors.ts b/packages/remix-server-runtime/errors.ts index 5bc4479aa7b..c4a4ccd38b0 100644 --- a/packages/remix-server-runtime/errors.ts +++ b/packages/remix-server-runtime/errors.ts @@ -44,7 +44,8 @@ import { isRouteErrorResponse } from "@remix-run/router"; */ /** - * @deprecated in favor of the `ErrorResponse` class in React Router. + * @deprecated in favor of the `ErrorResponse` class in React Router. Please + * enable the `future.v2_errorBoundary` flag to ease your migration to Remix v2. */ export interface ThrownResponse { status: number; diff --git a/packages/remix-server-runtime/responses.ts b/packages/remix-server-runtime/responses.ts index 2b84151f38e..12be2d6c0a3 100644 --- a/packages/remix-server-runtime/responses.ts +++ b/packages/remix-server-runtime/responses.ts @@ -48,18 +48,7 @@ export const json: JsonFunction = (data, init = {}) => { * @see https://remix.run/docs/utils/defer */ export const defer: DeferFunction = (data, init = {}) => { - let responseInit = typeof init === "number" ? { status: init } : init; - - // TODO: Do we need this or is this copy/paste from json()? - let headers = new Headers(responseInit.headers); - if (!headers.has("Content-Type")) { - headers.set("Content-Type", "application/json; charset=utf-8"); - } - - return routerDefer(data, { - ...responseInit, - headers, - }) as TypedDeferredData; + return routerDefer(data, init) as TypedDeferredData; }; export type RedirectFunction = ( From ac94a7a4353a22822e090608dd74acdd02254091 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 20 Mar 2023 13:16:39 -0400 Subject: [PATCH 5/6] Updates --- packages/remix-server-runtime/routeModules.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/remix-server-runtime/routeModules.ts b/packages/remix-server-runtime/routeModules.ts index 9adebe78c81..d8eec949d49 100644 --- a/packages/remix-server-runtime/routeModules.ts +++ b/packages/remix-server-runtime/routeModules.ts @@ -19,7 +19,10 @@ export interface RouteModules { /** * The arguments passed to ActionFunction and LoaderFunction. * - * @deprecated in favor of React Router `LoaderFunctionArgs` and `ActionFunctionArgs` + * Note this is almost identical to React Router's version but over there the + * context is optional since it's only there during static handler invocations. + * Keeping Remix's own definition for now so it can differentiate between + * client/server */ export interface DataFunctionArgs { request: Request; @@ -27,20 +30,12 @@ export interface DataFunctionArgs { params: Params; } -/** - * @deprecated in favor of React Router `LoaderFunctionArgs` - */ export type LoaderArgs = DataFunctionArgs; -/** - * @deprecated in favor of React Router `ActionFunctionArgs` - */ export type ActionArgs = DataFunctionArgs; /** * A function that handles data mutations for a route. - * - * @deprecated in favor of React Router `ActionFunction` */ export interface ActionFunction { (args: DataFunctionArgs): @@ -93,8 +88,6 @@ export interface LinksFunction { /** * A function that loads data for a route. - * - * @deprecated in favor of React Router `LoaderFunction` */ export interface LoaderFunction { (args: DataFunctionArgs): From 503cc2d00e2232ff2a1317d4515e1aeb4bd76859 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 20 Mar 2023 13:30:04 -0400 Subject: [PATCH 6/6] Add back removed comment --- packages/remix-server-runtime/responses.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/remix-server-runtime/responses.ts b/packages/remix-server-runtime/responses.ts index 12be2d6c0a3..3494202a12a 100644 --- a/packages/remix-server-runtime/responses.ts +++ b/packages/remix-server-runtime/responses.ts @@ -25,6 +25,8 @@ export type JsonFunction = ( init?: number | ResponseInit ) => TypedResponse; +// must be a type since this is a subtype of response +// interfaces must conform to the types they extend export type TypedResponse = Omit< Response, "json"