fix(producer): cap compile-time remote downloads, give them one deadline and stop them on cancel (#8195)

* test(producer): compile-time remote downloads are capped, timed and stop with the render

* fix(producer): cap compile-time remote downloads, give them one deadline and stop them on cancel

* test(producer): size-limit tests stay under the remote download cap

* test(producer): count a refetched bundled script; start the deadline at the first download

* test(producer): export the download deadline so its test reads the real value

* fix(producer): count every downloaded script and start the download deadline at the first one

* test(producer): read the host's script copy once however many tags name it

* fix(producer): read a bundled script once per address; document the compile download limits

* test(producer): size the shared-font test from the 64 MB limit so it reaches it
This commit is contained in:
Miguel Ángel
2026-11-19 13:07:31 +00:00
committed by GitHub
parent d106f9c8c7
commit 77ea9d80cf
4 changed files with 312 additions and 55 deletions
+16
View File
@@ -190,6 +190,22 @@ await executeRenderJob(
An aborted render throws `RenderCancelledError`. Correctness warnings can also
block a render when `strictness: "strict"` is enabled.
## Remote scripts and stylesheets
Before rendering, the producer downloads a composition's remote `<script src>` files and
its stylesheets from hosts other than Google Fonts, and inlines them so the render needs
no network for them. One compile downloads at most 32 distinct script addresses and 32
distinct stylesheet addresses. A composition that links more of either is refused before
any of that kind is downloaded, with an error that names the count. Stylesheets count
before their contents are read, so a sheet with only layout rules counts too. Google Fonts
links are handled by the font step and do not count. A script the host ships itself (GSAP,
when `HYPERFRAMES_GSAP_VENDOR_DIR` names its folder) counts only when a tag's integrity
metadata does not match that copy and it has to be downloaded.
These downloads share one 60-second window, which starts with the first of them.
Anything still pending then fails like an unreachable file, and its tag stays as written.
Font files and other assets keep their own per-request time limits.
## Build a render service
The package exports a Hono application and server helpers: