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
base: v7
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: a98826b The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
@@ -2,20 +2,34 @@ import * as React from "react"; | |||
import type { | |||
ActionFunction, | |||
ActionFunctionArgs, | |||
AgnosticRouteObject, |
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 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
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.
Added this as a separate task here: https://github.com/orgs/remix-run/projects/21/views/1?pane=issue&itemId=58418436
BrowserHistory, | ||
BrowserHistoryOptions, |
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.
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?
createBrowserHistory, | ||
createHashHistory, |
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.
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[], |
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.
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; |
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.
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
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.
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
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.
👍 Just a few minor questions
No description provided.