Two things shipped together because they wanted each other.
blog.makespdf.com
The blog is now served from a dedicated subdomain with its own routing, while still living inside the same Cloudflare Worker as the rest of the app. Posts are markdown files in apps/web/content/blog/; each one is also available as a download-ready PDF rendered by the same engine that powers the public API.
@pdf/mermaid-render
The Mermaid → SVG pipeline was rewritten end-to-end. The old approach pulled in mermaid + linkedom (76.5 MB installed) and depended on a fake DOM; the new package is a clean parse → layout → render pipeline:
- Vendored jison parsers from Mermaid v11.12.2 produce typed ASTs.
- ELK.js computes graph layout for flowchart / class / state / ER.
- SVG XML is generated directly — no DOM, no shim.
- Single external dependency:
elkjs.
Result: 7.7 MB installed (down from 76.5 MB), SVG output ~80% smaller (3 KB vs 15 KB), deterministic, Workers-compatible. Supports all 8 Mermaid diagram types: flowchart (with subgraphs), sequence, class, state, gantt, pie, ER, gitgraph.