Skip to content

Commit

Permalink
name change (#10812)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored Aug 23, 2023
1 parent a4495de commit 9852bb0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .changeset/error-response-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"@remix-run/router": patch
---

Move the `@private` class export `ErrorResponse` to an `UNSAFE_ErrorResponse` export since it is an implementation detail and there should be no construction of `ErrorResponse` instances in userland. This frees us up to export a `type ErrorResponse` which correlates to an instance of the class via `InstanceType`. Userland code should only ever be using `ErrorResponse` as a type and should be type-narrowing via `isRouteErrorResponse`.
Move the `@private` class export `ErrorResponse` to an `UNSAFE_ErrorResponseImpl` export since it is an implementation detail and there should be no construction of `ErrorResponse` instances in userland. This frees us up to export a `type ErrorResponse` which correlates to an instance of the class via `InstanceType`. Userland code should only ever be using `ErrorResponse` as a type and should be type-narrowing via `isRouteErrorResponse`.
2 changes: 1 addition & 1 deletion packages/react-router-dom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
createHashHistory,
joinPaths,
stripBasename,
UNSAFE_ErrorResponse as ErrorResponseImpl,
UNSAFE_ErrorResponseImpl as ErrorResponseImpl,
UNSAFE_invariant as invariant,
UNSAFE_warning as warning,
} from "@remix-run/router";
Expand Down
2 changes: 1 addition & 1 deletion packages/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export * from "./router";
export type { RouteManifest as UNSAFE_RouteManifest } from "./utils";
export {
DeferredData as UNSAFE_DeferredData,
ErrorResponseImpl as UNSAFE_ErrorResponse,
ErrorResponseImpl as UNSAFE_ErrorResponseImpl,
convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes,
getPathContributingMatches as UNSAFE_getPathContributingMatches,
} from "./utils";
Expand Down

0 comments on commit 9852bb0

Please sign in to comment.