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 884eed0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/odd-bananas-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@remix-run/dev": patch
---

Warn if `future.v2_dev` is set

Prompt user to delete it if its set to `true` or move it to `dev` if its an object.
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 884eed0

Please sign in to comment.