cloudnativedaysjp / website

Website for CloudNative Days a.k.a Dreamkast-Archives
1 stars 0 forks source link

Update dependency svgo to v3 #124

Closed renovate[bot] closed 1 year ago

renovate[bot] commented 1 year ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
svgo 2.8.0 -> 3.0.2 age adoption passing confidence

Release Notes

svg/svgo ### [`v3.0.2`](https://togithub.com/svg/svgo/releases/tag/v3.0.2) [Compare Source](https://togithub.com/svg/svgo/compare/v3.0.1...v3.0.2) Installing `@types/csso` no longer required ### [`v3.0.1`](https://togithub.com/svg/svgo/releases/tag/v3.0.1) [Compare Source](https://togithub.com/svg/svgo/compare/v3.0.0...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](https://togithub.com/Kreeg), [@​XhmikosR](https://togithub.com/XhmikosR) and [@​TrySound](https://togithub.com/TrySound) ### [`v3.0.0`](https://togithub.com/svg/svgo/releases/tag/v3.0.0) [Compare Source](https://togithub.com/svg/svgo/compare/v2.8.0...v3.0.0) ### SVGO v3 #### Improvements and fixes - fixed `datauri` option when `multipass` 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` ```js // svgo.config.js /** * @​type {import('svgo').Config} */ export default { // svgo configuration } ``` Active flag is no longer supported ```js 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 ```js export default { plugins: [ { name: 'preset-default', params: { overrides: { // plugins customization } } } ] } ``` Enabled sortAttrs plugin by default to get better gzip compression. ```diff - + ``` Can be disabled if necessary ```js export default { plugins: [ { name: 'preset-default', params: { overrides: { sortAttrs: false } } } ] } ``` cleanupIDs plugin is renamed to cleanupIds ```js export default { plugins: [ 'cleanupIds' ] } // or export default { plugins: [ { name: 'preset-default', params: { overrides: { cleanupIds: {} } } } ] } ``` Removed cleanupIds plugin "prefix" param, prefixIds should be used instead ```js export default { plugins: [ 'cleanupIds', { name: 'prefixIds', params: { prefix: 'my-prefix' } } ] } ``` ##### Public API Removed width and height from optimization result. ```js const { width, height } = optimize(svg).info ``` Can be found with custom plugin ```js 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 ```js const {data, error, modernError } = optimize(svg) ``` Now all errors are thrown, parsing error can be checked by name ```js 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 ```js 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. ```js 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](https://togithub.com/istarkov), [@​boidolr](https://togithub.com/boidolr), [@​deining](https://togithub.com/deining), [@​ranman](https://togithub.com/ranman), [@​mondeja](https://togithub.com/mondeja), [@​liamcmitchell-sc](https://togithub.com/liamcmitchell-sc), [@​rogierslag](https://togithub.com/rogierslag), [@​kriskowal](https://togithub.com/kriskowal), [@​hugolpz](https://togithub.com/hugolpz) and [@​TrySound](https://togithub.com/TrySound)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), 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.



This PR has been generated by Mend Renovate. View repository job log here.

renovate[bot] commented 1 year ago

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 3.x releases. But if you manually upgrade to 3.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.