mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
[build-utils] Rename Lambda experimentalResponseStreaming prop to supportsResponseStreaming (#9721)
This commit is contained in:
@@ -23,6 +23,10 @@ export interface LambdaOptionsBase {
|
||||
regions?: string[];
|
||||
supportsMultiPayloads?: boolean;
|
||||
supportsWrapper?: boolean;
|
||||
supportsResponseStreaming?: boolean;
|
||||
/**
|
||||
* @deprecated Use the `supportsResponseStreaming` property instead.
|
||||
*/
|
||||
experimentalResponseStreaming?: boolean;
|
||||
operationType?: string;
|
||||
framework?: FunctionFramework;
|
||||
@@ -69,7 +73,7 @@ export class Lambda {
|
||||
zipBuffer?: Buffer;
|
||||
supportsMultiPayloads?: boolean;
|
||||
supportsWrapper?: boolean;
|
||||
experimentalResponseStreaming?: boolean;
|
||||
supportsResponseStreaming?: boolean;
|
||||
framework?: FunctionFramework;
|
||||
|
||||
constructor(opts: LambdaOptions) {
|
||||
@@ -83,6 +87,7 @@ export class Lambda {
|
||||
regions,
|
||||
supportsMultiPayloads,
|
||||
supportsWrapper,
|
||||
supportsResponseStreaming,
|
||||
experimentalResponseStreaming,
|
||||
operationType,
|
||||
framework,
|
||||
@@ -162,7 +167,8 @@ export class Lambda {
|
||||
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
|
||||
this.supportsMultiPayloads = supportsMultiPayloads;
|
||||
this.supportsWrapper = supportsWrapper;
|
||||
this.experimentalResponseStreaming = experimentalResponseStreaming;
|
||||
this.supportsResponseStreaming =
|
||||
supportsResponseStreaming ?? experimentalResponseStreaming;
|
||||
this.framework = framework;
|
||||
}
|
||||
|
||||
@@ -181,6 +187,16 @@ export class Lambda {
|
||||
}
|
||||
return zipBuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use the `supportsResponseStreaming` property instead.
|
||||
*/
|
||||
get experimentalResponseStreaming(): boolean | undefined {
|
||||
return this.supportsResponseStreaming;
|
||||
}
|
||||
set experimentalResponseStreaming(v: boolean | undefined) {
|
||||
this.supportsResponseStreaming = v;
|
||||
}
|
||||
}
|
||||
|
||||
const sema = new Sema(10);
|
||||
|
||||
@@ -795,7 +795,7 @@ export async function createLambdaFromPseudoLayers({
|
||||
...lambdaOptions,
|
||||
...(isStreaming
|
||||
? {
|
||||
experimentalResponseStreaming: true,
|
||||
supportsResponseStreaming: true,
|
||||
}
|
||||
: {}),
|
||||
files,
|
||||
|
||||
@@ -35,7 +35,7 @@ if (parseInt(process.versions.node.split('.')[0], 10) >= 16) {
|
||||
expect(buildResult.output['api/hello-again']).toBeDefined();
|
||||
expect(buildResult.output['api/hello-again'].type).toBe('Lambda');
|
||||
expect(
|
||||
buildResult.output['api/hello-again'].experimentalResponseStreaming
|
||||
buildResult.output['api/hello-again'].supportsResponseStreaming
|
||||
).toBe(true);
|
||||
|
||||
expect(buildResult.output['edge-route-handler']).toBeDefined();
|
||||
|
||||
@@ -487,8 +487,11 @@ export const build: BuildV3 = async ({
|
||||
config.helpers === false || process.env.NODEJS_HELPERS === '0'
|
||||
);
|
||||
|
||||
const experimentalResponseStreaming =
|
||||
staticConfig?.experimentalResponseStreaming === true ? true : undefined;
|
||||
const supportsResponseStreaming =
|
||||
(staticConfig?.supportsResponseStreaming ??
|
||||
staticConfig?.experimentalResponseStreaming) === true
|
||||
? true
|
||||
: undefined;
|
||||
|
||||
output = new NodejsLambda({
|
||||
files: preparedFiles,
|
||||
@@ -497,7 +500,7 @@ export const build: BuildV3 = async ({
|
||||
shouldAddHelpers,
|
||||
shouldAddSourcemapSupport,
|
||||
awsLambdaHandler,
|
||||
experimentalResponseStreaming,
|
||||
supportsResponseStreaming,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -522,7 +522,7 @@ async function createRenderNodeFunction(
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
operationType: 'SSR',
|
||||
experimentalResponseStreaming: true,
|
||||
supportsResponseStreaming: true,
|
||||
regions: config.regions,
|
||||
memory: config.memory,
|
||||
maxDuration: config.maxDuration,
|
||||
|
||||
Reference in New Issue
Block a user