@swc/core 1.2.219 → 1.2.223
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 +165 -0
- package/index.d.ts +1 -1
- package/index.js +8 -8
- package/package.json +18 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,166 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [unreleased]
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- **(es/fixer)** Don't insert extra paren when left of `BinExpr` is `UpdateExpr` (#5376) ([77497e4](https://github.com/swc-project/swc/commit/77497e4fbe9bf10c5ffd510e932a6ff404da1760))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(es/lints)** Ignore TS module declare blocks (#5363) ([daaa8b5](https://github.com/swc-project/swc/commit/daaa8b5c4a86cf39ab34bc46b239719fab8b9916))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(es/minifier)** Drop more comments (#5361) ([27cdc65](https://github.com/swc-project/swc/commit/27cdc65a51af28e8a6073c325fe549d270b3f7dc))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(es/minifier)** Optimize inlining function calls with a literal in arguments (#5365) ([b221f90](https://github.com/swc-project/swc/commit/b221f90117a77f684dc6b9ae5296c6bd1a2d8349))
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(rustdoc)** FIx CI (#5370) ([cf3de12](https://github.com/swc-project/swc/commit/cf3de124d621c8735c551637136b325104c5668e))
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(es/minifier)** Remove duplicate `var` declarations (#5373) ([4fdbe40](https://github.com/swc-project/swc/commit/4fdbe40c74e618a9bdf00253f970e27e20c6b6eb))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- **(es/minifier)** Consider char frequencies (#5375) ([3943eb2](https://github.com/swc-project/swc/commit/3943eb24d11540928d436f63c4ffd6421400fcaf))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- **(swc_core)** Introduce package (#5364) ([27b464d](https://github.com/swc-project/swc/commit/27b464d90a410b5fb6dca438442e1e8669a28e32))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- **(swc_core)** Expand features and use it from wasm and cli (#5369) ([8b9dd6f](https://github.com/swc-project/swc/commit/8b9dd6f026e13fa850a7adcca52e285d874d4390))
|
|
39
|
+
|
|
40
|
+
### Miscellaneous Tasks
|
|
41
|
+
- **general**: Update toml formatting (#5368) ([12fd737](https://github.com/swc-project/swc/commit/12fd7373265df570aa129ce8c92ce5953db79254))
|
|
42
|
+
|
|
43
|
+
### Performance
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- **(es/minifier)** Make postcompress pass parallel (#5374) ([6552d1a](https://github.com/swc-project/swc/commit/6552d1a6f77e5a69cf3c21de9606653b1dcc285a))
|
|
48
|
+
|
|
49
|
+
## [1.2.222] - 2022-08-01
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- **(css/ast)** Support list of component values (#5321) ([8f81104](https://github.com/swc-project/swc/commit/8f811043809a8cc51bb717b678906576bb6eccc3))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
- **(css/prefixer)** Generate prefixes for selectors using env (#5307) ([b18172d](https://github.com/swc-project/swc/commit/b18172d7613c2ecee85f559b9b317aeb2f9bfda7))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
- **(es/codegen)** Emit type parameters of class super expression (#5338) ([42d8ad2](https://github.com/swc-project/swc/commit/42d8ad26ce5b56d9c26d342e8b6af8844b85bd17))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- **(es/minifier)** Change default es version to `es5` (#5333) ([64a9946](https://github.com/swc-project/swc/commit/64a99461ecc24b074e9b674c98c1cec12b687159))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
- **(es/minifier)** Check if an inlined value is mutated (#5318) ([11f495a](https://github.com/swc-project/swc/commit/11f495ad37cbaf56359174a206e97f0874cc0d15))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
- **(es/minifier)** Ignore member expression without side-effects in assign position (#5344) ([8611161](https://github.com/swc-project/swc/commit/8611161c02223f6b1fb8734e648392794f2b1d81))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
- **(es/minifier)** Allow single-thread mode (#5353) ([fbdc9af](https://github.com/swc-project/swc/commit/fbdc9af5ca51e7e2a0ba42997dd9ffd14d5059f4))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
- **(es/utils)** Fix `contains_top_level_await` (#5335) ([1d10c3e](https://github.com/swc-project/swc/commit/1d10c3e83725276fa466393fb7a3139f07fa66c7))
|
|
77
|
+
|
|
78
|
+
### Features
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
- **(css/prefixer)** Prefix more properties (#5340) ([8e12e52](https://github.com/swc-project/swc/commit/8e12e52a5735dafe1336d0bdc83e91dd7cca9d7d))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
- **(css/prefixer)** Avoid prefixing general functions (#5319) ([07732d6](https://github.com/swc-project/swc/commit/07732d6a0a3684697ebfd263749b12a083029db9))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
- **(wasm)** Add interfaces for wasm bindings (#5341) ([c16b6b7](https://github.com/swc-project/swc/commit/c16b6b72300a4e4952398c136ef834b8ca2f4b41))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
- **(wasm)** Enable string interning (#5351) ([b0cb35a](https://github.com/swc-project/swc/commit/b0cb35abaad7ca2a2e58462285548959d3e2c0fc))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
- **(wasm)** Expose async facade interfaces (#5352) ([281bdd9](https://github.com/swc-project/swc/commit/281bdd9e9741ec7375497b390058a86a4f199029))
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
- **(xml)** Add xml crates (#5329) ([83e5023](https://github.com/swc-project/swc/commit/83e502367b5224be8e147d2e255e1ea3b7be4faa))
|
|
98
|
+
|
|
99
|
+
### Miscellaneous Tasks
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
- **(ci)** Set MSRV to `1.60` (#5354) ([d3ecfd3](https://github.com/swc-project/swc/commit/d3ecfd36cd79e25334f36119da3233be53fa7e10))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
- **(ci)** Fix publish action (#5358) ([4c461d1](https://github.com/swc-project/swc/commit/4c461d1ba7d389cc1275884dc037ec51cd3e48b7))
|
|
107
|
+
|
|
108
|
+
### Performance
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
- **(es/minifier)** Make name mangler faster (#5336) ([b378c06](https://github.com/swc-project/swc/commit/b378c060816411dd1990a1dae4977703d3c80748))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
- **(html/parser)** Apply small memory optimizations (#5345) ([2a499de](https://github.com/swc-project/swc/commit/2a499de61decdb836a4a51bc0fa5631568b77015))
|
|
116
|
+
|
|
117
|
+
### Refactor
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
- **(wasm)** Use async interfaces for fallback bindings (#5356) ([74e7486](https://github.com/swc-project/swc/commit/74e748617e288b98b80e4b71aee15ed6fda1c48d))
|
|
122
|
+
|
|
123
|
+
### Testing
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
- **(es)** Support tsc multi-file unit tests (#5316) ([81ac366](https://github.com/swc-project/swc/commit/81ac36604edda1d38329cf10fc65720eedf48cb9))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
- **(es)** Update test cases (#5334) ([add1b75](https://github.com/swc-project/swc/commit/add1b75f61683f129b148fa14942e10a6514a0f3))
|
|
131
|
+
|
|
132
|
+
### Build
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
- **(cargo)** Update packages (#5331) ([5c9ea16](https://github.com/swc-project/swc/commit/5c9ea16b2a5e003a5fa0198f3101e93efceab3b0))
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
- **(node)** Include fallback binding as a dependency (#5322) ([0782d25](https://github.com/swc-project/swc/commit/0782d250746eae97426ce7db9a24308efddcccf0))
|
|
140
|
+
|
|
141
|
+
## [1.2.220] - 2022-07-28
|
|
142
|
+
|
|
143
|
+
### Bug Fixes
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
- **(atoms)** Workaround a bug of `rkyv` (#5323) ([14894ed](https://github.com/swc-project/swc/commit/14894ed4c970b7d283e36acd6001339e7d0d04fd))
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
- **(css/prefixer)** Avoid prefixes for media features (#5308) ([925b16a](https://github.com/swc-project/swc/commit/925b16a563227a43fc52c107a8d2ead577137aa3))
|
|
151
|
+
|
|
152
|
+
### Features
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
- **(html/minifier)** Compress title (#5320) ([6ad5b3c](https://github.com/swc-project/swc/commit/6ad5b3ce5fc1ebb1ab37d03039065af682369610))
|
|
157
|
+
|
|
158
|
+
### Testing
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
- **(swc)** Update test cases (#5324) ([27c6f23](https://github.com/swc-project/swc/commit/27c6f2318af03aaafa4288ff96840977972fa7a7))
|
|
163
|
+
|
|
2
164
|
## [1.2.219] - 2022-07-27
|
|
3
165
|
|
|
4
166
|
### Bug Fixes
|
|
@@ -95,6 +257,9 @@
|
|
|
95
257
|
- **(ci)** Update macos runner (#5284) ([e8473eb](https://github.com/swc-project/swc/commit/e8473eb8a8d3bebea157d0e06a56d95b2350872c))
|
|
96
258
|
|
|
97
259
|
|
|
260
|
+
- **(ci)** Fix build for Android platforms (#5317) ([18d4029](https://github.com/swc-project/swc/commit/18d4029b337a94881ea173886271a54b5f385998))
|
|
261
|
+
|
|
262
|
+
|
|
98
263
|
- **(deps)** Update `bytecheck` (#5296) ([35b1e78](https://github.com/swc-project/swc/commit/35b1e7817974b0e1d7a5af1f9314444fe4070585))- **general**: Fix CI (#5251) ([d229917](https://github.com/swc-project/swc/commit/d229917588a7bfda8bf4023c42c4190552a3b0c6))- **general**: Fix CI ([3421064](https://github.com/swc-project/swc/commit/34210648b06c4e4e4bd7d368a1b9d203535bbc30))
|
|
99
264
|
|
|
100
265
|
### Performance
|
package/index.d.ts
CHANGED
|
@@ -102,6 +102,6 @@ export declare function __experimental_registerGlobalTraceConfig(traceConfig: {
|
|
|
102
102
|
* as internal representation may change anytime. Use it with caution.
|
|
103
103
|
*/
|
|
104
104
|
export declare function getBinaryMetadata(): {
|
|
105
|
-
target:
|
|
105
|
+
target: string | undefined;
|
|
106
106
|
};
|
|
107
107
|
export declare const DEFAULT_EXTENSIONS: readonly string[];
|
package/index.js
CHANGED
|
@@ -53,6 +53,7 @@ const spack_1 = require("./spack");
|
|
|
53
53
|
const assert = __importStar(require("assert"));
|
|
54
54
|
// Allow overrides to the location of the .node binding file
|
|
55
55
|
const bindingsOverride = process.env["SWC_BINARY_PATH"];
|
|
56
|
+
// `@swc/core` includes d.ts for the `@swc/wasm` to provide typed fallback bindings
|
|
56
57
|
let fallbackBindings;
|
|
57
58
|
const bindings = (() => {
|
|
58
59
|
let binding;
|
|
@@ -95,7 +96,7 @@ class Compiler {
|
|
|
95
96
|
return bindings.minify(toBuffer(src), toBuffer(opts !== null && opts !== void 0 ? opts : {}));
|
|
96
97
|
}
|
|
97
98
|
else if (fallbackBindings) {
|
|
98
|
-
return
|
|
99
|
+
return fallbackBindings.minify(src, opts);
|
|
99
100
|
}
|
|
100
101
|
throw new Error('Bindings not found.');
|
|
101
102
|
});
|
|
@@ -124,8 +125,7 @@ class Compiler {
|
|
|
124
125
|
return JSON.parse(res);
|
|
125
126
|
}
|
|
126
127
|
else if (fallbackBindings) {
|
|
127
|
-
|
|
128
|
-
return Promise.resolve(JSON.parse(res));
|
|
128
|
+
return fallbackBindings.parse(src, options);
|
|
129
129
|
}
|
|
130
130
|
throw new Error('Bindings not found.');
|
|
131
131
|
});
|
|
@@ -137,7 +137,7 @@ class Compiler {
|
|
|
137
137
|
return JSON.parse(bindings.parseSync(src, toBuffer(options), filename));
|
|
138
138
|
}
|
|
139
139
|
else if (fallbackBindings) {
|
|
140
|
-
return
|
|
140
|
+
return fallbackBindings.parseSync(src, options);
|
|
141
141
|
}
|
|
142
142
|
throw new Error('Bindings not found.');
|
|
143
143
|
}
|
|
@@ -177,7 +177,7 @@ class Compiler {
|
|
|
177
177
|
return bindings.print(JSON.stringify(m), toBuffer(options));
|
|
178
178
|
}
|
|
179
179
|
else if (fallbackBindings) {
|
|
180
|
-
return
|
|
180
|
+
return fallbackBindings.print(m, options);
|
|
181
181
|
}
|
|
182
182
|
throw new Error('Bindings not found.');
|
|
183
183
|
});
|
|
@@ -192,7 +192,7 @@ class Compiler {
|
|
|
192
192
|
return bindings.printSync(JSON.stringify(m), toBuffer(options));
|
|
193
193
|
}
|
|
194
194
|
else if (fallbackBindings) {
|
|
195
|
-
return fallbackBindings.printSync(
|
|
195
|
+
return fallbackBindings.printSync(m, options);
|
|
196
196
|
}
|
|
197
197
|
throw new Error('Bindings not found.');
|
|
198
198
|
}
|
|
@@ -219,7 +219,7 @@ class Compiler {
|
|
|
219
219
|
console.warn(`Fallback bindings does not support legacy plugins, it'll be ignored.`);
|
|
220
220
|
this.fallbackBindingsPluginWarningDisplayed = true;
|
|
221
221
|
}
|
|
222
|
-
return
|
|
222
|
+
return fallbackBindings.transform(src, options);
|
|
223
223
|
}
|
|
224
224
|
throw new Error('Bindings not found.');
|
|
225
225
|
});
|
|
@@ -244,7 +244,7 @@ class Compiler {
|
|
|
244
244
|
console.warn(`Fallback bindings does not support legacy plugins, it'll be ignored.`);
|
|
245
245
|
this.fallbackBindingsPluginWarningDisplayed = true;
|
|
246
246
|
}
|
|
247
|
-
return fallbackBindings.transformSync(src, options);
|
|
247
|
+
return fallbackBindings.transformSync(isModule ? JSON.stringify(src) : src, options);
|
|
248
248
|
}
|
|
249
249
|
throw new Error("Bindings not found");
|
|
250
250
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.223",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"prepublishOnly": "tsc -d && napi prepublish -p scripts/npm --tagstyle npm",
|
|
60
60
|
"pack": "wasm-pack",
|
|
61
61
|
"build:ts": "tsc -d",
|
|
62
|
-
"build:wasm": "npm-run-all \"pack -- build ./crates/
|
|
62
|
+
"build:wasm": "npm-run-all \"pack -- build ./crates/binding_core_wasm --scope swc {1} -t {2} --features plugin\" --",
|
|
63
63
|
"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",
|
|
64
64
|
"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",
|
|
65
65
|
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --config ./node-swc/jest.config.js",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@babel/preset-typescript": "^7.13.0",
|
|
97
97
|
"@babel/types": "^7.14.0",
|
|
98
98
|
"@napi-rs/cli": "^2.10.0",
|
|
99
|
-
"@swc/core": "^1.2.
|
|
99
|
+
"@swc/core": "^1.2.220",
|
|
100
100
|
"@swc/helpers": "^0.4.2",
|
|
101
101
|
"@taplo/cli": "^0.3.2",
|
|
102
102
|
"@types/jest": "^28.1.4",
|
|
@@ -138,19 +138,19 @@
|
|
|
138
138
|
"url": "https://opencollective.com/swc"
|
|
139
139
|
},
|
|
140
140
|
"optionalDependencies": {
|
|
141
|
-
"@swc/core-win32-x64-msvc": "1.2.
|
|
142
|
-
"@swc/core-darwin-x64": "1.2.
|
|
143
|
-
"@swc/core-linux-x64-gnu": "1.2.
|
|
144
|
-
"@swc/core-linux-x64-musl": "1.2.
|
|
145
|
-
"@swc/core-freebsd-x64": "1.2.
|
|
146
|
-
"@swc/core-win32-ia32-msvc": "1.2.
|
|
147
|
-
"@swc/core-linux-arm64-gnu": "1.2.
|
|
148
|
-
"@swc/core-linux-arm-gnueabihf": "1.2.
|
|
149
|
-
"@swc/core-darwin-arm64": "1.2.
|
|
150
|
-
"@swc/core-android-arm64": "1.2.
|
|
151
|
-
"@swc/core-linux-arm64-musl": "1.2.
|
|
152
|
-
"@swc/core-win32-arm64-msvc": "1.2.
|
|
153
|
-
"@swc/core-android-arm-eabi": "1.2.
|
|
141
|
+
"@swc/core-win32-x64-msvc": "1.2.223",
|
|
142
|
+
"@swc/core-darwin-x64": "1.2.223",
|
|
143
|
+
"@swc/core-linux-x64-gnu": "1.2.223",
|
|
144
|
+
"@swc/core-linux-x64-musl": "1.2.223",
|
|
145
|
+
"@swc/core-freebsd-x64": "1.2.223",
|
|
146
|
+
"@swc/core-win32-ia32-msvc": "1.2.223",
|
|
147
|
+
"@swc/core-linux-arm64-gnu": "1.2.223",
|
|
148
|
+
"@swc/core-linux-arm-gnueabihf": "1.2.223",
|
|
149
|
+
"@swc/core-darwin-arm64": "1.2.223",
|
|
150
|
+
"@swc/core-android-arm64": "1.2.223",
|
|
151
|
+
"@swc/core-linux-arm64-musl": "1.2.223",
|
|
152
|
+
"@swc/core-win32-arm64-msvc": "1.2.223",
|
|
153
|
+
"@swc/core-android-arm-eabi": "1.2.223"
|
|
154
154
|
},
|
|
155
155
|
"files": [
|
|
156
156
|
"CHANGELOG.md",
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
"package.json",
|
|
171
171
|
"spack.d.ts",
|
|
172
172
|
"types.js",
|
|
173
|
-
"postinstall.js"
|
|
173
|
+
"postinstall.js",
|
|
174
|
+
"crates/binding_core_wasm/pkg/binding_core_wasm.d.ts"
|
|
174
175
|
]
|
|
175
176
|
}
|