Skip to content
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

warn that future.v2_dev should be moved to dev in v2 #7427

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading