Commit 9a32d71
perf(test): transpile runtime .ts imports with oxc-node instead of tsx
The vitest run loads many .ts files at runtime via Node's native `import()`
(the egg loader resolving fixtures/plugins/app code, plus workspace `src`
exports under node_modules). That path is driven by the `--import` hook in
`test.env.NODE_OPTIONS`, previously `tsx/esm`.
Switch it to `@oxc-node/core/register` (oxc-based, Rust): it is noticeably
faster than tsx and transpiles workspace `src` + decorators correctly.
`@oxc-node/core` >= 0.1.0 fixes the earlier "Cannot read properties of
undefined (reading 'mode')" crash that blocked this swap (the old FIXME).
Full Node-22 suite (isolate:false, --retry 2): same pass/fail result as tsx
(only the env-dependent orm/ssrf failures), with the runtime-transpile portion
~6-13% faster depending on how transpile-heavy the workload is.
tsx is kept as a dependency — it is still used by worker_threads tests and a
few other spots.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d8c6128 commit 9a32d71
3 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
0 commit comments