Skip to content

Remove SVG export option from visual designer#19302

Merged
shenglol merged 1 commit intomainfrom
shenglol/remove-svg-export
Mar 30, 2026
Merged

Remove SVG export option from visual designer#19302
shenglol merged 1 commit intomainfrom
shenglol/remove-svg-export

Conversation

@shenglol
Copy link
Copy Markdown
Contributor

@shenglol shenglol commented Mar 30, 2026

The html-to-image library relies on foreignObject for SVG export, which largely defeats the purpose of using SVG. This PR removes SVG export support altogether

Changes

  • Remove svg from ExportFormat type (now png | jpeg)
  • Remove SVG from the format dropdown in ExportToolbar
  • Remove toSvg import and the svg capture case
  • Remove ~270 lines of SVG post-processing helpers
  • Remove svg entries from FORMAT_MIME / FORMAT_DESC

The html-to-image library uses ForeignObjects for SVG export, which
produces low-quality output, and the SVG cleaner has known bugs.

- Remove 'svg' from ExportFormat type
- Remove SVG from the format dropdown
- Remove toSvg import and SVG capture/clean code
- Remove ~270 lines of SVG post-processing helpers
@shenglol shenglol enabled auto-merge (squash) March 30, 2026 17:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Test this change out locally with the following install scripts (Action run 23765883933)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 23765883933
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 23765883933"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 23765883933
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 23765883933"

/* ------------------------------------------------------------------ */

const FORMATS: ExportFormat[] = ["svg", "png", "jpeg"];
const FORMATS: ExportFormat[] = ["png", "jpeg"];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would vote for "png" and "png (no background)", rather than giving "jpg" as an option.

Jpg is a lossy format, and IMO isn't as relevant today for non-photograph content - compression doesn't matter so much, browser/OS support is good for png.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. I was planning to put this in a separate PR since it requires some UI design changes for the export toolbar.

@shenglol shenglol merged commit 91c56b3 into main Mar 30, 2026
79 of 81 checks passed
@shenglol shenglol deleted the shenglol/remove-svg-export branch March 30, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants