@swc/core 1.2.165 → 1.2.167
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 +118 -0
- package/Visitor.d.ts +1 -1
- package/Visitor.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +16 -16
- package/types.d.ts +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,124 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
- **(es/parser)** Reject optional constructor call (#4340) ([31b3336](https://github.com/swc-project/swc/commit/31b3336cd5881ff8f99d791254ee02ff4fa23fcc))
|
|
9
|
+
|
|
10
|
+
### Miscellaneous Tasks
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(ci)** Fix wasm publish script ([1900d35](https://github.com/swc-project/swc/commit/1900d3506efb8bc319dece4219789e2509ecf67c))
|
|
15
|
+
|
|
16
|
+
### Performance
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- **(es/minifier)** Make name mangler faster (#4342) ([66ff7b8](https://github.com/swc-project/swc/commit/66ff7b8a09bc504d3912d12b4a8ebea3a96d4e4b))
|
|
21
|
+
|
|
22
|
+
## [1.2.166] - 2022-04-15
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
- **(css/parser)** Parse legacy `calc`s (#4320) ([81370d1](https://github.com/swc-project/swc/commit/81370d16cb405d43aeb9198e1fce4aa11009045f))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
- **(css/prefixer)** Don't prefix if it's already prefixed (#4307) ([690ce26](https://github.com/swc-project/swc/commit/690ce2628c988a3d1823cbcf4f786203e548cb84))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
- **(css/prefixer)** Handle at-rules and don't generate unnecessary prefixes (#4318) ([ac4f14a](https://github.com/swc-project/swc/commit/ac4f14ad7b70e67c41507cafd997f6b4e346e815))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
- **(css/prefixer)** Fix more bugs (#4330) ([405e5ed](https://github.com/swc-project/swc/commit/405e5ed0b3bbcf8076c80d1383588bfee1cf8d22))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
- **(es/codegen)** Fix overflow of numeric literals (#4321) ([0245e26](https://github.com/swc-project/swc/commit/0245e26af5f984cf89a2f474d89f6b3dfe2f0eff))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- **(es/codegen)** Fix codegen of arrow expressions (#4306) ([4c99730](https://github.com/swc-project/swc/commit/4c9973010a5c2b865e6ed676a4e0364234cf5d88))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
- **(es/compat)** Fix renaming bug of `block_scoping` (#4310) ([6c9882e](https://github.com/swc-project/swc/commit/6c9882ec68fee9b702f5e4749482eca74fbd87e8))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
- **(es/lints)** Check parameters in the duplicate binding rule (#4288) ([e4a565c](https://github.com/swc-project/swc/commit/e4a565c2d4c90dc23267b44e8f4aee2e0cc79c23))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
- **(es/loader)** Fix traversal of node modules resolver (#4327) ([780de70](https://github.com/swc-project/swc/commit/780de7095e1ea6b71204017f708f8370ed4531a8))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- **(es/minifier)** Fix inlining of uninitialized variables (#4292) ([b990b19](https://github.com/swc-project/swc/commit/b990b19ed130ce1dc57f76b883bf638ace64c4f4))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
- **(es/minifier)** Respect `dead_code` (#4328) ([8886a4b](https://github.com/swc-project/swc/commit/8886a4b572c4b24091aa3db38fdc7b486334c069))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
- **(es/minifier)** Inline before cloning (#4338) ([4110fcb](https://github.com/swc-project/swc/commit/4110fcb9612ceeba0c52f539896075a571c9a619))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- **(es/parser)** Enable static blocks by default (#4334) ([7599fe7](https://github.com/swc-project/swc/commit/7599fe74317f790cce8f8638e84c320c5ebbc4c2))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
- **(es/parser)** Make parsing of TS InstantiationExpr more permissive (#4332) ([ea466af](https://github.com/swc-project/swc/commit/ea466afdc8dc6b64be81244a8c0261ac34f22157))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
- **(node-swc/types)** Add `isTypeOnly` to types (#4303) ([1a48732](https://github.com/swc-project/swc/commit/1a48732e78b9c650f93320f4d6f7be57a9f4a6c4))
|
|
71
|
+
|
|
72
|
+
### Features
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
- **(css/minifier)** Compress colors (#4308) ([65b18ee](https://github.com/swc-project/swc/commit/65b18ee602506d455ce10c6ca2bd599d57d29d14))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
- **(es)** Support `typeof` with private fields (#4302) ([d0de5a6](https://github.com/swc-project/swc/commit/d0de5a63a01ef45101cdd10f90546ec7950ce7ac))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
- **(es/minifier)** Enable `conditionals` by default (#4301) ([7e8f613](https://github.com/swc-project/swc/commit/7e8f6132729ca3ddf7884f1b246964921cde1c35))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
- **(es/minifier)** Enable `dead_code` by default (#4309) ([74a5087](https://github.com/swc-project/swc/commit/74a5087989173f833517cb6f6bf51afcf9642286))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
- **(es/minifier)** Improve sequential inliner (#4335) ([f92242d](https://github.com/swc-project/swc/commit/f92242dcb17a7b6dc25dac63d052df9e3d7042bc))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
- **(es/parser)** Support `extends` clause to `infer` type (#4326) ([1c3d1af](https://github.com/swc-project/swc/commit/1c3d1af01cdfdf6794e73e32bb0062698d4910be))
|
|
92
|
+
|
|
93
|
+
### Miscellaneous Tasks
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
- **(*)** Typo + fomatting (#4304) ([37a8c90](https://github.com/swc-project/swc/commit/37a8c90750d778edcd69ffdd85fe990a27efc75d))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
- **(ci)** Fix CI (#4299) ([adea17d](https://github.com/swc-project/swc/commit/adea17dbe3b17e397d79a7dae1f469bf38f0185f))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
- **(es/minifier)** Update terser test references (#4297) ([df0d572](https://github.com/swc-project/swc/commit/df0d572b4ff250be037ca9a04b6bcd95329f9f3b))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
- **(es/minifier)** Add full benchmark for `.minify()` (#4341) ([ba5f743](https://github.com/swc-project/swc/commit/ba5f7436c18b7e3845bc2935aca6cdb76477b686))
|
|
107
|
+
|
|
108
|
+
### Refactor
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
- **(bindings)** Rename crates (#4337) ([83a8f48](https://github.com/swc-project/swc/commit/83a8f489ec5b7010a762a75dc31a63b2fb060372))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
- **(es/minifier)** Clean up logging (#4322) ([2002554](https://github.com/swc-project/swc/commit/2002554fa26c1ebd683f71d87263f26fd95d00f1))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
- **(es/parser)** Simplify logic (#4329) ([37aec5b](https://github.com/swc-project/swc/commit/37aec5b19965bedbe67fa1b454be6a7017ccedec))
|
|
119
|
+
|
|
120
|
+
## [1.2.165] - 2022-04-09
|
|
121
|
+
|
|
122
|
+
### Bug Fixes
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
8
126
|
- **(css/prefixer)** FIx a bug related to `writing-mode` (#4278) ([7f38e06](https://github.com/swc-project/swc/commit/7f38e06e0209216200182555c7c7ddb11499e45d))
|
|
9
127
|
|
|
10
128
|
|
package/Visitor.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ export declare class Visitor {
|
|
|
107
107
|
visitExpression(n: Expression): Expression;
|
|
108
108
|
visitOptionalChainingExpression(n: OptionalChainingExpression): Expression;
|
|
109
109
|
visitAssignmentExpression(n: AssignmentExpression): Expression;
|
|
110
|
-
|
|
110
|
+
visitPatternOrExpression(n: Pattern | Expression): Pattern | Expression;
|
|
111
111
|
visitYieldExpression(n: YieldExpression): Expression;
|
|
112
112
|
visitUpdateExpression(n: UpdateExpression): Expression;
|
|
113
113
|
visitUnaryExpression(n: UnaryExpression): Expression;
|
package/Visitor.js
CHANGED
|
@@ -773,11 +773,11 @@ class Visitor {
|
|
|
773
773
|
return n;
|
|
774
774
|
}
|
|
775
775
|
visitAssignmentExpression(n) {
|
|
776
|
-
n.left = this.
|
|
776
|
+
n.left = this.visitPatternOrExpression(n.left);
|
|
777
777
|
n.right = this.visitExpression(n.right);
|
|
778
778
|
return n;
|
|
779
779
|
}
|
|
780
|
-
|
|
780
|
+
visitPatternOrExpression(n) {
|
|
781
781
|
switch (n.type) {
|
|
782
782
|
case "ObjectPattern":
|
|
783
783
|
case "ArrayPattern":
|
package/index.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export declare function __experimental_registerGlobalTraceConfig(traceConfig: {
|
|
|
97
97
|
*
|
|
98
98
|
* Returns current binary's metadata to determine which binary is actually loaded.
|
|
99
99
|
*
|
|
100
|
-
* This is undocumented interface, does not
|
|
100
|
+
* This is undocumented interface, does not guarantee stability across `@swc/core`'s semver
|
|
101
101
|
* as internal representation may change anytime. Use it with caution.
|
|
102
102
|
*/
|
|
103
103
|
export declare function getBinaryMetadata(): {
|
package/index.js
CHANGED
|
@@ -268,7 +268,7 @@ exports.__experimental_registerGlobalTraceConfig = __experimental_registerGlobal
|
|
|
268
268
|
*
|
|
269
269
|
* Returns current binary's metadata to determine which binary is actually loaded.
|
|
270
270
|
*
|
|
271
|
-
* This is undocumented interface, does not
|
|
271
|
+
* This is undocumented interface, does not guarantee stability across `@swc/core`'s semver
|
|
272
272
|
* as internal representation may change anytime. Use it with caution.
|
|
273
273
|
*/
|
|
274
274
|
function getBinaryMetadata() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.167",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"pack": "wasm-pack",
|
|
60
60
|
"build:ts": "tsc -d",
|
|
61
61
|
"build:wasm": "npm-run-all \"pack -- build ./crates/wasm --scope swc {1} -t {2} --features plugin\" --",
|
|
62
|
-
"build": "tsc -d && napi build --platform --cargo-name
|
|
63
|
-
"build:dev": "tsc -d && napi build --platform --cargo-name
|
|
62
|
+
"build": "tsc -d && napi build --platform --cargo-name binding_core_node --js ./node-swc/src/binding.js --dts ./node-swc/src/binding.d.ts -p binding_core_node --release",
|
|
63
|
+
"build:dev": "tsc -d && napi build --platform --cargo-name binding_core_node --js ./node-swc/src/binding.js --dts ./node-swc/src/binding.d.ts -p binding_core_node",
|
|
64
64
|
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest node-swc/__tests__",
|
|
65
65
|
"version": "napi version -p scripts/npm"
|
|
66
66
|
},
|
|
@@ -121,18 +121,18 @@
|
|
|
121
121
|
"url": "https://opencollective.com/swc"
|
|
122
122
|
},
|
|
123
123
|
"optionalDependencies": {
|
|
124
|
-
"@swc/core-win32-x64-msvc": "1.2.
|
|
125
|
-
"@swc/core-darwin-x64": "1.2.
|
|
126
|
-
"@swc/core-linux-x64-gnu": "1.2.
|
|
127
|
-
"@swc/core-linux-x64-musl": "1.2.
|
|
128
|
-
"@swc/core-freebsd-x64": "1.2.
|
|
129
|
-
"@swc/core-win32-ia32-msvc": "1.2.
|
|
130
|
-
"@swc/core-linux-arm64-gnu": "1.2.
|
|
131
|
-
"@swc/core-linux-arm-gnueabihf": "1.2.
|
|
132
|
-
"@swc/core-darwin-arm64": "1.2.
|
|
133
|
-
"@swc/core-android-arm64": "1.2.
|
|
134
|
-
"@swc/core-linux-arm64-musl": "1.2.
|
|
135
|
-
"@swc/core-win32-arm64-msvc": "1.2.
|
|
136
|
-
"@swc/core-android-arm-eabi": "1.2.
|
|
124
|
+
"@swc/core-win32-x64-msvc": "1.2.167",
|
|
125
|
+
"@swc/core-darwin-x64": "1.2.167",
|
|
126
|
+
"@swc/core-linux-x64-gnu": "1.2.167",
|
|
127
|
+
"@swc/core-linux-x64-musl": "1.2.167",
|
|
128
|
+
"@swc/core-freebsd-x64": "1.2.167",
|
|
129
|
+
"@swc/core-win32-ia32-msvc": "1.2.167",
|
|
130
|
+
"@swc/core-linux-arm64-gnu": "1.2.167",
|
|
131
|
+
"@swc/core-linux-arm-gnueabihf": "1.2.167",
|
|
132
|
+
"@swc/core-darwin-arm64": "1.2.167",
|
|
133
|
+
"@swc/core-android-arm64": "1.2.167",
|
|
134
|
+
"@swc/core-linux-arm64-musl": "1.2.167",
|
|
135
|
+
"@swc/core-win32-arm64-msvc": "1.2.167",
|
|
136
|
+
"@swc/core-android-arm-eabi": "1.2.167"
|
|
137
137
|
}
|
|
138
138
|
}
|
package/types.d.ts
CHANGED
|
@@ -140,7 +140,7 @@ export interface Options extends Config {
|
|
|
140
140
|
*
|
|
141
141
|
* "root" - Passes the "root" value through as unchanged.
|
|
142
142
|
* "upward" - Walks upward from the "root" directory, looking for a directory
|
|
143
|
-
*
|
|
143
|
+
* containing a swc.config.js file, and throws an error if a swc.config.js
|
|
144
144
|
* is not found.
|
|
145
145
|
* "upward-optional" - Walk upward from the "root" directory, looking for
|
|
146
146
|
* a directory containing a swc.config.js file, and falls back to "root"
|
|
@@ -198,7 +198,7 @@ export interface Options extends Config {
|
|
|
198
198
|
* a package that matches one of the "swcrcRoots" packages.
|
|
199
199
|
*
|
|
200
200
|
*
|
|
201
|
-
* Defaults to true as long as the filename option has been
|
|
201
|
+
* Defaults to true as long as the filename option has been specified
|
|
202
202
|
*/
|
|
203
203
|
swcrc?: boolean;
|
|
204
204
|
/**
|
|
@@ -258,11 +258,11 @@ export declare type Swcrc = Config | Config[];
|
|
|
258
258
|
*/
|
|
259
259
|
export interface Config {
|
|
260
260
|
/**
|
|
261
|
-
* Note: The type is string because it
|
|
261
|
+
* Note: The type is string because it follows rust's regex syntax.
|
|
262
262
|
*/
|
|
263
263
|
test?: string | string[];
|
|
264
264
|
/**
|
|
265
|
-
* Note: The type is string because it
|
|
265
|
+
* Note: The type is string because it follows rust's regex syntax.
|
|
266
266
|
*/
|
|
267
267
|
exclude?: string | string[];
|
|
268
268
|
env?: EnvConfig;
|
|
@@ -303,7 +303,7 @@ export interface EnvConfig {
|
|
|
303
303
|
path?: string;
|
|
304
304
|
shippedProposals?: boolean;
|
|
305
305
|
/**
|
|
306
|
-
* Enable all
|
|
306
|
+
* Enable all transforms
|
|
307
307
|
*/
|
|
308
308
|
forceAllTransforms?: boolean;
|
|
309
309
|
}
|
|
@@ -319,7 +319,7 @@ export interface JscConfig {
|
|
|
319
319
|
*/
|
|
320
320
|
externalHelpers?: boolean;
|
|
321
321
|
/**
|
|
322
|
-
* Defaults to `es3` (which
|
|
322
|
+
* Defaults to `es3` (which enabled **all** pass).
|
|
323
323
|
*/
|
|
324
324
|
target?: JscTarget;
|
|
325
325
|
/**
|
|
@@ -330,7 +330,7 @@ export interface JscConfig {
|
|
|
330
330
|
optimizeHygiene?: boolean;
|
|
331
331
|
keepImportAssertions?: boolean;
|
|
332
332
|
/**
|
|
333
|
-
* Specify the location where SWC stores its
|
|
333
|
+
* Specify the location where SWC stores its intermediate cache files.
|
|
334
334
|
* Currently only transform plugin uses this. If not specified, SWC will
|
|
335
335
|
* create `.swc` directories.
|
|
336
336
|
*/
|
|
@@ -1061,6 +1061,7 @@ export interface NamedImportSpecifier extends Node, HasSpan {
|
|
|
1061
1061
|
type: "ImportSpecifier";
|
|
1062
1062
|
local: Identifier;
|
|
1063
1063
|
imported: Identifier | null;
|
|
1064
|
+
isTypeOnly?: boolean;
|
|
1064
1065
|
}
|
|
1065
1066
|
export declare type ExportSpecifier = ExportNamespaceSpecifier | ExportDefaultSpecifier | NamedExportSpecifier;
|
|
1066
1067
|
/**
|
|
@@ -1081,6 +1082,7 @@ export interface NamedExportSpecifier extends Node, HasSpan {
|
|
|
1081
1082
|
* `Some(bar)` in `export { foo as bar }`
|
|
1082
1083
|
*/
|
|
1083
1084
|
exported: Identifier | null;
|
|
1085
|
+
isTypeOnly?: boolean;
|
|
1084
1086
|
}
|
|
1085
1087
|
interface HasInterpreter {
|
|
1086
1088
|
/**
|