Skip to content

Flight Icons pipeline / Fix svgo package (Part 1 / Code)#3720

Open
didoo wants to merge 5 commits intomainfrom
fix-svgo__package
Open

Flight Icons pipeline / Fix svgo package (Part 1 / Code)#3720
didoo wants to merge 5 commits intomainfrom
fix-svgo__package

Conversation

@didoo
Copy link
Contributor

@didoo didoo commented Mar 18, 2026

📌 Summary

This is a follow up of #3718 where, after merging the PR in main, we have realized that the major upgrade of the svgo package caused issues.

In the previous code we had this comment:

Notice: we're using SVGO vs 1.3.2 instead of 2.x.x because the new version has a terrible API, the documentation is still missing and I couldn't set it up to work in a node script; since what it does is just optimize an SVG and the SVG format hasn't changed in years is safe to use this older version, nothing groundbreaking is lost.

And the package version was pinned to version 1.3.2 in the package.json file.

In #3718 the version was overwritten using the pnpm overrides, but it was a major bump (to 3.3.3) and this broke the optimizeAssetsSVG script because SVGO changed its APIs.

This PR intends to fix the problem, by upgrading SVGO to the latest version (4.0.1). To avoid too much noise in it, the re-generation of the files/assets will be done in a separate PR (using the "Sync & Build Icons" GitHub Action, so we test that that one works as well).

🛠️ Detailed description

In this PR I have:

  • upgraded SVGO dependency to 4.0.1 directly in the main package.json file of the flight-icons package (and removed the override introduced in Apply a set of overrides to address flagged secvuln #3718)
    • in the process, I have also upgraded @figma-export/transform-svg-with-svgo to its latest, to reduce the risk of possible conflicts
  • updated the SVGO instantiation/usage in the optimizeAssetsSVG script (partially using Copilot)

📸 Screenshots

Before:
screenshot_6032

After:
screenshot_6035


👀 Component checklist

  • Percy was checked for any visual regression

💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@didoo didoo requested a review from alex-ju March 18, 2026 14:22
@didoo didoo requested a review from a team as a code owner March 18, 2026 14:22
@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hds-showcase Ready Ready Preview Mar 18, 2026 5:27pm
hds-website Ready Ready Preview Mar 18, 2026 5:27pm

Request Review

alex-ju
alex-ju previously approved these changes Mar 18, 2026
Copy link
Member

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

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

Nice and clean! 🙌

// touches the borders of the bounding box. The solution is to uncheck the "Clip content" flag in the Figma UI for that element.
// See: https://forum.figma.com/t/setting-an-explicit-svg-viewbox/2504/7
const svgo = new SVGO({
const svgoConfig = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: in SVGO v4:

  • sortAttrs is part of preset-default
  • viewBox is preserved by default, so the removeViewBox override is now obsolete

didoo and others added 3 commits March 18, 2026 16:31
…son` file of the `flight-icons` package

before it was fixed in the pnpm overrides to `3.3.3` (see PR #3718)
Co-authored-by: didoo <686239+didoo@users.noreply.github.com>
Co-authored-by: Cristiano Rastelli <public@didoo.net>
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