react-spring-bottom-sheet
react-spring-bottom-sheet copied to clipboard
chore(deps): update dependency svgo to v3
This PR contains the following updates:
Package | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|
svgo (source) | ^1.3.2 -> ^3.3.2 |
Release Notes
svg/svgo (svgo)
v3.3.2
Notice
An update on what happened with v3.3.0 and v3.3.1. While we have retained CJS support, the migration to EMS has changed the acceptable ways to import SVGO, in ways that users depended on before. This effectively made SVGO v3 a breaking change.
Rather than resolve or workaround these differences, we've opted to release SVGO v3.3.2, which is effectively a revert to v3.2.0, and deprecate versions v3.3.0 and v3.3.1. We'll then proceed to work on releasing v4 which will document the breaking changes, and feature further breaking changes that were slated for v4, like disabling removeViewBox
by default.
Before the v4.0.0 release, I'll put more focus on testing and use release candidates, just to help make the release go smoothly! 👍🏽
Sorry for the headache, and thanks for your patience.
v3.3.1
Notice
SVGO v3.3.0, which was meant to migrate to ESM without breaking CJS support, unfortunately broke CJS projects. There was a mistake with exports, so the loadConfig
function wasn't available in the CJS bundle and lead to issues for many users.
Thanks to everyone who raised the issue, and to @nuintun who submitted a pull request to resolve it so quickly.
I apologize for letting that breaking change through, and will aim to do better. Namely, by adding more tests to cover our exports, and any other public interface in general for each distribution of SVGO, so this doesn't happen again.
SVGO v3.3.1 should resolve the issue for CJS projects, but if you encounter anything else, do let us know by opening an issue on GitHub.
v3.3.0
Deprecated
This release introduced breaking changes, which have been reverted in v3.3.2. The bug fixes will be reintroduced in v4.0.0.
What's Changed
ESM
SVGO is now a dual package, serving for both Common JS and ESM usage. We believe there shouldn't be any problems, especially as SVGO as largely stateless, but feel free to open an issue if you encounter problems with this.
To be explicit, this is not a breaking change, and SVGO should continue to work in Common JS projects!
Thanks to @jdufresne for doing the bulk of the work.
Default Behavior
-
convertColors
, now converts all references to colors excluding references to IDs to lowercase. This can be disabled by settingconvertCase
tofalse
.
Bug Fixes
-
cleanupIds
, treat both URI encoded and non-URI encoded IDs as the same. By @liuweifeng in #1982 -
collapseGroups
, check styles as well as attributes. By @johnkenny54 in #1952 -
collapseGroups
, move attributes atomically. By @johnkenny54 in https://github.com/svg/svgo/pull/1930 -
convertPathData
, fix q control point when item is removed. By @KTibow in https://github.com/svg/svgo/pull/1927 -
convertPathData
, preserve vertex for markers only paths. By @SethFalco in #1967 -
mergePaths
, don't merge paths if attributes/styles depend depend on the nodes bounding box. By @johnkenny54 in #1964 -
moveElemsAttrsToGroups
, no longer moves the transforms if group has thefilter
attribute. By @johnkenny54 in #1933 -
prefixIds
, fixed issue where some IDs were not prefixed when style tag contained XML comments. By @john-neptune in #1942 -
removeHiddenElems
, don't remove node if child element has a referenced ID. By @johnkenny54 in https://github.com/svg/svgo/pull/1925 -
removeHiddenElems
, treatpath[opacity=0]
as a non-rendering node. By @johnkenny54 in #1948 -
removeUselessDefs
, don't remove node if child element has an ID. By @johnkenny54 in https://github.com/svg/svgo/pull/1923 - When stringifying path data, include a space before numbers represented in scientific notation. By @johnkenny54 in #1961
- No longer crashes when the output (
-o
argument) ends with a trailing slash to a location that didn't exist. By @SethFalco in #1954
SVG Optimization
-
convertColors
, introduce parameter to convert colors to common casing (lowercase/uppercase). By @JayLeininger in https://github.com/svg/svgo/pull/1692 -
removeDeprecatedAttrs
, new plugin that is disabled by default to remove SVG attributes that are deprecated. By @jdufresne in #1869
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
SVG | Original | v3.2.0 | v3.3.0 | Delta |
---|---|---|---|---|
Arch Linux Logo | 9.529 KiB | 4.115 KiB | 4.097 KiB | ⬇️ 0.018 KiB |
Blobs | 50.45 KiB | 42.623 KiB | 42.609 KiB | ⬇️ 0.014 KiB |
Isometric Madness | 869.034 KiB | 540.582 KiB | 540.073 KiB | ⬇️ 0.509 KiB |
tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
Wikipedia Logo | 161.551 KiB | 111.668 KiB | 111.668 KiB |
Before and after of the browser bundle of each respective version:
v3.2.0 | v3.3.0 | Delta | |
---|---|---|---|
svgo.browser.js | 910.9 kB | 753.0 kB | ⬇️ 157.9 kB |
v3.2.0
What's Changed
Bug Fixes
-
Convert Path Commands, fix instances were
q
was incorrectly converted tot
. By @KTibow in https://github.com/svg/svgo/pull/1889 - Convert Transform, fix for some transforms that weren't being converted correctly. By @SethFalco in https://github.com/svg/svgo/pull/1916
SVG Optimization
- Convert Path Commands, improves closing paths and how we determine if to use absolute or relative commands. By @KTibow in https://github.com/svg/svgo/pull/1867
-
Convert Path Commands, round arc or convert to lines based on the sagitta, can be disabled by setting
smartArcRounding
tofalse
. By @KTibow in https://github.com/svg/svgo/pull/1873 -
Convert Path Commands, convert cubic Bézier curves to quadratic Bézier curves where possible, can be disabled by setting
convertToQ
tofalse
. By @KTibow in https://github.com/svg/svgo/pull/1889
Performance
- Merge Paths, refactor for performance with large files. By @mozzie in https://github.com/svg/svgo/pull/1764 and https://github.com/svg/svgo/pull/1904
-
Convert Path Commands, refactor
#stringifyPathData
for performance. By @SethFalco in https://github.com/svg/svgo/pull/1900 - Use
Set
instead ofArray
for faster lookups. By @SethFalco in https://github.com/svg/svgo/pull/1899
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
SVG | Original | v3.1.0 | v3.2.0 | Delta |
---|---|---|---|---|
Arch Linux Logo | 9.529 KiB | 4.162 KiB | 4.115 KiB | ⬇️ 0.047 KiB |
Blobs | 50.45 KiB | 42.949 KiB | 42.623 KiB | ⬇️ 0.326 KiB |
Isometric Madness | 869.034 KiB | 550.153 KiB | 540.582 KiB | ⬇️ 9.571 KiB |
tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
Wikipedia Logo | 161.551 KiB | 116 KiB | 111.668 KiB | ⬇️ 4.332 KiB |
Before and after of the browser bundle of each respective version:
v3.1.0 | v3.2.0 | Delta | |
---|---|---|---|
svgo.browser.js | 660.9 kB | 910.9 kB | ⬆️ 250 kB |
v3.1.0
What's Changed
Bug Fixes
-
Prefix IDs, correctly prefix IDs when
<style>
tag contains XML comments. By @john-neptune in https://github.com/svg/svgo/pull/1736 -
Remove Hidden Elements, improve handling of definitions (
<defs>
), namely when<defs>
are defined at the end of the document. By @KTibow in https://github.com/svg/svgo/pull/1879 - Cleanup Enable Background, clean up inline-styles too. By @SethFalco in https://github.com/svg/svgo/pull/1866
- Cleanup IDs, handle URI encoded references properly. By @SethFalco in https://github.com/svg/svgo/pull/1880
- Inline Styles, no longer crashes on non-inlined selectors with a pseudo-class. By @SethFalco in https://github.com/svg/svgo/pull/1865
- Improve handling of URL references in reference attributes (
url('#a')
) across various plugins. By @SethFalco in https://github.com/svg/svgo/pull/1881
SVG Optimization
-
Remove Unknowns and Defaults, now removes defaults in XML declarations too, enabled by default and can be toggled with
defaultMarkupDeclarations
. By @SethFalco in https://github.com/svg/svgo/pull/1872
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
SVG | Original | v3.0.5 | v3.1.0 | Delta |
---|---|---|---|---|
Arch Linux Logo | 9.529 KiB | 4.608 KiB | 4.162 KiB | ⬇️ 0.446 KiB |
Blobs | 50.45 KiB | 42.949 KiB | 42.949 KiB | |
Isometric Madness | 869.034 KiB | 550.153 KiB | 550.153 KiB | |
tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
Wikipedia Logo | 161.551 KiB | 117.146 KiB | 116 KiB | ⬇️ 1.146 KiB |
Before and after of the browser bundle of each respective version:
v3.0.5 | v3.1.0 | Delta | |
---|---|---|---|
svgo.browser.js | 657.5 kB | 660.9 kB | ⬆️ 3.4 kB |
v3.0.5
What's Changed
Bug Fixes
- Cleanup IDs, correctly handle references to other nodes in animations. By @KTibow in https://github.com/svg/svgo/pull/1862
-
Convert Path Commands, fix issue when removing redundant
Z
between mergableM
/m
commands. By @KTibow in https://github.com/svg/svgo/pull/1856 -
Convert Path Commands, adhere to error/precision in
z
conversions. By @KTibow in https://github.com/svg/svgo/pull/1842 -
Remove Empty Containers, skip if parent node is
<switch>
, as empty containers can be used for attributes likerequiredFeatures
. By @vincentbernat in https://github.com/svg/svgo/pull/1747 - Remove Hidden Elements, when removing a hidden definition, also remove nodes that reference it. By @SethFalco in https://github.com/svg/svgo/pull/1852
- Output the optimization stats (profit) in red if the file size increased. By @gimler in https://github.com/svg/svgo/pull/1162
- Type definition files now correctly use the
.d.ts
file extension instead of.ts
. By @Exotelis in https://github.com/svg/svgo/pull/1780
Chores
- Improved exported types for the
#loadConfig
method. By @nuintun in https://github.com/svg/svgo/pull/1844
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
SVG | Original | v3.0.4 | v3.0.5 | Delta |
---|---|---|---|---|
Arch Linux Logo | 9.529 KiB | 4.735 KiB | 4.608 KiB | ⬇️ 0.127 KiB |
Blobs | 50.45 KiB | 42.949 KiB | 42.949 KiB | |
Isometric Madness | 869.034 KiB | 550.593 KiB | 550.153 KiB | ⬇️ 0.44 KiB |
tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
Wikipedia Logo | 161.551 KiB | 117.152 KiB | 117.146 KiB | ⬇️ 0.006 KiB |
Before and after of the browser bundle of each respective version:
v3.0.4 | v3.0.5 | Delta | |
---|---|---|---|
svgo.browser.js | 656.9 kB | 657.5 kB | ⬆️ 0.6 kB |
v3.0.4
Includes various bug fixes for existing plugins and a new optimization. Also splits removeXMLNS
, which removed XLink, into two separate plugins, removeXMLNS
and removeXlink
.
What's Changed
Default Behavior
-
Remove XML Namespace, no longer removes the XLink (
xmlns:xlink
) namespace. If that is desirable, you should enable the new Remove XLink (removeXlink
) plugin, which does more while being safer. By @TrySound and @SethFalco in https://github.com/svg/svgo/pull/1535
Bug Fixes
- Convert Path Commands, ignore instances where transform applied via style tag. By @SethFalco in https://github.com/svg/svgo/pull/1830
- Inline Styles, inline properties with the same specificity in the order that they appear in the stylesheet. By @SethFalco in https://github.com/svg/svgo/pull/1831
- Inline Styles, don't remove class or id from node if it's traversed in another CSS selector. By @SethFalco in https://github.com/svg/svgo/pull/1832 and https://github.com/svg/svgo/pull/1836
- Don't trim
pre
elements inforeignObject
. By @SethFalco in https://github.com/svg/svgo/pull/1796 - Don't crash when encountering
@-webkit-keyframes
in<style>
node. By @SethFalco in https://github.com/svg/svgo/pull/1826
SVG Optimization
-
Convert Path Commands, convert to
z
command if going back to initial position, or dropz
if redundant. By @KTibow in https://github.com/svg/svgo/pull/1822 - Inline Styles, when inlining a CSS property that's already declared in a presentation attribute of the node, drop the attribute. By @SethFalco in https://github.com/svg/svgo/pull/1829
-
Remove XLink, new plugin that removes the XLink (
xmlns:xlink
) namespace and migrates from XLink attributes to the SVG 2 equivalent. Disabled by default. By @TrySound and @SethFalco in https://github.com/svg/svgo/pull/1535
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
SVG | Original | v3.0.3 | v3.0.4 | Delta |
---|---|---|---|---|
Arch Linux Logo | 9.529 KiB | 4.738 KiB | 4.735 KiB | ⬇️ 0.003 KiB |
Blobs | 50.45 KiB | 42.949 KiB | 42.949 KiB | |
Isometric Madness | 869.034 KiB | 550.699 KiB | 550.593 KiB | ⬇️ 0.106 KiB |
tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
Wikipedia Logo | 161.552 KiB | 118.441 KiB | 117.152 KiB | ⬇️ 1.289 KiB |
Before and after of the browser bundle of each respective version:
v3.0.3 | v3.0.4 | Delta | |
---|---|---|---|
svgo.browser.js | 651.7 kB | 656.9 kB | ⬆️ 5.2 kB |
v3.0.3
Includes various bug fixes and optimizations for existing plugins.
We're also revamped the documentation for the project. You can find it on svgo.dev! The frontend for svgo.dev is maintained in svg/svgo.dev, contributions are welcome.
What's Changed
Settings
-
Remove Comments, introduces
preservePatterns
parameter. Preserves legal comments by default, same as the previous behavior, but can now be overridden. By @SethFalco in https://github.com/svg/svgo/pull/1812 -
Remove Description, set the
removeAny
parameter tofalse
by default for accessibility. By @SethFalco in https://github.com/svg/svgo/pull/1806
Bug Fixes
- Remove Raster Images, removes inlined JPEG images. By @abejfehr in https://github.com/svg/svgo/pull/1742
- Cleanup IDs, correctly handle when 2 IDs have been referenced in a single attribute. By @SethFalco in https://github.com/svg/svgo/pull/1795
- Cleanup IDS, correctly handle when we've encountered a reference to a node that doesn't exist. By @SethFalco in https://github.com/svg/svgo/pull/1817
- Inline Styles, treat style prop keys as case-insensitive. By @SethFalco in https://github.com/svg/svgo/pull/1797
- Inline Styles, remove all classes in multiclass selector. By @SethFalco in https://github.com/svg/svgo/pull/1801
- Inline Styles, ignore empty CSS blocks instead of adding empty style attribute. By @SethFalco in https://github.com/svg/svgo/pull/1823
- Minify Styles, removes unused class selectors when the document has no classes. By @SethFalco in https://github.com/svg/svgo/pull/1800
- Prefix IDs, reuse the same prefix when encountering an ID multiple times. By @SethFalco in https://github.com/svg/svgo/pull/1814
- Remove Hidden Elements, stops removing non-rendering elements like masks. By @SethFalco in https://github.com/svg/svgo/pull/1793
- Reuse Paths, creates a new ID if the current one is referenced by another element. By @SethFalco in https://github.com/svg/svgo/pull/1784
-
Reuse Paths, removes redundant
defs
children after optimization. By @SethFalco in https://github.com/svg/svgo/pull/1785 - Reuse Paths, stops duplicating attributes into the shared definition. By @SethFalco in https://github.com/svg/svgo/pull/1791
- Don't crash on a
null
,undefined
, or empty plugin. Instead, log a warning and ignore it. By @SethFalco in https://github.com/svg/svgo/issues/1128
SVG Optimization
- Convert Transform, omit spaces between functions. By @SethFalco in https://github.com/svg/svgo/pull/1802
-
Remove Scripts, removes callbacks (
on*
) andhref
attributes withjavascript:
URIs. By @cakeinpanic and @SethFalco in https://github.com/svg/svgo/pull/1807, https://github.com/svg/svgo/pull/1818, https://github.com/svg/svgo/pull/1819, https://github.com/svg/svgo/pull/1820 - Convert One-Stop Gradients, new plugin to convert gradients with one stop to a solid color, disabled by default. By @SethFalco in https://github.com/svg/svgo/pull/1790
Performance
- Various optimizations for path handling. By @marvinhagemeister in https://github.com/svg/svgo/pull/1716 and https://github.com/svg/svgo/pull/1717
Chores
- Revise the README. By @ADTC in https://github.com/svg/svgo/pull/1731
- Fix dead link to postcss-svgo in README. By @Lehoczky in https://github.com/svg/svgo/pull/1770
- Replace webpack loader library in README as previous was deprecated. By @tanyabouman in https://github.com/svg/svgo/pull/1771
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
SVG | Original | v3.0.2 | v3.0.3 | Delta |
---|---|---|---|---|
Arch Linux Logo | 8.584 KiB | 4.748 KiB | 4.747 KiB | ⬇️ 0.001 KiB |
Blobs | 50.45 KiB | 42.949 KiB | 42.949 KiB | |
Isometric Madness | 869.034 KiB | 550.829 KiB | 550.699 KiB | ⬇️ 0.13 KiB |
tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
Wikipedia Logo | 161.552 KiB | 118.441 KiB | 118.441 KiB |
Before and after of the browser bundle of each respective version:
v3.0.2 | v3.0.3 | Delta | |
---|---|---|---|
svgo.browser.js | 643.5 kB | 651.7 kB | ⬆️ 8.2 kB |
v3.0.2
Installing @types/csso
no longer required
v3.0.1
- store exposed types only in .d.ts files, no longer need to enable js checking
- update svgo.browser.js
- fixed "begin" attribute cleanup
Thanks to @Kreeg, @XhmikosR and @TrySound
v3.0.0
SVGO v3
Improvements and fixes
- fixed
datauri
option whenmultipass
is not enabled - improved default preset warnings
Breaking channges
- Node.js 14+ is required for version
- stable package is replaced with native stable sort (required node 12+)
Config
Typescript types are exposed out of the box. No longer need to install @types/svgo
// svgo.config.js
/**
* @​type {import('svgo').Config}
*/
export default {
// svgo configuration
}
Active flag is no longer supported
export default {
plugins: [
{
name: 'removeDoctype',
active: true
},
{
name: 'removeComments',
active: false
}
]
}
extendDefaultPlugins
is removed, preset-default
plugin should be used instead
when need to customize plugins defaults
export default {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// plugins customization
}
}
}
]
}
Enabled sortAttrs plugin by default to get better gzip compression.
<svg>
- <rect fill-opacity="" stroke="" fill="" stroke-opacity="" />
+ <rect fill="" fill-opacity="" stroke="" stroke-opacity="" />
</svg>
Can be disabled if necessary
export default {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
sortAttrs: false
}
}
}
]
}
cleanupIDs plugin is renamed to cleanupIds
export default {
plugins: [
'cleanupIds'
]
}
// or
export default {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
cleanupIds: {}
}
}
}
]
}
Removed cleanupIds plugin "prefix" param, prefixIds should be used instead
export default {
plugins: [
'cleanupIds',
{
name: 'prefixIds',
params: {
prefix: 'my-prefix'
}
}
]
}
Public API
Removed width and height from optimization result.
const { width, height } = optimize(svg).info
Can be found with custom plugin
let width = null
let height = null
const plugin = {
name: 'find-size',
fn: () => {
return {
element: {
enter: (node, parentNode) => {
if (parentNode.type === 'root') {
width = node.attributes.width
height = node.attributes.height
}
}
}
}
}
}
optimize(svg, {
plugins: ['preset-default', plugin]
})
Removed error and modernError from optimization result
const {data, error, modernError } = optimize(svg)
Now all errors are thrown, parsing error can be checked by name
try {
const { data } = optimize(svg)
} catch (error) {
if (error.name === 'SvgoParserError') {
// formatted error
error.toString()
} else {
// runtime error
}
}
Custom plugins
Removed full
, perItem
and perItemReverse
plugin types.
visitor
is the only supported plugin api so plugin.type
is no longer required.
Removed plugin.active
flag.
Removed plugin.params
used as default params, destructuring with defaults can be used instead
name
and fn
are only required now
const plugin = {
name: 'my-custom-plugin',
fn: (root, params) => {
const { myParam = true } = params
return {}
}
}
Removed createContentItem
and JSAPI class from nodes.
All nodes are now plain objects with one exception.
parentNode need to be defined to not break builtin plugins.
const plugin = {
name: 'my-custom-plugin',
fn: () => {
return {
element: {
enter: (node) => {
if (node === 'g') {
const child = {
type: 'element',
name: 'g',
attributes: {},
children: []
}
Object.defineProperty(child, 'parentNode', {
writable: true,
value: node,
})
node.children.push(child)
}
}
}
}
}
}
Thanks to @istarkov, @boidolr, @deining, @ranman, @mondeja, @liamcmitchell-sc, @rogierslag, @kriskowal, @hugolpz and @TrySound
v2.8.0
If you enjoy SVGO and would like to support our work, consider sponsoring us directly via our OpenCollective.
Join us in our discord
Features and bug fixes
- added --no-color flag for testing purposes but you may find it useful (https://github.com/svg/svgo/pull/1588)
- handle url() in style attributes properly (https://github.com/svg/svgo/pull/1592)
- removeXMLNS plugin now removes
xmlns:xlink
attribute (https://github.com/svg/svgo/pull/1508) - load .cjs configuration only with
require
to fix segfaults in linux (https://github.com/svg/svgo/pull/1605)
Refactorings
- simplified and covered with types svg stringifier (https://github.com/svg/svgo/pull/1593)
- migrated to visitor api and covered with types removeEmptyAttrs plugin (https://github.com/svg/svgo/pull/1594)
- migrated to visitor api and covered with types inlineStyles plugin (https://github.com/svg/svgo/pull/1601)
- migrated to picocolors (https://github.com/svg/svgo/pull/1606)
DX
I found some users are trying to enable plugins which are not part of default preset, for example
{
name: 'preset-default',
params: {
overrides: {
cleanupListOfValues: true
}
}
}
To fix this I made docs more concrete about plugin (https://github.com/svg/svgo/commit/5165ccb9d1f116b26a30a020e65aadd666012cb1) and introduced a warning when true is specified in overrides (https://github.com/svg/svgo/commit/cb7e9be623b6e2fbbfcb9b67c4c85131e1477925). Please give us feedback if you still have issues.
Thanks to @IlyaSkriblovsky, @devongovett, @matheus1lva, @omgovich, @renatorib and @TrySound
v2.7.0
If you enjoy SVGO and would like to support our work, consider sponsoring us directly via our OpenCollective.
Join us in our discord
ES Modules support
This release adds support for es modules in svgo.config.js when package.json type field is "module". For projects with mixed cjs and esm svgo.config.mjs and svgo.config.cjs are also supported as fallback.
See https://github.com/svg/svgo/pull/1583
export default {
plugins: [
'preset-default'
]
}
Fixes
- added validation to removeAttrs plugin (https://github.com/svg/svgo/pull/1582)
Refactorings
Follwing plugins are migrated to the new visitor plugin api and covered with tsdoc
- collapseGroups (https://github.com/svg/svgo/pull/1572)
- mergeStyles (https://github.com/svg/svgo/pull/1575)
- moveElemsAttrsToGroup (https://github.com/svg/svgo/pull/1574)
Other internal changes
- covered svg parser with tsdoc (https://github.com/svg/svgo/pull/1584)
- avoided parentNode in style manager which makes us one step closer to releasing new plugin api publicly (https://github.com/svg/svgo/pull/1576)
- replaced colorette with nanocolors (https://github.com/svg/svgo/pull/1586)
Thanks to @renatorib, @matheus1lva, @omgovich, @deepsweet, @ai, @samouss and @TrySound
v2.6.1
- fixed
optimize(svg)
usage without config (https://github.com/svg/svgo/pull/1573) - added missing filter primitives to collections (https://github.com/svg/svgo/pull/1571)
- migrated to visitor plugin api and covered with tsdoc removeEmptyContainers plugin (https://github.com/svg/svgo/pull/1570)
Thanks to @XhmikosR, @thewilkybarkid, @renatorib, @matheus1lva, @omgovich and @TrySound
v2.6.0
If you enjoy SVGO and would like to support our work, consider sponsoring us directly via our OpenCollective.
We have some good stuff in this release
Better syntax errors (https://github.com/svg/svgo/pull/1553)
Before people struggled to figure out what and why happens with such cryptic error
Error: Error in parsing SVG: Unquoted attribute value
Line: 1
Column: 29
Char: 6
File: input.svg
This gives too little information when a lot of svgs are transformed.
New errors look like this, include context and point to exact location with the issue. We hope this will solve many issues when dealing with bundlers and other tools integrations.
Error: SvgoParserError: input.svg:2:29: Unquoted attribute value
1 | <svg viewBox="0 0 120 120">
> 2 | <circle fill="#ff0000" cx=60.444444" cy="60" r="50"/>
| ^
3 | </svg>
4 |
pefixIds plugin is now idempotent (https://github.com/svg/svgo/pull/1561)
To get better compression results SVGO uses multipass option. This option is used to run prefixIds plugin only once to prefix ids and classes properly.
Though sometimes users run svgo manually a few times which leads to duplicated prefixes and make code much bigger. To solves this prefixIds was redesigned to add prefix only when it does not exit in ids and classes.
Eventually all plugins are planned to be determenistic and idempotent so multipass option would not be necessary and single pass compression could be as effective as possible.
New js2svg options (https://github.com/svg/svgo/pull/1546)
js2svg.eol: 'lf' | 'crlf'
Allows to customize end of line characters which is usually resolved by os.EOL in node.
finalNewline: boolean
Ensures SVG output has a final newline which is required for some tools like git.
Fixes and refactorings
Follwing plugins are migrated to the new visitor plugin api and covered with tsdoc
- reusePaths (https://github.com/svg/svgo/pull/1551)
- removeUselessStrokeAndFill (https://github.com/svg/svgo/pull/1549)
- minifyStyles (https://github.com/svg/svgo/pull/1552)
- cleanupIDs (https://github.com/svg/svgo/pull/1556)
- removeEditorsNSData (https://github.com/svg/svgo/pull/1557)
- removeUnusedNS (https://github.com/svg/svgo/pull/1559)
- prefixIds (https://github.com/svg/svgo/pull/1561)
- sortAttrs (https://github.com/svg/svgo/pull/1564)
Also fixed a few bugs
- add xmlns:xlink in reusePaths plugin when missing (https://github.com/svg/svgo/pull/1555)
- fixed removeNone param in removeUselessStrokeAndFill plugin (https://github.com/svg/svgo/pull/1549)
Thanks to @XhmikosR, @matheus1lva, @deepsweet, @omgovich, @adalinesimonian and @TrySound
v2.5.0
In this release we have a couple of fixes
- fixed removing transform-origin attribute (https://github.com/svg/svgo/commit/680e143daf622bc3ace9e0b82f626507caad0530)
- fixed applying transform to path arc with zero radius (https://github.com/svg/svgo/commit/ac8edbaf4163fd7e0934b72175d60e71844d8cf9)
Visitor api now get parentNode in enter and exit callback
return {
element: {
enter: (node, parentNode) => {
},
exit: (node, parentNode) => {
}
}
}
And a lot of plugins are migrated to visitor api and covered them with tsdoc
- addAttributesToSVGElement
- addClassesToSVGElement
- cleanupAttrs
- cleanupEnableBackground
- cleanupListOfValues
- cleanupNumericValues
- convertColors
- convertEllipseToCircle
- convertShapeToPath
- convertTransform
- mergePaths
- removeAttributesBySelector
- removeAttrs
- removeComments
- removeDesc
- removeDoctype
- removeElementsByAttr
- removeEmptyText
- removeMetadata
- removeRasterImages
- removeScriptElement
- removeStyleElement
- removeTitle
- removeXMLProcInst
- removeHiddenElems
- removeViewBox
- removeUselessDefs
- removeOffCanvasPaths
- removeUnknownsAndDefaults
- sortDefsChildren
Thanks to @XhmikosR, @morganney, @oBusk, @matheus1lva and @TrySound
v2.4.0
Hey everybody!
In this release I happy to introduce the new plugin "preset-default" which allows to declaratively setup and customize default set of plugins. Previous solution extendDefaultPlugins
utility prevented parcel users from using cachable json config, svgo-loader and svgo-jsx required svgo to be installed locally. "preset-default" plugin is just another builtin plugi.
module.exports = {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// customize options
builtinPluginName: {
optionName: 'optionValue',
},
// or disable plugins
anotherBuiltinPlugin: false,
},
},
},
],
};
We also fixed a few bugs
- performance is improved by ~37% for svg with styles (https://github.com/svg/svgo/pull/1456)
- reset cursor after "closeto" command when applying transformation (https://github.com/svg/svgo/commit/9e578b515a6b23e6ab4bd41f7b28e2655d3bd110)
- fixed usage of removed internal methods (https://github.com/svg/svgo/pull/1479)
- chalk is replaced with smaller colorette (https://github.com/svg/svgo/pull/1511)
- test files are excluded from published package (https://github.com/svg/svgo/pull/1458)
- remove more spaces around flag in arc command https://github.com/svg/svgo/pull/1484
Thanks to @TrySound, @ydaniv, @ludofischer, @XhmikosR and @joseprio
v2.3.1
Fixed vulnerability in css-select dependency (https://github.com/svg/svgo/pull/1485)
Thanks to @ericcornelissen
v2.3.0
Hey, everybody! We have a big release here.
- The new plugin is added for merging style elements into one. See #1381
Before:
<svg>
<style media="print">
.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }
</style>
<style>
.test { background: red; }
</style>
</svg>
After:
<svg>
<style>
@​media print{
.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }
}
.test { background: red; }
</style>
</svg>
- CLI got new
--exclude
flag which uses regexps to exclude some files from--folder
. See #1409
svgo --folder=svgs --exclude "invalid-icon" "bad-.+"
-
Internal AST is migrated to XAST. This spec makes maintaining plugins easier and may be used as interop with other tools like SVGR.
-
The new visitor plugin type combines features of "full", "perItem" and "perItemReverse" plugins without loosing simplicity. Eventually only visitor api will be supported. See #1454
Also small fixes
- override default floatPrecision in plugins with globally specified one (https://github.com/svg/svgo/commit/7389bcddbfadc49de84203b048199b4a397d656a)
- fix rendering -0 in path data (https://github.com/svg/svgo/commit/3d4adb6b044ff1361a970ea049f90d5626ea9888)
- make browser bundle 30% smaller (https://github.com/svg/svgo/commit/279962207e8c99ca8dd9f0ac093071aabafc8721)
- simplified convertPathData plugin (https://github.com/svg/svgo/commit/a04b27a1df12b9e6dc019fb8d50733d3d280a5c5 and https://github.com/svg/svgo/commit/61657433e161b6e5de61d470ac34e302b3aa297b)
- prepared for more regression tests (https://github.com/svg/svgo/commit/d89d36eacec7bd52002ef55ec6e2bd698352123e)
Thanks to @chambo-e, @strarsis, @XhmikosR, @omgovich and @TrySound
v2.2.2
- ignore keyframes in computeStyle (https://github.com/svg/svgo/commit/ddbd7046b2aed8133864b2d98feef6a80f665540)
v2.2.1
This is a big patch with new style computing (https://github.com/svg/svgo/pull/1399) and landed to master regression tests
A lot of bugs are fixed
- fixed scientific notation parsing in paths (https://github.com/svg/svgo/commit/d6f972c970d3cdd68ccc740e1a610ff0b23fcd34)
- forbade invalid
<style>
type attribute in inlineStyles plugin (https://github.com/svg/svgo/pull/1400) - fixed
<style>
support in removeHiddenElems plugin (https://github.com/svg/svgo/pull/1399) - fixed noSpaceAfterFlags option support (https://github.com/svg/svgo/commit/0e02fd9fdef0d031a8393a97af7207577cb86222)
- fixed floatPrecision when extending default plugins (https://github.com/svg/svgo/commit/d58a7e6089ccf15ecc3928427d55e6b9601094af)
- fixed
<style>
support when removing useless path commands (https://github.com/svg/svgo/commit/c21fef54e1aede8cf9f4b4b73ab79d91b7907d2b) - fixed
<style>
support when combining path commands (https://github.com/svg/svgo/commit/ba7e9bdc0d4ee677336f09b6fb24fd6cc866e97d) - prevent removing filter primitive defaults (https://github.com/svg/svgo/commit/555a9619dbc6273c665818a0ade27e5d4ab27a09)
- prevent merging paths with markers (https://github.com/svg/svgo/commit/de4fd79b5779a2e92f45dd06685cec5192067ecd)
- prevent removing single point paths with markers (https://github.com/svg/svgo/commit/21c04e4d8ae2765f3f00a87de7219d69c075bd22)
- keep empty
<pattern>
when at least one argument is present (https://github.com/svg/svgo/commit/0e6b0c4a0182fb79775fb6af2f1df18c12f917d9) - keep
<marker>
with display none (https://github.com/svg/svgo/commit/d3e3726ac42bf623572ff06405e12f4ee72873dd) - preserve empty conditional processing attributes (https://github.com/svg/svgo/commit/a2b0e737670a46955097a5b02fe3daa35c3f231b)
- preserve viewBox in nested
<svg>
(https://github.com/svg/svgo/commit/28c01cfe65cd87796fb061fe3ede7c6f59d0e1f6)
435 of 526 regression tests are passing
Thanks to @XhmikosR @sk- and @TrySound
v2.2.0
Wow, two minor releases in a row. There is a big reason for that. We got a new logo! See it in readme. Big thanks to @DerianAndre.
There were also implemented brand new path data parser and stringifier (https://github.com/svg/svgo/pull/1378 and https://github.com/svg/svgo/pull/1387) to do more reliable transformations and produce smaller svg.
A cup of small fixes
- fixed optimisation when stroke-linecap=round is specified (https://github.com/svg/svgo/commit/7901588a9f18d6ef476389405a73cd7fe42ed179)
- prevented transform applying when inline style is present (https://github.com/svg/svgo/commit/79dbb4bf6e7464e946d838ade0aa23c7189762f7)
- apply transform to stroke-dasharray and stroke-dashoffset (https://github.com/svg/svgo/commit/dd37fcfebbe2f3cea687ad0bf890ff83ab3c9eb7)
- fixed removing hidden elements when descendant enables visibility (https://github.com/svg/svgo/commit/d06747abca1e9e652a764db9747395d14f7f6f98)
- fixed removing elements with zero opacity inside clipPath (https://github.com/svg/svgo/commit/9d67586787ad16799d7a1cfce1eb0bce829470da)
- fixed removing empty mask which can hide elements by id (https://github.com/svg/svgo/commit/d14315b68fc1fcb43212219a0da5857ad7a23cd0)
- fixed removing stroke-width when marker-end is specified (https://github.com/svg/svgo/commit/36391564f2d0b2c7ad86c746bacdd6de030ebd3d)
- fixed
<tspan>
inside<a>
(https://github.com/svg/svgo/commit/091172a392f6d751855477d51e5c8bd3e44fde97)
Thanks to @sk- @XhmikosR @deepsweet and @TrySound
v2.1.0
This release introduced two big changes
- we forked sax parser to fix issues inaccessible from public api (https://github.com/svg/sax)
- we added regression tests which already caught 4 bugs (WIP)
See fixed bugs
- fixed empty
<svg />
with enabled cleanupIDs plugin (https://github.com/svg/svgo/commit/9b97e06ef69b7961f342c9ee8468c552c9b503a3) - fail when file specified in
--config
flag does not exist or json string is specified (https://github.com/svg/svgo/commit/a855b40ec5d53f3ce3b45213fd4c65bc4dc05347) - disabled convertStyleToAttrs by default (https://github.com/svg/svgo/pull/1365)
- preserve whitespace in elements containing text (https://github.com/svg/svgo/pull/1220)
- fixed removing
xml:space="preserve"
(https://github.com/svg/svgo/commit/776ec1e71bcd2aa768b2d3ac987177f706834547) - preserve whitespace in nested textual elements (https://github.com/svg/svgo/commit/9de471a0f4bea20581034c2d74b0652c27e0fad0)
- keep empty
<g>
whenfilter
attribute is specified (https://github.com/svg/svgo/commit/c1d5f0f7a93a6f1c947baa5860ddd40f8d1bb701) - fixed parsing xml entities (https://github.com/svg/svgo/pull/1371 https://github.com/isaacs/sax-js/pull/200)
Thanks to @XhmikosR @sk- @chromakode @devongovett and @TrySound
v2.0.3
- reduced browser build size 1450kB -> 820kB (https://github.com/svg/svgo/commit/82778c872d9fb990c22c431b63843a5bd50175f7)
- fixed adding empty
<defs>
by reusePaths plugin (https://github.com/svg/svgo/pull/1201) - fixed reporting parsing errors (https://github.com/svg/svgo/commit/ea82cc28807a1d77220b9c8bb94ad657f9285e31)
- fixed convertEllipseToCircle plugin when
rx
orry
attributes are not specified (https://github.com/svg/svgo/commit/7f4e05297ade6747a2b6ca63109d75dc9c4ea3c0) - fixed removing mask-type on
<mask>
(https://github.com/svg/svgo/commit/4490d62ee9f83febeb18f4a83a297c544459514a) - fixed removing elements when class is empty in removeElementsByAttr plugin (https://github.com/svg/svgo/commit/d9f68d3be0958f5d0899ae0a361d5f3b1ce12b95)
- disable removing spaces in
<path>
by default to support many broken non-browser environments (https://github.com/svg/svgo/pull/1353) - fixed error message in addAttributesToSVGElement plugin (https://github.com/svg/svgo/commit/c1edce4d2d9e64d026d9cb3de544181198cad5f3)
Thanks to @ChrisRu @XhmikosR @yisibl @TrySound
v2.0.2
- added better docs (https://github.com/svg/svgo/pull/1337)
- removed unsafe usage of Buffer constructor (https://github.com/svg/svgo/pull/1341)
- fixed incorrect regexp in convertStyleToAttrs plugin (https://github.com/svg/svgo/pull/1338)
- fixed swallowing errors in config files (https://github.com/svg/svgo/pull/1342)
Thanks to @XhmikosR and @TrySound
v2.0.1
- fixed path intersection in mergePaths plugi
Configuration
📅 Schedule: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate using a curated preset maintained by
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎
This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
Package | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|
npm/[email protected] | None | 0 |
4.75 kB | sindresorhus |
npm/[email protected] | None | 0 |
0 B |
🚮 Removed packages: npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-spring-bottom-sheet | ❌ Failed (Inspect) | May 9, 2024 11:04am |