Skip to content
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

Merged
merged 6 commits into from
Jul 29, 2024

Conversation

brophdawg11
Copy link
Contributor

A few things going on in here

  • Simplified react-router-dom to be a straight export * from react-router' instead of individually exporting the API surface
  • Removed the console warning about the deprecation of react-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 release
  • Removed the leftover lib/router/index file and changes all imports to come directly from the appropriate lib/router/*.ts file
  • Consolidated the react-router index.ts file to just export {...} from '...'; instead of importing and then exporting

Copy link

changeset-bot bot commented Jul 25, 2024

🦋 Changeset detected

Latest commit: 55c6d1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
react-router Major
@react-router/architect Major
@react-router/cloudflare Major
@react-router/dev Major
react-router-dom Major
@react-router/express Major
@react-router/node Major
@react-router/serve Major

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";
Copy link
Contributor Author

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

Comment on lines +5 to +8
import {
type BrowserHistory,
createBrowserHistory,
} from "../../lib/router/history";
Copy link
Contributor Author

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

Comment on lines -485 to -488
export { FrameworkContext as UNSAFE_FrameworkContext } from "./lib/dom/ssr/components";

/** @internal */
export type { RouteModules as UNSAFE_RouteModules } from "./lib/dom/ssr/routeModules";
Copy link
Contributor Author

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;
Copy link
Contributor Author

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...?

@brophdawg11 brophdawg11 merged commit e108bdf into dev Jul 29, 2024
7 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/cleanup-exports branch July 29, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant