What's Changed
Dependencies
- Sets minimum version of sax (XML parser) to v1.5.0, which improves built-in guards against entity expansion.
Bug Fixes
- removeEmptyContainers, removed leftover
<use>elements referencing an empty container that was removed. By @johnkenny54 in #2051 - removeUnknownsAndDefaults, don't remove attributes if they're referenced in attribute selectors (CSS). By @SethFalco in #2144
Performance
- convertPathData, refactor to reduce redundant equality checks. By @Lorfdail in #1764 and #2135
- removeHiddenElems, compute styles lazily. By @Lorfdail in #1764 and #2135
Other Changes
- Plugins no longer include if they are enabled or disabled by default, as this was written inconsistently. The
--show-pluginsargument appends the presets a plugin is in to the end of the line. By @viralcodex in #2174 - Plugin/preset types to enforce the name start with
preset-if it is a preset (collection of plugins). By @SethFalco in #2178
Metrics
Before and after of the browser bundle of each respective version:
| v4.0.0 | v4.0.1 | Delta | |
|---|---|---|---|
| svgo.browser.js | 780.2 kB | 781.5 kB | ⬆️ 1.3 kB |