Skip to content

Commit e36eab9

Browse files
committed
fix(producer): address PR review on lambda-local harness
Three review items from Vai: - `Config.width`/`Config.height` are now plumbed through RunLambdaLocalInput rather than hardcoded inside runLambdaLocalRender. Lambda-local's whole point is to catch event-shape drift; if the handler ever starts honouring Config.width/height (e.g. for canvas sizing), having those values flow from the caller means the harness sees what the fixture authored. The interface change makes the eventual upgrade-to-real-fixture-resolution a one-line dispatch swap. - Drop the dead `export type { Fps }` and its unused import from @hyperframes/core. The module never re-exports it. - The dispatch site in regression-harness.ts now passes 1920×1080 explicitly with a comment marking it as a placeholder until the harness compiles the composition HTML up-front to surface the authored data-width/data-height. distributed-simulated mode uses the same placeholder internally, kept for parity. No behavior change in the existing modes; lambda-local now has a clear extension point for honouring fixture dimensions.
1 parent d26ebf5 commit e36eab9

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎packages/producer/src/regression-harness-lambda-local.ts‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
import { dirname, join } from "node:path";
3434
import { pipeline } from "node:stream/promises";
3535
import { Readable } from "node:stream";
36-
import type { Fps } from "@hyperframes/core";
3736
import { downloadS3ObjectToFile, tarDirectory, untarDirectory } from "@hyperframes/aws-lambda";
3837
import { handler } from "@hyperframes/aws-lambda/handler";
3938
import type {
@@ -53,6 +52,17 @@ export interface RunLambdaLocalInput {
5352
tempRoot: string;
5453
renderedOutputPath: string;
5554
fps: 24 | 30 | 60;
55+
/**
56+
* Width/height from the fixture's renderConfig. Forwarded directly to
57+
* the Lambda event so this mode catches drift if the handler ever
58+
* starts honouring `Config.width/height` for canvas sizing rather
59+
* than reading the composition's `data-width`/`data-height`. The
60+
* `distributed-simulated` mode hardcodes 1920×1080 because it
61+
* bypasses the event-serialization boundary; lambda-local goes
62+
* through it, which is the whole point.
63+
*/
64+
width: number;
65+
height: number;
5666
format: "mp4" | "mov" | "png-sequence";
5767
codec?: "h264" | "h265";
5868
chunkSize?: number;
@@ -96,11 +106,8 @@ export async function runLambdaLocalRender(input: RunLambdaLocalInput): Promise<
96106

97107
const config: SerializableDistributedRenderConfig = {
98108
fps: input.fps,
99-
// Required-by-type but overridden by the composition's data-width /
100-
// data-height attrs; any positive integer works (same trick as
101-
// `runDistributedSimulatedRender`).
102-
width: 1920,
103-
height: 1080,
109+
width: input.width,
110+
height: input.height,
104111
format: input.format,
105112
...(input.format === "mp4" && input.codec !== undefined ? { codec: input.codec } : {}),
106113
chunkSize: input.chunkSize,
@@ -218,7 +225,3 @@ class FilesystemBackedFakeS3 {
218225
throw new Error(`FakeS3: unexpected command ${cmdName}`);
219226
}
220227
}
221-
222-
// Re-export the Fps type so callers that pass through this module's
223-
// boundary don't need a second @hyperframes/core dep declaration.
224-
export type { Fps };

‎packages/producer/src/regression-harness.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,13 @@ async function runTestSuite(
942942
};
943943
if (options.mode === "lambda-local") {
944944
const runLambdaLocalRender = await loadLambdaLocalRender();
945-
await runLambdaLocalRender(distributedInput);
945+
// The fixture's authored dimensions live in the composition's
946+
// `data-width`/`data-height` attributes, not in `meta.json`'s
947+
// renderConfig. Until the harness compiles the HTML up-front
948+
// to surface them here, pass 1920×1080 — the same placeholder
949+
// `runDistributedSimulatedRender` uses internally. The
950+
// composition attrs override at plan time.
951+
await runLambdaLocalRender({ ...distributedInput, width: 1920, height: 1080 });
946952
} else {
947953
await runDistributedSimulatedRender(distributedInput);
948954
}

0 commit comments

Comments
 (0)