@swc/core 1.2.151 → 1.2.154

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/package.json +18 -17
  3. package/types.d.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,234 @@
1
1
  # Changelog
2
2
  ## [unreleased]
3
3
 
4
+ ### Bug Fixes
5
+
6
+
7
+
8
+ - **(es)** Change error message as it can be misleading (#3982) ([48f2fd8](https://github.com/swc-project/swc/commit/48f2fd8e1b723e3dfa1d54c25aa9f3c391c5ee74))
9
+
10
+
11
+ - **(es/preset-env)** Fix compilation issue (#3972) ([7ebfcfa](https://github.com/swc-project/swc/commit/7ebfcfa70f1456e627f6cf30f65c00e2b0b17476))
12
+
13
+
14
+ - **(es/preset-env)** Publish `builtin.json` (#3973) ([858372f](https://github.com/swc-project/swc/commit/858372ffada23f0f36c1161d2ec36b6da93d973c))
15
+
16
+
17
+ - **(es/preset-env)** Move out finished proposals (#3970) ([502f934](https://github.com/swc-project/swc/commit/502f934ce5397526db3a26554293841c3c5821ae))
18
+
19
+
20
+ - **(preset-env)** Use `core-js-compat` and `@babel/compat-data` directly (#3968) ([487273f](https://github.com/swc-project/swc/commit/487273fc5b5f964c159ea23d409b0f66e1d74229))
21
+
22
+ ### Features
23
+
24
+
25
+
26
+ - **(*)** Update dependencies (#3964) ([1206c84](https://github.com/swc-project/swc/commit/1206c84e19eca2711670e96407c47062c22a4d04))
27
+
28
+
29
+ - **(css/codegen)** Fix source maps and ast defs (#3974) ([516dbc6](https://github.com/swc-project/swc/commit/516dbc65dc769b21411989f4397dc97cf97571ed))
30
+
31
+
32
+ - **(css/prefixer)** Prefix more properties (#3976) ([4a9a5ff](https://github.com/swc-project/swc/commit/4a9a5ffa4b128c706f9a73a8465a317240c4babf))
33
+
34
+
35
+ - **(es/lints)** Mark catch params as binding patterns while checking duplicates (#3981) ([f28134f](https://github.com/swc-project/swc/commit/f28134fe774173b6e12c8571c92fe1c015f8b53b))
36
+
37
+ ### Miscellaneous Tasks
38
+
39
+
40
+
41
+ - **(ci)** Skip unnecessary package for the benchmark (#3980) ([485dc54](https://github.com/swc-project/swc/commit/485dc54d299c6f48752841401d2bfaf716f64f06))
42
+
43
+
44
+ - **(es/parser)** Add some inline attributes (#3969) ([6a6c322](https://github.com/swc-project/swc/commit/6a6c32203b8f2fde61279320cca505052f969da3))
45
+
46
+
47
+ - **(es/preset-env)** Use js script for copying files (#3986) ([83722df](https://github.com/swc-project/swc/commit/83722df21a54d29caffb6fe8eb1261763a085830))
48
+
49
+ ### Performance
50
+
51
+
52
+
53
+ - **(common)** Use `fxhash` everywhere (#3985) ([db60291](https://github.com/swc-project/swc/commit/db602911647360e0a26139d93882c353ba4d9330))
54
+
55
+
56
+ - **(es/minifier)** Make mangler faster by merging hash sets into one (#3983) ([107c91d](https://github.com/swc-project/swc/commit/107c91dd206e31c221df98446f71e8f18020c060))
57
+
58
+
59
+ - **(es/minifier)** Use fxhash for integers (#3984) ([67e6154](https://github.com/swc-project/swc/commit/67e615421f85aee2919016a5d01e4ebb1b9b08c4))
60
+
61
+
62
+ - **(es/minifier)** Merge hashmap for scoping before checking (#3988) ([1beecce](https://github.com/swc-project/swc/commit/1beecceead16765abd1b698d3a255e647a2adcc7))
63
+
64
+ ### Testing
65
+
66
+
67
+
68
+ - **(es)** Add tests for fixed issues (#3987) ([073d847](https://github.com/swc-project/swc/commit/073d847a33fe9902428633292efa8a606fe208f1))
69
+
70
+ ## [1.2.153] - 2022-03-11
71
+
72
+ ### Bug Fixes
73
+
74
+
75
+
76
+ - **(api/rust)** Fix transform comment api (#3962) ([fcbd3c5](https://github.com/swc-project/swc/commit/fcbd3c5c5849418b911d87d3a0b36eb84bef1a68))
77
+
78
+
79
+ - **(es)** Adjust tracing span level (#3911) ([ca071fb](https://github.com/swc-project/swc/commit/ca071fb705210ec33698dbce81069156de4fcf7a))
80
+
81
+
82
+ - **(es/codegen)** Fix sourcemap issue caused by reserved `BytePos` values (#3948) ([e8018c5](https://github.com/swc-project/swc/commit/e8018c54d4581c43c72d27e51d0aa36a64881a9e))
83
+
84
+
85
+ - **(es/compat)** Refer this in constructor when `super_is_callable_constructor` is set (#3944) ([de8a711](https://github.com/swc-project/swc/commit/de8a7116cd587a6ddb8d734ffd96cdacd076f48c))
86
+
87
+
88
+ - **(es/lints)** Don't visit types while collecting `const` (#3967) ([c6b5371](https://github.com/swc-project/swc/commit/c6b5371c51413577165543eddb78e7d051f3d376))
89
+
90
+
91
+ - **(es/minifier)** Preserve fuction parameters used for template literals in `evaluate` and `reduce_vars` (#3949) ([91a302a](https://github.com/swc-project/swc/commit/91a302a672a70a34fe693fa84d65ba87901d0f36))
92
+
93
+
94
+ - **(es/parser)** Parse if-else chain iteratively (#3961) ([76e6468](https://github.com/swc-project/swc/commit/76e646804a025e2a451314013a437e79a6cd8ce2))
95
+
96
+
97
+ - **(node-swc/types)** Add `reserved` to `TerserMangleOptions` (#3959) ([70a68a7](https://github.com/swc-project/swc/commit/70a68a785091845c5e66ab3fe0fd52cc47f11a80))
98
+
99
+ ### Features
100
+
101
+
102
+
103
+ - **(css/codegen)** Support source map (#3958) ([5a6ebd3](https://github.com/swc-project/swc/commit/5a6ebd36ee7a35e81e4f3b0961106a41f83f6b7f))
104
+
105
+
106
+ - **(es)** Add an option to preserve all comments (#3815) ([c5a0c9a](https://github.com/swc-project/swc/commit/c5a0c9a0ab2345aa9c41a40100d049a144dfb70f))
107
+
108
+
109
+ - **(es/lints)** Refine error message (#3952) ([579aeb7](https://github.com/swc-project/swc/commit/579aeb7cfacb38d822634e5c82b209bd311ac9b2))
110
+
111
+ ## [1.2.152] - 2022-03-10
112
+
113
+ ### Bug Fixes
114
+
115
+
116
+
117
+ - **(es)** Don't create `.swc` if not required (#3937) ([46e9d3f](https://github.com/swc-project/swc/commit/46e9d3f62e07b5aaeac9a9f73bb4b5573ad69b27))
118
+
119
+
120
+ - **(es/compat/es2015)** Fix span handling of `arrow` and `classes` (#3921) ([12b8606](https://github.com/swc-project/swc/commit/12b8606c99994a1ae4fc65105cd380f1a34d632e))
121
+
122
+
123
+ - **(es/minifier)** Skip exported vars while collapsing vars (#3928) ([cc564ff](https://github.com/swc-project/swc/commit/cc564ff6c586db266f0ab8fcb7f25a8d32155d35))
124
+
125
+
126
+ - **(es/module)** Make exported vars follow specification (#3906) ([534fc52](https://github.com/swc-project/swc/commit/534fc52a727e5be43adfad47ed3fcdd606967c5c))
127
+
128
+
129
+ - **(es/module)** Fix exported vars with bigint values (#3909) ([8559fc9](https://github.com/swc-project/swc/commit/8559fc96239026d070f7fcf415e5443b096de605))
130
+
131
+
132
+ - **(es/module)** Use correct return values for suffix update expressions (#3927) ([dc457b4](https://github.com/swc-project/swc/commit/dc457b4883ef23815fcdff952c040e5e1e7d7897))
133
+
134
+
135
+ - **(es/module/cjs)** Allow re-exports to be lazy (#3856) ([f575b1b](https://github.com/swc-project/swc/commit/f575b1bc4868dd46c572c3ef61767fdd2ee2c2b3))
136
+
137
+
138
+ - **(es/parser)** Fix the logic for token contexts (#3926) ([4b4aef3](https://github.com/swc-project/swc/commit/4b4aef3270cac8bdd75c79af9be186bf446b23f1))
139
+
140
+
141
+ - **(es/transform/optimization)** Prevent inlining of vars used as RHS in logical expressions (#3907) ([782a874](https://github.com/swc-project/swc/commit/782a8746963f11a1ada446cb1f744a58f6516cf8))
142
+
143
+
144
+ - **(es/typescript)** Remove imports used in interfaces and type signatures (#3893) ([5c92b2d](https://github.com/swc-project/swc/commit/5c92b2d4cee64686d0aad788b177b34cd2fd3bfc))
145
+
146
+
147
+ - **(wasm)** Fix handling of `swc_common::GLOBALS` (#3936) ([45a4374](https://github.com/swc-project/swc/commit/45a4374ee19154238eb24952cffbd9e134831c8b))
148
+
149
+ ### Features
150
+
151
+
152
+
153
+ - **(common)** Align `stable_hasher` to latest rustc (#3895) ([372f298](https://github.com/swc-project/swc/commit/372f298f5f6faae804370a3caaf8dce309fcb9f5))
154
+
155
+
156
+ - **(css/lints)** Implement `custom-property-no-missing-var-function` rule (#3890) ([19ececc](https://github.com/swc-project/swc/commit/19ececcd507da27993b421ae76fd0f259b516125))
157
+
158
+
159
+ - **(css/lints)** Implement `no-duplicate-at-import-rules` rule (#3833) ([59c84ac](https://github.com/swc-project/swc/commit/59c84ac8bdd2919bb6c8550bc5d8ec7b814f9cda))
160
+
161
+
162
+ - **(css/parser)** Improve error recovery (#3901) ([6f781c3](https://github.com/swc-project/swc/commit/6f781c3b43a99ce65e5680665b8101a382adb4ef))
163
+
164
+
165
+ - **(css/prefixer)** Implement more prefixing rules (#3905) ([b25c479](https://github.com/swc-project/swc/commit/b25c47901e69a04079cbb9ce1e76154a8affbd11))
166
+
167
+
168
+ - **(css/prefixer)** Handle more properties (#3919) ([c2b9e1c](https://github.com/swc-project/swc/commit/c2b9e1c61aa5f72aa0738349ee330d46b9446ed6))
169
+
170
+
171
+ - **(css/prefixer)** Implement more rules (#3933) ([62ab179](https://github.com/swc-project/swc/commit/62ab17999eb98312bb03f3ad2f436fbac6ae4acc))
172
+
173
+
174
+ - **(es/compat)** Add tracing support to remaining compat transforms (#3904) ([bd0a921](https://github.com/swc-project/swc/commit/bd0a9214c3a678a65a814517ffef6c59199ac06b))
175
+
176
+
177
+ - **(es/compat)** Add pure comments for class fields keys (#3939) ([112f428](https://github.com/swc-project/swc/commit/112f4287343c818c28dc9d422c3df78d9f663397))
178
+
179
+
180
+ - **(es/fixer)** Remove extra parens around IIFE in statements (#3918) ([7cfa930](https://github.com/swc-project/swc/commit/7cfa930a629da96b30c2d5021a51d15c0b121013))
181
+
182
+
183
+ - **(es/minifier)** Remove pure calls (#3925) ([bd838ac](https://github.com/swc-project/swc/commit/bd838ac5a9524c1a7f3db34c2110c6ddb9718de0))
184
+
185
+
186
+ - **(es/minifier)** Improve dropping of unused vars (#3923) ([9e4dea6](https://github.com/swc-project/swc/commit/9e4dea6663eaba794fb4793318865892eecce910))
187
+
188
+
189
+ - **(es/parser)** Report errors for non-abstract members in an abstract class (#3917) ([16182d5](https://github.com/swc-project/swc/commit/16182d586f1b54e383ae83a264576267441e49ba))
190
+
191
+
192
+ - **(es/parser)** Relax MSRV requirement (#3922) ([a8ac7e3](https://github.com/swc-project/swc/commit/a8ac7e39b0fbd3908c4b506a1739a0ddf33ac250))
193
+
194
+
195
+ - **(es/testing)** Print comments in `test_fixture` (#3920) ([3d43a9b](https://github.com/swc-project/swc/commit/3d43a9b69df6002786654b3c378b9d981447c126))
196
+
197
+
198
+ - **(preset-env)** Update `browserslist-rs` (#3935) ([aec1a54](https://github.com/swc-project/swc/commit/aec1a54204e2140511442479753b6502448f25cb))
199
+
200
+ ### Performance
201
+
202
+
203
+
204
+ - **(*)** Update `tracing` to improve performance of disabled spans (#3932) ([86ea237](https://github.com/swc-project/swc/commit/86ea23785d911f572474d73462cc8bd9af6afaf6))
205
+
206
+
207
+ - **(es)** Add fast memory deallocator (#3910) ([f3da349](https://github.com/swc-project/swc/commit/f3da3499c5b2a2a58bdc85f33dd5886f49704932))
208
+
209
+
210
+ - **(es/minifier)** Remove needless type parameter (#3897) ([8b3aa6d](https://github.com/swc-project/swc/commit/8b3aa6d3aaf46a7bf4e8972bc867dede950196db))
211
+
212
+
213
+ - **(es/minifier)** Make optimization of pure calls parallel (#3938) ([f1ec862](https://github.com/swc-project/swc/commit/f1ec8620ac0df2f0325bd0437227b277de099950))
214
+
215
+
216
+ - **(es/parser)** Improve performance by adjusting inlining (#3902) ([4387813](https://github.com/swc-project/swc/commit/43878137e71894fbb3367473317ba65de5e40616))
217
+
218
+ ### Refactor
219
+
220
+
221
+
222
+ - **(css/parser)** Remove unused codes (#3903) ([3a9af73](https://github.com/swc-project/swc/commit/3a9af7316748641e8b59b59d014513456ecfc606))
223
+
224
+ ## [1.2.151] - 2022-03-07
225
+
226
+ ### Bug Fixes
227
+
228
+
229
+
230
+ - **(es/module)** Revert fix for `jest.spyOn` ([8e30d83](https://github.com/swc-project/swc/commit/8e30d83d145061c9ee256e76e77e64ab0b5552ed))
231
+
4
232
  ### Features
5
233
 
6
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.151",
3
+ "version": "1.2.154",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -53,7 +53,7 @@
53
53
  "types": "./index.d.ts",
54
54
  "scripts": {
55
55
  "changelog": "git cliff --output CHANGELOG.md",
56
- "prepare": "husky install && git config feature.manyFiles true",
56
+ "prepare": "husky install && git config feature.manyFiles true && node ./crates/swc_ecma_preset_env/scripts/copy-data.js",
57
57
  "artifacts": "napi artifacts --dist scripts/npm",
58
58
  "prepublishOnly": "tsc -d && napi prepublish -p scripts/npm --tagstyle npm",
59
59
  "build": "tsc -d && napi build --platform --cargo-name node --js ./node-swc/src/binding.js --dts ./node-swc/src/binding.d.ts -p node --release",
@@ -63,7 +63,7 @@
63
63
  "version": "napi version -p scripts/npm"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/compat-data": "^7.16.4",
66
+ "@babel/compat-data": "^7.17.0",
67
67
  "@babel/core": "^7.13.16",
68
68
  "@babel/plugin-proposal-class-properties": "^7.13.0",
69
69
  "@babel/plugin-proposal-decorators": "^7.13.15",
@@ -72,7 +72,7 @@
72
72
  "@babel/preset-react": "^7.13.13",
73
73
  "@babel/preset-typescript": "^7.13.0",
74
74
  "@babel/types": "^7.14.0",
75
- "@napi-rs/cli": "^2.4.2",
75
+ "@napi-rs/cli": "^2.4.5",
76
76
  "@swc/helpers": "^0.2.10",
77
77
  "@types/jest": "^26.0.23",
78
78
  "@types/node": "^14.14.41",
@@ -83,6 +83,7 @@
83
83
  "benchmark": "^2.1.4",
84
84
  "class-validator": "^0.13.1",
85
85
  "core-js": "^2.6.11",
86
+ "core-js-compat": "^3.21.1",
86
87
  "cross-env": "^7.0.3",
87
88
  "cspell": "^5.12.3",
88
89
  "expect": "^27.4.2",
@@ -107,18 +108,18 @@
107
108
  "url": "https://opencollective.com/swc"
108
109
  },
109
110
  "optionalDependencies": {
110
- "@swc/core-win32-x64-msvc": "1.2.151",
111
- "@swc/core-darwin-x64": "1.2.151",
112
- "@swc/core-linux-x64-gnu": "1.2.151",
113
- "@swc/core-linux-x64-musl": "1.2.151",
114
- "@swc/core-freebsd-x64": "1.2.151",
115
- "@swc/core-win32-ia32-msvc": "1.2.151",
116
- "@swc/core-linux-arm64-gnu": "1.2.151",
117
- "@swc/core-linux-arm-gnueabihf": "1.2.151",
118
- "@swc/core-darwin-arm64": "1.2.151",
119
- "@swc/core-android-arm64": "1.2.151",
120
- "@swc/core-linux-arm64-musl": "1.2.151",
121
- "@swc/core-win32-arm64-msvc": "1.2.151",
122
- "@swc/core-android-arm-eabi": "1.2.151"
111
+ "@swc/core-win32-x64-msvc": "1.2.154",
112
+ "@swc/core-darwin-x64": "1.2.154",
113
+ "@swc/core-linux-x64-gnu": "1.2.154",
114
+ "@swc/core-linux-x64-musl": "1.2.154",
115
+ "@swc/core-freebsd-x64": "1.2.154",
116
+ "@swc/core-win32-ia32-msvc": "1.2.154",
117
+ "@swc/core-linux-arm64-gnu": "1.2.154",
118
+ "@swc/core-linux-arm-gnueabihf": "1.2.154",
119
+ "@swc/core-darwin-arm64": "1.2.154",
120
+ "@swc/core-android-arm64": "1.2.154",
121
+ "@swc/core-linux-arm64-musl": "1.2.154",
122
+ "@swc/core-win32-arm64-msvc": "1.2.154",
123
+ "@swc/core-android-arm-eabi": "1.2.154"
123
124
  }
124
125
  }
package/types.d.ts CHANGED
@@ -87,6 +87,7 @@ export interface TerserMangleOptions {
87
87
  keep_private_props?: boolean;
88
88
  ie8?: boolean;
89
89
  safari10?: boolean;
90
+ reserved?: string[];
90
91
  }
91
92
  export interface TerserManglePropertiesOptions {
92
93
  }
@@ -348,6 +349,7 @@ export interface JscConfig {
348
349
  [from: string]: [string];
349
350
  };
350
351
  minify?: JsMinifyOptions;
352
+ preserveAllComments?: boolean;
351
353
  }
352
354
  export declare type JscTarget = "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022";
353
355
  export declare type ParserConfig = TsParserConfig | EsParserConfig;