-
-
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.
refactor(es/typescript): Reimplement TypeScript pass (#7202)
**Description:** ## Bugfixes - Exported `let`/`var` declarations in TypeScript namespaces should be mutable. - Fix missing declaration of complex exported patterns in TypeScript namespaces. - Preserve concrete TS namespaces. ## New Features - Introducing [Verbatim Module Syntax](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax). - Enum value will now be inlined whenever possible within a single module, optimizing runtime performance. - Constant enums will be automatically eliminated when feasible, This can reduce bundle size. - Added support for cross-referencing enum values. ## Deprecated `TsEnumConfig` is deprecated - The `treat_const_enum_as_enum` transform option is deprecated. - The `ts_enum_is_readonly` assumption option is deprecated. **BREAKING CHANGE:** TypeScript Config is changed. **Related issue:** - Closes #5197 - Closes #5259 - Closes #7177 - Closes #7453 - Closes #7676 - Closes #7681 - Closes #7791 - Closes #7961
- Loading branch information
1 parent
bea10ef
commit 9c9a538
Showing
542 changed files
with
5,285 additions
and
5,873 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import homura = require("homura"); | ||
|
||
export import madoka = require("madoka"); | ||
|
||
|
||
|
||
// avoid unused import be stripped | ||
export { homura }; |
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 |
---|---|---|
|
@@ -13,4 +13,6 @@ | |
2 | | ||
3 | export import madoka = require("madoka"); | ||
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
4 | | ||
5 | | ||
`---- |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"use strict"; | ||
var A; | ||
(function(A) { | ||
var v = A.v = 25; | ||
const v = A.v = 25; | ||
function a() { | ||
console.log(v); | ||
} | ||
|
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,7 +1,7 @@ | ||
var n; | ||
(function(n) { | ||
var ref; | ||
ref = { | ||
var a = (ref = { | ||
a: 1 | ||
}, n.a = ref.a, ref; | ||
}, n.a = ref.a, ref).a; | ||
})(n || (n = {})); |
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,8 +1,8 @@ | ||
var Foo; | ||
(function(Foo) { | ||
var ref; | ||
ref = { | ||
var _ref = (ref = { | ||
a: 1, | ||
b: 2 | ||
}, Foo.A = ref.a, Foo.B = ref.b, ref; | ||
}, Foo.A = ref.a, Foo.B = ref.b, ref), A = _ref.a, B = _ref.b; | ||
})(Foo || (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
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,3 +1,3 @@ | ||
var l; | ||
import { test as o } from "test"; | ||
(l || (l = {})).Hello = "World!", o(l.Hello); | ||
var o; | ||
import { test as r } from "test"; | ||
(o || (o = {})).Hello = "World!", r("World!"); |
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,8 @@ | ||
enum Foo { | ||
a, | ||
b = 1, | ||
c = Foo["a"], | ||
d = Foo.a, | ||
e, | ||
f, | ||
} |
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 @@ | ||
var Foo; | ||
(function(Foo) { | ||
Foo[Foo["a"] = 0] = "a"; | ||
Foo[Foo["b"] = 1] = "b"; | ||
Foo[Foo["c"] = 0] = "c"; | ||
Foo[Foo["d"] = 0] = "d"; | ||
Foo[Foo["e"] = 1] = "e"; | ||
Foo[Foo["f"] = 2] = "f"; | ||
})(Foo || (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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es5" | ||
} | ||
} |
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 @@ | ||
a?.b!.c ?? 0; | ||
a?.b.c ?? 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var _a, _a1; | ||
var _a_b_c; | ||
(_a_b_c = (_a = a) === null || _a === void 0 ? void 0 : _a.b.c) !== null && _a_b_c !== void 0 ? _a_b_c : 0; | ||
var _a_b_c1; | ||
(_a_b_c1 = (_a1 = a) === null || _a1 === void 0 ? void 0 : _a1.b.c) !== null && _a_b_c1 !== void 0 ? _a_b_c1 : 0; |
12 changes: 12 additions & 0 deletions
12
...vercel-site/1/output/node_modules/.pnpm/[email protected]/node_modules/nanoid/async/index.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
...l-site/1/output/node_modules/.pnpm/[email protected]/node_modules/nanoid/non-secure/index.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
9c9a538
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/bugs-1
286527
ns/iter (± 5545
)293552
ns/iter (± 6825
)0.98
es/full/minify/libraries/antd
1341640931
ns/iter (± 19093820
)1306377147
ns/iter (± 5472389
)1.03
es/full/minify/libraries/d3
293412364
ns/iter (± 6721225
)275046135
ns/iter (± 1954536
)1.07
es/full/minify/libraries/echarts
1099869856
ns/iter (± 53101563
)1036811585
ns/iter (± 6322032
)1.06
es/full/minify/libraries/jquery
84574471
ns/iter (± 577717
)83704918
ns/iter (± 108235
)1.01
es/full/minify/libraries/lodash
97899239
ns/iter (± 1258337
)96725772
ns/iter (± 252292
)1.01
es/full/minify/libraries/moment
49796489
ns/iter (± 236662
)49482003
ns/iter (± 52191
)1.01
es/full/minify/libraries/react
18034686
ns/iter (± 93862
)17913875
ns/iter (± 17722
)1.01
es/full/minify/libraries/terser
219916203
ns/iter (± 2202834
)215942917
ns/iter (± 682956
)1.02
es/full/minify/libraries/three
394051997
ns/iter (± 10217188
)382573841
ns/iter (± 1413844
)1.03
es/full/minify/libraries/typescript
2650637010
ns/iter (± 46296548
)2618712391
ns/iter (± 7326268
)1.01
es/full/minify/libraries/victory
560046547
ns/iter (± 5743602
)560406056
ns/iter (± 2834930
)1.00
es/full/minify/libraries/vue
118651680
ns/iter (± 655484
)118715984
ns/iter (± 317889
)1.00
es/full/codegen/es3
33980
ns/iter (± 75
)34660
ns/iter (± 146
)0.98
es/full/codegen/es5
34051
ns/iter (± 140
)34739
ns/iter (± 172
)0.98
es/full/codegen/es2015
33984
ns/iter (± 69
)34522
ns/iter (± 143
)0.98
es/full/codegen/es2016
33977
ns/iter (± 40
)34748
ns/iter (± 83
)0.98
es/full/codegen/es2017
34021
ns/iter (± 95
)34722
ns/iter (± 50
)0.98
es/full/codegen/es2018
33986
ns/iter (± 40
)34675
ns/iter (± 78
)0.98
es/full/codegen/es2019
33891
ns/iter (± 67
)34708
ns/iter (± 120
)0.98
es/full/codegen/es2020
34001
ns/iter (± 83
)34699
ns/iter (± 123
)0.98
es/full/all/es3
166383207
ns/iter (± 1472751
)169383833
ns/iter (± 721764
)0.98
es/full/all/es5
158443828
ns/iter (± 737774
)160125474
ns/iter (± 904295
)0.99
es/full/all/es2015
118069357
ns/iter (± 871648
)119614949
ns/iter (± 625762
)0.99
es/full/all/es2016
116543165
ns/iter (± 631312
)118854468
ns/iter (± 505098
)0.98
es/full/all/es2017
116418721
ns/iter (± 845104
)117495624
ns/iter (± 638372
)0.99
es/full/all/es2018
114508582
ns/iter (± 458995
)115843801
ns/iter (± 956547
)0.99
es/full/all/es2019
113596221
ns/iter (± 959347
)115920218
ns/iter (± 647243
)0.98
es/full/all/es2020
109155796
ns/iter (± 589614
)111650714
ns/iter (± 922413
)0.98
es/full/parser
489947
ns/iter (± 5387
)489634
ns/iter (± 6226
)1.00
es/full/base/fixer
18742
ns/iter (± 114
)19788
ns/iter (± 161
)0.95
es/full/base/resolver_and_hygiene
80005
ns/iter (± 122
)81961
ns/iter (± 198
)0.98
serialization of serde
295
ns/iter (± 2
)299
ns/iter (± 0
)0.99
css/minify/libraries/bootstrap
28776211
ns/iter (± 81619
)28177692
ns/iter (± 85813
)1.02
css/visitor/compare/clone
1668480
ns/iter (± 3981
)1648220
ns/iter (± 5036
)1.01
css/visitor/compare/visit_mut_span
1794898
ns/iter (± 6867
)1772518
ns/iter (± 2520
)1.01
css/visitor/compare/visit_mut_span_panic
1856908
ns/iter (± 4355
)1859227
ns/iter (± 5126
)1.00
css/visitor/compare/fold_span
2571687
ns/iter (± 4958
)2578936
ns/iter (± 9817
)1.00
css/visitor/compare/fold_span_panic
2766270
ns/iter (± 5415
)2766172
ns/iter (± 17633
)1.00
css/lexer/bootstrap_5_1_3
4447858
ns/iter (± 62280
)4481426
ns/iter (± 3728
)0.99
css/lexer/foundation_6_7_4
3730032
ns/iter (± 3213
)3770026
ns/iter (± 2720
)0.99
css/lexer/tailwind_3_1_1
708597
ns/iter (± 1175
)714686
ns/iter (± 347
)0.99
css/parser/bootstrap_5_1_3
19669470
ns/iter (± 136352
)18876605
ns/iter (± 38484
)1.04
css/parser/foundation_6_7_4
15505757
ns/iter (± 21530
)15082635
ns/iter (± 9312
)1.03
css/parser/tailwind_3_1_1
2994202
ns/iter (± 12327
)2945426
ns/iter (± 6443
)1.02
es/codegen/colors
728304
ns/iter (± 397026
)726509
ns/iter (± 396235
)1.00
es/codegen/large
3140497
ns/iter (± 1668389
)3133282
ns/iter (± 1661616
)1.00
es/codegen/with-parser/colors
45945
ns/iter (± 151
)45784
ns/iter (± 212
)1.00
es/codegen/with-parser/large
488320
ns/iter (± 1941
)491523
ns/iter (± 1384
)0.99
es/minify/libraries/antd
1169279324
ns/iter (± 11911837
)1121476543
ns/iter (± 8253898
)1.04
es/minify/libraries/d3
239568363
ns/iter (± 724527
)237150045
ns/iter (± 340147
)1.01
es/minify/libraries/echarts
913752172
ns/iter (± 7013231
)884520093
ns/iter (± 4594801
)1.03
es/minify/libraries/jquery
73124786
ns/iter (± 116031
)73166920
ns/iter (± 162527
)1.00
es/minify/libraries/lodash
86888778
ns/iter (± 284513
)86751578
ns/iter (± 350386
)1.00
es/minify/libraries/moment
43506211
ns/iter (± 233667
)43434102
ns/iter (± 155304
)1.00
es/minify/libraries/react
16121215
ns/iter (± 66914
)16020031
ns/iter (± 20186
)1.01
es/minify/libraries/terser
186889237
ns/iter (± 456077
)185116156
ns/iter (± 375099
)1.01
es/minify/libraries/three
324745845
ns/iter (± 1383546
)318479399
ns/iter (± 990098
)1.02
es/minify/libraries/typescript
2272065915
ns/iter (± 13673506
)2215717565
ns/iter (± 10738100
)1.03
es/minify/libraries/victory
475592222
ns/iter (± 2969781
)463531919
ns/iter (± 1090321
)1.03
es/minify/libraries/vue
106491397
ns/iter (± 473568
)105782218
ns/iter (± 107360
)1.01
es/visitor/compare/clone
1963025
ns/iter (± 7720
)1971666
ns/iter (± 2162
)1.00
es/visitor/compare/visit_mut_span
2300835
ns/iter (± 5399
)2328279
ns/iter (± 4447
)0.99
es/visitor/compare/visit_mut_span_panic
2333279
ns/iter (± 5796
)2362204
ns/iter (± 3616
)0.99
es/visitor/compare/fold_span
3379509
ns/iter (± 5730
)3400907
ns/iter (± 6290
)0.99
es/visitor/compare/fold_span_panic
3540958
ns/iter (± 4690
)3565861
ns/iter (± 5182
)0.99
es/lexer/colors
13175
ns/iter (± 8
)13154
ns/iter (± 12
)1.00
es/lexer/angular
6117668
ns/iter (± 23100
)6117060
ns/iter (± 5373
)1.00
es/lexer/backbone
789538
ns/iter (± 786
)793721
ns/iter (± 1399
)0.99
es/lexer/jquery
4507316
ns/iter (± 12594
)4492175
ns/iter (± 9795
)1.00
es/lexer/jquery mobile
6872445
ns/iter (± 5580
)6852671
ns/iter (± 2025
)1.00
es/lexer/mootools
3583795
ns/iter (± 7054
)3571059
ns/iter (± 9285
)1.00
es/lexer/underscore
673089
ns/iter (± 1681
)664624
ns/iter (± 809
)1.01
es/lexer/three
21577969
ns/iter (± 32159
)21367964
ns/iter (± 12889
)1.01
es/lexer/yui
3851062
ns/iter (± 4856
)3821564
ns/iter (± 1742
)1.01
es/parser/colors
27706
ns/iter (± 402
)27125
ns/iter (± 633
)1.02
es/parser/angular
13679330
ns/iter (± 56353
)13461242
ns/iter (± 67156
)1.02
es/parser/backbone
2010213
ns/iter (± 9704
)1968295
ns/iter (± 8467
)1.02
es/parser/jquery
10946093
ns/iter (± 45235
)10794743
ns/iter (± 31748
)1.01
es/parser/jquery mobile
16701337
ns/iter (± 85625
)16504569
ns/iter (± 58329
)1.01
es/parser/mootools
8441850
ns/iter (± 17658
)8308914
ns/iter (± 14836
)1.02
es/parser/underscore
1731040
ns/iter (± 12258
)1694839
ns/iter (± 10749
)1.02
es/parser/three
47350773
ns/iter (± 179302
)46133111
ns/iter (± 136020
)1.03
es/parser/yui
8392786
ns/iter (± 32339
)8206119
ns/iter (± 27047
)1.02
es/preset-env/usage/builtin_type
137660
ns/iter (± 32599
)136340
ns/iter (± 32102
)1.01
es/preset-env/usage/property
17059
ns/iter (± 45
)17182
ns/iter (± 59
)0.99
es/resolver/typescript
90567224
ns/iter (± 1801288
)89472515
ns/iter (± 1006854
)1.01
es/fixer/typescript
64449697
ns/iter (± 1977461
)63820888
ns/iter (± 248943
)1.01
es/hygiene/typescript
131589918
ns/iter (± 711874
)129745748
ns/iter (± 507399
)1.01
es/resolver_with_hygiene/typescript
242453713
ns/iter (± 991759
)240447449
ns/iter (± 636516
)1.01
es/visitor/base-perf/module_clone
58617
ns/iter (± 520
)58817
ns/iter (± 207
)1.00
es/visitor/base-perf/fold_empty
62776
ns/iter (± 377
)63527
ns/iter (± 233
)0.99
es/visitor/base-perf/fold_noop_impl_all
62842
ns/iter (± 310
)63130
ns/iter (± 760
)1.00
es/visitor/base-perf/fold_noop_impl_vec
62662
ns/iter (± 175
)63251
ns/iter (± 250
)0.99
es/visitor/base-perf/boxing_boxed_clone
56
ns/iter (± 0
)56
ns/iter (± 0
)1
es/visitor/base-perf/boxing_unboxed_clone
39
ns/iter (± 0
)41
ns/iter (± 0
)0.95
es/visitor/base-perf/boxing_boxed
110
ns/iter (± 0
)109
ns/iter (± 0
)1.01
es/visitor/base-perf/boxing_unboxed
77
ns/iter (± 0
)77
ns/iter (± 0
)1
es/visitor/base-perf/visit_empty
0
ns/iter (± 0
)0
ns/iter (± 0
)NaN
es/visitor/base-perf/visit_contains_this
2523
ns/iter (± 25
)2531
ns/iter (± 12
)1.00
es/base/parallel/resolver/typescript
3864096578
ns/iter (± 267759037
)4396654612
ns/iter (± 303804904
)0.88
es/base/parallel/hygiene/typescript
1480515213
ns/iter (± 10855884
)1450786205
ns/iter (± 6942120
)1.02
misc/visitors/time-complexity/time 5
150
ns/iter (± 0
)150
ns/iter (± 0
)1
misc/visitors/time-complexity/time 10
324
ns/iter (± 4
)439
ns/iter (± 2
)0.74
misc/visitors/time-complexity/time 15
878
ns/iter (± 0
)798
ns/iter (± 1
)1.10
misc/visitors/time-complexity/time 20
1283
ns/iter (± 30
)1284
ns/iter (± 7
)1.00
misc/visitors/time-complexity/time 40
4363
ns/iter (± 2
)4340
ns/iter (± 51
)1.01
misc/visitors/time-complexity/time 60
9032
ns/iter (± 18
)8998
ns/iter (± 14
)1.00
This comment was automatically generated by workflow using github-action-benchmark.