Skip to content

Commit 0280f4b

Browse files
Fruupteemingc
andauthored
feat: expose waitUntil also for serverless runtime & add docs (#14725)
* improvement: expose `waitUntil` also for serverless runtime & add documentation * changeset * revert previous changes and add docs * revert previous changes * change changeset --------- Co-authored-by: Tee Ming <chewteeming01@gmail.com>
1 parent 9e9fd2d commit 0280f4b

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.changeset/slimy-tips-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-vercel': minor
3+
---
4+
5+
chore: mark `RequestContext` as deprecated and refer to `@vercel/functions`

documentation/docs/25-build-and-deploy/90-adapter-vercel.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ Cookie-based skew protection comes with one caveat: if a user has multiple versi
177177

178178
## Notes
179179

180+
### Vercel utilities
181+
182+
If you need Vercel-specific utilities like `waitUntil`, use the package [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package).
183+
180184
### Vercel functions
181185

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

packages/adapter-vercel/ambient.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { RequestContext } from './index.js';
1+
import type { RequestContext } from './index.js';
22

33
declare global {
44
namespace App {
55
export interface Platform {
66
/**
77
* `context` is only available in Edge Functions
8+
*
9+
* @deprecated Vercel's context is deprecated. Use [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package) instead.
810
*/
911
context?: RequestContext;
1012
}

packages/adapter-vercel/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ export type Config = (EdgeConfig | ServerlessConfig) & {
110110
/**
111111
* An extension to the standard `Request` object that is passed to every Edge Function.
112112
*
113+
* @deprecated - use [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package) instead.
114+
*
113115
* @example
114116
* ```ts
115117
* import type { RequestContext } from '@vercel/edge';

0 commit comments

Comments
 (0)