streamdown@2.0.0
vercel/streamdownstreamdown@2.0.0Jan 12, 2026
AI Summary
This is a major 2.0.0 release that dramatically reduces bundle size by 98% through the new Streamdown CDN. It includes significant Mermaid rendering performance optimizations using viewport-based lazy loading to prevent page freezing with multiple diagrams, along with support for self-hosted CDN and various bug fixes.
Key Highlights
- 98% bundle size reduction with new Streamdown CDN
- Mermaid rendering optimization with viewport-based lazy loading (useDeferredRender hook + Intersection Observer)
- Support for self-hosted CDN
- Fix for code block line numbers over 100 wrapping incorrectly
- Shadow DOM compatibility improvements
New Features
- Streamdown CDN for optimized asset delivery
- Self-hosted CDN support
- Caret support in markdown
- useDeferredRender hook for lazy loading components when entering viewport
- Dynamic language loading improvements
- KaTeX CSS loading from CDN
- Rehype sanitize for security
Full Release Notes
### Major Changes
- 75faa2e: Reduce bundle size by 98%, create Streamdown CDN
### Minor Changes
- 13b91d8: Add support for carets
### Patch Changes
- 104798e: Make remend configurable
- 23f2a40: Attempt to fallback to raw to prevent cdn-loader blocking
- 133c6c8: Load KaTeX CSS from CDN
- 0c830f5: Fix Mermaid pan/zoom controls layout issues in fullscreen and non-fullscreen modes
- 68109f2: Fix setext heading issues
- 2c32b2e: Fix shouldParseIncompleteMarkdown leaking to DOM
- ee12ec8: Add support for self-hosted CDN
- 5653400: Fix loading langs dynamically
- 1b898b0: Fix dynamic module imports
- 6a7dc7c: Optimize Mermaid rendering performance with viewport-based lazy loading
- Add useDeferredRender hook for lazy loading components when entering viewport
- Use Intersection Observer + debounce + requestIdleCallback for optimal performance
- Only render Mermaid charts when they are visible or about to enter viewport
- Prevents page freezing when loading chat history with many Mermaid diagrams
- Fixes white screen issue when scrolling through chat messages with multiple diagrams
- 8d8d67f: Add rehype sanitize
- 271265c: Fix list indentation
- 8157e80: Fix fullscreen mermaid
- 91b425f: Refactor click outside handler for Shadow DOM compatibility
- 16df4a4: Fix KaTeX parsing
- 6bd211d: Update rehype-harden to fix relative URLs
- 48c9c51: Fix autolink parsing to stop at CJK punctuation boundaries.
- d1635f0: Fix bug: Code block line numbers over 100 wrap and start new line
- Updated dependencies [104798e]
- Updated dependencies [6769e7a]
- Updated dependencies [217b128]
- Updated dependencies [68109f2]
- Updated dependencies [e0ee74e]
- Updated dependencies [45f0f4d]
- Updated dependencies [b8c8c79]
- Updated dependencies [68f29c0]
- Updated dependencies [e7eca51]
- Updated dependencies [d708864]
- remend@1.0.2