Replace Rough.js sketch runtime with rough-go - #2821
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github.com/d2lang/rough-goportd2renderers/d2sketch/rough.js,setup.js, their embedded loader, and the sketch-pathJSRunnerUses d2lang/rough-go#1, merged and tagged
v0.1.0.Compatibility
The dependency is pinned to:
github.com/d2lang/rough-go v0.1.0There is no local
replace.All 38 focused sketch SVG fixtures remain byte-for-byte unchanged, and the full D2 E2E suite passes with its existing board and SVG goldens. The Rough sketch path no longer loads or evaluates JavaScript in native or WASM builds; unrelated JavaScript consumers elsewhere in D2 are unchanged.
The branch is reconciled with current
master, including the native elk-go migration, and the combined ELK + Rough E2E corpus passes.Tests
GOWORK=off go test -race ./d2renderers/d2sketch ./d2renderers/d2svg -count=1GOWORK=off go test ./d2layouts/d2elklayout -count=1GOWORK=off go test ./e2etests -run '^TestE2E$' -count=1GOWORK=off go vet ./d2renderers/d2sketch ./d2renderers/d2svg ./d2layouts/d2elklayout ./d2pluginGOWORK=off GOOS=js GOARCH=wasm go build ./d2jsA repository-wide
go test ./...run passes all relevant packages but still reports the two environment-dependent GIF conversion failuresone-layer-gifandhow_to_solve_problems_gif; both reproduce unchanged on currentmaster.