Skip to content

Commit

Permalink
feat(remix-vercel): show deprecation warning on usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Apr 19, 2023
1 parent 8941a69 commit 63754f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/remix-vercel/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
import "./globals";

const alreadyWarned: Record<string, boolean> = {};
const warnOnce = (message: string, key = message) => {
if (!alreadyWarned[key]) {
alreadyWarned[key] = true;
console.warn(message);
}
};

warnOnce(
"⚠️ DEPRECATED: The `@remix-run/vercel` runtime adapter has been " +
"deprecated in favor of out of the box Vercel functionality and will be " +
"removed in Remix v2. Please update your code by removing " +
"`@remix-run/vercel` & `@vercel/node` from your `package.json`, removing " +
"your `server.js`/`server.ts` file, and removing the `server` & " +
"`serverBuildPath` options from your `remix.config.json`.",
"built-in-vercel-functionality"
);

export type { GetLoadContextFunction, RequestHandler } from "./server";
export { createRequestHandler } from "./server";

0 comments on commit 63754f9

Please sign in to comment.