In #79, we added SVG optimization using the SVGO library. This optimization is enabled by default and the only way to turn it off was through a filter. I had some concerns with this feature (around performance and potential issues with stripping params we may want to keep) and so in order to not delay a 2.2.0 release any longer, talked to @jeffpaul and decided that we would keep this feature in place but we would change this to be disabled by default.
A new filter has been added (safe_svg_optimizer_enabled) that returns false by default. Users that want to try out this new optimization feature will have to hook into that filter and return true:
This gives people the opportunity to test this out and decide whether they want this extra optimization or not (and doesn't impact sites that don't care about this). If enough people use and like this feature, in the future we can look to either enable this by default or add an admin setting to turn this on/off.
How to test the Change
Follow the steps outlined in #79, once you add the line of code above. Without that line in place, ensure optimization doesn't happen and everything works as expected.
Changelog Entry
Changed - Don't run SVGO optimization by default and instead make this an opt-in feature.
Description of the Change
In #79, we added SVG optimization using the SVGO library. This optimization is enabled by default and the only way to turn it off was through a filter. I had some concerns with this feature (around performance and potential issues with stripping params we may want to keep) and so in order to not delay a 2.2.0 release any longer, talked to @jeffpaul and decided that we would keep this feature in place but we would change this to be disabled by default.
A new filter has been added (
safe_svg_optimizer_enabled
) that returnsfalse
by default. Users that want to try out this new optimization feature will have to hook into that filter and returntrue
:This gives people the opportunity to test this out and decide whether they want this extra optimization or not (and doesn't impact sites that don't care about this). If enough people use and like this feature, in the future we can look to either enable this by default or add an admin setting to turn this on/off.
How to test the Change
Follow the steps outlined in #79, once you add the line of code above. Without that line in place, ensure optimization doesn't happen and everything works as expected.
Changelog Entry
Credits
Props @dkotter, @jeffpaul
Checklist: