mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
fix(core): give the preview bundler the render's expansion budget (#8306)
* fix(core): give the preview bundler the render's expansion budget The preview bundler inlined every sub-composition mount with only a depth limit, so a few small files that mount each other many times assembled a page without bound. The producer's expansion budget now lives in core, and the bundler charges every mount and the scripts and styles generated for it to that budget, and checks each file's size before reading it. Studio preview shows the refusal instead of falling back to the raw page, whose mounts the browser would expand the same way. * refactor: drop comments the names already carry * test(core): give the preview fan-out budget test a 30 s timeout The flake gate saw it pass 9 of 10 runs under CPU contention, timing out at the default 5 s. The neighbouring scoper bound tests use 30 s too.
This commit is contained in:
@@ -418,6 +418,8 @@ A render refuses any composition HTML file, the entry or a sub-composition, that
|
||||
|
||||
The same error refuses a render whose sub-composition mounts add up to more than 64 MB of composition HTML, to more than 10,000 mounts, or to more than 100,000 elements copied by those mounts. Every mount counts, including each repeat of the same file and each mount nested inside another. The scripts and scoped styles generated for those mounts have their own 64 MB limit. Every inline script in a mounted file is wrapped in a few kilobytes of scoping code, and every style rule is prefixed with its host's `data-composition-id`. Many tiny inline scripts, or a long composition id over many style rules, can reach this limit. Merge small scripts and rules, or keep ids short.
|
||||
|
||||
Studio preview and the CLI commands that assemble a project, such as `validate` and `compare`, apply the same limits with the same error. Studio shows the error in place of the preview.
|
||||
|
||||
<Tip>
|
||||
Always watch the exported file itself. Preview proves that the project can play; the output file
|
||||
proves that the delivery is correct.
|
||||
|
||||
Reference in New Issue
Block a user