@swc/core 1.3.20 → 1.3.22
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 +211 -0
- package/package.json +13 -13
- package/types.d.ts +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,217 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
- **(common)** Fix handling of input source maps (#6561) ([4af52c7](https://github.com/swc-project/swc/commit/4af52c79aea73f2e916bd11ce089bb4a4317179c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(common)** Fix `BytePos` -> `CharPos` calculations (#6574) ([a203fdb](https://github.com/swc-project/swc/commit/a203fdb1b62ce2df855421d46905f8b821eeabbd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(css/parser)** Fix recovery more for invalid component values in declaration value (#6560) ([db1eb48](https://github.com/swc-project/swc/commit/db1eb483fda71ca5f88342d8c53cb795707c6221))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(css/parser)** Fix parsing of nested rules (#6563) ([a1fe907](https://github.com/swc-project/swc/commit/a1fe9076c231ca1eef05c558f43803ec006559c3))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- **(css/parser)** Fix a small bug (#6591) ([4de378c](https://github.com/swc-project/swc/commit/4de378cb1e170df496b277bc141dacaa1c21738f))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(css/parser)** Avoid skipping extra whitespaces (#6592) ([d8936ad](https://github.com/swc-project/swc/commit/d8936ade5b34f682af08e01833d629a67c54f888))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- **(es/compat)** Prepend generated `_loop` to the correct scope (#6604) ([4c2d422](https://github.com/swc-project/swc/commit/4c2d42261ed0382c49e8a564b574362a5ab182a3))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(es/parser)** Fix `typeof` in `TSCallSignatureDeclaration` (#6553) ([aa28aa0](https://github.com/swc-project/swc/commit/aa28aa0c7fefcaea063340c711a5ea8a3ba60e7b))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- **(es/parser)** Fix parsing of JSX with ASI (#6577) ([ad95ead](https://github.com/swc-project/swc/commit/ad95ead291640b1ada65860af1adf5e8185c80a4))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- **(es/resolver)** Reset `in_type` flag correctly (#6597) ([29ba05d](https://github.com/swc-project/swc/commit/29ba05d137c606f9e67fec9db8bd2377671900e1))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- **(es/typescript)** Strip inline type declarations (#6600) ([fe0c651](https://github.com/swc-project/swc/commit/fe0c65195d2308b1475e958a7051b5f529bf4580))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- **(node-swc)** Sync types for `jsc.optimizer.globals` (#6603) ([b97aa45](https://github.com/swc-project/swc/commit/b97aa45c5c0ef5cfccc15294767c2bc8f0a7307d))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
- **(xml/parser)** Fix parsing of legacy document types (#6555) ([cdf0d8a](https://github.com/swc-project/swc/commit/cdf0d8a8b59a05498b6ca609d8a2ecf3c2f35f28))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- **(xml/parser)** Fix various bugs (#6566) ([01232f0](https://github.com/swc-project/swc/commit/01232f09883de34eb3eb94d364f9bd2a3b985703))
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- **(css/ast)** Make AST intuitive (#6606) ([b4eef53](https://github.com/swc-project/swc/commit/b4eef53680b0e553f14404f641b521a346e55f1f))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
- **(css/plugin)** Prepare Wasm plugins (#6567) ([8cdc28c](https://github.com/swc-project/swc/commit/8cdc28cdfa17f1773bdd30c2187c79e1db0a3ffe))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
- **(css/plugin)** Support Wasm plugin (#6568) ([fa8f7b0](https://github.com/swc-project/swc/commit/fa8f7b00fc458c4ee2a74b431fb9004f67e54dde))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
- **(es/analyzer)** Extract the analyzer from the minifier to a separate crate (#6586) ([e1d01d8](https://github.com/swc-project/swc/commit/e1d01d8b7aa23d1bf3f3894546691c0b249ab647))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
- **(html/parser)** Improve lexer (#6543) ([49b7e9e](https://github.com/swc-project/swc/commit/49b7e9e224c36346a8fe5ccbec623ae76f0cc79d))
|
|
66
|
+
|
|
67
|
+
### Miscellaneous Tasks
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
- **(ci)** Add debug logs for cli binaries (#6556) ([8083484](https://github.com/swc-project/swc/commit/80834843f4180bc292f8b2959b1390a07bec0a77))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
- **(ci)** Fix CI (#6558) ([8587589](https://github.com/swc-project/swc/commit/85875897f1fd3e71fe5e5d1877bb0e80458835d9))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
- **(ci)** Fix benchmark action (#6582) ([d8adc58](https://github.com/swc-project/swc/commit/d8adc580110e0764686f5aea848425905605daa0))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
- **(ci)** Fix benchmark action (#6596) ([154c315](https://github.com/swc-project/swc/commit/154c315d91f20466ae90b83f5300017e57e4a078))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
- **(css/lexer)** Fix typo (#6588) ([f383836](https://github.com/swc-project/swc/commit/f383836bad48a791c93d1f6bd5670a2d19a545d8))
|
|
84
|
+
|
|
85
|
+
### Performance
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
- **(css/ast)** Reduce token size (#6569) ([8633d27](https://github.com/swc-project/swc/commit/8633d27df0f429cd024c3b36f686c136b2bb945f))
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
- **(css/codegen)** Reduce allocations (#6599) ([538d63e](https://github.com/swc-project/swc/commit/538d63eb800506fd8ff44d238d0cb02a1d3cf478))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
- **(css/minifier)** Remove redundant clone (#6579) ([70ac028](https://github.com/swc-project/swc/commit/70ac0286e50d8117e918e11131ffb15d77d9ed18))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
- **(css/minifier)** Remove more redundant clones (#6580) ([4171ee7](https://github.com/swc-project/swc/commit/4171ee7fb353966c5a11e4701b2bdf28bc895ad1))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
- **(css/minifier)** Improve performance (#6583) ([7895599](https://github.com/swc-project/swc/commit/78955995a2fd381a9d56a325e368aa29dcc3c7be))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
- **(css/parser)** Reduce clones and allocations (#6585) ([6479670](https://github.com/swc-project/swc/commit/64796701e45a59a9d9ba439064d012b5ad3ce144))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
- **(css/parser)** Reduce number of function calls (#6587) ([252edb5](https://github.com/swc-project/swc/commit/252edb550be2464d34c1ccce668d1666f3799878))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
- **(css/parser)** Don't allocate for comparisons (#6593) ([08b6eab](https://github.com/swc-project/swc/commit/08b6eab0103ed7b42b6053392161ea8bd4fd597a))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
- **(html/parser)** Optimize usage of buffers (#6590) ([d6e9613](https://github.com/swc-project/swc/commit/d6e961368bb231dfa842b7cd37f77e2f0fb9c8c2))
|
|
114
|
+
|
|
115
|
+
### Refactor
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
- **(common)** Cleanup source_map.rs (#6570) ([b3ea52f](https://github.com/swc-project/swc/commit/b3ea52f8637998721f6762f93f486892f7676993))
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
- **(es/minifier)** Remove unnecessary code (#6575) ([586bfd5](https://github.com/swc-project/swc/commit/586bfd5480aa6e0d37cc50505efa61a6343b1bc8))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
- **(xml/parser)** Simplify logic for parsing elements (#6557) ([85a03e7](https://github.com/swc-project/swc/commit/85a03e71b7fe98d6f4f7c3fd0e49ce862130dfcc))
|
|
126
|
+
|
|
127
|
+
### Testing
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
- **(css/parser)** Move vendor tests (#6564) ([4d422b6](https://github.com/swc-project/swc/commit/4d422b6228c0a29e3e540697e805be5ae33f4cf2))
|
|
132
|
+
|
|
133
|
+
## [1.3.21] - 2022-11-30
|
|
134
|
+
|
|
135
|
+
### Bug Fixes
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
- **(ci)** Fix publish action for binaries (#6517) ([2ac3201](https://github.com/swc-project/swc/commit/2ac32017bad112956a781b0d003782988655409c))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
- **(es/minifier)** Don't drop used variables from sequential inliner (#6520) ([b394f9f](https://github.com/swc-project/swc/commit/b394f9f1d3efd24fd55b4ac5efdbaee91b9d8021))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
- **(es/minifier)** Make sequential inliner respect resolution order (#6509) ([27ae59e](https://github.com/swc-project/swc/commit/27ae59e77bb8cb1f1d1dbbba3f8dec58359bc2ba))
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
- **(es/minifier)** Use unsafe option for arrow => method (#6521) ([9752b43](https://github.com/swc-project/swc/commit/9752b43f94313fe2902ad04e5b01b865e0180155))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
- **(es/minifier)** Don't convert a signed integer literal key to a numeric literal (#6529) ([81224b5](https://github.com/swc-project/swc/commit/81224b5d67a92c7154a870f07f28d9802be2106e))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
- **(html/parser)** Fix parsing of cdata (#6534) ([e3cbe7e](https://github.com/swc-project/swc/commit/e3cbe7e9a98149bfc05421a264d4e421fb543f7e))
|
|
155
|
+
|
|
156
|
+
### Features
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
- **(common)** Add contexts to the error messages (#6526) ([b8fe04f](https://github.com/swc-project/swc/commit/b8fe04f720d81f2d4ef0778cbb345f64b9ec1956))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
- **(es/parser)** Make error message helpful (#6535) ([cb15721](https://github.com/swc-project/swc/commit/cb157215d26e5acfe74f7592da011ab9d5206207))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
- **(es/preset-env)** Update data (#6538) ([ae63220](https://github.com/swc-project/swc/commit/ae6322064d67bc24d65f560f699a2a554bbfdb37))
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
- **(xml/parser)** Parse cdata section (#6531) ([7f8c4e0](https://github.com/swc-project/swc/commit/7f8c4e04b246bef493a044f794ea1608f4550457))
|
|
170
|
+
|
|
171
|
+
### Miscellaneous Tasks
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
- **(bindings)** Fix jemalloc on aarch64 (#6541) ([d56b5a8](https://github.com/swc-project/swc/commit/d56b5a890a69a9a9177eed2a955f2c959fd1eaa1))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
- **(swc_core)** Reexport more modules (#6548) ([9b58cce](https://github.com/swc-project/swc/commit/9b58cce10bf5d313b6397c0366222c51db19eaca))
|
|
179
|
+
|
|
180
|
+
### Performance
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
- **(common)** Fix perf bug of sourcemap for inputs with multi-byte chars (#6523) ([47908a4](https://github.com/swc-project/swc/commit/47908a49d3d773b7ffacf6ffa6e38c7e091101cb))
|
|
185
|
+
|
|
186
|
+
### Refactor
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
- **(css/parser)** Canonicalize only if required (#6532) ([251e98c](https://github.com/swc-project/swc/commit/251e98c05576d0495647e93ae0fe179da7435db9))
|
|
191
|
+
|
|
192
|
+
### Testing
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
- **(es/minifier)** Add tests for preserving top-level directives (#6545) ([8d8f150](https://github.com/swc-project/swc/commit/8d8f15079224de52482397c1a36b9b9575ba1464))
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
- **(es/transforms)** Add tests about preserving top-level directives (#6518) ([5ff87af](https://github.com/swc-project/swc/commit/5ff87afa78e5bb56f2b03678577279256c18e4da))
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
- **(es/typescript)** Migrate inline tests to fixture tests (#6546) ([cddbc41](https://github.com/swc-project/swc/commit/cddbc41430c524b126368a6989de3b2c88e5e713))
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
- **(ts/compat)** Migrate inline tests to fixture testing (#6475) ([cc4646a](https://github.com/swc-project/swc/commit/cc4646a4cc455c08680f7dedb344337f90f0c668))- **general**: Use correct extensions for fixture tests (#6539) ([7ee86d1](https://github.com/swc-project/swc/commit/7ee86d1d2579d861501a525cbc6ddd3669d4c25c))
|
|
206
|
+
|
|
207
|
+
### Build
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
- **(cargo)** Update `browerslist-rs` (#6547) ([d730186](https://github.com/swc-project/swc/commit/d730186e9f49b9481b89b35121d7095e05781565))
|
|
212
|
+
|
|
213
|
+
## [1.3.20] - 2022-11-26
|
|
214
|
+
|
|
215
|
+
### Bug Fixes
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
8
219
|
- **(es/codegen)** Preserve parens for `new` in optional chaining (#6484) ([1ca281a](https://github.com/swc-project/swc/commit/1ca281a6cfdbdcb4b52e7617c5e843b8458a2299))
|
|
9
220
|
|
|
10
221
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.22",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@napi-rs/cli": "^2.10.0",
|
|
98
98
|
"@swc/core": "=1.2.220",
|
|
99
99
|
"@swc/helpers": "^0.4.2",
|
|
100
|
-
"@swc/plugin-jest": "
|
|
100
|
+
"@swc/plugin-jest": "1.5.25",
|
|
101
101
|
"@taplo/cli": "^0.3.2",
|
|
102
102
|
"@types/jest": "^28.1.4",
|
|
103
103
|
"@types/node": "^14.14.41",
|
|
@@ -141,16 +141,16 @@
|
|
|
141
141
|
"url": "https://opencollective.com/swc"
|
|
142
142
|
},
|
|
143
143
|
"optionalDependencies": {
|
|
144
|
-
"@swc/core-win32-x64-msvc": "1.3.
|
|
145
|
-
"@swc/core-darwin-x64": "1.3.
|
|
146
|
-
"@swc/core-linux-x64-gnu": "1.3.
|
|
147
|
-
"@swc/core-linux-x64-musl": "1.3.
|
|
148
|
-
"@swc/core-win32-ia32-msvc": "1.3.
|
|
149
|
-
"@swc/core-linux-arm64-gnu": "1.3.
|
|
150
|
-
"@swc/core-linux-arm-gnueabihf": "1.3.
|
|
151
|
-
"@swc/core-darwin-arm64": "1.3.
|
|
152
|
-
"@swc/core-linux-arm64-musl": "1.3.
|
|
153
|
-
"@swc/core-win32-arm64-msvc": "1.3.
|
|
144
|
+
"@swc/core-win32-x64-msvc": "1.3.22",
|
|
145
|
+
"@swc/core-darwin-x64": "1.3.22",
|
|
146
|
+
"@swc/core-linux-x64-gnu": "1.3.22",
|
|
147
|
+
"@swc/core-linux-x64-musl": "1.3.22",
|
|
148
|
+
"@swc/core-win32-ia32-msvc": "1.3.22",
|
|
149
|
+
"@swc/core-linux-arm64-gnu": "1.3.22",
|
|
150
|
+
"@swc/core-linux-arm-gnueabihf": "1.3.22",
|
|
151
|
+
"@swc/core-darwin-arm64": "1.3.22",
|
|
152
|
+
"@swc/core-linux-arm64-musl": "1.3.22",
|
|
153
|
+
"@swc/core-win32-arm64-msvc": "1.3.22"
|
|
154
154
|
},
|
|
155
155
|
"files": [
|
|
156
156
|
"CHANGELOG.md",
|
|
@@ -173,5 +173,5 @@
|
|
|
173
173
|
"postinstall.js",
|
|
174
174
|
"bindings/binding_core_wasm/pkg/binding_core_wasm.d.ts"
|
|
175
175
|
],
|
|
176
|
-
"packageManager": "yarn@3.
|
|
176
|
+
"packageManager": "yarn@3.3.0"
|
|
177
177
|
}
|
package/types.d.ts
CHANGED
|
@@ -653,19 +653,23 @@ export interface OptimizerConfig {
|
|
|
653
653
|
*/
|
|
654
654
|
export interface GlobalPassOption {
|
|
655
655
|
/**
|
|
656
|
-
* Global variables.
|
|
656
|
+
* Global variables that should be inlined with passed value.
|
|
657
657
|
*
|
|
658
658
|
* e.g. `{ __DEBUG__: true }`
|
|
659
659
|
*/
|
|
660
|
-
vars?:
|
|
661
|
-
[key: string]: string;
|
|
662
|
-
};
|
|
660
|
+
vars?: Record<string, string>;
|
|
663
661
|
/**
|
|
664
|
-
*
|
|
662
|
+
* Names of environment variables that should be inlined with the value of corresponding env during build.
|
|
665
663
|
*
|
|
666
664
|
* Defaults to `["NODE_ENV", "SWC_ENV"]`
|
|
667
665
|
*/
|
|
668
666
|
envs?: string[];
|
|
667
|
+
/**
|
|
668
|
+
* Replaces typeof calls for passed variables with corresponding value
|
|
669
|
+
*
|
|
670
|
+
* e.g. `{ window: 'object' }`
|
|
671
|
+
*/
|
|
672
|
+
typeofs?: Record<string, string>;
|
|
669
673
|
}
|
|
670
674
|
export type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;
|
|
671
675
|
export interface BaseModuleConfig {
|