mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(producer): cap a render's total sub-composition expansion The 16 MB limit checked each composition file alone, so a few small files that mount each other many times assembled a page far larger, and the pre-flight walk and sub-composition compile redid their work for every mount. The pre-flight walk now reads each file once and charges every mount to one budget: 32 MB of composition HTML across at most 10,000 mounts. Past either limit the render fails with the existing non-retryable COMPOSITION_TOO_LARGE error, before compiling. Sub-composition compilation handles each path once, and the inliner charges each mount to the same budget as it builds the page. * docs: describe the total sub-composition expansion limit * fix(producer): check each mount path and read each fallback file once The pre-flight walk resolved and checked a mount's path on disk for every mount, and the inliner's disk fallback did the same for every mount it inlined. Both now do it once per path, so a refused fan-out costs about half a second instead of several. The test now covers both a fan-out the pre-flight refuses and one inside templates, which only the inliner sees. * fix(producer): the pre-flight charges mounts inside templates to the budget The pre-flight walk could not see mounts inside a <template>, so a template-wrapped fan-out was only refused by the inliner, after seconds of work. The walk now charges those mounts to the same budget without reporting them, since the inliner still only warns about a broken one. The refusal now names which limit it passed, and the tests assert the mount count instead of a time.