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 users about obsolete future flags in remix.config.js #7048

Merged
merged 1 commit into from
Aug 4, 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
5 changes: 5 additions & 0 deletions .changeset/brown-seals-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": minor
---

Warn users about obsolete future flags in remix.config.js
31 changes: 31 additions & 0 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,39 @@ export async function readConfig(
tsconfigPath = rootJsConfig;
}

// Note: When a future flag is removed from here, it should be added to the
// list below so we can let folks know if they have obsolete flags in their
// config. If we ever convert remix.config.js to a TS file so we get proper
// typings this won't be necessary anymore.
let future: FutureConfig = {};

if (appConfig.future) {
let userFlags = appConfig.future;
let deprecatedFlags = [
"unstable_cssModules",
"unstable_cssSideEffectImports",
"unstable_dev",
"unstable_postcss",
"unstable_tailwind",
"unstable_vanillaExtract",
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
"v2_dev",
"v2_errorBoundary",
"v2_headers",
"v2_meta",
"v2_normalizeFormMethod",
"v2_routeConvention",
] as const;

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 ` +
`and can be removed from your remix.config.js file:\n` +
obsoleteFlags.map((f) => `- ${f}\n`).join("")
);
}
}

return {
appDirectory,
cacheDirectory,
Expand Down
8 changes: 0 additions & 8 deletions packages/remix-dev/warnOnce.ts

This file was deleted.