diff --git a/web_ui/scripts/check-bundle-size.mjs b/web_ui/scripts/check-bundle-size.mjs index ea6211d..22dd800 100644 --- a/web_ui/scripts/check-bundle-size.mjs +++ b/web_ui/scripts/check-bundle-size.mjs @@ -151,7 +151,49 @@ const ASSETS_DIR = join(HERE, "..", "dist", "app", "assets"); // and React Flow are the bulk of what remains, and no further split is // planned; this closes the gap that was attributed to the node views, not // the whole gap. -const LARGEST_CHUNK_CEILING_BYTES = 804_000; +// Deliberate, commented amendment - 2026-09-04 (ADR-019 section 4). +// +// The second time this number has moved DOWN, and the first time the ADR-019 +// budget has been in sight rather than a footnote. +// +// A sourcemap attribution of the initial chunk - every output byte charged +// back to the module it came from - found that two things reachable ONLY +// through a click were sitting in it: +// +// * The markdown machinery behind the Document View. DocumentViewPanel was +// statically imported by App.tsx, and it pulled DocumentViewMarkdown +// (react-markdown plus six remark/rehype plugins and +// react-medium-image-zoom) and documentViewHeadings (its own +// unified/remark-parse pass for the table of contents). The 11 node views +// that also use markdown were already lazy; this one eager importer was +// holding the whole unified/micromark/mdast stack in the initial chunk +// for every session, including the many that never open the panel. +// * html-to-image, reached from AppBar's Export PNG button and the command +// palette's export command. +// +// Both now load on demand. The Document View's SHELL deliberately stays +// eager: it is an