Skip to content

MarkdownUI 2.5.0 — Single-Pass Layout, Theme.chat & 120 Hz Streaming

Choose a tag to compare

@peter-maude-new peter-maude-new released this 12 Nov 17:19
· 3 commits to ripul since this release

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, and Theme.docC now use declarative block margins, headings, paragraphs, and list items, unlocking single-pass DirectBlockSequenceView + ParagraphStackLayout automatically with pixel and height parity against upstream 2.4.1 (and automatic fallback for custom .markdownBlockStyle(...) closures).
  • Measured on iPhone 15 Pro Max (400pt width) — 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.chat preset — 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 / PreferenceKey height 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 structural markdownBlockPath identity.
  • Interactive Examples/BenchmarkApp — New iOS + macOS app with live latency runner, 120 Hz streaming simulator, and theme gallery.
  • DocC & CI modernized — Added .spi.yml for Swift Package Index DocC hosting and updated GitHub Actions CI to macos-15.