Skip to content

Commit

Permalink
Add deprecation warning for v2_meta (#5878)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored Mar 23, 2023
1 parent 5b4674c commit e4c93b3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/meta-deprecation-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Add deprecation warning for `future.v2_meta`
1 change: 1 addition & 0 deletions integration/hmr-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let fixture = (options: { port: number; appServerPort: number }) => ({
v2_routeConvention: true,
v2_errorBoundary: true,
v2_normalizeFormMethod: true,
v2_meta: true,
},
files: {
"package.json": json({
Expand Down
3 changes: 3 additions & 0 deletions packages/remix-dev/__tests__/create-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
errorBoundaryWarning,
flatRoutesWarning,
formMethodWarning,
metaWarning,
} from "../config";

beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
Expand Down Expand Up @@ -356,6 +357,8 @@ describe("the create command", () => {
"\n" +
formMethodWarning +
"\n" +
metaWarning +
"\n" +
flatRoutesWarning +
"\n\n" +
getOptOutOfInstallMessage() +
Expand Down
9 changes: 9 additions & 0 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ export async function readConfig(
warnOnce(formMethodWarning, "v2_normalizeFormMethod");
}

if (!appConfig.future?.v2_meta) {
warnOnce(metaWarning, "v2_meta");
}

let isCloudflareRuntime = ["cloudflare-pages", "cloudflare-workers"].includes(
appConfig.serverBuildTarget ?? ""
);
Expand Down Expand Up @@ -852,3 +856,8 @@ export const formMethodWarning =
"prepare for the Remix v2 release. Lowercase `useNavigation().formMethod`" +
"values are being normalized to uppercase in v2 to align with the `fetch()` " +
"behavior. For more information, see https://remix.run/docs/hooks/use-navigation";

export const metaWarning =
"⚠️ DEPRECATED: Please enable the `future.v2_meta` flag to " +
"prepare for the Remix v2 release. For more information, see " +
"https://remix.run/docs/route/meta#md-metav2.";

0 comments on commit e4c93b3

Please sign in to comment.