markstream-vue Streams LLM Markdown in Vue Without Flicker
The author, maintainer of the markstream-vue library, describes how rendering LLM token streams with conventional Markdown renderers causes flicker, scroll jumps, and delayed diagrams. Typical renderers assume complete documents, so re-parsing partial Markdown on every token is costly and error-prone. markstream-vue treats incomplete syntax as a normal state and offers a virtual window mode for long content and an incremental mode for actively growing chat messages. Mermaid and KaTeX are optional peers that can render as soon as their syntax completes, and a final prop tells the renderer when the stream has ended so it can reparse. The post also covers pre-parsing Markdown into typed nodes on the server or in a worker.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in