diff --git a/.changeset/odd-bananas-teach.md b/.changeset/odd-bananas-teach.md new file mode 100644 index 00000000000..509d3364349 --- /dev/null +++ b/.changeset/odd-bananas-teach.md @@ -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. diff --git a/packages/remix-dev/config.ts b/packages/remix-dev/config.ts index 00d43bd88f5..9d3c0503a07 100644 --- a/packages/remix-dev/config.ts +++ b/packages/remix-dev/config.ts @@ -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("") );