Skip to content

Commit

Permalink
[Reland] WebUI: Update several toolchain dependencies to latest versi…
Browse files Browse the repository at this point in the history
…ons.

Reland notes: Fixed presubmit test failures in
 - tools/resources/svgo_presubmit_test.py
 - ui/webui/resources/tools/bundle_js_test.py

Specifically updating:
 - svgo:   2.8.0  -> 3.0.2
 - terser: 5.16.2 -> 5.20.0
 - rollup: 3.12.0 -> 3.29.4
 - eslint: 8.33.0 -> 8.50.0

rollup notes:
With the latest version of Rollup, bundled files are unfortunately a
bit larger, due to fixing a previous bug [1], which incorrectly only
kept the first line of all license header comments. The new behavior
is correct (see updated tests), so perhaps we should look into ways of
deduplicating license header comments in the future, to further reduce
the file size.

svgo notes:
 - Latest version includes a fix for [2] which was affecting some SVG
   files, and has resulted in using 'minifyStyles: false' in
   tools/resources/svgo.config.js as a workaround, see [3].
 - Updated svgo.config.js to account for the breaking change at [4].
 - Updated svgo_presubmit_test.py since it now re-arranges
   the order of SVG attributes as part of the optimization.

[1] rollup/rollup#4953
[2] svg/svgo#1672
[3] https://source.chromium.org/chromium/chromium/src/+/main:tools/resources/svgo.config.js;l=17-18;drc=4046a6ad0dfa25c3ec4ff3a0f2019badcd4ede70
[4] svg/svgo@6295c60

Bug: None
Change-Id: I12ca6f1204868a8592d03b24852c12c97e4e5b0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908394
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1204712}
  • Loading branch information
freshp86 authored and Chromium LUCI CQ committed Oct 3, 2023
1 parent 46d40dc commit 23ac8cb
Show file tree
Hide file tree
Showing 11 changed files with 453 additions and 316 deletions.
2 changes: 1 addition & 1 deletion third_party/node/node_modules.tar.gz.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
937cea04689b7b8dcf3cb9adbb12c79d1d6c38bb
ddc7cddc319ae5689ebf2c927e284814f2892e47
690 changes: 382 additions & 308 deletions third_party/node/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions third_party/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"@typescript-eslint/eslint-plugin": "5.50.0",
"@typescript-eslint/parser": "5.50.0",
"babel-eslint": "10.0.2",
"eslint": "8.33.0",
"eslint": "8.50.0",
"eslint-plugin-jsdoc": "37.5.1",
"html-minifier": "4.0.0",
"rollup": "3.12.0",
"svgo": "2.8.0",
"terser": "5.16.2",
"rollup": "3.29.4",
"svgo": "3.0.2",
"terser": "5.20.0",
"typescript": "5.0.3"
}
}
2 changes: 1 addition & 1 deletion tools/resources/svgo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
// This plugin strips 'unused' IDs, however they may be used in
// another file to embed an external SVG via <use>. This setting keeps
// all IDs that start with "EXPORT_".
cleanupIDs: {
cleanupIds: {
preservePrefixes: ["EXPORT_"],
},
},
Expand Down
4 changes: 2 additions & 2 deletions tools/resources/svgo_presubmit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from PRESUBMIT_test_mocks import MockInputApi, MockOutputApi, MockFile

_OPTIMIZED_SVG = (
b'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" ' +
b'id="EXPORT_preserved_id" viewBox="0 0 24 24" fill="#757575"><path ' +
b'<svg xmlns="http://www.w3.org/2000/svg" id="EXPORT_preserved_id" ' +
b'width="24" height="24" fill="#757575" viewBox="0 0 24 24"><path ' +
b'd="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 ' +
b'2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg>')

Expand Down
15 changes: 15 additions & 0 deletions ui/webui/resources/tools/tests/bundle_js/expected/baz_ui.rollup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions ui/webui/resources/tools/tests/bundle_js/expected/foo_ui.rollup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23ac8cb

Please sign in to comment.