Skip to content

Commit d37390e

Browse files
committed
Merge branch 'main' into next
2 parents d74617c + 50c3ed2 commit d37390e

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.changeset/weak-dancers-beam.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@astrojs/vercel': minor
3+
---
4+
5+
Deprecates the `functionPerRoute` option
6+
7+
This option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to:
8+
9+
```diff
10+
import { defineConfig } from 'astro/config';
11+
import vercel from '@astrojs/vercel/serverless';
12+
13+
export default defineConfig({
14+
// ...
15+
output: 'server',
16+
adapter: vercel({
17+
- functionPerRoute: true,
18+
}),
19+
});
20+
```

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"test:smoke:example": "turbo run build --concurrency=100% --filter=\"@example/*\"",
3131
"test:smoke:docs": "turbo run build --filter=docs",
3232
"test:check-examples": "node ./scripts/smoke/check.js",
33-
"test:vite-ci": "turbo run test --filter=astro",
33+
"test:vite-ci": "cd packages/astro && pnpm run test:node",
3434
"test:e2e": "cd packages/astro && pnpm playwright install chromium firefox && pnpm run test:e2e",
3535
"test:e2e:match": "cd packages/astro && pnpm playwright install chromium firefox && pnpm run test:e2e:match",
3636
"test:e2e:hosts": "turbo run test:hosted",

packages/integrations/vercel/src/serverless/adapter.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ export interface VercelServerlessConfig {
134134
/** Whether to create the Vercel Edge middleware from an Astro middleware in your code base. */
135135
edgeMiddleware?: boolean;
136136

137-
/** Whether to split builds into a separate function for each route. */
137+
/**
138+
* Whether to split builds into a separate function for each route.
139+
* @deprecated `functionPerRoute` is deprecated and will be removed in the next major release of the adapter.
140+
*/
138141
functionPerRoute?: boolean;
139142

140143
/** The maximum duration (in seconds) that Serverless Functions can run before timing out. See the [Vercel documentation](https://vercel.com/docs/functions/serverless-functions/runtimes#maxduration) for the default and maximum limit for your account plan. */
@@ -286,6 +289,11 @@ export default function vercelServerless({
286289
`\tMake sure to check your plan carefully to avoid incurring additional costs.\n` +
287290
`\tYou can set functionPerRoute: false to prevent surpassing the limit.\n`,
288291
);
292+
293+
logger.warn(
294+
`\n` +
295+
`\t\`functionPerRoute\` is deprecated and will be removed in a future version of the adapter.\n`,
296+
);
289297
}
290298

291299
setAdapter(

0 commit comments

Comments
 (0)