@swc/core 1.2.208 → 1.2.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,183 @@
5
5
 
6
6
 
7
7
 
8
+ - **(cli)** Constructs config file correctly (#5146) ([4f87396](https://github.com/swc-project/swc/commit/4f87396b3b4ca1ec75eff77567f001ea5092598a))
9
+
10
+
11
+ - **(es/compat)** Preserve more class names (#5106) ([dd39a79](https://github.com/swc-project/swc/commit/dd39a798ae25dfb44c8a428a4a5c0fb962e78ae4))
12
+
13
+
14
+ - **(es/compat)** Optimize `for-of` loops for array literals (#5141) ([9351303](https://github.com/swc-project/swc/commit/93513031b51e6b0b8ac21982ed97bb12e5dec14f))
15
+
16
+
17
+ - **(es/compat)** Remove extra `this`/`arguments` capture in arrows (#5152) ([cd8d65b](https://github.com/swc-project/swc/commit/cd8d65b9a75a25ed62ad7daf40a02d6f76067696))
18
+
19
+
20
+ - **(es/lints)** Handle import-require duplicate bindings (#5131) ([a0ec370](https://github.com/swc-project/swc/commit/a0ec3705a4dc59709ad388660d8994295fa80074))
21
+
22
+
23
+ - **(es/minifier)** Don't inline a callable expression if it's used as a reference (#5118) ([0e4a03c](https://github.com/swc-project/swc/commit/0e4a03ccc65aaca143873f16643513a922ace6cd))
24
+
25
+
26
+ - **(es/modules)** Handle top level this (#5159) ([451f346](https://github.com/swc-project/swc/commit/451f346af0116bb26707b38b951a4e74ed2cdc97))
27
+
28
+
29
+ - **(es/modules)** Handle top level this, really (#5160) ([2555d71](https://github.com/swc-project/swc/commit/2555d71a6045ef6522323e5ea9b5c40800d4ab12))
30
+
31
+
32
+ - **(es/parser)** Support type-only export-import declarations (#5122) ([fbfca36](https://github.com/swc-project/swc/commit/fbfca36f58cf393faae132b092d05e9aaa931d55))
33
+
34
+
35
+ - **(sourcemap)** Handle multi-byte characters correctly (#5153) ([bbbe0b6](https://github.com/swc-project/swc/commit/bbbe0b6e94cb230245ead484125da23615f4f6d6))
36
+
37
+ ### Documentation
38
+
39
+
40
+
41
+ - **(es/parser)** Typo (#5136) ([9d4be11](https://github.com/swc-project/swc/commit/9d4be11f2ef0b9245a1626717f9c75e0220e5dfa))
42
+
43
+
44
+ - **(visit)** Add docs for visitors (#5137) ([76de911](https://github.com/swc-project/swc/commit/76de91146661a7b1b72e81f91787e57943040481))
45
+
46
+ ### Features
47
+
48
+
49
+
50
+ - **(css/minifier)** Compress hsl colors (#5142) ([714ff53](https://github.com/swc-project/swc/commit/714ff5321d415e7ec1bfa211364ca4c8012df31e))
51
+
52
+
53
+ - **(css/minifier)** Compress `hwb` color (#5155) ([d6a827d](https://github.com/swc-project/swc/commit/d6a827d173a2fcea3143ce3100a2b08d25af0d1f))
54
+
55
+
56
+ - **(es/parser)** Support `d` in regex flag for es2022 (#5127) ([2d94797](https://github.com/swc-project/swc/commit/2d94797975ee162837b24283c8b738f282586a4d))
57
+
58
+
59
+ - **(es/typescript)** Follow TypeScript error report (#5114) ([f952a61](https://github.com/swc-project/swc/commit/f952a6161c634fbb430b0befad6f3946c9fbfde5))
60
+
61
+
62
+ - **(html)** Add `raw` for text (#5148) ([01bfe46](https://github.com/swc-project/swc/commit/01bfe46019ed897a4a3151ac207fd989497621e8))
63
+
64
+
65
+ - **(html/minifier)** Sort attributes (#4784) ([f813a60](https://github.com/swc-project/swc/commit/f813a60497da416c41041af1d82d7186a6f0cc09))
66
+
67
+
68
+ - **(html/minifier)** Compress default attributes for svg (#5150) ([8bc9a40](https://github.com/swc-project/swc/commit/8bc9a40c99268ff5858479b29cf74a30c8c361db))
69
+
70
+
71
+ - **(plugin)** Wrap serialized struct with a version (#5128) ([82fbe15](https://github.com/swc-project/swc/commit/82fbe15a57e51ae444c3846fe6a512af297e0087))
72
+
73
+
74
+ - **(visit)** Implement `Eq` for `AstKind` (#5133) ([46b1b42](https://github.com/swc-project/swc/commit/46b1b42c3c8ceafadfdc30973344eaded5a52bda))
75
+
76
+
77
+ - **(visit)** Implement more traits for `AstKind` (#5135) ([f26d59b](https://github.com/swc-project/swc/commit/f26d59b7701f5d7f6cf25055c1ed0e37da6964a1))
78
+
79
+ ### Refactor
80
+
81
+
82
+
83
+ - **(common)** Bikeshed plugin apis (#5120) ([2ba8b39](https://github.com/swc-project/swc/commit/2ba8b39fa0f2ff7e553d74a4c5ef0f04660a8c40))
84
+
85
+
86
+ - **(plugin)** Refactor transform executor (#5147) ([e8214ba](https://github.com/swc-project/swc/commit/e8214babf5ad405c7be1f2391a3be01ab355178f))
87
+
88
+ ## [1.2.210] - 2022-07-05
89
+
90
+ ### Bug Fixes
91
+
92
+
93
+
94
+ - **(es/codegen)** Fix codegen of some non-ascii characters (#5108) ([b76b499](https://github.com/swc-project/swc/commit/b76b4999cce42fb2e41ca165bd68bbc8f6663bdc))
95
+
96
+
97
+ - **(es/fixer)** Preserve parens in opt calls (#5110) ([3e3c44a](https://github.com/swc-project/swc/commit/3e3c44a0b64c55b4d976a4dafbb999000612d14a))
98
+
99
+
100
+ - **(es/fixer)** Preserve parens in more opt calls (#5111) ([528d4c5](https://github.com/swc-project/swc/commit/528d4c5aa45f4a7445fcc7b50eb71302d3631190))
101
+
102
+
103
+ - **(es/lints)** Allow overload in typescript (#5116) ([bef8aeb](https://github.com/swc-project/swc/commit/bef8aebdeadb4d15b7417af88947bfc905f93628))
104
+
105
+ ### Documentation
106
+
107
+
108
+
109
+ - **(visit)** Generate rustdoc (#5107) ([8ea631c](https://github.com/swc-project/swc/commit/8ea631c7669356905fb7defd6aeb0fb0602ec458))
110
+
111
+ ## [1.2.209] - 2022-07-05
112
+
113
+ ### Bug Fixes
114
+
115
+
116
+
117
+ - **(es/codegen)** Emit numeric value for Binary and Octal literals (#5083) ([8df6e04](https://github.com/swc-project/swc/commit/8df6e047cc523088a26a3363fe33f1bc224738b0))
118
+
119
+
120
+ - **(es/compat)** Preserve spans in `object_rest_spread` (#5082) ([de66b64](https://github.com/swc-project/swc/commit/de66b64aed13166803ebdfb91d1c421eec064c25))
121
+
122
+
123
+ - **(es/compat)** Preserve class names (#5104) ([adbb0bf](https://github.com/swc-project/swc/commit/adbb0bf8d8391aa4f15d64c72be701c03de98617))
124
+
125
+
126
+ - **(es/lints)** Cover more `const-assign` cases (#5098) ([f7d857c](https://github.com/swc-project/swc/commit/f7d857c6b6c32ad228aa929d0301b22c9d34ff8b))
127
+
128
+
129
+ - **(es/modules)** Preserve orders of exports (#5081) ([2f2039c](https://github.com/swc-project/swc/commit/2f2039c693bd1e16b16dd1b1b32f3582fdadca4e))
130
+
131
+
132
+ - **(es/modules)** Create an indirect call for a lazy require (#5089) ([0a7ca2f](https://github.com/swc-project/swc/commit/0a7ca2f4bbfaa2573b4da6b25127064cbcfd755f))
133
+
134
+
135
+ - **(es/modules)** Support lazy for `export from` (#5103) ([c531e67](https://github.com/swc-project/swc/commit/c531e67a3058bd6d567922d74fe51dc6e393761b))
136
+
137
+
138
+ - **(es/react)** Don't panic on invalid react pragma (#5101) ([cc555ef](https://github.com/swc-project/swc/commit/cc555ef225e3299bc17b6e21d67b3a42619abd5a))
139
+
140
+
141
+ - **(es/resolver)** Fix handling of block scoped functions (#5092) ([9519e80](https://github.com/swc-project/swc/commit/9519e801ea3bd9a0d7cc4f145323d0a734c83669))
142
+
143
+
144
+ - **(html/minifier)** Small fix (#5079) ([5ac5ae2](https://github.com/swc-project/swc/commit/5ac5ae200c3c896f205e7c4567a5a6281d16015b))
145
+
146
+
147
+ - **(html/minifier)** Fix bugs of the smart mode (#5093) ([5932a0a](https://github.com/swc-project/swc/commit/5932a0a2ef42ae67f1d2eceebe752b01160ca6fe))
148
+
149
+
150
+ - **(node/types)** Add `simplify` (#5105) ([2a29b50](https://github.com/swc-project/swc/commit/2a29b50c5eb7e1441c2735fec9686771c6050053))
151
+
152
+ ### Features
153
+
154
+
155
+
156
+ - **(es/modules)** Support `allowTopLevelThis` (#5086) ([9addef6](https://github.com/swc-project/swc/commit/9addef6fc8672854b52a1b71668795474a6f3fec))
157
+
158
+
159
+ - **(es/modules)** Add pure annotations to interop functions (#5087) ([4d5783d](https://github.com/swc-project/swc/commit/4d5783d9cd1f91f5b7cdcc5efaa7d83f35ee4fef))
160
+
161
+
162
+ - **(es/modules)** Support AMD triple slash directives (#5091) ([ddb31d1](https://github.com/swc-project/swc/commit/ddb31d1fd79250b14cbb873424f02c750f9c6ef6))
163
+
164
+
165
+ - **(es/parser)** Support labelled function from annex B (#5078) ([b62fd3e](https://github.com/swc-project/swc/commit/b62fd3e6cc371ad4f8cb9055b3fed70f1954afa2))
166
+
167
+
168
+ - **(html/minifier)** Remove empty metadata elements (#5085) ([cb845c9](https://github.com/swc-project/swc/commit/cb845c9bf903136b074af269b96a685027599284))
169
+
170
+
171
+ - **(visit)** Add path-aware variants (#5073) ([204d742](https://github.com/swc-project/swc/commit/204d742ed6ed5f91612245604b4e9037470bc97a))
172
+
173
+ ### Testing
174
+
175
+
176
+
177
+ - **(es/modules)** Add test for string-names (#5088) ([52bfb18](https://github.com/swc-project/swc/commit/52bfb18113895d20bc952e84302e8591c1fdf407))
178
+
179
+ ## [1.2.208] - 2022-07-01
180
+
181
+ ### Bug Fixes
182
+
183
+
184
+
8
185
  - **(es/compat)** Preserve this in function with block scoped vars (#5056) ([18ea2b5](https://github.com/swc-project/swc/commit/18ea2b577011d610fbb06bb6728a86be8366703a))
9
186
 
10
187
 
package/README.md CHANGED
@@ -34,6 +34,14 @@
34
34
 
35
35
  SWC (stands for `Speedy Web Compiler`) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a library for Rust and JavaScript at the same time. If you are using SWC from Rust, see [rustdoc](https://rustdoc.swc.rs/swc/) and for most users, your entry point for using the library will be [parser](https://rustdoc.swc.rs/swc_ecma_parser/).
36
36
 
37
+ Also, SWC tries to ensure that
38
+
39
+ > If you select the latest version of each crates, it will work
40
+
41
+ for rust users. Without such guarantee, using SWC would be too hard as SWC is a large, modular project and typically you have to use many modules.
42
+
43
+ ---
44
+
37
45
  If you are using SWC from JavaScript, please refer to [docs on the website](https://swc.rs/docs/installation/).
38
46
 
39
47
  # Documentation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.208",
3
+ "version": "1.2.211",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -135,18 +135,18 @@
135
135
  "url": "https://opencollective.com/swc"
136
136
  },
137
137
  "optionalDependencies": {
138
- "@swc/core-win32-x64-msvc": "1.2.208",
139
- "@swc/core-darwin-x64": "1.2.208",
140
- "@swc/core-linux-x64-gnu": "1.2.208",
141
- "@swc/core-linux-x64-musl": "1.2.208",
142
- "@swc/core-freebsd-x64": "1.2.208",
143
- "@swc/core-win32-ia32-msvc": "1.2.208",
144
- "@swc/core-linux-arm64-gnu": "1.2.208",
145
- "@swc/core-linux-arm-gnueabihf": "1.2.208",
146
- "@swc/core-darwin-arm64": "1.2.208",
147
- "@swc/core-android-arm64": "1.2.208",
148
- "@swc/core-linux-arm64-musl": "1.2.208",
149
- "@swc/core-win32-arm64-msvc": "1.2.208",
150
- "@swc/core-android-arm-eabi": "1.2.208"
138
+ "@swc/core-win32-x64-msvc": "1.2.211",
139
+ "@swc/core-darwin-x64": "1.2.211",
140
+ "@swc/core-linux-x64-gnu": "1.2.211",
141
+ "@swc/core-linux-x64-musl": "1.2.211",
142
+ "@swc/core-freebsd-x64": "1.2.211",
143
+ "@swc/core-win32-ia32-msvc": "1.2.211",
144
+ "@swc/core-linux-arm64-gnu": "1.2.211",
145
+ "@swc/core-linux-arm-gnueabihf": "1.2.211",
146
+ "@swc/core-darwin-arm64": "1.2.211",
147
+ "@swc/core-android-arm64": "1.2.211",
148
+ "@swc/core-linux-arm64-musl": "1.2.211",
149
+ "@swc/core-win32-arm64-msvc": "1.2.211",
150
+ "@swc/core-android-arm-eabi": "1.2.211"
151
151
  }
152
152
  }
package/types.d.ts CHANGED
@@ -642,6 +642,7 @@ export interface ConstModulesConfig {
642
642
  };
643
643
  }
644
644
  export interface OptimizerConfig {
645
+ simplify?: boolean;
645
646
  globals?: GlobalPassOption;
646
647
  jsonify?: {
647
648
  minCost: number;