-
-
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(css/minifier): Handle zero in at-rules (#6155)
- Loading branch information
1 parent
16df442
commit 0f38e38
Showing
15 changed files
with
91 additions
and
30 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
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_css_minifier/tests/fixture/compress-calc/container/output.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
crates/swc_css_minifier/tests/fixture/compress-calc/import/input.css
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 @@ | ||
@import url("narrow.css") supports(display: flex) screen and (max-width: calc(0px)); | ||
@import url("narrow.css") supports(display: flex) screen and (max-width: calc(100px * 0)); |
1 change: 1 addition & 0 deletions
1
crates/swc_css_minifier/tests/fixture/compress-calc/import/output.min.css
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 @@ | ||
@import"narrow.css"supports(display:flex)screen and (max-width:0);@import"narrow.css"supports(display:flex)screen and (max-width:0); |
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_css_minifier/tests/fixture/compress-calc/media-query/output.min.css
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 @@ | ||
@media(min-width:20px){.class1{color:red}}@media(min-width:calc(20px)){.class1{color:red}}@media(color:1){.class1{color:red}} | ||
@media(min-width:20px){.class1{color:red}}@media(min-width:calc(20px)){.class1{color:red}}@media(color:1){.class1{color:red}}@media(min-width:0){.class1{color:red}}@media(min-width:0){.class1{color:red}} |
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_css_minifier/tests/fixture/compress-calc/supports-condition/output.min.css
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 @@ | ||
@supports(width:calc(200px)){div{background:red}}@supports(width:calc(calc(200px))){div{background:red}} | ||
@supports(width:calc(200px)){div{background:red}}@supports(width:calc(calc(200px))){div{background:red}}@supports(width:calc(0px)){div{background:red}}@supports(width:calc(0px)){div{background:red}} |
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_css_minifier/tests/fixture/compress-calc/units/output.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
2 changes: 1 addition & 1 deletion
2
crates/swc_css_minifier/tests/fixture/compress-length/output.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
0f38e38
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
1914444605
ns/iter (± 107549417
)2015562752
ns/iter (± 28005356
)0.95
es/full/minify/libraries/d3
430217137
ns/iter (± 14323961
)384817667
ns/iter (± 23995060
)1.12
es/full/minify/libraries/echarts
1582893392
ns/iter (± 73005719
)1706567840
ns/iter (± 47308913
)0.93
es/full/minify/libraries/jquery
108417826
ns/iter (± 7090934
)114085605
ns/iter (± 3107774
)0.95
es/full/minify/libraries/lodash
115140595
ns/iter (± 4076471
)137797128
ns/iter (± 13707766
)0.84
es/full/minify/libraries/moment
67383821
ns/iter (± 3553303
)74946097
ns/iter (± 15800127
)0.90
es/full/minify/libraries/react
28080496
ns/iter (± 17570352
)25100276
ns/iter (± 1373092
)1.12
es/full/minify/libraries/terser
327031846
ns/iter (± 7704815
)478940130
ns/iter (± 336414217
)0.68
es/full/minify/libraries/three
568710094
ns/iter (± 16681015
)627116485
ns/iter (± 24200158
)0.91
es/full/minify/libraries/typescript
3608956218
ns/iter (± 148304921
)4218395148
ns/iter (± 204695328
)0.86
es/full/minify/libraries/victory
858509768
ns/iter (± 9164333
)926313940
ns/iter (± 87392427
)0.93
es/full/minify/libraries/vue
169582844
ns/iter (± 14947793
)174570347
ns/iter (± 8157904
)0.97
es/full/codegen/es3
35854
ns/iter (± 2544
)41927
ns/iter (± 1199
)0.86
es/full/codegen/es5
35456
ns/iter (± 3674
)41501
ns/iter (± 1364
)0.85
es/full/codegen/es2015
34893
ns/iter (± 1385
)41220
ns/iter (± 2111
)0.85
es/full/codegen/es2016
35192
ns/iter (± 1310
)41122
ns/iter (± 2960
)0.86
es/full/codegen/es2017
35378
ns/iter (± 2322
)40630
ns/iter (± 2716
)0.87
es/full/codegen/es2018
34661
ns/iter (± 841
)41199
ns/iter (± 4842
)0.84
es/full/codegen/es2019
34990
ns/iter (± 1626
)41724
ns/iter (± 27729
)0.84
es/full/codegen/es2020
34756
ns/iter (± 1223
)41720
ns/iter (± 13576
)0.83
es/full/all/es3
225981851
ns/iter (± 23718760
)239405001
ns/iter (± 23327302
)0.94
es/full/all/es5
220831314
ns/iter (± 27960088
)226843921
ns/iter (± 21595910
)0.97
es/full/all/es2015
193600112
ns/iter (± 22578234
)183606446
ns/iter (± 17213743
)1.05
es/full/all/es2016
177571546
ns/iter (± 14406823
)182694742
ns/iter (± 14969074
)0.97
es/full/all/es2017
176926235
ns/iter (± 20711515
)183324645
ns/iter (± 13771465
)0.97
es/full/all/es2018
175353587
ns/iter (± 20991811
)176973367
ns/iter (± 11613859
)0.99
es/full/all/es2019
172146189
ns/iter (± 17618816
)179108311
ns/iter (± 16975959
)0.96
es/full/all/es2020
162769040
ns/iter (± 10103792
)174247112
ns/iter (± 20964067
)0.93
es/full/parser
752268
ns/iter (± 48247
)885301
ns/iter (± 76033
)0.85
es/full/base/fixer
26986
ns/iter (± 1786
)33082
ns/iter (± 1310
)0.82
es/full/base/resolver_and_hygiene
95519
ns/iter (± 5639
)120100
ns/iter (± 11597
)0.80
serialization of ast node
208
ns/iter (± 8
)253
ns/iter (± 14
)0.82
serialization of serde
229
ns/iter (± 9
)256
ns/iter (± 15
)0.89
This comment was automatically generated by workflow using github-action-benchmark.