Skip to content

B-1JZA-markdown-ui-surface-bundle-budget

State: promoted/task

nuxi analyze on the markdown-ui playground production build (2026-09-03): the /surface/ route eagerly modulepreloads ~1.64 MB raw / ~0.53 MB gzip before the editor can mount - the layer+CodeMirror chunk (858 KB raw / 283 KB gz) plus the obsidian-md renderer chunk (389 KB / 121 KB gz) - against the PLAN budget of <150 KB gzip added to a product’s main chunk. Also: two KaTeX majors ship (0.16.47 pulled in lazily by mermaid beside the renderer’s 0.18.4); Shiki is bundled as 310 lazy grammar/theme chunks (9.4 MB raw, emacs-lisp and cpp grammars are the 2nd/3rd largest files in the build) although nothing sets options.highlight, because obsidian-md’s shiki plugin reaches grammars through shiki’s bundledLanguages record. Work: (1) per-mode lazy loading - read mode should not pull the editor chunk, edit modes should not pull the full renderer pipeline eagerly; (2) alias mermaid’s katex to the layer’s single copy; (3) exclude Shiki from builds that never set highlight (or load grammars on demand behind an explicit option). Mermaid is confirmed lazy and not prefetched. Evidence: PR 3 handoff evidence/bundle (bundle-summary.txt, analyze/, manifest.json).


← Back to Backlog