-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(html/minifier): Add
normalize_attributes
for disabling normali…
…zation (#5045)
- Loading branch information
1 parent
70770e0
commit 0836d29
Showing
5 changed files
with
126 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
crates/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"normalizeAttributes": false | ||
} |
11 changes: 11 additions & 0 deletions
11
crates/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/input.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="test.css" media="screen and (min-width: 1024px)"> | ||
</head> | ||
<body> | ||
<a rel="foo bar baz"></a> | ||
<div onclick="javascript:alert( 'test' ) ;"></div> | ||
</body> | ||
</html> |
2 changes: 2 additions & 0 deletions
2
...s/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/output.min.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!doctype html><html lang=en><title>Document</title><link rel=stylesheet href=test.css media="screen and (min-width:1024px)"><a rel="foo bar baz"></a> | ||
<div onclick='javascript:alert("test")'></div> |
0836d29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/minify/libraries/antd
1620959921
ns/iter (± 13653757
)1629261898
ns/iter (± 9160935
)0.99
es/full/minify/libraries/d3
408098235
ns/iter (± 16249612
)400016458
ns/iter (± 4699793
)1.02
es/full/minify/libraries/echarts
1610858523
ns/iter (± 18365633
)1610667988
ns/iter (± 28928933
)1.00
es/full/minify/libraries/jquery
88265703
ns/iter (± 3492952
)87064706
ns/iter (± 1254987
)1.01
es/full/minify/libraries/lodash
116885471
ns/iter (± 2379516
)116421667
ns/iter (± 2095223
)1.00
es/full/minify/libraries/moment
50990523
ns/iter (± 1869261
)52014933
ns/iter (± 1241650
)0.98
es/full/minify/libraries/react
17129573
ns/iter (± 893723
)18367196
ns/iter (± 858627
)0.93
es/full/minify/libraries/terser
598977226
ns/iter (± 17022992
)592997037
ns/iter (± 13296702
)1.01
es/full/minify/libraries/three
537373478
ns/iter (± 14503456
)542737979
ns/iter (± 3026572
)0.99
es/full/minify/libraries/typescript
3439170822
ns/iter (± 73736135
)3445681172
ns/iter (± 37589007
)1.00
es/full/minify/libraries/victory
712985392
ns/iter (± 11816656
)718145074
ns/iter (± 9571676
)0.99
es/full/minify/libraries/vue
138363576
ns/iter (± 6260433
)131031034
ns/iter (± 2736413
)1.06
es/full/codegen/es3
31553
ns/iter (± 1231
)32671
ns/iter (± 1363
)0.97
es/full/codegen/es5
31696
ns/iter (± 1222
)32726
ns/iter (± 670
)0.97
es/full/codegen/es2015
31580
ns/iter (± 831
)32654
ns/iter (± 1377
)0.97
es/full/codegen/es2016
31518
ns/iter (± 592
)32686
ns/iter (± 1073
)0.96
es/full/codegen/es2017
31757
ns/iter (± 635
)32526
ns/iter (± 1362
)0.98
es/full/codegen/es2018
32612
ns/iter (± 703
)32616
ns/iter (± 1054
)1.00
es/full/codegen/es2019
32718
ns/iter (± 1302
)32605
ns/iter (± 1096
)1.00
es/full/codegen/es2020
32754
ns/iter (± 780
)32783
ns/iter (± 1490
)1.00
es/full/all/es3
181984003
ns/iter (± 4675686
)179259661
ns/iter (± 9822465
)1.02
es/full/all/es5
170537809
ns/iter (± 6794378
)167434061
ns/iter (± 2999797
)1.02
es/full/all/es2015
139173680
ns/iter (± 3808562
)136365286
ns/iter (± 3483988
)1.02
es/full/all/es2016
137519205
ns/iter (± 5573861
)135498835
ns/iter (± 3521091
)1.01
es/full/all/es2017
137146227
ns/iter (± 5050149
)135041208
ns/iter (± 3040354
)1.02
es/full/all/es2018
135670420
ns/iter (± 6485647
)133606034
ns/iter (± 2862796
)1.02
es/full/all/es2019
135689467
ns/iter (± 5082285
)132820617
ns/iter (± 3235566
)1.02
es/full/all/es2020
137722510
ns/iter (± 14048126
)128089391
ns/iter (± 2553936
)1.08
es/full/parser
721573
ns/iter (± 26257
)683380
ns/iter (± 22549
)1.06
es/full/base/fixer
29555
ns/iter (± 1107
)28809
ns/iter (± 1087
)1.03
es/full/base/resolver_and_hygiene
88655
ns/iter (± 3452
)85282
ns/iter (± 2382
)1.04
serialization of ast node
202
ns/iter (± 11
)206
ns/iter (± 6
)0.98
serialization of serde
223
ns/iter (± 7
)215
ns/iter (± 10
)1.04
This comment was automatically generated by workflow using github-action-benchmark.