Files
David Luzar b99a49dbeb perf(editor): load Mermaid diagram code per diagram type (mermaid-to-excalidraw 3.1) (#12481)
* perf(editor): bump @excalidraw/mermaid-to-excalidraw to 3.1.0

3.1.0 loads Pele's code per diagram type, on first use (`pele/lazy`),
instead of all 33 diagram types at once: a first flowchart downloads
~66 KiB (brotli) instead of ~217 KiB. The per-diagram chunks are only
reachable through the lib's dynamic import, so `lazyChunksPlugin` keeps
them out of the PWA precache.

Claude Opus 5.5 (xhigh)

* chore(editor): name Pele's diagram chunks in TTD chunk-load comments

Since mermaid-to-excalidraw v3, it's Pele (not Mermaid) that lazy-loads
a chunk per diagram type, as of 3.1.0.

Claude Opus 5.5 (xhigh)

* feat(app): cache all Mermaid chunks for offline use once the TTD dialog opens

mermaid-to-excalidraw 3.1 splits Pele into a chunk per diagram type,
which aren't precached. With 3.0, the single Pele chunk cached on first
use covered every diagram type offline; now only the types converted
while online would.

`lazyChunksPlugin` emits the list of mermaid chunks as a hashed JSON
asset, which index.html points to with a `<meta>` (+33 B br). Once the
TTD dialog is opened, the app fetches the list and the chunks (after 5 s,
so the dialog's own chunks aren't fetched twice, at low priority) for the
service worker to cache in `lazy-chunks` (~200 kB br on top of what the
dialog loads). App only: package hosts (e.g. E+) are unaffected.

Claude Opus 5.5 (xhigh)
2026-10-30 12:10:15 +01:00
..