[next] Add flag for experimental grouping (#11177)

Just adds a flag for experimenting
This commit is contained in:
JJ Kasper
2024-02-20 18:03:03 -08:00
committed by GitHub
parent 7910f2f307
commit ea0e9aeaec
3 changed files with 18 additions and 0 deletions

View File

@@ -804,6 +804,7 @@ export interface CreateLambdaFromPseudoLayersOptions
layers: PseudoLayer[];
isStreaming?: boolean;
nextVersion?: string;
experimentalAllowBundling?: boolean;
}
// measured with 1, 2, 5, 10, and `os.cpus().length || 5`
@@ -815,6 +816,7 @@ export async function createLambdaFromPseudoLayers({
layers,
isStreaming,
nextVersion,
experimentalAllowBundling,
...lambdaOptions
}: CreateLambdaFromPseudoLayersOptions) {
await createLambdaSema.acquire();
@@ -862,6 +864,7 @@ export async function createLambdaFromPseudoLayers({
slug: 'nextjs',
version: nextVersion,
},
experimentalAllowBundling,
});
}
@@ -1502,6 +1505,7 @@ export async function getPageLambdaGroups({
internalPages,
pageExtensions,
inversedAppPathManifest,
experimentalAllowBundling,
}: {
entryPath: string;
config: Config;
@@ -1524,6 +1528,7 @@ export async function getPageLambdaGroups({
internalPages: string[];
pageExtensions?: string[];
inversedAppPathManifest?: Record<string, string>;
experimentalAllowBundling?: boolean;
}) {
const groups: Array<LambdaGroup> = [];
@@ -1565,6 +1570,7 @@ export async function getPageLambdaGroups({
let matchingGroup = groups.find(group => {
const matches =
!experimentalAllowBundling &&
group.maxDuration === opts.maxDuration &&
group.memory === opts.memory &&
group.isPrerenders === isPrerenderRoute &&