-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(remix-vercel): show deprecation warning on usage
- Loading branch information
1 parent
8941a69
commit 63754f9
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |