Commit 96c4390
authored
🤖 feat: Replace tsc with tsgo for 7.7x faster type checking (#260)
## Summary
Replace TypeScript's tsc with tsgo (TypeScript's new Go-based compiler)
for significantly faster type checking in the build system.
## Performance Improvement
- **Before (tsc):** 5.942s
- **After (tsgo):** 0.776s
- **Result: 7.7x faster type checking** ⚡
## Changes
### Dependencies
- Added `@typescript/native-preview` devDependency (includes
platform-specific binaries automatically)
### Configuration
- Updated `tsconfig.json` to be compatible with TypeScript 7:
- Removed deprecated `baseUrl` option
- Fixed `paths` to use relative paths (`./src/*` instead of `src/*`)
### Build System
- Updated `scripts/typecheck.sh` to use tsgo with automatic fallback to
tsc
- Updated `Makefile` dev target to use tsgo in watch mode for faster
development feedback
## About tsgo
tsgo is Microsoft's Go-based TypeScript compiler that will become the
default in TypeScript 7. It provides:
- Same type checking accuracy as tsc
- 7-10x performance improvement
- Native binary execution for better startup time
The implementation uses bun runtime which correctly detects arm64
architecture, and includes fallback to tsc for compatibility.
## Testing
Type checking verified locally:
```bash
$ time ./scripts/typecheck.sh
[0] bun run node_modules/@typescript/native-preview/bin/tsgo.js --noEmit exited with code 0
[1] bun run node_modules/@typescript/native-preview/bin/tsgo.js --noEmit -p tsconfig.main.json exited with code 0
real 0m0.776s
user 0m2.406s
sys 0m0.638s
```
_Generated with `cmux`_1 parent 27508c7 commit 96c4390
File tree
5 files changed
+32
-18
lines changed- scripts
5 files changed
+32
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
652 | 653 | | |
653 | 654 | | |
654 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
655 | 672 | | |
656 | 673 | | |
657 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
0 commit comments