ADR-0012: ADR: Replace archived remark-kroki-plugin dependency
This ADR is automatically copied from docs/adr/0012-integrate-remark-kroki-plugin.md in the repository.
Edit the source file to update this page.
Status
Pending
Context
The remark-kroki-a11y plugin currently wraps remark-kroki-plugin to add accessibility features (source code display, natural language descriptions) to Kroki-generated diagrams. However, remark-kroki-plugin has been archived by its owner:
- Repository: https://github.com/atooni/remark-kroki-plugin
- Archived: December 7, 2024 (read-only)
- Last npm publish: v0.1.1, over a year ago
- Dependencies: Uses outdated
remark@^13.0.0 - Open issues: 2 unresolved bugs
- Forks: 3, none actively maintained
This creates problems:
- MDX 2/3 compatibility: The plugin generates
rawHTML nodes that requirerehype-rawwith special configuration in Docusaurus 3 - No bug fixes: Open issues will never be addressed upstream
- Complex setup: Users must configure multiple plugins in correct order
- Security risk: No security updates for archived dependency
Code assessment
The remark-kroki-plugin codebase is small and manageable:
- ~130 lines of TypeScript core logic
- Dependencies:
ts-md5,unist-util-visit,node-fetch - Simple architecture: visits code blocks, POSTs to Kroki API, caches SVGs locally
Options
Option A: Integrate remark-kroki-plugin code
Fork and integrate the remark-kroki-plugin code directly into remark-kroki-a11y.
Pros:
- Full control over the codebase
- Can fix MDX 2/3 compatibility issues properly
- Can address the 2 open bugs
- Simpler installation for users (one plugin instead of two)
- No dependency on archived project
- Can optimize for our specific use case
Cons:
- Maintenance burden for Kroki API integration
- Need to keep up with Kroki service changes
- ~130 lines of additional code to maintain
Option B: Keep wrapping remark-kroki-plugin
Continue using remark-kroki-plugin as an external dependency.
Pros:
- Less code to maintain
- No immediate work required
Cons:
- Technical debt accumulates
- Dependency on dead project
- Complex user setup with
rehype-rawworkaround - Cannot fix upstream bugs
- Risk of future incompatibilities
Option C: Switch to remark-kroki (show-docs)
Switch to the actively maintained remark-kroki package.
Package info:
- Repository: https://github.com/show-docs/remark-kroki
- npm:
remark-krokiv0.3.8 (published Oct 2025) - Stars: 34 | Forks: 4 | Contributors: 2
- Last update: Added MDX 3.0 support
- Dependencies: Modern (
unist-util-visit@^5,node-fetch@^3)
Features:
- Multiple output formats: inline SVG, base64-encoded images, HTML object tags
- Docusaurus v2 and v3 compatible
- MDX 3.0 support built-in
- Customizable Kroki server configuration
- Language alias support
Pros:
- Actively maintained with recent MDX 3.0 support
- Modern dependencies (no outdated remark@13)
- No
rehype-rawworkaround needed (supports MDX3 target) - Drop-in replacement potential
- Community maintained
Cons:
- Different API - requires adapter work in remark-kroki-a11y
- Less control than full integration (Option A)
- Still external dependency (though healthy one)
- Need to verify compatibility with our a11y wrapper approach
Decision
Status: Pending - requires further evaluation
Option C (switch to remark-kroki) has emerged as a strong candidate:
- Actively maintained with MDX 3.0 support already built-in
- Modern dependencies, no
rehype-rawworkaround needed - Less maintenance burden than Option A
- Healthier community than archived Option B
However, Option A (integrate) still has merit if:
- We need deep customization for a11y features
- The remark-kroki API doesn't fit our wrapper pattern
- We want full control over the Kroki integration
Next step: Prototype Option C to verify compatibility with our a11y wrapper approach.
Consequences
If Option A is chosen:
- Major version bump required (breaking change to API)
- Need to document migration path for existing users
- Can provide unified configuration for both Kroki and a11y options
- Should consider making
rehype-rawrequirement explicit or automatic
Actions
- Evaluate
remark-kroki-plugincode in detail - Prototype integration
- Assess test coverage needs
- Make final decision
- If proceeding: implement, test, document migration
References
- GitHub Issue: https://github.com/bartvanderwal/remark-kroki-a11y/issues/17
- Archived upstream: https://github.com/atooni/remark-kroki-plugin
- Alternative: https://github.com/show-docs/remark-kroki
- Kroki API: https://kroki.io/
Date: 2026-02-09 Author: Bart van der Wal & Claude