From 172b104bec6083f3d73d4cd2db5511da4d3b215d Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Thu, 20 Jul 2023 17:22:53 -0400 Subject: [PATCH] Fix TS errors --- integration/catch-boundary-test.ts | 6 ++++++ packages/remix-cloudflare/index.ts | 2 -- packages/remix-deno/index.ts | 2 -- packages/remix-node/index.ts | 2 -- packages/remix-react/errorBoundaries.tsx | 2 -- packages/remix-react/index.tsx | 2 -- packages/remix-react/server.tsx | 10 ++-------- packages/remix-server-runtime/index.ts | 2 -- packages/remix-server-runtime/reexport.ts | 2 -- 9 files changed, 8 insertions(+), 22 deletions(-) diff --git a/integration/catch-boundary-test.ts b/integration/catch-boundary-test.ts index ec31bab8a30..00527d2c481 100644 --- a/integration/catch-boundary-test.ts +++ b/integration/catch-boundary-test.ts @@ -223,6 +223,10 @@ test.describe("ErrorBoundary (thrown responses)", () => { }); test("non-matching urls on document requests", async () => { + let oldConsoleError; + oldConsoleError = console.error; + console.error = () => {}; + let res = await fixture.requestDocument(NOT_FOUND_HREF); expect(res.status).toBe(404); let html = await res.text(); @@ -233,6 +237,8 @@ test.describe("ErrorBoundary (thrown responses)", () => { { id: "root", pathname: "", params: {} }, ]).replace(/"/g, """); expect(html).toContain(`
${expected}
`); + + console.error = oldConsoleError; }); test("non-matching urls on client transitions", async ({ page }) => { diff --git a/packages/remix-cloudflare/index.ts b/packages/remix-cloudflare/index.ts index 36910883313..35fb287eb9b 100644 --- a/packages/remix-cloudflare/index.ts +++ b/packages/remix-cloudflare/index.ts @@ -37,7 +37,6 @@ export type { CookieSignatureOptions, DataFunctionArgs, EntryContext, - ErrorBoundaryComponent, HandleDataRequestFunction, HandleDocumentRequestFunction, HeadersArgs, @@ -56,7 +55,6 @@ export type { HandleErrorFunction, PageLinkDescriptor, RequestHandler, - RouteComponent, RouteHandle, SerializeFrom, ServerBuild, diff --git a/packages/remix-deno/index.ts b/packages/remix-deno/index.ts index e426df4653d..40346581e68 100644 --- a/packages/remix-deno/index.ts +++ b/packages/remix-deno/index.ts @@ -40,7 +40,6 @@ export type { CookieSignatureOptions, DataFunctionArgs, EntryContext, - ErrorBoundaryComponent, HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, @@ -59,7 +58,6 @@ export type { MetaFunction, PageLinkDescriptor, RequestHandler, - RouteComponent, RouteHandle, SerializeFrom, ServerBuild, diff --git a/packages/remix-node/index.ts b/packages/remix-node/index.ts index f16ec506627..c42cd61c626 100644 --- a/packages/remix-node/index.ts +++ b/packages/remix-node/index.ts @@ -63,7 +63,6 @@ export type { CookieSignatureOptions, DataFunctionArgs, EntryContext, - ErrorBoundaryComponent, HandleDataRequestFunction, HandleDocumentRequestFunction, HeadersArgs, @@ -82,7 +81,6 @@ export type { HandleErrorFunction, PageLinkDescriptor, RequestHandler, - RouteComponent, RouteHandle, SerializeFrom, ServerBuild, diff --git a/packages/remix-react/errorBoundaries.tsx b/packages/remix-react/errorBoundaries.tsx index 17e02949d8e..3b61c33d651 100644 --- a/packages/remix-react/errorBoundaries.tsx +++ b/packages/remix-react/errorBoundaries.tsx @@ -1,11 +1,9 @@ import * as React from "react"; import type { Location } from "@remix-run/router"; -import type { ErrorBoundaryComponent } from "@remix-run/server-runtime"; import { isRouteErrorResponse } from "react-router-dom"; type RemixErrorBoundaryProps = React.PropsWithChildren<{ location: Location; - component: ErrorBoundaryComponent; error?: Error; }>; diff --git a/packages/remix-react/index.tsx b/packages/remix-react/index.tsx index 4b10d1672a5..37864c79540 100644 --- a/packages/remix-react/index.tsx +++ b/packages/remix-react/index.tsx @@ -72,8 +72,6 @@ export { RemixContext as UNSAFE_RemixContext, } from "./components"; -export type { ThrownResponse } from "./errors"; - export type { HtmlLinkDescriptor } from "./links"; export type { HtmlMetaDescriptor, diff --git a/packages/remix-react/server.tsx b/packages/remix-react/server.tsx index 35d3cbd21f8..47c4b576116 100644 --- a/packages/remix-react/server.tsx +++ b/packages/remix-react/server.tsx @@ -7,10 +7,7 @@ import { import { RemixContext } from "./components"; import type { EntryContext } from "./entry"; -import { - RemixErrorBoundary, - RemixRootDefaultErrorBoundary, -} from "./errorBoundaries"; +import { RemixErrorBoundary } from "./errorBoundaries"; import { createServerRoutes } from "./routes"; export interface RemixServerProps { @@ -52,10 +49,7 @@ export function RemixServer({ abortDelay, }} > - +