Skip to content

Commit

Permalink
Move invariant to UNSAFE_ export (#10066)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored Feb 15, 2023
1 parent 5706fbd commit bbe4ec5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-forks-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/router": patch
---

Change `invariant` to an `UNSAFE_` export since it's only intended for internal use
2 changes: 1 addition & 1 deletion packages/react-router-dom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
createRouter,
createBrowserHistory,
createHashHistory,
invariant,
UNSAFE_invariant as invariant,
joinPaths,
ErrorResponse,
} from "@remix-run/router";
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dom/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
IDLE_FETCHER,
IDLE_NAVIGATION,
Action,
invariant,
UNSAFE_invariant as invariant,
isRouteErrorResponse,
UNSAFE_convertRoutesToDataRoutes as convertRoutesToDataRoutes,
} from "@remix-run/router";
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/lib/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Action as NavigationType,
AbortedDeferredError,
createMemoryHistory,
invariant,
UNSAFE_invariant as invariant,
parsePath,
stripBasename,
warning,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/lib/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
} from "@remix-run/router";
import {
Action as NavigationType,
invariant,
UNSAFE_invariant as invariant,
isRouteErrorResponse,
joinPaths,
matchPath,
Expand Down
3 changes: 2 additions & 1 deletion packages/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export {
createPath,
createHashHistory,
createMemoryHistory,
invariant,
parsePath,
} from "./history";

Expand All @@ -82,3 +81,5 @@ export {
convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes,
getPathContributingMatches as UNSAFE_getPathContributingMatches,
} from "./utils";

export { invariant as UNSAFE_invariant } from "./history";

0 comments on commit bbe4ec5

Please sign in to comment.