{"slug": "brookmd-streaming-markdown-renderer-in-rust-web-rn-swift-and-more", "title": "Brookmd – streaming Markdown renderer in Rust (web, RN, Swift and more)", "summary": "Brookmd, a streaming Markdown renderer built with a single Rust core, has been released for web, React Native, Swift, and Kotlin platforms. The engine uses incremental parsing with speculative closure for mid-stream constructs and stable block identities to avoid re-reconciling unchanged blocks, compiling to WASM for the web and native libraries for mobile and desktop. It is 100% CommonMark 0.31 + GFM compliant and emits a versioned JSON wire format byte-for-byte across all boundaries.", "body_md": "**Streaming markdown for every platform.** One Rust core — incremental parse\nwith speculative closure for mid-stream constructs, stable block identities so\nunchanged blocks never re-reconcile — compiled to WASM for the web and to\nnative libraries for mobile and desktop. Every boundary emits the same\nversioned JSON wire, byte-for-byte. 100% CommonMark 0.31 + GFM.\n\nIn the browser, wire each LLM stream to a `BrookClient`\n\nand the markdown\nrenders incrementally **off the main thread**, block by block — so many\nconcurrent streams render without melting the UI thread.\n\n** Live demo** ·\n\n**·**\n\n[Full docs & API →](/siinghd/brookmd/blob/main/packages/brookmd/README.md)\n\n[Changelog](/siinghd/brookmd/blob/main/packages/brookmd/CHANGELOG.md)\n\n```\nnpm i brookmd\njs\nimport { BrookMarkdown } from \"brookmd/react\";\n\n// `stream` is an AsyncIterable<string> (SSE deltas), a Response, or a ReadableStream\n<BrookMarkdown stream={stream} />;\n```\n\n**Off the main thread**— a pooled Web Worker per stream; the parser re-parses only the active tail on each token, patches cross the worker boundary as verified splices (emitted bytes stay O(n) even for one giant growing block — wire delta mode, contract v1.2.0), and heavy renderers (highlighting, math, mermaid) defer until a block closes.**SSR-safe**— imports and`renderToString`\n\ncleanly on the server across React, Vue, Solid, and Svelte; the worker is created lazily on the client.**Structured**`block.data`\n\nchannel*(opt-in, default off)*— tables, headings, code, math, and lists are exposed as**typed, streaming data** on`block.kind.data`\n\n, so you build toolbars (sort/filter/CSV), tables of contents, charts, and copy buttons from data — no HTML re-parsing, no AST tree to walk.**Renderers for every stack**— React, Vue 3, Svelte (4 & 5), Solid, a framework-agnostic`<brook-markdown>`\n\nWeb Component, and a vanilla DOM mount on the web; a React Native renderer and Swift/Kotlin/Flutter bindings over the native core (experimental — see[Platforms](#platforms)).**Zero runtime dependencies.** The whole engine is one WASM binary plus a small TypeScript client.\n\nSee the ** package README** for the full API,\nper-stream config, framework bindings, security model, and scaling helpers\n(\n\n`virtualize`\n\n, `stickToBottom`\n\n).| Path | What |\n|---|---|\n`packages/brookmd` |\n\n`crates/brookmd-core`\n\n[crates.io](https://crates.io/crates/brookmd-core); compiled to WASM for the npm package. Emits the versioned JSON[wire contract](/siinghd/brookmd/blob/main/crates/brookmd-core/WIRE.md).`crates/brookmd-ffi`\n\n`crates/brookmd-cabi`\n\n`packages/brookmd-react-native`\n\n[(experimental).](https://www.npmjs.com/package/brookmd-react-native)`brookmd-react-native`\n\n`packages/brookmd-flutter`\n\n`bindings/kotlin`\n\n`bindings/swift`\n\n`web`\n\n[md.hsingh.app](https://md.hsingh.app/)).The same Rust core streams the same versioned JSON wire\n([WIRE.md](/siinghd/brookmd/blob/main/crates/brookmd-core/WIRE.md)) across every boundary; golden tests\npin every binding to byte-identical output.\n\n| Platform | Use | Status |\n|---|---|---|\n| Browser / Node / SSR |\n`brookmd` |\n\n**Stable**— published[on crates.io](https://crates.io/crates/brookmd-core)`brookmd-core`\n\n**Stable**— published[on npm — native parser via JSI, RN renderer](https://www.npmjs.com/package/brookmd-react-native)`brookmd-react-native`\n\n[— SPM package](/siinghd/brookmd/blob/main/bindings/swift)`bindings/swift`\n\n`BrookMd`\n\nover an XCFramework[— Android library + uniffi bindings](/siinghd/brookmd/blob/main/bindings/kotlin)`bindings/kotlin`\n\n[over the C ABI](/siinghd/brookmd/blob/main/packages/brookmd-flutter)`packages/brookmd-flutter`\n\n[+](/siinghd/brookmd/blob/main/crates/brookmd-cabi)`crates/brookmd-cabi`\n\n`include/brook_md.h`\n\nSwift/Kotlin/C-ABI bindings ship prebuilt from CI as checksummed\n[release assets](https://github.com/siinghd/brookmd/releases) (Android `.so`\n\nper ABI, Apple XCFrameworks with iOS + macOS slices); the React Native package\nvendors its binaries in the npm tarball.\n\n```\nbun install\nbun run build:wasm        # compile the Rust core → WASM\ncd packages/brookmd && bun test\n```\n\nCI enforces the CommonMark 652/652 + GFM conformance floors, the JS test suite, a fresh-process SSR cold-import check, and that the published tarball ships the WASM.", "url": "https://wpnews.pro/news/brookmd-streaming-markdown-renderer-in-rust-web-rn-swift-and-more", "canonical_source": "https://github.com/siinghd/brookmd", "published_at": "2026-07-21 21:41:10+00:00", "updated_at": "2026-07-21 21:52:26.929539+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence"], "entities": ["Brookmd", "Rust", "WASM", "CommonMark", "GFM"], "alternates": {"html": "https://wpnews.pro/news/brookmd-streaming-markdown-renderer-in-rust-web-rn-swift-and-more", "markdown": "https://wpnews.pro/news/brookmd-streaming-markdown-renderer-in-rust-web-rn-swift-and-more.md", "text": "https://wpnews.pro/news/brookmd-streaming-markdown-renderer-in-rust-web-rn-swift-and-more.txt", "jsonld": "https://wpnews.pro/news/brookmd-streaming-markdown-renderer-in-rust-web-rn-swift-and-more.jsonld"}}