mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-15 22:08:03 +00:00
The studio shipped one eager entry chunk of 1,126,473 B gzip. CodeMirror and the markdown renderer were the two largest blocks on that path and neither is needed to paint the shell. - React.lazy the source editor (@codemirror/*, @lezer/*) and the storyboard source view (marked, dompurify), copying the deferred-dependency shape of the mediabunny dynamic import in player/lib/mediaProbe.ts. - Add LazyPanel: one Suspense + error boundary whose fallback fills the panel's slot (h-full w-full flex-1) so opening the editor cannot shift the layout, and whose rejected-chunk state renders a visible retry instead of a blank panel. - manualChunks splits the React runtime and the remaining vendor code out of the app chunk so app-only deploys stop invalidating them for repeat visitors. - tests/e2e/studio-bundle-budget.mjs gates the built artifact with no browser. It measures the entry module plus its modulepreloaded chunks, not the entry file alone: the entry file alone gzips to well under half the eager total and would report a false pass while the browser still downloads all of it. The gate enforces a ratchet just above what we ship today and reports the gap to the 600 KiB target every run. Closing that gap needs the Node-only AST stack (@babel/parser, esprima, acorn, recast, ast-types) out of the browser bundle, where it arrives through @hyperframes/sdk — outside this unit.