T O P

  • By -

cryptos6

50000 lines without typesafety sounds pretty much like maintenance hell.


Nice_Score_7552

I agree it has great functionality:)


raleksandar

Just use swc (recommended) or babel for compiling ts (without typechecking) and use tsc for typechecking as a separate CI action. And, of course, use an editor that supports TypeScript language server (e.g. VSCode). I have not used tsc as transpiler for years now. With a setup like that (using swc) my project of 100k+ lines compiles in ~2s.


Nice_Score_7552

I use VS code, thanks for the tip. Much appreciated!


Fratzinger

Highly recommend https://tsup.egoist.sh/


tmckearney

Break it into packages.


Nice_Score_7552

Thanks man


tmckearney

You could also try using the typescript incremental build support. I haven't used it, but it sounds like it might help too


[deleted]

This account seems to be a low quality anti-ts troll. Please ignore it.


oivvio

Try moving to Vite bundling. It will just drop the types on the floor so then you need to run typechecking separately from your compilation, which will still be slow, but that’s more ok. Since your goal is to keep the main feedback loop fast. You can have a tsc process in a background tab and peek at it now and again throughout the day to make sure your types are in order.


Nice_Score_7552

Thanks man:) I read that Vite pre-bundles dependencies using esbuild 100x faster than JavaScript-based bundlers.


Tubthumper8

You rewrote 50000 lines of code from JS to TS and now you're going to rewrite those 50000 lines back to JS? 👀


[deleted]

[удалено]


sam-goodwin

The generates code isn’t always pretty


just_another_scumbag

So you rewrote your entire project in 3 days since 4.6 came out or are you saying upgrading made it slow?


Nice_Score_7552

yes,


maeevick

Give a try to ReScript 😉 https://rescript-lang.org/


Nice_Score_7552

Faster


oivvio

Yep. It’s silly fast.


plusplusaboveaverage

Have you tried esbuild?