fix(producer): linear probe media check, and renders refuse composition HTML over 16 MB (#7992)

* fix(producer): linear probe media check, and renders refuse composition HTML over 8 MB

The probe stage tested every inline script body with /<(?:video|audio)\b[^>]*>/i.
A body full of unclosed <video openers made that test take quadratic time on the
render server's main thread. hasClosedMediaTag finds the first opener and then
looks for one '>' after it, which gives the same answer in linear time.

Compile and probe work on a page also runs on the main thread, and its cost grows
with the page's size. Entry and sub-composition HTML files over 8 MB are now
refused before they are read, with the COMPOSITION_TOO_LARGE error code.

* fix(producer): raise the composition HTML limit to 16 MB

The largest real render pages are about 7 MB of HTML, so 8 MB left too little room.
16 MB is more than twice that, and still bounds one file's compile to about 12 s
on dense markup.
This commit is contained in:
Michael Wang
2026-11-17 01:40:57 +00:00
committed by GitHub
parent 32fe10a8b3
commit d53b6059bd
10 changed files with 158 additions and 1 deletions
+2
View File
@@ -414,6 +414,8 @@ npx hyperframes check
Keep the first exact error rather than only the final “render failed” message. See [Troubleshooting](/help) for the next checks.
A render refuses any composition HTML file, the entry or a sub-composition, that is larger than 16 MB. The error code is `COMPOSITION_TOO_LARGE`. Keep images, fonts and data in separate files and reference them by path instead of inlining them.
<Tip>
Always watch the exported file itself. Preview proves that the project can play; the output file
proves that the delivery is correct.