While applying T328144: Drop PNG fallback for SVG icons / etc. across all Wikimedia products to the ArticleFeedbackv5 codebase we noticed (again) that a lot of the .svg files in the codebase contain extremely large <defs> sections with hundreds of gradients, masks, and filters. It looks like a copy of the entire Inkscape gradient library. This dead, unused code adds up to a total of 1.5 megabytes in only 14 files.
This is a problem because:
- These .svg files are actually used as background images in .css.
- Some of them are even marked as /* @embed */, which implies a ~33% increase in size when base64 encoded.
- Remove unused files → https://gerrit.wikimedia.org/r/922818
- Drop unused code → https://gerrit.wikimedia.org/r/922827
- Run SVGO on each .svg file
- Enforce SVGO via CI