Skip to content

feat: svg optimizer#16333

Merged
Princesseuh merged 9 commits intomainfrom
feat/svg-optimizer
Apr 29, 2026
Merged

feat: svg optimizer#16333
Princesseuh merged 9 commits intomainfrom
feat/svg-optimizer

Conversation

@florian-lefebvre
Copy link
Copy Markdown
Member

@florian-lefebvre florian-lefebvre commented Apr 15, 2026

Changes

  • Updates how svg optimization works
  • Instead of having svgo directly in our config types, there's a new SvgOptimizer interface with a built-in svgoOptimizer() implementation. This is partly motivated by the nightmare that was the zod 3 to 4 update
  • This makes it easier to make changes to the API and also allows using other services, for example https://github.com/noahbald/oxvg

Testing

  • New type test
  • Updated test fixture
  • Manual check

Docs

@florian-lefebvre florian-lefebvre self-assigned this Apr 15, 2026
@github-actions github-actions Bot added pkg: astro Related to the core `astro` package (scope) docs pr labels Apr 15, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: 52d4201

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the semver: minor Change triggers a `minor` release label Apr 15, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 15, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing feat/svg-optimizer (52d4201) with main (a49637a)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (631eada) during the generation of this report, so a49637a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@florian-lefebvre florian-lefebvre marked this pull request as ready for review April 15, 2026 08:43
@Princesseuh Princesseuh added this to the 6.2 milestone Apr 15, 2026
Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

I thought we had an RFC, but we don't. Code looks good!

Comment thread packages/astro/src/assets/svg/svgo.ts Outdated
Copy link
Copy Markdown
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

One small comma nit but LGTM!

Comment thread .changeset/twelve-times-slide.md Outdated
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

e18e dependency analysis

No dependency warnings found.

@Princesseuh Princesseuh merged commit 0f7c3c8 into main Apr 29, 2026
22 of 28 checks passed
@Princesseuh Princesseuh deleted the feat/svg-optimizer branch April 29, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants