Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to svgo v3 #10

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Upgrade to svgo v3 #10

merged 1 commit into from
Jan 16, 2024

Conversation

SethFalco
Copy link
Contributor

@SethFalco SethFalco commented Nov 22, 2023

Hey! I'm trying to get all libraries/client that use SVGO upgraded to the latest release, which has many bug fixes.

Consider checking out the changelog of the last two releases:
https://github.com/svg/svgo/releases

This migrates OhMySVG from SVGO v2 to SVGO v3, I've tried to take an approach similar to SVGOMG where I can.

Changes

  • Added instructions to contribute from Debian/Ubuntu.
  • Added a warning that building may fail in a sandboxed environment. (I wasn't able to run make test in VSC installed via snap, I had to open a normal terminal instance.)
  • Incremented the version to 1.4. (I did not update the changelog.)
  • Upgraded from SVGO v2.8.0 to v3.
  • Rename cleanupIDs to cleanupIds, renamed in SVGO v3.
  • Move sort* plugins to the end of the list, as these work best when run last.
    • I have not addressed this, but it looks to me like the order of the set changes as the user enables/disabled plugins. This isn't ideal because the order of the plugins matters!
  • Added the two new plugins (disabled by default) to the list, convertOneStopGradients and removeXlink.
  • Drops debug log for height/width, as SVGO no longer returns this in the result.

@SethFalco SethFalco changed the title deps: upgrade to svgo v3.0.4 deps: upgrade to svgo v3.0.5 Dec 1, 2023
@SethFalco SethFalco force-pushed the deps/svgov3 branch 2 times, most recently from fdc1742 to dd7e417 Compare January 13, 2024 23:00
@SethFalco SethFalco changed the title deps: upgrade to svgo v3.0.5 deps: upgrade to svgo v3 Jan 13, 2024
@sonnyp sonnyp changed the title deps: upgrade to svgo v3 Upgrade to svgo v3 Jan 15, 2024
Copy link
Owner

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

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

Looks great thank you

{
id: "removeDoctype",
name: "Remove doctype",
enabledByDefault: true
Copy link
Owner

Choose a reason for hiding this comment

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

can we use this file from svgo instead directly ?

https://github.com/jakearchibald/svgomg/blob/main/src/config.json

Copy link
Contributor Author

@SethFalco SethFalco Jan 15, 2024

Choose a reason for hiding this comment

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

We currently don't have a file like that, nor export enough for clients to derive it programmatically, I don't think.

(Note that your link is to SVGOMG, not SVGO!)

It is possible to get a list of all plugins, which includes the default preset (preset-default), but from there, not which plugins are the default nor a clean name for them that can be displayed in the UI.

Following the discussion in jakearchibald/svgomg#431, we're already evaluating what would be best to expose this kind of information so it's easier for clients.

If you're cool with it, I'll come back to you with another PR later once we have something in place and help with migrating. 👍🏽

@sonnyp
Copy link
Owner

sonnyp commented Jan 15, 2024

Feel free to add your name to contributors in about.js

@sonnyp sonnyp merged commit 654ec60 into sonnyp:main Jan 16, 2024
@SethFalco SethFalco deleted the deps/svgov3 branch January 16, 2024 10:24
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