@swc/core 1.2.147 → 1.2.148

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,98 @@
5
5
 
6
6
 
7
7
 
8
+ - **(css/codegen)** Fix codegen of preserved tokens (#3819) ([7ba5861](https://github.com/swc-project/swc/commit/7ba5861a334657cb443b2f143222f632fcbcf752))
9
+
10
+
11
+ - **(css/codegen)** Fix the output of `SimpleBlock` (#3838) ([e3a5c14](https://github.com/swc-project/swc/commit/e3a5c142d5f6e965478bd68201714e6d0b4bc863))
12
+
13
+
14
+ - **(css/parser)** Fix parsing of `;` in values (#3821) ([30cd29b](https://github.com/swc-project/swc/commit/30cd29b0f0153bd732f0004dfcb10892635ee027))
15
+
16
+
17
+ - **(es/compat)** Fix block scoping of variables (#3826) ([406b8ea](https://github.com/swc-project/swc/commit/406b8eaeafa37d1ec68a5d5aca0f8dd337ae39ec))
18
+
19
+
20
+ - **(es/hygiene)** Fix renaming bugs (#3824) ([043fba2](https://github.com/swc-project/swc/commit/043fba274e13055dad4b2f6cee85b1bf751572ca))
21
+
22
+
23
+ - **(es/minifier)** Preserve more variables (#3805) ([89388e6](https://github.com/swc-project/swc/commit/89388e6ac3669f129d1dfc1f687ad7792373dbc9))
24
+
25
+
26
+ - **(es/minifier)** Don't reorder unnecessarily (#3817) ([8a468f7](https://github.com/swc-project/swc/commit/8a468f7544ae7e717de4d629c33e5cdffdfcc7de))
27
+
28
+
29
+ - **(es/minifier)** Support declaring multiple bindings with the same name (#3837) ([0fc819e](https://github.com/swc-project/swc/commit/0fc819e2ef04a5a809d1c15523262b2f3fbc580a))
30
+
31
+
32
+ - **(node-swc)** Correctly close trace spans after completion (#3811) ([ffb2ee8](https://github.com/swc-project/swc/commit/ffb2ee85e6e3cac7136578c2eaaff73b883f208c))
33
+
34
+
35
+ - **(node-swc)** Fix handling of `OptionalChainingExpression` in `Visitor` (#3809) ([4d123c3](https://github.com/swc-project/swc/commit/4d123c3789cd5a837de08014675e945990122c62))
36
+
37
+
38
+ - **(node-swc/types)** Add a missing field of `ExportNamedDeclaration` (#3822) ([bde7577](https://github.com/swc-project/swc/commit/bde75770988a6e1c9bb6ae4b850866cea79b0f2c))
39
+
40
+ ### Features
41
+
42
+
43
+
44
+ - **(config)** Add a dedicated cached regex (#3832) ([efc6741](https://github.com/swc-project/swc/commit/efc67417a5afd7813c2d09938300b5c372d1a978))
45
+
46
+
47
+ - **(css)** Support color functions (#3836) ([3df887c](https://github.com/swc-project/swc/commit/3df887ca3744813d8cfc6c253a7bb3decaca54db))
48
+
49
+
50
+ - **(css/lints)** Add `font-family-no-duplicate-names` rule (#3818) ([2d273d6](https://github.com/swc-project/swc/commit/2d273d60b9dec4d9f969f0e691ba21ce4b252b7d))
51
+
52
+
53
+ - **(css/lints)** Implement `color-hex-alpha` rule (#3829) ([818b408](https://github.com/swc-project/swc/commit/818b40857328ae9b855d78d774621fa1ab243da9))
54
+
55
+
56
+ - **(css/minifier)** Compress more declarations (#3840) ([0db6915](https://github.com/swc-project/swc/commit/0db6915e32d6c1de848b0f5aeacea2c4cb4522f8))
57
+
58
+
59
+ - **(css/parser)** Improve error recovery (#3810) ([f969f8c](https://github.com/swc-project/swc/commit/f969f8c5f54e3028576a74ccfcaae72b1c19eaf9))
60
+
61
+
62
+ - **(css/parser)** Improve error recovery (#3828) ([fbb98aa](https://github.com/swc-project/swc/commit/fbb98aa73cbbac186493065af8cfa0fd31407fe6))
63
+
64
+
65
+ - **(es/lints)** Implement `radix` rule (#3651) ([f6b4bbe](https://github.com/swc-project/swc/commit/f6b4bbe47beccb6052d60c8e6d7d8c8c7fec5100))
66
+
67
+
68
+ - **(es/minifier)** Drop more function parameters in strict mode (#3814) ([789eb7b](https://github.com/swc-project/swc/commit/789eb7baa9ece80e85f0ffd9a92f4d07214d9b11))
69
+
70
+
71
+ - **(es/minifier)** Improve sequential inlining (#3820) ([364532e](https://github.com/swc-project/swc/commit/364532e9a74ee55196cecb37eb3fc8256e3a23df))
72
+
73
+
74
+ - **(es/minifier)** Implement more rules (#3841) ([260c2a8](https://github.com/swc-project/swc/commit/260c2a885e16332a0e3401bccb65d1381bfab3f3))
75
+
76
+ ### Miscellaneous Tasks
77
+ - **general**: Ignore linguist detection for CSS test files (#3831) ([8755ce1](https://github.com/swc-project/swc/commit/8755ce160f9fa6f9ce75c4ac40fc02d5df236d2d))
78
+
79
+ ### Performance
80
+
81
+
82
+
83
+ - **(es)** Use `Mutex` from `parking_lot` (#3830) ([351b814](https://github.com/swc-project/swc/commit/351b814ed0f1ca36a1e8fd352674689ffe392eda))
84
+
85
+
86
+ - **(es/parser)** Remove duplicated instantiations of `Parser` to reduce binary size (#3813) ([f5103a7](https://github.com/swc-project/swc/commit/f5103a77256060e2c27ca360d0c58bbcc6b92b13))
87
+
88
+ ### Testing
89
+
90
+
91
+
92
+ - **(es/compat)** Organize tests (#3825) ([814dcc0](https://github.com/swc-project/swc/commit/814dcc09d66f9c7a968348fc3a08573cadd036f8))
93
+
94
+ ## [1.2.147] - 2022-03-02
95
+
96
+ ### Bug Fixes
97
+
98
+
99
+
8
100
  - **(es/compat)** Initialize class fields as a last step (#3767) ([11bf29f](https://github.com/swc-project/swc/commit/11bf29f44b4233b2e7f60b750ef56429dbe47ce9))
9
101
 
10
102
 
@@ -127,6 +219,12 @@
127
219
 
128
220
  - **(es/minifier)** Prepare porting more rules from `terser` (#3779) ([86072b5](https://github.com/swc-project/swc/commit/86072b57f9e0cf59b660f88cdb2c9cee15f33720))
129
221
 
222
+ ### Build
223
+
224
+
225
+
226
+ - **(node-swc)** Rename entrypoint to avoid artifact collision (#3806) ([b485a2f](https://github.com/swc-project/swc/commit/b485a2fc267e0f373b9882e61c14b9fbf7a92471))
227
+
130
228
  ## [1.2.146] - 2022-02-27
131
229
 
132
230
  ### Bug Fixes
package/Visitor.js CHANGED
@@ -779,7 +779,7 @@ class Visitor {
779
779
  }
780
780
  }
781
781
  visitOptionalChainingExpression(n) {
782
- n.expr = this.visitExpression(n.expr);
782
+ n.base = this.visitExpression(n.base);
783
783
  return n;
784
784
  }
785
785
  visitAssignmentExpression(n) {
package/binding.d.ts CHANGED
@@ -11,5 +11,5 @@ export const transform: any;
11
11
  export const transformSync: any;
12
12
  export const transformFile: any;
13
13
  export const transformFileSync: any;
14
- export const initTraceOnce: any;
14
+ export const initCustomTraceSubscriber: any;
15
15
  export const Compiler: any;
package/binding.js CHANGED
@@ -243,7 +243,7 @@ if (!nativeBinding) {
243
243
  }
244
244
  throw new Error(`Failed to load native binding`);
245
245
  }
246
- const { bundle, minify, minifySync, parse, parseSync, parseFileSync, parseFile, print, printSync, transform, transformSync, transformFile, transformFileSync, initTraceOnce, Compiler } = nativeBinding;
246
+ const { bundle, minify, minifySync, parse, parseSync, parseFileSync, parseFile, print, printSync, transform, transformSync, transformFile, transformFileSync, initCustomTraceSubscriber, Compiler } = nativeBinding;
247
247
  module.exports.bundle = bundle;
248
248
  module.exports.minify = minify;
249
249
  module.exports.minifySync = minifySync;
@@ -257,5 +257,5 @@ module.exports.transform = transform;
257
257
  module.exports.transformSync = transformSync;
258
258
  module.exports.transformFile = transformFile;
259
259
  module.exports.transformFileSync = transformFileSync;
260
- module.exports.initTraceOnce = initTraceOnce;
260
+ module.exports.initCustomTraceSubscriber = initCustomTraceSubscriber;
261
261
  module.exports.Compiler = Compiler;
package/index.js CHANGED
@@ -258,7 +258,9 @@ exports.minifySync = minifySync;
258
258
  * or bug report at https://github.com/swc-project/swc/discussions.
259
259
  */
260
260
  function __experimental_registerGlobalTraceConfig(traceConfig) {
261
- bindings.initTraceOnce(traceConfig.type === 'traceEvent', traceConfig.fileName);
261
+ if (traceConfig.type === 'traceEvent') {
262
+ bindings.initCustomTraceSubscriber(traceConfig.fileName);
263
+ }
262
264
  }
263
265
  exports.__experimental_registerGlobalTraceConfig = __experimental_registerGlobalTraceConfig;
264
266
  exports.DEFAULT_EXTENSIONS = Object.freeze([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.147",
3
+ "version": "1.2.148",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -107,18 +107,18 @@
107
107
  "url": "https://opencollective.com/swc"
108
108
  },
109
109
  "optionalDependencies": {
110
- "@swc/core-win32-x64-msvc": "1.2.147",
111
- "@swc/core-darwin-x64": "1.2.147",
112
- "@swc/core-linux-x64-gnu": "1.2.147",
113
- "@swc/core-linux-x64-musl": "1.2.147",
114
- "@swc/core-freebsd-x64": "1.2.147",
115
- "@swc/core-win32-ia32-msvc": "1.2.147",
116
- "@swc/core-linux-arm64-gnu": "1.2.147",
117
- "@swc/core-linux-arm-gnueabihf": "1.2.147",
118
- "@swc/core-darwin-arm64": "1.2.147",
119
- "@swc/core-android-arm64": "1.2.147",
120
- "@swc/core-linux-arm64-musl": "1.2.147",
121
- "@swc/core-win32-arm64-msvc": "1.2.147",
122
- "@swc/core-android-arm-eabi": "1.2.147"
110
+ "@swc/core-win32-x64-msvc": "1.2.148",
111
+ "@swc/core-darwin-x64": "1.2.148",
112
+ "@swc/core-linux-x64-gnu": "1.2.148",
113
+ "@swc/core-linux-x64-musl": "1.2.148",
114
+ "@swc/core-freebsd-x64": "1.2.148",
115
+ "@swc/core-win32-ia32-msvc": "1.2.148",
116
+ "@swc/core-linux-arm64-gnu": "1.2.148",
117
+ "@swc/core-linux-arm-gnueabihf": "1.2.148",
118
+ "@swc/core-darwin-arm64": "1.2.148",
119
+ "@swc/core-android-arm64": "1.2.148",
120
+ "@swc/core-linux-arm64-musl": "1.2.148",
121
+ "@swc/core-win32-arm64-msvc": "1.2.148",
122
+ "@swc/core-android-arm-eabi": "1.2.148"
123
123
  }
124
124
  }
package/types.d.ts CHANGED
@@ -742,7 +742,7 @@ export interface OptionalChainingExpression extends ExpressionBase {
742
742
  /**
743
743
  * Call expression or member expression.
744
744
  */
745
- expr: Expression;
745
+ base: Expression;
746
746
  }
747
747
  export interface ThisExpression extends ExpressionBase {
748
748
  type: "ThisExpression";
@@ -1020,6 +1020,7 @@ export interface ExportNamedDeclaration extends Node, HasSpan {
1020
1020
  type: "ExportNamedDeclaration";
1021
1021
  specifiers: ExportSpecifier[];
1022
1022
  source?: StringLiteral;
1023
+ typeOnly: boolean;
1023
1024
  }
1024
1025
  export interface ExportDefaultDeclaration extends Node, HasSpan {
1025
1026
  type: "ExportDefaultDeclaration";