v2.0.0 — Native everywhere
MermaidKit now renders natively on five platforms — macOS/iOS, Linux, Android, Windows/.NET, and WebAssembly — from one Swift layout core. The Swift package's public API is additive (no breaking changes); the major bump marks the platform expansion. Android, Windows, and .NET ship as their own 0.1.0 artifacts.
Native everywhere
-
Android — the
android/Gradle module renders all 30 types with a KotlinCanvas. ASceneWiremodel +SceneRenderer, a JNI bridge (MermaidNativeover a per-ABIlibmermaidkit.so), the device measure seam (Paint.measureTextthrough JNI), Material theming (MermaidTheme.fromMaterial), a ComposeMermaidDiagram+ classicMermaidView,contentDescriptionfrom the narration, and a stripped multi-ABI AAR — verified on an android-34 emulator in CI.MermaidDiagram("flowchart LR\n A[Start] --> B[End]", Modifier.fillMaxWidth())
-
Windows / .NET — the
windows/library renders with SkiaSharp (real Skia, a fidelity match for Android; no SVG fallback): aSceneWiremodel, aSceneRendereroverSKCanvas, and a P/Invoke bridge (MermaidNativeover a Swift-builtMermaidKitCShared.dll). Gated onwindows-latest.var scene = MermaidNative.Scene("flowchart LR\n A[Start] --> B[End]"); new SceneRenderer().Draw(scene, canvas);
-
WebAssembly — the platform-free core compiles to
wasm32-unknown-wasiand emits SVG (or a Canvas2D scene) in the browser.
Proven byte-identical
A conformance harness + CI gate run the same fixtures through the core on all five platforms and assert one signature. Reaching byte-identity caught and fixed two real cross-platform determinism bugs — a Double→JSON formatting difference between Foundation implementations (fixed via 1/256-grid coordinate quantization), and a ceil that amplified a 1-ULP sin/cos difference in pie tessellation.
C ABI additions
mmk_scene_json_themed + ThemeWire (theme a scene with caller colors); a dynamic MermaidKitCShared product (the Windows DLL); WASI/Bionic portability guards.
Full detail in CHANGELOG.md and the platform notes under docs/notes/.