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

feat(remix-vercel): show deprecation warning on usage #5964

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
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