Skip to content

release: v2.0.0 — native renderer, no Chrome dependency#1

Merged
mrslbt merged 1 commit into
mainfrom
v2-native-renderer
Jun 6, 2026
Merged

release: v2.0.0 — native renderer, no Chrome dependency#1
mrslbt merged 1 commit into
mainfrom
v2-native-renderer

Conversation

@mrslbt

@mrslbt mrslbt commented Jun 6, 2026

Copy link
Copy Markdown
Owner

pdf-it 2.0.0

Production-grade rewrite. Same design language, entirely new render stack.

Breaking changes

  • Chrome is no longer required. Removed puppeteer-core, pdf-lib, markdown-it, and the CHROME_PATH env var.
  • Node ≥ 20 required (was ≥ 18). React 19 + TypeScript 6 baseline.

Renderer

Markdown → remark/mdast AST → typed React components → PDF via @react-pdf/renderer, in a single deterministic pass. No external runtime, no font CDN at render time, no post-render PDF mutation.

Typography

Ships 5 baked Newsreader instances (Display 60 Light, Display 32 Regular, Text Regular/Medium/Italic) + JetBrains Mono + DM Sans inside the package. Variable-font opsz axis baked into static instances because Font.register can't express font-variation-settings. Every PDF renders identically on every machine.

Design system

  • src/templates/design-tokens.ts — single source of truth for colors, type sizes, leadings, cover positioning.
  • Components: Cover, TOC, Footer, body primitives (H1/H2/H3, P, Strong/Em, A, InlineCode, CodeBlock, Blockquote, lists, HR, Table), and the first chart primitive HorizontalBarChart.

MCP polish

  • Tool annotations on the wire (readOnlyHint, destructiveHint, idempotentHint, openWorldHint, title) for both tools.
  • MCP resources (style-guide, markdown-cheatsheet) refreshed to describe v2 reality.
  • server.json + smithery.yaml + glama.json version-bumped and registry-ready.

Project identity

  • assets/icon.png — a Newsreader Display 60 Light capital P. The icon and the cover title share an alphabet.
  • AGENTS.md — agent-readable project contract.

Verification

  • tsc clean (strict), boots as pdf-it v2.0.0, tools/list carries annotations.
  • End-to-end generate_pdf writes valid PDFs with embedded fonts, TOC anchors, and Title/Author metadata.
  • Edge cases pass: tilde-path expansion, no-title cover, plain template, empty/bogus input error gracefully.
  • npm pack: 64 files, ~750 KB, no dev preview scripts shipped.
  • CI: clean-build + MCP smoke test (boot → tools/list → generate_pdf → size assertion).

🤖 Generated with Claude Code

BREAKING CHANGES
- Chrome is no longer required. Removed puppeteer-core, pdf-lib, markdown-it
  and the CHROME_PATH env var.
- Node ≥ 20 required (was ≥ 18). React 19 + TypeScript 6 baseline.

Renderer
- Replaces Puppeteer + Chrome printing with @react-pdf/renderer. Markdown →
  remark/mdast AST → typed React components → PDF in a single deterministic
  pass. No external runtime, no font CDN at render time, no post-render PDF
  mutation.

Typography
- Ships 5 baked instances of Newsreader (Display 60 Light, Display 32 Regular,
  Text Regular/Medium/Italic) + JetBrains Mono + DM Sans inside dist/.
  Variable-font opsz axis is baked into static instances because
  @react-pdf/renderer's Font.register cannot express font-variation-settings.
- Every PDF renders identically on every machine.

Design system
- New src/templates/design-tokens.ts is the single source of truth for
  colors, type sizes, leadings, and cover positioning ratios. Every
  component reads from it; no eyeballed values anywhere.
- Component architecture: Cover, TOC, Footer, body primitives
  (H1/H2/H3, P, Strong/Em, A, InlineCode, CodeBlock, Blockquote,
  UL/OL, HR, Table), and the first chart primitive HorizontalBarChart.

MCP polish
- Tool annotations on the wire: readOnlyHint, destructiveHint,
  idempotentHint, openWorldHint, and human-readable title for both
  generate_pdf and list_templates.
- server.json + smithery.yaml + glama.json all version-bumped and
  registry-ready.

Project identity
- Adds assets/icon.png (256/512, transparent + paper-white variants).
  The mark is a Newsreader Display 60 Light capital P — the same font
  and weight as the cover title. The icon and the artifact share an
  alphabet.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mrslbt mrslbt merged commit bc7bee0 into main Jun 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant