For the last few months we've been working hard on bringing new and improved APIs to Remix. We've introduced serveral major changes to prepare you for v2 via future flags, and we think v1.15.0 is our last big push to get you ready for the future of Remix.
It's important to note that nothing in your app will break if you do not opt-in to our future flags. 🥳 We are on a mission to provide the smoothest possible upgrade path so you can take it on before a new major release.
Let's get into it 🤓
Future Flags
As of v1.15.0, we have deprecated all v1 APIs impacted by v2 future flags. When you run your app in development, we will show a one-time warning for deprecated APIs along with a link that explains how to incrementally migrate to the new APIs before v2 is released.
The v2 future flags include:
v2_errorBoundary: Removes the CatchBoundary component in favor of handling thrown Response objects in ErrorBoundary directly
v2_meta: Uses the new function signature for route meta functions and simplifies rendering in <Meta />
v2_normalizeFormMethod: useNavigation and useFetcher hooks returning an object with formMethod will uses uppercase method verbs ("GET", "POST", etc.) to align with fetch() behavior
For detailed information on how to use these flags and incrementally upgrade your app, please refer to Preparing for v2 in the Remix docs.
Changes to v2 meta
We have made a few changes to the API for route module meta functions when using the future.v2_meta flag.
V2_HtmlMetaDescriptor has been renamed to V2_MetaDescriptor
The meta function's arguments have been simplified
parentsData has been removed, as each route's loader data is available on the data property of its respective match object
// before
export function meta({ parentsData }) {
return [{ title: parentsData["routes/parent"].title }];
}
// after
export function meta({ matches }) {
let parent = matches.find((match) => match.id === "routes/parent");
return [{ title: parent.data.title }];
}
The route property on route matches has been removed, as relevant match data is attached directly to the match object
// before
export function meta({ matches }) {
let rootModule = matches.find((match) => match.route.id === "root");
}
// after
export function meta({ matches }) {
let rootModule = matches.find((match) => match.id === "root");
}
We have added support for generating <script type='application/ld+json' /> and meta-related <link /> tags to document head via the route meta function
We have made a few changes to the API for route module meta functions when using the future.v2_meta flag. These changes are only breaking for users who have opted in. (#5746)
V2_HtmlMetaDescriptor has been renamed to V2_MetaDescriptor
The meta function's arguments have been simplified
parentsData has been removed, as each route's loader data is available on the data property of its respective match object
// before
export function meta({ parentsData }) {
return [{ title: parentsData["routes/some-route"].title }];
}
// after
export function meta({ matches }) {
return [
{
title: matches.find((match) => match.id === "routes/some-route")
.data.title,
},
];
}
The route property on route matches has been removed, as relevant match data is attached directly to the match object
// before
export function meta({ matches }) {
let rootModule = matches.find((match) => match.route.id === "root");
}
// after
export function meta({ matches }) {
let rootModule = matches.find((match) => match.id === "root");
}
Added support for generating <script type='application/ld+json' /> and meta-related <link /> tags to document head via the route meta function when using the v2_meta future flag
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps @remix-run/node from 1.14.3 to 1.15.0.
Release notes
Sourced from
@remix-run/node
's releases.... (truncated)
Changelog
Sourced from
@remix-run/node
's changelog.Commits
7f70071
chore: Update version for release (#5963)aff8fff
chore: Update version for release (pre) (#5950)39ee2df
chore: Update version for release (pre) (#5885)5b4674c
chore: Update version for release (pre) (#5877)58779de
chore: Update version for release (pre) (#5867)6d0a298
Merge branch 'release-next' into devaa6f573
Merge branch 'release-next' into dev212f17c
chore: Update version for releasea33ebfb
API updates for v2meta
arguments and types (#5785)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)