feat(site): add mermaid diagram rendering - #2754
Conversation
PR Summary by QodoEnable Mermaid diagram rendering in VitePress docs site
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Site previewPreview: https://898fced3-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 4:47 PM UTC · Completed 4:59 PM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Code Review by Qodo
1. Docs Node engine too low
|
|
Looks good to me Labels: PR modifies the VitePress documentation site |
8e565f7 to
91564e9
Compare
|
🤖 Review · |
Add mermaid diagram support to VitePress docs via a custom Mermaid.vue component that dynamically imports mermaid only on pages containing ```mermaid code fences. Uses defineAsyncComponent for zero overhead on non-diagram pages (~80 of ~81 pages). Key decisions: - Alias mermaid to its pre-bundled ESM build (mermaid.esm.mjs) to avoid dayjs CJS default-export error under noExternal: [/./] SSR config - Pin mermaid ~11.16.0 since the ESM alias targets an undocumented build artifact that could change in a minor release - securityLevel: 'strict' enables DOMPurify sanitization on all SVG output - MutationObserver re-renders diagrams on dark/light theme toggle Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
91564e9 to
d9e60a7
Compare
|
🤖 Finished Review · ✅ Success · Started 6:05 PM UTC · Completed 6:16 PM UTC |
|
🤖 Retro · ❌ Terminated · Started 6:16 PM UTC · Ended 6:22 PM UTC |
|
Review skipped — this PR is already merged. The Posted by fullsend post-review check |
|
🤖 Finished Retro · ❌ Failure · Started 6:16 PM UTC · Completed 6:22 PM UTC |
Summary
Mermaid.vuecomponent```mermaidcode fences, with zero JS overhead on the ~80 other pagesdefineAsyncComponent+ dynamicimport('mermaid')inonMounted()instead ofvitepress-plugin-mermaid, which registered the component globally and caused ~1.4 MB of modulepreload chunks on every pagemermaid.esm.mjs) to avoid CJS/ESMdayjsdefault-export error under thenoExternal: [/./]SSR config~11.16.0since the ESM alias targets an undocumented build artifactsecurityLevel: 'strict'enables DOMPurify sanitization on all SVG outputMutationObserverre-renders diagrams on dark/light theme toggleFiles changed
website/.vitepress/theme/components/Mermaid.vue— new lazy-loading component (~40 lines)website/.vitepress/theme/index.ts— async component registration viaenhanceAppwebsite/.vitepress/config.ts— markdown-it fence transform for```mermaidblocks, alias commentwebsite/package.json— addmermaid ~11.16.0, no plugin dependencyTest plan
docs/ADRs/0002-initial-fullsend-design(two flowcharts)Assisted-by: Claude