Remix.run Logo
tyleo 4 days ago

I’m curious what the benefit of stuff like this is vs tsc --watch and running the JS?

I’ve always just run tsc to a .gitignored’d directory and execute my JS from there.

Edit: Thanks for the responses. There’s some great examples in there!

wildpeaks 4 days ago | parent | next [-]

The benefit is one fewer step between Intellisense-enhanced development (which speeds things up with autocompletion and catches a lot of issues at design time already) and running the code, same as any linter.

bastawhiz 4 days ago | parent | prev | next [-]

It performs no type checking, and you don't need to load the compiler to compile. Tsc is a heavy package and having Node do this for you means much faster startup.

As a note, Node has a built in --watch now, too

homebrewer 4 days ago | parent | prev | next [-]

I've been using this for helper scripts, where each script is its own entry point, to assist with various maintenance tasks in frontend projects. Much easier to clone the project and run `./scripts/frobnicate` than faff around with tsc. Previously they would have been written in pure JS or just bash.

throwanem 4 days ago | parent | prev [-]

It's faster and a good bit more convenient in greenfield, in my experience. Less safe in that you do still need a type checker, but nothing about Node's stripping is at all meant for more than experimental use anyway so that's fine.