Files
hyperframes/packages/studio-server
Michael Wang 12eab05b5a fix(studio-server): refuse a sub-composition preview past the render's limits (#8308)
* 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

* fix(studio-server): refuse a sub-composition preview past the render's limits

The single sub-composition page is served without bundling its mounts, and
the browser runtime then fetches one copy for every data-composition-src
host in it, with no count or byte limit. The page build now charges each
host the browser will fetch to the shared expansion budget, reading each
target's size once, and the route serves the preview's refusal page.

Also moves the preview route's size-limit check above the comment it had
displaced, and uses core's check through a light subpath.

* fix(core): give the preview bundler the render's element cap

#8295 added a 100,000-element cap to the render's expansion budget. The
preview bundler now passes chargeElements to the shared inliner too, so
preview refuses the same compositions.

* fix(studio-server): charge a percent-encoded composition src for the file it serves

The comp page build looked up each data-composition-src by its raw text, so
an encoded spelling such as b%69g.html counted as a mount but was charged
0 bytes, while the preview route decodes it and serves big.html. Resolve
the same decoded path the route serves.

* 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.
2026-11-20 22:09:10 +00:00
..
2026-11-19 22:02:17 -05:00