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

feat!: remove @remix-run/router package #11378

Open
wants to merge 1 commit into
base: v7
Choose a base branch
from
Open

feat!: remove @remix-run/router package #11378

wants to merge 1 commit into from

Conversation

jacob-ebey
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Mar 27, 2024

🦋 Changeset detected

Latest commit: a98826b

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

This PR includes changesets to release 4 packages
Name Type
react-router-dom-v5-compat Major
react-router-native Major
react-router-dom Major
react-router 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

@@ -2,20 +2,34 @@ import * as React from "react";
import type {
ActionFunction,
ActionFunctionArgs,
AgnosticRouteObject,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need to keep exporting this type of stuff - we only really needed this because it was a standalone package - it could theoretically just use route objects now since it's all done from react-router

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +8 to +9
BrowserHistory,
BrowserHistoryOptions,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to consider exporting these as UNSAFE_ since the intended usage is createBrowserRouter which wraps createBrowserHistory/createRouter. Remix currently does the latter for granular control over the hydration/initialization ordering but for the most part histories should be an implementation detail in v7?

Comment on lines +58 to +59
createBrowserHistory,
createHashHistory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels weird - eventually maybe these implementations should just live in react-router-dom? But that feels weird too - maybe another vote for keeping a standalone router package to colocate histories and let RR and RR-dom can both import from there...

@@ -289,7 +356,7 @@ function mapRouteProperties(route: RouteObject) {
}

export function createMemoryRouter(
routes: RouteObject[],
routes: AgnosticRouteObject[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did TS not like this? We want react-aware objects at this point when we create a router since they need elements on them so I think we want to revert this change

@@ -51,6 +51,7 @@ import {
} from "./hooks";

export interface FutureConfig {
v7_partialHydration: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be left off - it's nuanced and annoying but there are currently 2 sets of future flags:

  • Those that apply to the router via createRouter
  • Those that apply to the react layer via RouterProvider

This is the latter and partialHydration is the former

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also discussed during the burst that the v7_ prefix is superfluous, but if we already have a couple future flags that use v7_ prefix then we can keep it for now and just remember not to include v8_ prefixes in next version

Copy link
Contributor

@brophdawg11 brophdawg11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Just a few minor questions

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.

None yet

3 participants