5 ms·
The number one problem with typescript is how slow it is. Compiling a 14k line project takes 5s. This is absurdly slow.
by david2ndaccount 4y ago
The number one problem with typescript is how slow it is. Compiling a 14k line project takes 5s. This is absurdly slow.
- Tajnymag 4y agoTypescript by itself is just the language. You could try a different typescript compiler like esbuild for example.
- david2ndaccount 4y ago> However, esbuild does not do any type checking so you will still need to run tsc -noEmit in parallel with esbuild to check types.
- Tajnymag 4y agoYou're right, I didn't count with that
- jcparkyn 4y agoPersonally, I find that I don't really need full type checking on every build. For most small changes, the errors shown in vscode are sufficient while editing, and then full type checking can be run occasionally when needed (and in CI of course).
- DangitBobby 4y agoYour IDE can be doing type checks on whatever file(s) you're working on, you can use esbuild or swc to compile to javascript to make sure it runs correctly, and you can periodically use tsc to fully compile and typecheck your entire codebase to catch anything that you somehow missed in the IDE.
- wwwigham 4y agoWhen you can write a busy beaver machine in the type system, LOC ceases to be a good indicator or how long something should take to typecheck, imo. If you're frustrated with your build, you should use the trace tools on the TS wiki[1] to track down what types are slow to check, so you can attribute the slowness to the appropriate library authors/yourself and decide for yourself if the speed/correctness tradeoff they've made is right for you. [1]https://github.com/microsoft/TypeScript-wiki/blob/main/Performance-Tracing.md https://github.com/microsoft/TypeScript-wiki/blob/main/Perfo...
- david2ndaccount 4y agoMy code is straightforward and doesn’t do advanced type operations.
- scrollaway 4y agoCheck your libraries. Some are really trash and mess with Typescript's speed. Material UI comes to mind.
- pragmatic 4y agoCheck out vite.