diff --git a/packages/remix-vercel/index.ts b/packages/remix-vercel/index.ts index fb640bf4799..74cbdf5c001 100644 --- a/packages/remix-vercel/index.ts +++ b/packages/remix-vercel/index.ts @@ -1,4 +1,22 @@ import "./globals"; +const alreadyWarned: Record = {}; +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"; diff --git a/templates/vercel/README.md b/templates/vercel/README.md index 944936b3429..d25767760ee 100644 --- a/templates/vercel/README.md +++ b/templates/vercel/README.md @@ -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)