Skip to content

Commit

Permalink
feat(remix-vercel): show deprecation warning on usage (#5964)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Jun 13, 2023
1 parent 8c13767 commit 320f158
Show file tree
Hide file tree
Showing 2 changed files with 24 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(
"⚠️ REMIX FUTURE CHANGE: 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.js`.",
"built-in-vercel-functionality"
);

export type { GetLoadContextFunction, RequestHandler } from "./server";
export { createRequestHandler } from "./server";
6 changes: 6 additions & 0 deletions templates/vercel/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
> **Warning**
> 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.
> This means you don't have to use the Vercel template & can just use the Remix
> template instead.
# Welcome to Remix!

- [Remix Docs](https://remix.run/docs)
Expand Down

0 comments on commit 320f158

Please sign in to comment.