@swc/core 1.3.21 → 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/package.json +12 -12
  3. package/types.d.ts +9 -5
package/CHANGELOG.md CHANGED
@@ -5,6 +5,137 @@
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
+
8
139
  - **(ci)** Fix publish action for binaries (#6517) ([2ac3201](https://github.com/swc-project/swc/commit/2ac32017bad112956a781b0d003782988655409c))
9
140
 
10
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.3.21",
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": "^1.2.12",
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.21",
145
- "@swc/core-darwin-x64": "1.3.21",
146
- "@swc/core-linux-x64-gnu": "1.3.21",
147
- "@swc/core-linux-x64-musl": "1.3.21",
148
- "@swc/core-win32-ia32-msvc": "1.3.21",
149
- "@swc/core-linux-arm64-gnu": "1.3.21",
150
- "@swc/core-linux-arm-gnueabihf": "1.3.21",
151
- "@swc/core-darwin-arm64": "1.3.21",
152
- "@swc/core-linux-arm64-musl": "1.3.21",
153
- "@swc/core-win32-arm64-msvc": "1.3.21"
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",
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
- * Name of environment variables to inline.
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 {