@swc/core 1.3.4 → 1.3.5
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 +113 -0
- package/README.md +33 -37
- package/package.json +15 -15
- package/types.d.ts +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,119 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
- **(bindings)** Fix type definitions (#6018) ([8fea8ca](https://github.com/swc-project/swc/commit/8fea8ca3fa5d9d441b67bffe5f64efbcc9ea4d2c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(cli)** Configure `GLOBALS` (#6061) ([6cdb5ed](https://github.com/swc-project/swc/commit/6cdb5ed97fb821fa9ac04306eaa8a2e0f42260af))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(es)** Respect exclude option (#6054) ([69da081](https://github.com/swc-project/swc/commit/69da0817982eda2e9e9e755e3526f83286e874b1))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(es/codegen)** Improve performance of debug build (#6003) ([8b31b65](https://github.com/swc-project/swc/commit/8b31b65059a3b62fd1d12be57e0b62f62e499354))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- **(es/compat)** Fix handling of deep array pattern of object rest pass (#6035) ([0c67a3a](https://github.com/swc-project/swc/commit/0c67a3adbaec69d72016fe7c525223888d34ef3e))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(es/compat)** Fix handling of op-assignment in `generator` (#6036) ([7554482](https://github.com/swc-project/swc/commit/755448220529f82e82b56624e5a431c256c172ba))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- **(es/minifier)** Don't inline into nested scope (#6002) ([2ee3ad0](https://github.com/swc-project/swc/commit/2ee3ad00663a515697769cef55ad5606e14943da))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(es/minifier)** Don't evaluate `String.fromCharCode` for non-ascii values (#6033) ([197c4e2](https://github.com/swc-project/swc/commit/197c4e269d639a188bc3cca01f8618a61fed8d58))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- **(es/minifier)** Don't skip unresolved identifiers (#6050) ([c5fb774](https://github.com/swc-project/swc/commit/c5fb7744870dd2ba9ec606513c4e17142035ed14))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- **(es/minifier)** Fix optimization of numeric keys (#6052) ([e3b55e4](https://github.com/swc-project/swc/commit/e3b55e4bcf2bc12bbcc0fb2cb65e0931622d5dcb))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- **(es/minifier)** Fix analysis of var declaration after usage (#6043) ([36d467e](https://github.com/swc-project/swc/commit/36d467e7d7792bff9f735171a611b714e108e41f))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- **(es/minifier)** Fix infection analysis of sequential inliner (#6053) ([d65fba1](https://github.com/swc-project/swc/commit/d65fba134d50609543c1d1ef0dc07db9891913ac))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
- **(es/minifier)** Mark `delete` as a property mutation (#6063) ([38df597](https://github.com/swc-project/swc/commit/38df5978c14c1fd7c24c0881f7cd1c19021b3f9f))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- **(es/renamer)** Use a separate scope for the name of `FnExpr` (#6008) ([31ffd5a](https://github.com/swc-project/swc/commit/31ffd5a01dc9a20de36c9b9606a15c42f023e72f))
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- **(css/modules)** Implement css modules (#6000) ([2cce1c8](https://github.com/swc-project/swc/commit/2cce1c82b2a72e69668c170e1b9a0bc78b2b4afd))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
- **(css/modules)** Support `:local` and `:global` (#6045) ([10d0f8e](https://github.com/swc-project/swc/commit/10d0f8e0011fc9e02769cde49fcfd8f8730ca15e))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
- **(css/modules)** Support `:global` in `@keyframes` (#6046) ([51e935e](https://github.com/swc-project/swc/commit/51e935eb4abd8911b2568f1598b20a9c0db7dbbf))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
- **(es/compat)** Support iterator protocol on loose mode (#6034) ([80da098](https://github.com/swc-project/swc/commit/80da0981bd31e612d97d5c9fb10101891cabac90))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
- **(es/minifier)** Drop vars from sequential inliner (#5993) ([286334c](https://github.com/swc-project/swc/commit/286334c4d0b15d92347c6e51e05a3c3bf506e982))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
- **(es/minifier)** Inline function calls in more cases (#6010) ([61807ab](https://github.com/swc-project/swc/commit/61807abf6e482df5f34d24955c8fa56d6857659c))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
- **(es/minifier)** Ignore return values of ignored IIFEs (#6020) ([2b62752](https://github.com/swc-project/swc/commit/2b627524acaeb555988a9537d84fe51033e7f8fd))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
- **(es/minifier)** Clone trivial literals in sequential inliner (#6005) ([877936f](https://github.com/swc-project/swc/commit/877936f626882e7fe139a97e3d0ea53f93d56344))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
- **(es/minifier)** Inline vars initialized before the declaration (#6027) ([c485099](https://github.com/swc-project/swc/commit/c4850997a292f9bc6c057b28e002d427db6587c8))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
- **(html/codegen)** Add an option to keep quotes while minifying (#5996) ([35da762](https://github.com/swc-project/swc/commit/35da76241dd9e456a9124717cc8ddba82c97a2b2))
|
|
81
|
+
|
|
82
|
+
### Miscellaneous Tasks
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
- **(ci)** Merge CI scripts (#5999) ([10fb645](https://github.com/swc-project/swc/commit/10fb645552131d48c99789b346e6c31ed3a969cb))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
- **(ci)** Extract bot action to a separate repository (#6064) ([39481c6](https://github.com/swc-project/swc/commit/39481c622c288139ccd74fd2b3ba1bd65f4d9708))- **general**: Update `README.md` (#6007) ([185d6fe](https://github.com/swc-project/swc/commit/185d6fe98276d413a10159cac96adce1e2e4d549))
|
|
90
|
+
|
|
91
|
+
### Performance
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
- **(common)** Split the mutex for the hygiene system (#6019) ([5ea2d81](https://github.com/swc-project/swc/commit/5ea2d81aa3cd7ce46d92582fc88e50676c54c202))
|
|
96
|
+
|
|
97
|
+
### Testing
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
- **(es/minifier)** Organize terser tests (#6015) ([1aae503](https://github.com/swc-project/swc/commit/1aae503913da14134b758527fa5049a1e46352ef))
|
|
102
|
+
|
|
103
|
+
### Build
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
- **(cargo)** Introduce workspace deps (#5997) ([af64217](https://github.com/swc-project/swc/commit/af64217f19107ba654c086470ba3a2d1379eebde))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
- **(cargo)** Use workspace deps for internal pkg (#6001) ([3204ac3](https://github.com/swc-project/swc/commit/3204ac3e0c2d04d3e9269655ba3d4dddf3ae74af))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
- **(cargo)** Dedup `indexmap` with known version (#6060) ([fff4b9c](https://github.com/swc-project/swc/commit/fff4b9ce6550b1db3c0b9086d199090e7211f609))
|
|
114
|
+
|
|
115
|
+
## [1.3.4] - 2022-09-30
|
|
116
|
+
|
|
117
|
+
### Bug Fixes
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
8
121
|
- **(es/codegen)** Align sourcemap with terser (#5657) ([2ba8815](https://github.com/swc-project/swc/commit/2ba88154fced01cb6ad0428207cf88ad7ddee75c))
|
|
9
122
|
|
|
10
123
|
|
package/README.md
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://swc.rs/">
|
|
3
|
-
<img alt="
|
|
3
|
+
<img alt="swc" src="https://raw.githubusercontent.com/swc-project/logo/master/swc.png" width="546">
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
|
|
8
|
+
Make the web (development) faster.
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
<a href="https://www.npmjs.com/package/@swc/core">
|
|
13
|
+
<img alt="npm Downloads" src="https://img.shields.io/npm/dm/@swc/helpers">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://crates.io/crates/swc_ecma_parser">
|
|
16
|
+
<img alt="undefined" src="https://img.shields.io/crates/d/swc_ecma_parser.svg?label=crates.io%20downloads">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://github.com/swc-project/swc/releases/latest">
|
|
18
19
|
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/swc-project/swc">
|
|
20
|
+
</a>
|
|
19
21
|
</p>
|
|
20
22
|
|
|
21
23
|
<p align="center">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<img alt="node-current (scoped)" src="https://img.shields.io/node/v/@swc/core">
|
|
24
|
+
<img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/swc-project/swc">
|
|
25
|
+
<a href="https://github.com/swc-project/swc/blob/main/package.json#L22">
|
|
26
|
+
<img alt="node-current (scoped)" src="https://img.shields.io/node/v/@swc/core">
|
|
27
|
+
</a>
|
|
27
28
|
</p>
|
|
28
29
|
|
|
29
30
|
<p align="center">
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
<a href="https://discord.com/invite/GnHbXTdZz6">
|
|
32
|
+
<img alt="Discord" src="https://img.shields.io/discord/889779439272075314">
|
|
33
|
+
</a>
|
|
33
34
|
</p>
|
|
34
35
|
|
|
35
36
|
SWC (stands for `Speedy Web Compiler`) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a library for Rust and JavaScript at the same time. If you are using SWC from Rust, see [rustdoc](https://rustdoc.swc.rs/swc/) and for most users, your entry point for using the library will be [parser](https://rustdoc.swc.rs/swc_ecma_parser/).
|
|
@@ -61,24 +62,24 @@ Please see [benchmark results](https://swc.rs/docs/benchmark-transform) on the w
|
|
|
61
62
|
<h2 align="center">Supporting swc</h2>
|
|
62
63
|
|
|
63
64
|
<p align="center">
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
<a href="#backers">
|
|
66
|
+
<img alt="Backers on Open Collective" src="https://opencollective.com/swc/tiers/backer/badge.svg?label=backer&color=brightgreen" />
|
|
67
|
+
</a>
|
|
68
|
+
<a href="#gold-sponsors">
|
|
69
|
+
<img alt="Gold sponsors on Open Collective" src="https://opencollective.com/swc/tiers/gold-sponsors/badge.svg?label=Gold%20sponsors&color=brightgreen"/>
|
|
70
|
+
</a>
|
|
71
|
+
<a href="#silver-sponsors">
|
|
72
|
+
<img alt="Silver sponsors on Open Collective" src="https://opencollective.com/swc/tiers/silver-sponsors/badge.svg?label=Silver%20sponsors&color=brightgreen"/>
|
|
73
|
+
</a>
|
|
74
|
+
<a href="#bronze-sponsors">
|
|
75
|
+
<img alt="Bronze sponsors on Open Collective" src="https://opencollective.com/swc/tiers/bronze-sponsors/badge.svg?label=Bronze%20sponsors&color=brightgreen"/>
|
|
76
|
+
</a>
|
|
76
77
|
</p>
|
|
77
78
|
|
|
78
79
|
SWC is a community-driven project, and is maintained by a group of [volunteers](https://opencollective.com/swc#team). If you'd like to help support the future of the project, please consider:
|
|
79
80
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
81
|
+
- Giving developer time on the project. (Message us on [Discord](https://discord.gg/GnHbXTdZz6) (preferred) or [Github discussions](https://github.com/swc-project/swc/discussions) for guidance!)
|
|
82
|
+
- Giving funds by becoming a sponsor (see https://opencollective.com/swc)!
|
|
82
83
|
|
|
83
84
|
## Contributing
|
|
84
85
|
|
|
@@ -87,11 +88,6 @@ documentation useful ([ARCHITECTURE.md](ARCHITECTURE.md)).
|
|
|
87
88
|
|
|
88
89
|
## License
|
|
89
90
|
|
|
90
|
-
SWC is primarily distributed under the terms of
|
|
91
|
-
and the Apache License (Version 2.0).
|
|
92
|
-
|
|
93
|
-
See LICENSE-APACHE and LICENSE-MIT for details.
|
|
91
|
+
SWC is primarily distributed under the terms of the Apache License (Version 2.0).
|
|
94
92
|
|
|
95
|
-
[
|
|
96
|
-
[closure compiler]: https://github.com/google/closure-compiler
|
|
97
|
-
[rust]: https://www.rust-lang.org
|
|
93
|
+
See [LICENSE](LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"source-map": "^0.7.3",
|
|
135
135
|
"source-map-support": "^0.5.19",
|
|
136
136
|
"sourcemap-validator": "^2.1.0",
|
|
137
|
-
"swc-plugin-coverage-instrument": "^0.0.
|
|
137
|
+
"swc-plugin-coverage-instrument": "^0.0.12",
|
|
138
138
|
"terser": "^5.7.1",
|
|
139
139
|
"ts-node": "^10.5.0",
|
|
140
140
|
"typescript": "^4.5.2"
|
|
@@ -144,19 +144,19 @@
|
|
|
144
144
|
"url": "https://opencollective.com/swc"
|
|
145
145
|
},
|
|
146
146
|
"optionalDependencies": {
|
|
147
|
-
"@swc/core-win32-x64-msvc": "1.3.
|
|
148
|
-
"@swc/core-darwin-x64": "1.3.
|
|
149
|
-
"@swc/core-linux-x64-gnu": "1.3.
|
|
150
|
-
"@swc/core-linux-x64-musl": "1.3.
|
|
151
|
-
"@swc/core-freebsd-x64": "1.3.
|
|
152
|
-
"@swc/core-win32-ia32-msvc": "1.3.
|
|
153
|
-
"@swc/core-linux-arm64-gnu": "1.3.
|
|
154
|
-
"@swc/core-linux-arm-gnueabihf": "1.3.
|
|
155
|
-
"@swc/core-darwin-arm64": "1.3.
|
|
156
|
-
"@swc/core-android-arm64": "1.3.
|
|
157
|
-
"@swc/core-linux-arm64-musl": "1.3.
|
|
158
|
-
"@swc/core-win32-arm64-msvc": "1.3.
|
|
159
|
-
"@swc/core-android-arm-eabi": "1.3.
|
|
147
|
+
"@swc/core-win32-x64-msvc": "1.3.5",
|
|
148
|
+
"@swc/core-darwin-x64": "1.3.5",
|
|
149
|
+
"@swc/core-linux-x64-gnu": "1.3.5",
|
|
150
|
+
"@swc/core-linux-x64-musl": "1.3.5",
|
|
151
|
+
"@swc/core-freebsd-x64": "1.3.5",
|
|
152
|
+
"@swc/core-win32-ia32-msvc": "1.3.5",
|
|
153
|
+
"@swc/core-linux-arm64-gnu": "1.3.5",
|
|
154
|
+
"@swc/core-linux-arm-gnueabihf": "1.3.5",
|
|
155
|
+
"@swc/core-darwin-arm64": "1.3.5",
|
|
156
|
+
"@swc/core-android-arm64": "1.3.5",
|
|
157
|
+
"@swc/core-linux-arm64-musl": "1.3.5",
|
|
158
|
+
"@swc/core-win32-arm64-msvc": "1.3.5",
|
|
159
|
+
"@swc/core-android-arm-eabi": "1.3.5"
|
|
160
160
|
},
|
|
161
161
|
"files": [
|
|
162
162
|
"CHANGELOG.md",
|
package/types.d.ts
CHANGED
|
@@ -203,9 +203,9 @@ export interface TerserCompressOptions {
|
|
|
203
203
|
}
|
|
204
204
|
export interface TerserMangleOptions {
|
|
205
205
|
props?: TerserManglePropertiesOptions;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
toplevel?: boolean;
|
|
207
|
+
keep_classnames?: boolean;
|
|
208
|
+
keep_fnames?: boolean;
|
|
209
209
|
keep_private_props?: boolean;
|
|
210
210
|
ie8?: boolean;
|
|
211
211
|
safari10?: boolean;
|
|
@@ -667,7 +667,7 @@ export interface GlobalPassOption {
|
|
|
667
667
|
*/
|
|
668
668
|
envs?: string[];
|
|
669
669
|
}
|
|
670
|
-
export declare type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig;
|
|
670
|
+
export declare type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;
|
|
671
671
|
export interface BaseModuleConfig {
|
|
672
672
|
/**
|
|
673
673
|
* By default, when using exports with babel a non-enumerable `__esModule`
|
|
@@ -825,6 +825,8 @@ export interface BaseModuleConfig {
|
|
|
825
825
|
* If set to true, dynamic imports will be preserved.
|
|
826
826
|
*/
|
|
827
827
|
ignoreDynamic?: boolean;
|
|
828
|
+
allowTopLevelThis?: boolean;
|
|
829
|
+
preserveImportMeta?: boolean;
|
|
828
830
|
}
|
|
829
831
|
export interface Es6Config extends BaseModuleConfig {
|
|
830
832
|
type: "es6";
|
|
@@ -845,6 +847,10 @@ export interface AmdConfig extends BaseModuleConfig {
|
|
|
845
847
|
type: "amd";
|
|
846
848
|
moduleId?: string;
|
|
847
849
|
}
|
|
850
|
+
export interface SystemjsConfig {
|
|
851
|
+
type: "systemjs";
|
|
852
|
+
allowTopLevelThis?: boolean;
|
|
853
|
+
}
|
|
848
854
|
export interface Output {
|
|
849
855
|
/**
|
|
850
856
|
* Transformed code
|