Skip to content

d2sketch: upgrade to Rough.js 4.6.6 - #2845

Merged
alixander merged 2 commits into
masterfrom
agent/rough-4.6.6-d2-integration
Aug 12, 2026
Merged

d2sketch: upgrade to Rough.js 4.6.6#2845
alixander merged 2 commits into
masterfrom
agent/rough-4.6.6-d2-integration

Conversation

@alixander

@alixander alixander commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Depends on: d2lang/rough-go#2

Summary

  • upgrade D2 sketch rendering from the Rough.js 4.0.4-compatible native port to the D2-used Rough.js 4.6.6 surface
  • update Rough.js, hachure-fill, and path-data-parser attribution and notices
  • accept the deterministic seeded sketch-path changes from Rough.js 4.6.6

Compatibility

This changes seeded sketch SVG path data. It does not change diagram layout, board JSON, IDs, text, style semantics, or the non-sketch renderer.

The accepted update contains 40 SVGs: 33 focused d2sketch fixtures, 6 E2E fixtures, and 1 CLI fixture. Thirty-six keep identical SVG structure and path counts while updating only path data. The other four are the light/dark arrowhead and crow's-foot matrices, where current Rough.js emits fewer internal paths for filled markers; visual review confirms the rendered markers remain intact.

The dependency is the signed rough-go v0.2.0 release, which targets the merged native-port PR exactly.

Validation

  • official Rough.js 4.6.6 npm oracle: 1,000 randomized D2-profile calls
  • every rough-generated path in D2's focused sketch suite matches official Rough.js 4.6.6 after D2 serialization
  • CI=1 go test -mod=readonly --timeout=30m -count=1 ./...
  • focused go test -race, full go vet, native build, and Go WASM build
  • D2.js build plus 39 Bun unit tests and 2 CJS/ESM integration tests
  • all 40 accepted SVGs parse and contain no NaN/Inf output

@alixander
alixander marked this pull request as ready for review August 12, 2026 04:39
@alixander
alixander merged commit a0cb0de into master Aug 12, 2026
6 checks passed
@alixander
alixander deleted the agent/rough-4.6.6-d2-integration branch August 12, 2026 04:44
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