-
-
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
Clean up types within consolidated package #12177
Conversation
🦋 Changeset detectedLatest commit: 6c6c57f The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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 |
} | ||
routes[parentId].push(route); |
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.
- Remix
RouteManifest
wasRecord<string, Route>
- React Router's internal
RouteManifest
was more accuratelyRecord<string, Route | undefined>
Switching to the stricter type means we have to introduce some defensiveness in existing Remix code - which feels more appropriate given the new fog of war behavior
/** | ||
* Data for a route that was returned from a `loader()`. | ||
*/ | ||
export type AppData = unknown; |
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.
Got rid of this - just used unknown
in the few spots this was used
ActionFunction, | ||
ActionFunctionArgs, | ||
LoaderFunction, | ||
LoaderFunctionArgs, |
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 can just use these directly now since there are no "Remix" versions anymore
headers: Headers; | ||
}; | ||
} | ||
) => ReturnType<RRLoaderFunction>; |
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.
🫡
| undefined; | ||
params: Params; | ||
location: Location; | ||
matches: MetaMatches<MatchLoaders>; | ||
error?: unknown; | ||
} | ||
|
||
/** |
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.
Copied this comment from the duped server runtime type
export type RouteManifest<R = AgnosticDataRouteObject> = Record< | ||
string, | ||
R | undefined | ||
>; |
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 a generic here so the remix layers could pass in their route type
/** | ||
* @deprecated Use `LoaderFunctionArgs`/`ActionFunctionArgs` instead | ||
*/ | ||
export type DataFunctionArgs = RRActionFunctionArgs<AppLoadContext> & |
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 these can go away and we just use the RR types - and users will add context: appLoadContext
via module augmentation: https://reactrouter.com/dev/guides/upgrading/remix#step-7---update-types-for-apploadcontext
* A function that handles data mutations for a route on the client | ||
* @private Public API is exported from @react-router/react | ||
*/ | ||
type ClientActionFunction = ( |
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.
These client types were duped here and in the @remix-run/react
package so we just keep the other ones.
* A function that defines `<link>` tags to be inserted into the `<head>` of | ||
* the document on route transitions. | ||
*/ | ||
export interface LinksFunction { |
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.
Kill link/meta types in favor of the ones from @remix-run/react
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
No description provided.