Repository navigation
MarkdownUI 2.5.0 — Single-Pass Layout, Theme.chat & 120 Hz Streaming
MarkdownUI 2.5.0 is an actively maintained, 100% source-compatible continuation of gonzalezreal/swift-markdown-ui (2.4.1) with single-pass native SwiftUI layout, zero post-mount scroll jumps, and 120 Hz AI/LLM token streaming.
1-Line Upgrade from 2.4.1
.package(url: "https://github.com/ripulio/swift-markdown-ui", from: "2.5.0")Keep import MarkdownUI — all existing Theme, BlockStyle, and TextStyle APIs work unchanged.
Highlights
- 3×–10× faster settled layout out of the box —
Theme.basic,Theme.gitHub, andTheme.docCnow use declarative block margins, headings, paragraphs, and list items, unlocking single-passDirectBlockSequenceView+ParagraphStackLayoutautomatically with pixel and height parity against upstream2.4.1(and automatic fallback for custom.markdownBlockStyle(...)closures). - Measured on iPhone 15 Pro Max (
400ptwidth) — Settled layout dropped from 28.9 ms → 4.6 ms on a rich AI reply, 22.8 ms → 3.5 ms on a 16-item bullet list, and 30.1 ms → 3.0 ms on a 15×3 GFM table. - New
Theme.chatpreset — Purpose-built for AI assistants and messaging UIs (Markdown(reply).markdownTheme(.chat)): compact single-pass prose, headered code cards, accented callout blockquotes, and viewport-aware horizontal-scrolling GFM tables (AdaptiveTableLayout+ shape-batched borders and alternating stripes). - Zero scroll jumps & upstream bug fixes — Eliminates
GeometryReader/PreferenceKeyheight corrections, fixes newline-heavy paragraph hangs (upstream#312), dropped whitespace after styled spans (#402), inline/mixed image rendering (#420/#439), and preserves streaming child view state via structuralmarkdownBlockPathidentity. - Interactive
Examples/BenchmarkApp— New iOS + macOS app with live latency runner, 120 Hz streaming simulator, and theme gallery. - DocC & CI modernized — Added
.spi.ymlfor Swift Package Index DocC hosting and updated GitHub Actions CI tomacos-15.