Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/slimy-tips-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': minor
---

chore: mark `RequestContext` as deprecated and refer to `@vercel/functions`
4 changes: 4 additions & 0 deletions documentation/docs/25-build-and-deploy/90-adapter-vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ Cookie-based skew protection comes with one caveat: if a user has multiple versi

## Notes

### Vercel utilities

If you need Vercel-specific utilities like `waitUntil`, use the package [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package).

### Vercel functions

If you have Vercel functions contained in the `api` directory at the project's root, any requests for `/api/*` will _not_ be handled by SvelteKit. You should implement these as [API routes](routing#server) in your SvelteKit app instead, unless you need to use a non-JavaScript language in which case you will need to ensure that you don't have any `/api/*` routes in your SvelteKit app.
Expand Down
4 changes: 3 additions & 1 deletion packages/adapter-vercel/ambient.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { RequestContext } from './index.js';
import type { RequestContext } from './index.js';

declare global {
namespace App {
export interface Platform {
/**
* `context` is only available in Edge Functions
*
* @deprecated Vercel's context is deprecated. Use [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package) instead.
*/
context?: RequestContext;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/adapter-vercel/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export type Config = (EdgeConfig | ServerlessConfig) & {
/**
* An extension to the standard `Request` object that is passed to every Edge Function.
*
* @deprecated - use [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package) instead.
*
* @example
* ```ts
* import type { RequestContext } from '@vercel/edge';
Expand Down
Loading