@swc/core 1.2.152 → 1.2.155

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 +186 -0
  2. package/package.json +18 -17
  3. package/types.d.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,192 @@
5
5
 
6
6
 
7
7
 
8
+ - **(common)** Don't use `None` as source while generating source maps (#4007) ([0ad13d9](https://github.com/swc-project/swc/commit/0ad13d93f288e54f245b249920d74cfe13d1e969))
9
+
10
+
11
+ - **(css/codegen)** Fix source maps (#3997) ([ece8d96](https://github.com/swc-project/swc/commit/ece8d962f86a9adadf02b425288308a2a06851fb))
12
+
13
+
14
+ - **(es)** Merge `jsc.loose` and `jsc.assumptions` (#3990) ([3590ea2](https://github.com/swc-project/swc/commit/3590ea22779fa3ca57fc9eab55cd203f9fb23f29))
15
+
16
+
17
+ - **(es/resolver)** Use correct context for identifiers after type parameters (#4000) ([87a3c1c](https://github.com/swc-project/swc/commit/87a3c1c91673c2609e71eda12f969a1fd4e56294))
18
+
19
+ ### Documentation
20
+
21
+
22
+
23
+ - **(api/rust)** Add examples (#4002) ([dac84b9](https://github.com/swc-project/swc/commit/dac84b98e38bd546cb9c9df72e3ad8d08b9550d9))
24
+
25
+
26
+ - **(api/rust)** Add an example for generating code and sourcemap (#4005) ([f650ca6](https://github.com/swc-project/swc/commit/f650ca6bb91845558d66c975d7c01c235eaa4ab1))
27
+
28
+ ### Features
29
+
30
+
31
+
32
+ - **(common)** Implement a pretty error reporter (#3946) ([40b8a4e](https://github.com/swc-project/swc/commit/40b8a4e596f0df33a325c93b75e5abab1336be11))
33
+
34
+
35
+ - **(css/parser)** Improve error reporting (#3999) ([96d6f37](https://github.com/swc-project/swc/commit/96d6f37c204f4962d0850a4ee2e38652d4833fa3))
36
+
37
+
38
+ - **(es/minifier)** Implement more rules for `arrows` (#3992) ([64ca5ba](https://github.com/swc-project/swc/commit/64ca5bae4d87b0aed82776d74e6aa5e2a712a35f))
39
+
40
+
41
+ - **(es/minifier)** Compress more comparisons (#3996) ([a23af2d](https://github.com/swc-project/swc/commit/a23af2dea243a16a12ce09c778f6fd3d56da0382))
42
+
43
+ ### Miscellaneous Tasks
44
+
45
+
46
+
47
+ - **(ci)** Invoke `yarn` before publishing ([743a5da](https://github.com/swc-project/swc/commit/743a5da1e5e6a3c9b8c59694e4f3cf04fa89006d))
48
+
49
+
50
+ - **(es/preset-env)** Track `.json` files to make cargo happy ([bd0fcb9](https://github.com/swc-project/swc/commit/bd0fcb9ea491f713ab3c0ed2b6035d3438446e8e))- **general**: Update linguist (#3991) ([0312292](https://github.com/swc-project/swc/commit/0312292410e3e001906241f5a2ab88839995376f))
51
+
52
+ ### Performance
53
+
54
+
55
+
56
+ - **(es/minifier)** Refactor base54 (#3989) ([04db7e2](https://github.com/swc-project/swc/commit/04db7e2a9be00248e005deb0a9113bcba0039e8f))
57
+
58
+
59
+ - **(es/minifier)** Use `Vec<u8>` as a buffer for `base54` (#3993) ([f7b212b](https://github.com/swc-project/swc/commit/f7b212bfc4fe9cdc89b77b5639be52a586c220e0))
60
+
61
+ ### Testing
62
+
63
+
64
+
65
+ - **(*)** Print diagnostics to stderr while testing (#4003) ([ee9a841](https://github.com/swc-project/swc/commit/ee9a841f33005c1ae287151952cf132a18b26de6))
66
+
67
+
68
+ - **(es)** Add an execution test system (#3994) ([b22d084](https://github.com/swc-project/swc/commit/b22d084180b77508f5e940045eb1b7bb9cd5c99b))
69
+
70
+
71
+ - **(es)** Add auto-closable tests (#3995) ([dabc492](https://github.com/swc-project/swc/commit/dabc4920a813ab395a96f9f8f90b3c50163063f9))
72
+
73
+ ### Build
74
+
75
+
76
+
77
+ - **(cargo)** Set workspace default members (#3978) ([560c81b](https://github.com/swc-project/swc/commit/560c81b120043b1edc20702a3ccfe3d3336c489a))
78
+
79
+ ## [1.2.154] - 2022-03-12
80
+
81
+ ### Bug Fixes
82
+
83
+
84
+
85
+ - **(es)** Change error message as it can be misleading (#3982) ([48f2fd8](https://github.com/swc-project/swc/commit/48f2fd8e1b723e3dfa1d54c25aa9f3c391c5ee74))
86
+
87
+
88
+ - **(es/preset-env)** Fix compilation issue (#3972) ([7ebfcfa](https://github.com/swc-project/swc/commit/7ebfcfa70f1456e627f6cf30f65c00e2b0b17476))
89
+
90
+
91
+ - **(es/preset-env)** Publish `builtin.json` (#3973) ([858372f](https://github.com/swc-project/swc/commit/858372ffada23f0f36c1161d2ec36b6da93d973c))
92
+
93
+
94
+ - **(es/preset-env)** Move out finished proposals (#3970) ([502f934](https://github.com/swc-project/swc/commit/502f934ce5397526db3a26554293841c3c5821ae))
95
+
96
+
97
+ - **(preset-env)** Use `core-js-compat` and `@babel/compat-data` directly (#3968) ([487273f](https://github.com/swc-project/swc/commit/487273fc5b5f964c159ea23d409b0f66e1d74229))
98
+
99
+ ### Features
100
+
101
+
102
+
103
+ - **(*)** Update dependencies (#3964) ([1206c84](https://github.com/swc-project/swc/commit/1206c84e19eca2711670e96407c47062c22a4d04))
104
+
105
+
106
+ - **(css/codegen)** Fix source maps and ast defs (#3974) ([516dbc6](https://github.com/swc-project/swc/commit/516dbc65dc769b21411989f4397dc97cf97571ed))
107
+
108
+
109
+ - **(css/prefixer)** Prefix more properties (#3976) ([4a9a5ff](https://github.com/swc-project/swc/commit/4a9a5ffa4b128c706f9a73a8465a317240c4babf))
110
+
111
+
112
+ - **(es/lints)** Mark catch params as binding patterns while checking duplicates (#3981) ([f28134f](https://github.com/swc-project/swc/commit/f28134fe774173b6e12c8571c92fe1c015f8b53b))
113
+
114
+ ### Miscellaneous Tasks
115
+
116
+
117
+
118
+ - **(ci)** Skip unnecessary package for the benchmark (#3980) ([485dc54](https://github.com/swc-project/swc/commit/485dc54d299c6f48752841401d2bfaf716f64f06))
119
+
120
+
121
+ - **(es/parser)** Add some inline attributes (#3969) ([6a6c322](https://github.com/swc-project/swc/commit/6a6c32203b8f2fde61279320cca505052f969da3))
122
+
123
+
124
+ - **(es/preset-env)** Use js script for copying files (#3986) ([83722df](https://github.com/swc-project/swc/commit/83722df21a54d29caffb6fe8eb1261763a085830))
125
+
126
+ ### Performance
127
+
128
+
129
+
130
+ - **(common)** Use `fxhash` everywhere (#3985) ([db60291](https://github.com/swc-project/swc/commit/db602911647360e0a26139d93882c353ba4d9330))
131
+
132
+
133
+ - **(es/minifier)** Make mangler faster by merging hash sets into one (#3983) ([107c91d](https://github.com/swc-project/swc/commit/107c91dd206e31c221df98446f71e8f18020c060))
134
+
135
+
136
+ - **(es/minifier)** Use fxhash for integers (#3984) ([67e6154](https://github.com/swc-project/swc/commit/67e615421f85aee2919016a5d01e4ebb1b9b08c4))
137
+
138
+
139
+ - **(es/minifier)** Merge hashmap for scoping before checking (#3988) ([1beecce](https://github.com/swc-project/swc/commit/1beecceead16765abd1b698d3a255e647a2adcc7))
140
+
141
+ ### Testing
142
+
143
+
144
+
145
+ - **(es)** Add tests for fixed issues (#3987) ([073d847](https://github.com/swc-project/swc/commit/073d847a33fe9902428633292efa8a606fe208f1))
146
+
147
+ ## [1.2.153] - 2022-03-11
148
+
149
+ ### Bug Fixes
150
+
151
+
152
+
153
+ - **(api/rust)** Fix transform comment api (#3962) ([fcbd3c5](https://github.com/swc-project/swc/commit/fcbd3c5c5849418b911d87d3a0b36eb84bef1a68))
154
+
155
+
156
+ - **(es)** Adjust tracing span level (#3911) ([ca071fb](https://github.com/swc-project/swc/commit/ca071fb705210ec33698dbce81069156de4fcf7a))
157
+
158
+
159
+ - **(es/codegen)** Fix sourcemap issue caused by reserved `BytePos` values (#3948) ([e8018c5](https://github.com/swc-project/swc/commit/e8018c54d4581c43c72d27e51d0aa36a64881a9e))
160
+
161
+
162
+ - **(es/compat)** Refer this in constructor when `super_is_callable_constructor` is set (#3944) ([de8a711](https://github.com/swc-project/swc/commit/de8a7116cd587a6ddb8d734ffd96cdacd076f48c))
163
+
164
+
165
+ - **(es/lints)** Don't visit types while collecting `const` (#3967) ([c6b5371](https://github.com/swc-project/swc/commit/c6b5371c51413577165543eddb78e7d051f3d376))
166
+
167
+
168
+ - **(es/minifier)** Preserve fuction parameters used for template literals in `evaluate` and `reduce_vars` (#3949) ([91a302a](https://github.com/swc-project/swc/commit/91a302a672a70a34fe693fa84d65ba87901d0f36))
169
+
170
+
171
+ - **(es/parser)** Parse if-else chain iteratively (#3961) ([76e6468](https://github.com/swc-project/swc/commit/76e646804a025e2a451314013a437e79a6cd8ce2))
172
+
173
+
174
+ - **(node-swc/types)** Add `reserved` to `TerserMangleOptions` (#3959) ([70a68a7](https://github.com/swc-project/swc/commit/70a68a785091845c5e66ab3fe0fd52cc47f11a80))
175
+
176
+ ### Features
177
+
178
+
179
+
180
+ - **(css/codegen)** Support source map (#3958) ([5a6ebd3](https://github.com/swc-project/swc/commit/5a6ebd36ee7a35e81e4f3b0961106a41f83f6b7f))
181
+
182
+
183
+ - **(es)** Add an option to preserve all comments (#3815) ([c5a0c9a](https://github.com/swc-project/swc/commit/c5a0c9a0ab2345aa9c41a40100d049a144dfb70f))
184
+
185
+
186
+ - **(es/lints)** Refine error message (#3952) ([579aeb7](https://github.com/swc-project/swc/commit/579aeb7cfacb38d822634e5c82b209bd311ac9b2))
187
+
188
+ ## [1.2.152] - 2022-03-10
189
+
190
+ ### Bug Fixes
191
+
192
+
193
+
8
194
  - **(es)** Don't create `.swc` if not required (#3937) ([46e9d3f](https://github.com/swc-project/swc/commit/46e9d3f62e07b5aaeac9a9f73bb4b5573ad69b27))
9
195
 
10
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.152",
3
+ "version": "1.2.155",
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.152",
111
- "@swc/core-darwin-x64": "1.2.152",
112
- "@swc/core-linux-x64-gnu": "1.2.152",
113
- "@swc/core-linux-x64-musl": "1.2.152",
114
- "@swc/core-freebsd-x64": "1.2.152",
115
- "@swc/core-win32-ia32-msvc": "1.2.152",
116
- "@swc/core-linux-arm64-gnu": "1.2.152",
117
- "@swc/core-linux-arm-gnueabihf": "1.2.152",
118
- "@swc/core-darwin-arm64": "1.2.152",
119
- "@swc/core-android-arm64": "1.2.152",
120
- "@swc/core-linux-arm64-musl": "1.2.152",
121
- "@swc/core-win32-arm64-msvc": "1.2.152",
122
- "@swc/core-android-arm-eabi": "1.2.152"
111
+ "@swc/core-win32-x64-msvc": "1.2.155",
112
+ "@swc/core-darwin-x64": "1.2.155",
113
+ "@swc/core-linux-x64-gnu": "1.2.155",
114
+ "@swc/core-linux-x64-musl": "1.2.155",
115
+ "@swc/core-freebsd-x64": "1.2.155",
116
+ "@swc/core-win32-ia32-msvc": "1.2.155",
117
+ "@swc/core-linux-arm64-gnu": "1.2.155",
118
+ "@swc/core-linux-arm-gnueabihf": "1.2.155",
119
+ "@swc/core-darwin-arm64": "1.2.155",
120
+ "@swc/core-android-arm64": "1.2.155",
121
+ "@swc/core-linux-arm64-musl": "1.2.155",
122
+ "@swc/core-win32-arm64-msvc": "1.2.155",
123
+ "@swc/core-android-arm-eabi": "1.2.155"
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;