Skip to content

Consider replacing Playwright with chromedp #2865

Closed

Description

@alixander

D2 only uses a narrow slice of Playwright to drive Chromium for PNG/GIF/PDF/PPTX. We should probably replace it with chromedp and use an installed Chrome-family browser (proposed minimum: Chromium 132), while keeping SVG browser-free.

Why:

  • Remove the Node/Playwright driver and browser-download lifecycle, including CDN/module failures.
  • Keep D2 a pure-Go, no-cgo binary and reuse an installed browser.
  • A spike found static and animated output parity when both paths used the same Chrome.

Important tradeoffs:

  • Browserless systems must install Chromium; official Docker/CI must provision and pin it on amd64 and arm64.
  • Raster bytes and performance may vary by browser version, so reproducible CI must use an exact browser version.
  • chromedp is lower-level, so D2 must own and test focus, animation, readiness, screenshots, and lifecycle behavior.

Related: #2502, #2776, #2783, #496, #1930.

Before deciding, complete browser discovery/version UX, representative parity tests, and a pinned multi-architecture Docker path.

Activity

  1. added
    cli
    improvement
    on Aug 28, 2026
  2. alixander commented on Sep 3, 2026

    @alixander
    CollaboratorAuthor

    Closing as resolved by #2868: D2 no longer uses Playwright or Chromium for PNG, GIF, PDF, or PPTX rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliimprovement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions