-
-
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.
fix(es/resolver): Hoist namespaces (#4902)
- Loading branch information
Showing
17 changed files
with
317 additions
and
263 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": false | ||
}, | ||
"target": "es2021", | ||
"loose": false | ||
}, | ||
"module": { | ||
"type": "amd", | ||
"noInterop": true | ||
} | ||
} |
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,7 @@ | ||
export function boo() { | ||
return Foo.Bar * 2; | ||
} | ||
|
||
export namespace Foo { | ||
export const Bar = 1234; | ||
} |
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,19 @@ | ||
define([ | ||
"require", | ||
"exports" | ||
], function(require, _exports) { | ||
"use strict"; | ||
Object.defineProperty(_exports, "__esModule", { | ||
value: true | ||
}); | ||
_exports.boo = boo; | ||
_exports.Foo = void 0; | ||
function boo() { | ||
return Foo1.Bar * 2; | ||
} | ||
var Foo1; | ||
_exports.Foo = Foo1; | ||
(function(Foo) { | ||
var Bar = Foo.Bar = 1234; | ||
})(Foo1 || (_exports.Foo = Foo1 = {})); | ||
}); |
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
10 changes: 5 additions & 5 deletions
10
crates/swc/tests/tsc-references/circularImportAlias_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,13 +1,13 @@ | ||
var B, A1; | ||
var B, A; | ||
!function(B1) { | ||
var a = A; | ||
B1.a = a; | ||
class D extends a.C { | ||
} | ||
B1.D = D; | ||
}(B || (B = {})), function(A) { | ||
A.C = class { | ||
}(B || (B = {})), function(A1) { | ||
A1.C = class { | ||
}; | ||
var b = B; | ||
A.b = b; | ||
}(A1 || (A1 = {})), new B.a.C(); | ||
A1.b = b; | ||
}(A || (A = {})), new B.a.C(); |
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
10 changes: 5 additions & 5 deletions
10
crates/swc/tests/tsc-references/classExtendsItselfIndirectly2_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
Oops, something went wrong.
a9f91dc
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
2697384751
ns/iter (± 99455141
)1981900781
ns/iter (± 48036631
)1.36
es/full/minify/libraries/d3
573220387
ns/iter (± 25533479
)483669191
ns/iter (± 14878623
)1.19
es/full/minify/libraries/echarts
2927046536
ns/iter (± 30379377
)2398443174
ns/iter (± 17608810
)1.22
es/full/minify/libraries/jquery
121748355
ns/iter (± 3194589
)105403269
ns/iter (± 823235
)1.16
es/full/minify/libraries/lodash
177106155
ns/iter (± 5143078
)152124303
ns/iter (± 739302
)1.16
es/full/minify/libraries/moment
73187760
ns/iter (± 1843908
)61775507
ns/iter (± 335599
)1.18
es/full/minify/libraries/react
24637045
ns/iter (± 598814
)20066374
ns/iter (± 72119
)1.23
es/full/minify/libraries/terser
824503266
ns/iter (± 16164282
)527787452
ns/iter (± 9494635
)1.56
es/full/minify/libraries/three
756894718
ns/iter (± 43819032
)631359119
ns/iter (± 15191116
)1.20
es/full/minify/libraries/typescript
5948783284
ns/iter (± 62131020
)4576307705
ns/iter (± 22353294
)1.30
es/full/minify/libraries/victory
1058740468
ns/iter (± 32952198
)834406932
ns/iter (± 12823170
)1.27
es/full/minify/libraries/vue
191292071
ns/iter (± 3792718
)159649140
ns/iter (± 1465959
)1.20
es/full/codegen/es3
37172
ns/iter (± 2014
)34541
ns/iter (± 131
)1.08
es/full/codegen/es5
38019
ns/iter (± 2479
)34540
ns/iter (± 160
)1.10
es/full/codegen/es2015
38063
ns/iter (± 1698
)34547
ns/iter (± 138
)1.10
es/full/codegen/es2016
37902
ns/iter (± 2457
)34546
ns/iter (± 147
)1.10
es/full/codegen/es2017
37737
ns/iter (± 2652
)34547
ns/iter (± 146
)1.09
es/full/codegen/es2018
38888
ns/iter (± 2623
)34532
ns/iter (± 154
)1.13
es/full/codegen/es2019
40916
ns/iter (± 2393
)34489
ns/iter (± 150
)1.19
es/full/codegen/es2020
40671
ns/iter (± 3360
)34549
ns/iter (± 171
)1.18
es/full/all/es3
239540083
ns/iter (± 6745430
)193133036
ns/iter (± 760795
)1.24
es/full/all/es5
220629347
ns/iter (± 8467463
)182610896
ns/iter (± 940671
)1.21
es/full/all/es2015
175611474
ns/iter (± 4795007
)145184431
ns/iter (± 852226
)1.21
es/full/all/es2016
174099425
ns/iter (± 6589569
)144781699
ns/iter (± 1014219
)1.20
es/full/all/es2017
174440909
ns/iter (± 4888366
)143664680
ns/iter (± 786159
)1.21
es/full/all/es2018
174068159
ns/iter (± 4437207
)141586849
ns/iter (± 805704
)1.23
es/full/all/es2019
172745080
ns/iter (± 5394709
)141079205
ns/iter (± 1446754
)1.22
es/full/all/es2020
163579989
ns/iter (± 4483204
)136971924
ns/iter (± 1367832
)1.19
es/full/parser
774578
ns/iter (± 50942
)587088
ns/iter (± 75650
)1.32
es/full/base/fixer
38044
ns/iter (± 2033
)27312
ns/iter (± 213
)1.39
es/full/base/resolver_and_hygiene
186464
ns/iter (± 9500
)141707
ns/iter (± 1745
)1.32
serialization of ast node
209
ns/iter (± 9
)182
ns/iter (± 0
)1.15
serialization of serde
194
ns/iter (± 9
)182
ns/iter (± 0
)1.07
This comment was automatically generated by workflow using github-action-benchmark.