Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/minifier): Change default es version to
es5
(#5333)
- Loading branch information
Showing
54 changed files
with
164 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ var M, ANY2 = [ | |
"" | ||
], obj1 = { | ||
x: "", | ||
y () {} | ||
y: ()=>{} | ||
}; | ||
class A { | ||
static foo() {} | ||
|
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
4 changes: 3 additions & 1 deletion
4
crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1_es2015.2.minified.js
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
4 changes: 3 additions & 1 deletion
4
crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty2_es2015.2.minified.js
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
...es/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES5_es2015.2.minified.js
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,6 +1,6 @@ | ||
foo({ | ||
p: "", | ||
0 () {}, | ||
0: ()=>{}, | ||
hibye: !0, | ||
1: 0, | ||
[NaN]: [ | ||
|
2 changes: 1 addition & 1 deletion
2
...es/swc/tests/tsc-references/computedPropertyNamesContextualType6_ES6_es2015.2.minified.js
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,6 +1,6 @@ | ||
foo({ | ||
p: "", | ||
0 () {}, | ||
0: ()=>{}, | ||
hibye: !0, | ||
1: 0, | ||
[NaN]: [ | ||
|
2 changes: 1 addition & 1 deletion
2
...es/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES5_es2015.2.minified.js
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,5 +1,5 @@ | ||
foo({ | ||
0 () {}, | ||
0: ()=>{}, | ||
hibye: !0, | ||
1: 0, | ||
[NaN]: [ | ||
|
2 changes: 1 addition & 1 deletion
2
...es/swc/tests/tsc-references/computedPropertyNamesContextualType7_ES6_es2015.2.minified.js
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,5 +1,5 @@ | ||
foo({ | ||
0 () {}, | ||
0: ()=>{}, | ||
hibye: !0, | ||
1: 0, | ||
[NaN]: [ | ||
|
4 changes: 3 additions & 1 deletion
4
crates/swc/tests/tsc-references/contextualThisType_es2015.2.minified.js
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,4 +1,6 @@ | ||
var x = { | ||
a: (p)=>p | ||
a (p) { | ||
return p; | ||
} | ||
}; | ||
x.a(x); |
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
4 changes: 3 additions & 1 deletion
4
crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es2015.2.minified.js
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ var M, ANY2 = [ | |
"" | ||
], obj1 = { | ||
x: "", | ||
y () {} | ||
y: ()=>{} | ||
}; | ||
class A { | ||
static foo() {} | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ var M, ANY2 = [ | |
"" | ||
], obj1 = { | ||
x: "", | ||
y () {} | ||
y: ()=>{} | ||
}; | ||
class A { | ||
static foo() {} | ||
|
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/tests/tsc-references/objectTypeHidingMembersOfObject_es2015.2.minified.js
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,4 +1,4 @@ | ||
var i, b; | ||
(void 0).valueOf(), i.valueOf(), ({ | ||
valueOf () {} | ||
valueOf: ()=>{} | ||
}).valueOf(), b.valueOf(); |
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
4 changes: 3 additions & 1 deletion
4
crates/swc/tests/tsc-references/symbolProperty18_es2015.2.minified.js
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,6 +1,8 @@ | ||
var i = { | ||
[Symbol.iterator]: 0, | ||
[Symbol.toStringTag]: ()=>"", | ||
[Symbol.toStringTag] () { | ||
return ""; | ||
}, | ||
set [Symbol.toPrimitive] (p){} | ||
}; | ||
i[Symbol.iterator], i[Symbol.toStringTag](), i[Symbol.toPrimitive] = !1; |
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 |
---|---|---|
|
@@ -18,5 +18,7 @@ extend1({ | |
foo (n) { | ||
return n.length + this.bar(); | ||
}, | ||
bar: ()=>14 | ||
bar () { | ||
return 14; | ||
} | ||
}); |
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
Oops, something went wrong.
64a9946
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
1806238021
ns/iter (± 100429634
)1622447998
ns/iter (± 37731133
)1.11
es/full/minify/libraries/d3
458689603
ns/iter (± 33275540
)418982906
ns/iter (± 17744724
)1.09
es/full/minify/libraries/echarts
1753634635
ns/iter (± 126506590
)1563500521
ns/iter (± 36374416
)1.12
es/full/minify/libraries/jquery
117313212
ns/iter (± 2344835
)88827586
ns/iter (± 813573
)1.32
es/full/minify/libraries/lodash
153460236
ns/iter (± 13737784
)118249410
ns/iter (± 6464666
)1.30
es/full/minify/libraries/moment
66473435
ns/iter (± 6228911
)52127674
ns/iter (± 1173451
)1.28
es/full/minify/libraries/react
20843545
ns/iter (± 2397650
)17114045
ns/iter (± 420212
)1.22
es/full/minify/libraries/terser
324216858
ns/iter (± 39319665
)289323614
ns/iter (± 4290493
)1.12
es/full/minify/libraries/three
612515817
ns/iter (± 61392560
)536107219
ns/iter (± 2822790
)1.14
es/full/minify/libraries/typescript
3910479412
ns/iter (± 228321768
)3451130307
ns/iter (± 67592688
)1.13
es/full/minify/libraries/victory
800986046
ns/iter (± 78851358
)730022748
ns/iter (± 15282988
)1.10
es/full/minify/libraries/vue
169046136
ns/iter (± 12215771
)132949641
ns/iter (± 7088191
)1.27
es/full/codegen/es3
33825
ns/iter (± 2610
)32500
ns/iter (± 368
)1.04
es/full/codegen/es5
35612
ns/iter (± 5922
)32519
ns/iter (± 585
)1.10
es/full/codegen/es2015
36060
ns/iter (± 4498
)32548
ns/iter (± 746
)1.11
es/full/codegen/es2016
35629
ns/iter (± 3308
)32541
ns/iter (± 675
)1.09
es/full/codegen/es2017
34142
ns/iter (± 3193
)32559
ns/iter (± 1487
)1.05
es/full/codegen/es2018
33947
ns/iter (± 3153
)32540
ns/iter (± 901
)1.04
es/full/codegen/es2019
33795
ns/iter (± 3492
)32511
ns/iter (± 324
)1.04
es/full/codegen/es2020
33600
ns/iter (± 3626
)32503
ns/iter (± 410
)1.03
es/full/all/es3
224326953
ns/iter (± 20466628
)189070194
ns/iter (± 5666065
)1.19
es/full/all/es5
208733633
ns/iter (± 25037245
)176976052
ns/iter (± 4840554
)1.18
es/full/all/es2015
168221940
ns/iter (± 18177800
)145564230
ns/iter (± 4230758
)1.16
es/full/all/es2016
166942037
ns/iter (± 16404809
)144613591
ns/iter (± 7153291
)1.15
es/full/all/es2017
168036261
ns/iter (± 19277710
)144625881
ns/iter (± 5792735
)1.16
es/full/all/es2018
165433518
ns/iter (± 21191253
)142443814
ns/iter (± 4045583
)1.16
es/full/all/es2019
166971123
ns/iter (± 17031094
)141785394
ns/iter (± 6518611
)1.18
es/full/all/es2020
159042846
ns/iter (± 22935747
)137748710
ns/iter (± 4487375
)1.15
es/full/parser
816181
ns/iter (± 101448
)753299
ns/iter (± 30706
)1.08
es/full/base/fixer
30762
ns/iter (± 5320
)28875
ns/iter (± 452
)1.07
es/full/base/resolver_and_hygiene
91320
ns/iter (± 5078
)86765
ns/iter (± 4868
)1.05
serialization of ast node
217
ns/iter (± 16
)210
ns/iter (± 5
)1.03
serialization of serde
249
ns/iter (± 23
)227
ns/iter (± 2
)1.10
This comment was automatically generated by workflow using github-action-benchmark.