5 ms·
Our front end is ~200k LOC of TypeScript and all changes are instant (<1s). TypeScript compiler is too slow for hot module replacement so it’s used only for ID
by e1g 2y ago
Our front end is ~200k LOC of TypeScript and all changes are instant (<1s).
TypeScript compiler is too slow for hot module replacement so it’s used only for IDEs. During development, all transformation happens via esbuild/swc and is abstracted away with Vite https://vitejs.dev/ https://vitejs.dev/
- brabel 2y agoesbuild does not do type checking. You must invoke tsc explicitly to do that.
- e1g 2y agoType-checking is helpful in your IDE (for developer hints) and in your CI (for verification), but you don't want type-checking in your hot-reloading dev loop.
- brabel 2y agoI pointed that out because your previous comment could be misinterpreted to mean you do full type checking on your dev cycle, which you probably don't.
- anonzzzies 2y agoOn what hardware? I have a m3 and yeah, it’s terrible with ts. Instant (milliseconds) with cl (of el even). Go is not terrible.
- e1g 2y agoSame, M3. The DX within a modern frontend stack is indistinguishable from Bret Victor’s ideas (even if a decade late).
- anonzzzies 2y agoOk, when can we meet? I have never seen it work, and, as said, I review 100s of project a year; everything ts is super slow so far. Maybe you have something.
- brabel 2y agoTheir hot reload cycle is fast because esbuild doesn't type check the code, it just removes types from Typescript so it turns into JS (it may do minification and tree shaking but in dev, they probably remove that). I've written some esbuild plugins and can confirm that on incremental builds, esbuild will probably never take more than a few ms even on larger projects (because it doesn't matter how big your project is, esbuild will only rebuild what changed, which usually is a few files only).
- anonzzzies 2y agoNo one wants to show me though. Is that not weird? Fanbois say it is, but not one person even sends an open source project that demonstrates it. I don’t understand that? Please show me a non trivial project on GitHub that does this in ms like you say. All I try are slow af. Emacs is notoriously slow as a lisp; it is always faster, for me, than anything ts and definitely not trivial. Sbcl/cl blows it all away. Please an example in ts or it didn’t happen. Download some horror show like Unkey and show a video of its millisecond hot reload…
- e1g 2y agoYou are asking for someone else to do a demo of something trivial that takes 15 minutes to setup yourself (with Vite). Nobody is biting because it’s a strange (and, frankly, lazy) request. If you tried and still think such a setup is not possible, send me an email (in profile) and I can do a 10-15 minute show&tell.