-
-
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): Remove empty metadata elements (#5085)
- Loading branch information
1 parent
8c42961
commit cb845c9
Showing
16 changed files
with
271 additions
and
205 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
crates/swc_html_minifier/tests/fixture/comment/spaces/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 |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang=en><title>Document</title><link><div>foo<div>baz</div>bar</div> | ||
<!doctype html><html lang=en><title>Document</title><link rel=stylesheet href=test.css><div>foo<div>baz</div>bar</div> |
23 changes: 23 additions & 0 deletions
23
crates/swc_html_minifier/tests/fixture/element/empty-metadata-elements/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,23 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title></title> | ||
<base> | ||
</head> | ||
<body> | ||
<script></script> | ||
<style></style> | ||
<link> | ||
<meta> | ||
<title></title> | ||
<svg> | ||
<script></script> | ||
<style></style> | ||
</svg> | ||
<script> | ||
|
||
|
||
|
||
</script> | ||
</body> | ||
</html> |
9 changes: 9 additions & 0 deletions
9
crates/swc_html_minifier/tests/fixture/element/empty-metadata-elements/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,9 @@ | ||
<!doctype html><html lang=en><body> | ||
|
||
|
||
|
||
|
||
<svg> | ||
|
||
|
||
</svg> |
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 |
---|---|---|
|
@@ -110,7 +110,7 @@ | |
</a> | ||
</svg> | ||
|
||
<script> | ||
<script data-test="test"> | ||
|
||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ | |
</a> | ||
</svg> | ||
|
||
<script> | ||
<script data-test="test"> | ||
|
||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ | |
</a> | ||
</svg> | ||
|
||
<script> | ||
<script data-test="test"> | ||
|
||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ | |
</a> | ||
</svg> | ||
|
||
<script> | ||
<script data-test="test"> | ||
|
||
|
||
|
||
|
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
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
cb845c9
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
1622278891
ns/iter (± 11354460
)1649683665
ns/iter (± 11179019
)0.98
es/full/minify/libraries/d3
405433761
ns/iter (± 5828541
)413076625
ns/iter (± 12941708
)0.98
es/full/minify/libraries/echarts
1611406136
ns/iter (± 24185414
)1629429673
ns/iter (± 37979655
)0.99
es/full/minify/libraries/jquery
88722317
ns/iter (± 1285370
)97487429
ns/iter (± 4904514
)0.91
es/full/minify/libraries/lodash
116794705
ns/iter (± 1608474
)126561694
ns/iter (± 11806956
)0.92
es/full/minify/libraries/moment
51466879
ns/iter (± 932945
)50884626
ns/iter (± 1427521
)1.01
es/full/minify/libraries/react
17376299
ns/iter (± 287114
)17343124
ns/iter (± 82964
)1.00
es/full/minify/libraries/terser
599632273
ns/iter (± 5061040
)607778629
ns/iter (± 17292900
)0.99
es/full/minify/libraries/three
536807996
ns/iter (± 1278493
)559673717
ns/iter (± 15217928
)0.96
es/full/minify/libraries/typescript
3439486496
ns/iter (± 36814612
)3440841141
ns/iter (± 87545187
)1.00
es/full/minify/libraries/victory
746013580
ns/iter (± 18869307
)722569267
ns/iter (± 10810069
)1.03
es/full/minify/libraries/vue
159296534
ns/iter (± 6544050
)137018057
ns/iter (± 4239741
)1.16
es/full/codegen/es3
32690
ns/iter (± 753
)32649
ns/iter (± 584
)1.00
es/full/codegen/es5
32532
ns/iter (± 411
)32689
ns/iter (± 797
)1.00
es/full/codegen/es2015
32554
ns/iter (± 1271
)32794
ns/iter (± 989
)0.99
es/full/codegen/es2016
32673
ns/iter (± 709
)32759
ns/iter (± 467
)1.00
es/full/codegen/es2017
32693
ns/iter (± 831
)32681
ns/iter (± 547
)1.00
es/full/codegen/es2018
32679
ns/iter (± 2393
)32670
ns/iter (± 398
)1.00
es/full/codegen/es2019
32606
ns/iter (± 296
)32732
ns/iter (± 18294
)1.00
es/full/codegen/es2020
32625
ns/iter (± 370
)32650
ns/iter (± 655
)1.00
es/full/all/es3
190521554
ns/iter (± 9509863
)193572978
ns/iter (± 17407071
)0.98
es/full/all/es5
170996170
ns/iter (± 6854663
)174257389
ns/iter (± 6282614
)0.98
es/full/all/es2015
144154599
ns/iter (± 6791857
)145133310
ns/iter (± 6163162
)0.99
es/full/all/es2016
145019080
ns/iter (± 5368859
)143168598
ns/iter (± 7742159
)1.01
es/full/all/es2017
143967554
ns/iter (± 5546123
)137845252
ns/iter (± 4913371
)1.04
es/full/all/es2018
141573922
ns/iter (± 5475309
)137583822
ns/iter (± 4521329
)1.03
es/full/all/es2019
144262956
ns/iter (± 5640827
)135805584
ns/iter (± 4855698
)1.06
es/full/all/es2020
135855008
ns/iter (± 5684862
)129403968
ns/iter (± 3242465
)1.05
es/full/parser
709729
ns/iter (± 67437
)715632
ns/iter (± 19393
)0.99
es/full/base/fixer
29943
ns/iter (± 507
)29776
ns/iter (± 704
)1.01
es/full/base/resolver_and_hygiene
88668
ns/iter (± 3172
)87161
ns/iter (± 3342
)1.02
serialization of ast node
213
ns/iter (± 2
)213
ns/iter (± 1
)1
serialization of serde
227
ns/iter (± 1
)227
ns/iter (± 7
)1
This comment was automatically generated by workflow using github-action-benchmark.