Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";