Would tsrs make our builds faster?
Result: typecheck now runs on tsrs
The change is merged as allternit-ai #706 (eadd6f14). vite build stays the same at about 20 s, because it never ran the type checker.
| Run | Time | Peak memory | Result |
|---|---|---|---|
| tsc 5.9, full typecheck | 203 s | 4.4 GB | crashed (out of memory) |
| tsc 5.9, fast typecheck | 213 s | 4.3 GB | pass |
| TypeScript 7.0.2 | 13–53 s | 4.2–5.3 GB | same errors as tsrs |
| tsrs, full typecheck | 3.9 s | 1.9 GB | pass |
| tsrs, fast typecheck | 3.0 s | 1.8 GB | pass |
What changed
- All three typecheck scripts call tsrs, pinned to an exact version.
- TypeScript 5.9 stays installed. ESLint and Storybook need its library API, and TS 7 removed that API.
- tsconfig no longer uses
baseUrl, which TS 7 removed. TS 5.9 still passes with the new config. - A WebSocket type in
fetch-interceptor.tsnow matches the stricter TS 7 types. typecheck:v2was broken on main with 61 errors. It now has 0.- The deploy workflow's typecheck step used to crash after 3.5 minutes. Now it takes seconds.
Watch
tsrs is version 0.18. If it reports an error that TypeScript does not report, run npx -y typescript@7 tsc --noEmit to compare.