Skip to content

Commit

Permalink
warn that future.v2_dev should be moved to dev in v2
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Sep 15, 2023
1 parent be1a68b commit c63c062
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,18 +568,29 @@ export async function readConfig(
"unstable_postcss",
"unstable_tailwind",
"unstable_vanillaExtract",
"v2_dev",
"v2_errorBoundary",
"v2_headers",
"v2_meta",
"v2_normalizeFormMethod",
"v2_routeConvention",
] as const;
];

if ("v2_dev" in userFlags) {
if (userFlags.v2_dev === true) {
deprecatedFlags.push("v2_dev");
} else {
logger.warn("The `v2_dev` future flag is obsolete.", {
details: [
"Move your dev options from `future.v2_dev` to `dev` within your `remix.config.js` file",
],
});
}
}

let obsoleteFlags = deprecatedFlags.filter((f) => f in userFlags);
if (obsoleteFlags.length > 0) {
logger.warn(
`⚠️ REMIX FUTURE CHANGE: the following Remix future flags are now obsolete ` +
`The following Remix future flags are now obsolete ` +
`and can be removed from your remix.config.js file:\n` +
obsoleteFlags.map((f) => `- ${f}\n`).join("")
);
Expand Down

0 comments on commit c63c062

Please sign in to comment.