From b797014b23bc60990e61e1c28539c6885d7ea0ec Mon Sep 17 00:00:00 2001 From: John Kenny Date: Fri, 8 Aug 2025 19:19:56 -0700 Subject: [PATCH 1/9] chore: add test file with overlapping rectangle borders --- test/fixtures/files/overlap.svg | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/fixtures/files/overlap.svg diff --git a/test/fixtures/files/overlap.svg b/test/fixtures/files/overlap.svg new file mode 100644 index 00000000..a68c7767 --- /dev/null +++ b/test/fixtures/files/overlap.svg @@ -0,0 +1,6 @@ + + + + + From 8e544b2eaacac0ddcfea1773589062fd9dbfcc8a Mon Sep 17 00:00:00 2001 From: John Kenny Date: Sat, 9 Aug 2025 08:59:09 -0700 Subject: [PATCH 2/9] chore: begin doc with differences from SVGO --- docs/diffs-from-svgo.md | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docs/diffs-from-svgo.md diff --git a/docs/diffs-from-svgo.md b/docs/diffs-from-svgo.md new file mode 100644 index 00000000..5efb8fb7 --- /dev/null +++ b/docs/diffs-from-svgo.md @@ -0,0 +1,47 @@ +# Differences Between **svgo-ll** and SVGO version 4 + +**svgo-ll** originated as a clone of an [SVGO](https://github.com/svg/svgo) version 4 release candidate. Since then, numerous changes have been made to prioritize lossless compression, fix bugs, and improve performance. + +## Rounding and Precision + +In SVGO, rounding of decimal values is enabled by default and integrated into many plugins in ways that are not possible to disable. In **svgo-ll**, default plugins do not do any rounding. Rounding is opt-in and handled by a [separate plugin](./plugins/round.md). + +## Plugins + +The following SVGO plugins have been removed from **svgo-ll**: + +- **cleanupAttrs** +- **cleanupEnableBackground** +- **cleanupNumericValues** +- **convertColors** - similar functionality is in the new **[minifyColors](./plugins/minifyColors.md)** plugin +- **convertPathData** - most of the lossless functionality of this plugin has been preserved in the new **[minifyPathData](./plugins/minifyPathData.md)** plugin +- **convertTransform** +- **mergePaths** - some of the benefits of **mergePaths** are achieved with the new **[createGroups](./plugins/createGroups.md)** plugin +- **mergeStyles** +- **moveElemsAttrsToGroup** +- **moveGroupAttrsToElems** +- **removeDeprecatedAttrs** +- **removeEmptyAttrs** +- **removeEmptyText** +- **sortAttrs** +- **sortDefsChildren** + +The following new plugins have been added to **svgo-ll**: + +- **[cleanupStyleAttributes](./plugins/cleanupStyleAttributes.md)** +- **[cleanupTextElements](./plugins/cleanupTextElements.md)** +- **[cleanupXlink](./plugins/cleanupXlink.md)** +- **combineStyleElements** +- **[createGroups](./plugins/createGroups.md)** +- **mergeGradients** +- **[minifyColors](./plugins/minifyColors.md)** +- **[minifyGradients](./plugins/minifyGradients.md)** +- **[minifyPathData](./plugins/minifyPathData.md)** +- **minifyTransforms** +- **moveElemsStylesToGroup** + +## CSS + +## Scalability + +caching, list of issues From 1c198adaab3d5896d33f46812b8cb49af5cb4ec6 Mon Sep 17 00:00:00 2001 From: John Kenny Date: Sun, 10 Aug 2025 11:37:15 -0700 Subject: [PATCH 3/9] chore: update diffs from SVGO --- .github/workflows/main.yml | 4 ++-- docs/command-line-options.md | 6 ++++++ docs/diffs-from-svgo.md | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b890a377..21da688e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: CI env: FORCE_COLOR: 2 - NODE: 20 + NODE: 22 on: pull_request: @@ -31,9 +31,9 @@ jobs: fail-fast: false matrix: node-version: + - 24 - 22 - 20 - - 18 os: - ubuntu-latest - windows-latest diff --git a/docs/command-line-options.md b/docs/command-line-options.md index f1b7603c..52b0ab94 100644 --- a/docs/command-line-options.md +++ b/docs/command-line-options.md @@ -19,8 +19,11 @@ If `--folder` is specified, process files in all sub-folders recursively. `--exclude ` If `--folder` is specified, exclude files matching any of the specified regular expression patterns. + + ## Plugin and Compression Options + `--preset ` Specify which set of predefined plugins to use. If this option is not used, and no plugins are define by the `--config` option, [preset-default](./preset-default.md) is used. @@ -33,6 +36,7 @@ Specify one or more builtin plugins to run in addition to those specified by `-- ` --options ` Path to a [JSON file](https://www.json.org) containing configuration parameters for enabled plugins. The JSON file should contain an object whose keys are the names of plugins, and whose values are the parameters to pass to that plugin. This option cannot be used if the [`--config` option](#config) is specified. + `--disable ` Specify one or more plugins specified by `--preset` or `--config` which should not be run. @@ -40,6 +44,8 @@ Specify one or more plugins specified by `--preset` or `--config` which should n `--config ` Specifies a [custom configuration file](./custom-config-file.md). + + `--max-passes ` Maximum number of iterations over the plugins. Must be an integer between 1 and 10. Default is 10. diff --git a/docs/diffs-from-svgo.md b/docs/diffs-from-svgo.md index 5efb8fb7..1a5472b2 100644 --- a/docs/diffs-from-svgo.md +++ b/docs/diffs-from-svgo.md @@ -42,6 +42,19 @@ The following new plugins have been added to **svgo-ll**: ## CSS +In SVGO, many plugins do not account for the impact of CSS. Many transformations are not safe when styles are used; when `