perf(markdown): rewrite rendering on marked + Shiki + morphdom
Replace the react-markdown/Prism component tree with an HTML-string pipeline (marked -> KaTeX -> Shiki -> DOMPurify -> DOM decorators) patched into the DOM via morphdom, with per-block reconciliation and a paced streaming reveal. Cuts streaming CPU versus the previous renderer while preserving file-reference links, mermaid diagrams, table export, and agent/skill/favicon link handling. Public MarkdownRenderer/ SimpleMarkdownRenderer props are unchanged (drop-in).
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { lazyWithChunkRecovery } from '@/lib/chunkLoadRecovery';
|
||||
|
||||
// Thin lazy wrapper around the heavy MarkdownRenderer implementation.
|
||||
// The full implementation (marked, react-markdown, beautiful-mermaid,
|
||||
// react-syntax-highlighter, etc.) is loaded on demand, keeping the
|
||||
// Thin lazy wrapper around the MarkdownRenderer implementation.
|
||||
// The full implementation (marked + Shiki highlighting + KaTeX + morphdom
|
||||
// DOM morphing, plus beautiful-mermaid) is loaded on demand, keeping the
|
||||
// initial bundle lean.
|
||||
|
||||
export type { MarkdownVariant } from './MarkdownRendererImpl';
|
||||
|
||||
Reference in New Issue
Block a user