-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup imports/exports in consolidated react-router package #11840
Conversation
🦋 Changeset detectedLatest commit: 55c6d1c The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
UNSAFE_SingleFetchRedirectSymbol, | ||
} from "react-router"; | ||
export type * from "react-router"; | ||
export * from "react-router"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't export individually - just export everything from react-router
import { | ||
type BrowserHistory, | ||
createBrowserHistory, | ||
} from "../../lib/router/history"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All router imports come from the source files, no more lib/router/index.ts
barrel file to re-export
export { FrameworkContext as UNSAFE_FrameworkContext } from "./lib/dom/ssr/components"; | ||
|
||
/** @internal */ | ||
export type { RouteModules as UNSAFE_RouteModules } from "./lib/dom/ssr/routeModules"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed most of the UNSAFE_
exports at the bottom here, leaving only the contexts and then the few things we need exported for integration tests
@@ -276,7 +276,7 @@ export interface RouterState { | |||
/** | |||
* The action of the most recent navigation | |||
*/ | |||
historyAction: HistoryAction; | |||
historyAction: NavigationType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should rename this to navigationType
in v7 to align with useNavigationType
...?
A few things going on in here
react-router-dom
to be a straightexport * from react-router'
instead of individually exporting the API surfacereact-router-dom
so we don't spam user's consoles immediately after the upgrade - we can add that back in later in a 7.x releaselib/router/index
file and changes all imports to come directly from the appropriatelib/router/*.ts file
react-router
index.ts
file to justexport {...} from '...';
instead of importing and then exporting