-
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 (#5964)
- Loading branch information
1 parent
8c13767
commit 320f158
Showing
2 changed files
with
24 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( | ||
"⚠️ 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"; |
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