@jscutlery/swc-angular 0.13.1 → 0.14.0
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 +12 -0
- package/README.md +24 -24
- package/index.cjs.js +3 -3
- package/index.esm.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- TOC -->
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
- [⚡️ Speed Up Angular Testing with SWC 🦀](#-speed-up-angular-testing-with-swc-)
|
|
6
|
+
- [👀 What is this?](#-what-is-this)
|
|
7
|
+
- [🤔 Context](#-context)
|
|
8
|
+
- [🥇 Benchmark Summary](#-benchmark-summary)
|
|
9
|
+
- [🎭 Setup with Jest](#-setup-with-jest)
|
|
10
|
+
- [1. Install](#1-install)
|
|
11
|
+
- [2. Configure](#2-configure)
|
|
12
|
+
- [3. Add `reflect-metadata`](#3-add-reflect-metadata)
|
|
13
|
+
- [⚡️Setup with Vitest](#setup-with-vitest)
|
|
14
|
+
- [1. Install](#1-install-1)
|
|
15
|
+
- [2. Configure](#2-configure-1)
|
|
16
|
+
- [3. Add `reflect-metadata`](#3-add-reflect-metadata-1)
|
|
17
|
+
- [🥇 Benchmark Data](#-benchmark-data)
|
|
18
|
+
- [🔥 No Cache](#-no-cache)
|
|
19
|
+
- [⚡️ With Cache](#-with-cache)
|
|
20
|
+
- [🥱 Cold Start](#-cold-start)
|
|
21
|
+
- [Configurations](#configurations)
|
|
22
|
+
- [Source](#source)
|
|
23
23
|
|
|
24
24
|
<!-- TOC -->
|
|
25
25
|
|
|
@@ -120,7 +120,7 @@ import { defineConfig } from 'vite';
|
|
|
120
120
|
|
|
121
121
|
export default defineConfig({
|
|
122
122
|
// ...
|
|
123
|
-
plugins: [swc.vite(swcAngularUnpluginOptions())]
|
|
123
|
+
plugins: [swc.vite(swcAngularUnpluginOptions())],
|
|
124
124
|
// ...
|
|
125
125
|
});
|
|
126
126
|
```
|
|
@@ -141,7 +141,7 @@ import 'reflect-metadata';
|
|
|
141
141
|
All caches are cleared before each benchmark run.
|
|
142
142
|
|
|
143
143
|
| Configuration | Relative | Mean [s] | Min [s] | Max [s] |
|
|
144
|
-
|
|
144
|
+
| :---------------------------- | -----------: | -------------: | ------: | ------: |
|
|
145
145
|
| 🥇`vitest-swc-no-isolate` | 1.00 | 3.137 ± 0.061 | 3.042 | 3.227 |
|
|
146
146
|
| 🥈`jest-swc` | 3.31 ± 0.15 | 10.393 ± 0.429 | 9.745 | 10.994 |
|
|
147
147
|
| 🥉`angular-cli-karma` | 3.52 ± 0.53 | 11.041 ± 1.642 | 10.218 | 15.690 |
|
|
@@ -157,7 +157,7 @@ All caches are cleared before each benchmark run.
|
|
|
157
157
|
All tests are ran once to warm up the cache before running the benchmark.
|
|
158
158
|
|
|
159
159
|
| Configuration | Relative | Mean [s] | Min [s] | Max [s] |
|
|
160
|
-
|
|
160
|
+
| :---------------------------- | -----------: | -------------: | ------: | ------: |
|
|
161
161
|
| 🥇`vitest-swc-no-isolate` | 1.00 | 3.092 ± 0.090 | 3.030 | 3.301 |
|
|
162
162
|
| 🥈`angular-cli-karma` | 1.91 ± 0.07 | 5.901 ± 0.139 | 5.718 | 6.131 |
|
|
163
163
|
| 🥉`jest-swc` | 2.93 ± 0.18 | 9.045 ± 0.494 | 8.513 | 10.065 |
|
|
@@ -176,7 +176,7 @@ All tests are ran once to warm up the cache before running the benchmark.
|
|
|
176
176
|
Run a single test module just and try to measure the bootstrap time.
|
|
177
177
|
|
|
178
178
|
| Configuration | Relative | Mean [s] | Min [s] | Max [s] |
|
|
179
|
-
|
|
179
|
+
| :---------------------------- | ----------: | ------------: | ------: | ------: |
|
|
180
180
|
| 🥇`vitest-swc-no-isolate` | 1.00 | 1.260 ± 0.024 | 1.241 | 1.314 |
|
|
181
181
|
| 🥈`vitest-swc` | 1.00 ± 0.03 | 1.262 ± 0.026 | 1.225 | 1.305 |
|
|
182
182
|
| 🥉`jest-swc` | 1.44 ± 0.15 | 1.812 ± 0.186 | 1.714 | 2.310 |
|
|
@@ -190,7 +190,7 @@ Run a single test module just and try to measure the bootstrap time.
|
|
|
190
190
|
### Configurations
|
|
191
191
|
|
|
192
192
|
| | Configuration | Test Isolation\* |
|
|
193
|
-
|
|
193
|
+
| ----------------------------- | :----------------------------- | ---------------: |
|
|
194
194
|
| `angular-cli-karma` | Angular CLI's Karma | false |
|
|
195
195
|
| `angular-cli-jest` | Angular CLI's Jest | true |
|
|
196
196
|
| `angular-cli-web-test-runner` | Angular CLI's @web/test-runner | true |
|
|
@@ -206,5 +206,5 @@ Run a single test module just and try to measure the bootstrap time.
|
|
|
206
206
|
|
|
207
207
|
### Source
|
|
208
208
|
|
|
209
|
-
💻 try it yourself: https://github.com/yjaaidi/experiments/tree/angular-
|
|
209
|
+
💻 try it yourself: https://github.com/yjaaidi/experiments/tree/angular-swc-benchmark
|
|
210
210
|
or checkout the last benchmark results: https://github.com/yjaaidi/experiments/actions/workflows/benchmark.yml
|
package/index.cjs.js
CHANGED
|
@@ -88,11 +88,11 @@ function assertCompatibleSwcCoreVersion(version) {
|
|
|
88
88
|
const packageJsonPath = node_path.join(node_path.dirname(require.resolve('@swc/core')), 'package.json');
|
|
89
89
|
version = fileSystem.readJsonFile(packageJsonPath).version;
|
|
90
90
|
}
|
|
91
|
-
if (!version.startsWith('1.4.')) {
|
|
91
|
+
if (!(version.startsWith('1.4.') || version.startsWith('1.5.'))) {
|
|
92
92
|
console.error(`
|
|
93
93
|
@swc/core version ${version} is incompatible with @jscutlery/swc-angular.
|
|
94
|
-
Please use @swc/core version 1.4.x.
|
|
95
|
-
> npm add -D @swc/core@~1.
|
|
94
|
+
Please use @swc/core version 1.4.x or 1.5.x.
|
|
95
|
+
> npm add -D @swc/core@~1.5.0
|
|
96
96
|
`);
|
|
97
97
|
process.exit(1);
|
|
98
98
|
}
|
package/index.esm.js
CHANGED
|
@@ -84,11 +84,11 @@ function assertCompatibleSwcCoreVersion(version) {
|
|
|
84
84
|
const packageJsonPath = join(dirname(require.resolve('@swc/core')), 'package.json');
|
|
85
85
|
version = fileSystem.readJsonFile(packageJsonPath).version;
|
|
86
86
|
}
|
|
87
|
-
if (!version.startsWith('1.4.')) {
|
|
87
|
+
if (!(version.startsWith('1.4.') || version.startsWith('1.5.'))) {
|
|
88
88
|
console.error(`
|
|
89
89
|
@swc/core version ${version} is incompatible with @jscutlery/swc-angular.
|
|
90
|
-
Please use @swc/core version 1.4.x.
|
|
91
|
-
> npm add -D @swc/core@~1.
|
|
90
|
+
Please use @swc/core version 1.4.x or 1.5.x.
|
|
91
|
+
> npm add -D @swc/core@~1.5.0
|
|
92
92
|
`);
|
|
93
93
|
process.exit(1);
|
|
94
94
|
}
|