@swc/core 1.2.220 → 1.2.222

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,95 @@
5
5
 
6
6
 
7
7
 
8
+ - **(css/ast)** Support list of component values (#5321) ([8f81104](https://github.com/swc-project/swc/commit/8f811043809a8cc51bb717b678906576bb6eccc3))
9
+
10
+
11
+ - **(css/prefixer)** Generate prefixes for selectors using env (#5307) ([b18172d](https://github.com/swc-project/swc/commit/b18172d7613c2ecee85f559b9b317aeb2f9bfda7))
12
+
13
+
14
+ - **(es/codegen)** Emit type parameters of class super expression (#5338) ([42d8ad2](https://github.com/swc-project/swc/commit/42d8ad26ce5b56d9c26d342e8b6af8844b85bd17))
15
+
16
+
17
+ - **(es/minifier)** Change default es version to `es5` (#5333) ([64a9946](https://github.com/swc-project/swc/commit/64a99461ecc24b074e9b674c98c1cec12b687159))
18
+
19
+
20
+ - **(es/minifier)** Check if an inlined value is mutated (#5318) ([11f495a](https://github.com/swc-project/swc/commit/11f495ad37cbaf56359174a206e97f0874cc0d15))
21
+
22
+
23
+ - **(es/minifier)** Ignore member expression without side-effects in assign position (#5344) ([8611161](https://github.com/swc-project/swc/commit/8611161c02223f6b1fb8734e648392794f2b1d81))
24
+
25
+
26
+ - **(es/minifier)** Allow single-thread mode (#5353) ([fbdc9af](https://github.com/swc-project/swc/commit/fbdc9af5ca51e7e2a0ba42997dd9ffd14d5059f4))
27
+
28
+
29
+ - **(es/utils)** Fix `contains_top_level_await` (#5335) ([1d10c3e](https://github.com/swc-project/swc/commit/1d10c3e83725276fa466393fb7a3139f07fa66c7))
30
+
31
+ ### Features
32
+
33
+
34
+
35
+ - **(css/prefixer)** Prefix more properties (#5340) ([8e12e52](https://github.com/swc-project/swc/commit/8e12e52a5735dafe1336d0bdc83e91dd7cca9d7d))
36
+
37
+
38
+ - **(css/prefixer)** Avoid prefixing general functions (#5319) ([07732d6](https://github.com/swc-project/swc/commit/07732d6a0a3684697ebfd263749b12a083029db9))
39
+
40
+
41
+ - **(wasm)** Add interfaces for wasm bindings (#5341) ([c16b6b7](https://github.com/swc-project/swc/commit/c16b6b72300a4e4952398c136ef834b8ca2f4b41))
42
+
43
+
44
+ - **(wasm)** Enable string interning (#5351) ([b0cb35a](https://github.com/swc-project/swc/commit/b0cb35abaad7ca2a2e58462285548959d3e2c0fc))
45
+
46
+
47
+ - **(wasm)** Expose async facade interfaces (#5352) ([281bdd9](https://github.com/swc-project/swc/commit/281bdd9e9741ec7375497b390058a86a4f199029))
48
+
49
+
50
+ - **(xml)** Add xml crates (#5329) ([83e5023](https://github.com/swc-project/swc/commit/83e502367b5224be8e147d2e255e1ea3b7be4faa))
51
+
52
+ ### Miscellaneous Tasks
53
+
54
+
55
+
56
+ - **(ci)** Set MSRV to `1.60` (#5354) ([d3ecfd3](https://github.com/swc-project/swc/commit/d3ecfd36cd79e25334f36119da3233be53fa7e10))
57
+
58
+ ### Performance
59
+
60
+
61
+
62
+ - **(es/minifier)** Make name mangler faster (#5336) ([b378c06](https://github.com/swc-project/swc/commit/b378c060816411dd1990a1dae4977703d3c80748))
63
+
64
+
65
+ - **(html/parser)** Apply small memory optimizations (#5345) ([2a499de](https://github.com/swc-project/swc/commit/2a499de61decdb836a4a51bc0fa5631568b77015))
66
+
67
+ ### Refactor
68
+
69
+
70
+
71
+ - **(wasm)** Use async interfaces for fallback bindings (#5356) ([74e7486](https://github.com/swc-project/swc/commit/74e748617e288b98b80e4b71aee15ed6fda1c48d))
72
+
73
+ ### Testing
74
+
75
+
76
+
77
+ - **(es)** Support tsc multi-file unit tests (#5316) ([81ac366](https://github.com/swc-project/swc/commit/81ac36604edda1d38329cf10fc65720eedf48cb9))
78
+
79
+
80
+ - **(es)** Update test cases (#5334) ([add1b75](https://github.com/swc-project/swc/commit/add1b75f61683f129b148fa14942e10a6514a0f3))
81
+
82
+ ### Build
83
+
84
+
85
+
86
+ - **(cargo)** Update packages (#5331) ([5c9ea16](https://github.com/swc-project/swc/commit/5c9ea16b2a5e003a5fa0198f3101e93efceab3b0))
87
+
88
+
89
+ - **(node)** Include fallback binding as a dependency (#5322) ([0782d25](https://github.com/swc-project/swc/commit/0782d250746eae97426ce7db9a24308efddcccf0))
90
+
91
+ ## [1.2.220] - 2022-07-28
92
+
93
+ ### Bug Fixes
94
+
95
+
96
+
8
97
  - **(atoms)** Workaround a bug of `rkyv` (#5323) ([14894ed](https://github.com/swc-project/swc/commit/14894ed4c970b7d283e36acd6001339e7d0d04fd))
9
98
 
10
99
 
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: any;
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 Promise.resolve(fallbackBindings.minifySync(src, opts));
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
- const res = fallbackBindings.parseSync(src, toBuffer(options), filename);
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 JSON.parse(fallbackBindings.parseSync(src, options));
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 Promise.resolve(fallbackBindings.printSync(JSON.stringify(m), options));
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(JSON.stringify(m), options);
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 Promise.resolve(fallbackBindings.transformSync(src, options));
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.220",
3
+ "version": "1.2.222",
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/wasm --scope swc {1} -t {2} --features plugin\" --",
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.219",
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.220",
142
- "@swc/core-darwin-x64": "1.2.220",
143
- "@swc/core-linux-x64-gnu": "1.2.220",
144
- "@swc/core-linux-x64-musl": "1.2.220",
145
- "@swc/core-freebsd-x64": "1.2.220",
146
- "@swc/core-win32-ia32-msvc": "1.2.220",
147
- "@swc/core-linux-arm64-gnu": "1.2.220",
148
- "@swc/core-linux-arm-gnueabihf": "1.2.220",
149
- "@swc/core-darwin-arm64": "1.2.220",
150
- "@swc/core-android-arm64": "1.2.220",
151
- "@swc/core-linux-arm64-musl": "1.2.220",
152
- "@swc/core-win32-arm64-msvc": "1.2.220",
153
- "@swc/core-android-arm-eabi": "1.2.220"
141
+ "@swc/core-win32-x64-msvc": "1.2.222",
142
+ "@swc/core-darwin-x64": "1.2.222",
143
+ "@swc/core-linux-x64-gnu": "1.2.222",
144
+ "@swc/core-linux-x64-musl": "1.2.222",
145
+ "@swc/core-freebsd-x64": "1.2.222",
146
+ "@swc/core-win32-ia32-msvc": "1.2.222",
147
+ "@swc/core-linux-arm64-gnu": "1.2.222",
148
+ "@swc/core-linux-arm-gnueabihf": "1.2.222",
149
+ "@swc/core-darwin-arm64": "1.2.222",
150
+ "@swc/core-android-arm64": "1.2.222",
151
+ "@swc/core-linux-arm64-musl": "1.2.222",
152
+ "@swc/core-win32-arm64-msvc": "1.2.222",
153
+ "@swc/core-android-arm-eabi": "1.2.222"
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
  }