Skip to content

Update svgo dependency to v4 - #64

Merged
rpominov merged 3 commits into
svg:mainfrom
askoufis:main
Mar 26, 2026
Merged

rpominov merged 3 commits into
svg:mainfrom
askoufis:main

Conversation

@askoufis

@askoufis askoufis commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor
  • Updated the svgo dep to v4. AFAICT no changes are necessary within the loader.
  • Added prettier to make code formatting consistent across all files
  • Updated CI node versions
  • Updated the webpack-cli dep

The only files that have more than just formatting changes are:

  • .github/workflows/ci.yaml
  • index.test.js
  • package.json

Seems like a straightfoward update to me, though will obviously be breaking as svgo@4 had various breaking changes.

I updated CI to use Node 22 and 24, mainly because it allowed me to use the Node fileSnapshot API, which is convenient because updating asserts manually was proving to be a pain. I don't see that much value testing against older node versions as svgo's supported version(s) will ultimately dictate what this loader can support too.

name: 'preset-default',
params: {
overrides: {
removeTitle: false,

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.

removeTitle is now disabled by default.

Comment thread index.test.js
path.join(__dirname, 'example', 'external-config', 'dist', 'SVG_logo.svg'),
'utf8',
);
t.assert.fileSnapshot(output, 'snapshots/external-config.svg', {

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.

File snapshots allow you to see proper syntax highlighting in a real file, simplify the testing process (if you ever need to update snapshots), and facilitate both visual and syntax diffing in GitHub.

@rpominov

rpominov commented Mar 26, 2026 •

Copy link
Copy Markdown
Member

Thank you for the work! Looks good! Will release a new version to NPM soon

@rpominov
rpominov merged commit b19bea5 into svg:main Mar 26, 2026
2 checks passed
@askoufis

askoufis commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@rpominov Thanks for the quick turnaround ❤️

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.

2 participants