Live data from Hacker News

TypeScript in 5 minutes

typescriptlang.org

31–33 of 33 posts

Re: TypeScript in 5 minutes

#31

Genuinely curious. Does anyone use the command line `tsc` to compile typescript in everyday work? Or is it more of just a learning stepping stone?

Yes. ts-node is great for development, but for deployment (in our ci/cd) we run tsc to compile the typescript down to javascript.

Re: TypeScript in 5 minutes

#32
post #3

I just started a side project with Typescript, and I like a lot of it, but, ironically, type discovery seems _very_ lacking. The JS keywords like `instanceof` are useless because everything is just an object, and Typescript doesn't give you a way to pattern match on types. For example, in React there is this type that's a union of an array, single object or null. Some kind of catch-all, I guess. So, when you see one…

Misclassifies an empty array as object since zero is falsy.

Re: TypeScript in 5 minutes

#33

Genuinely curious. Does anyone use the command line `tsc` to compile typescript in everyday work? Or is it more of just a learning stepping stone?

Yeah, we use tsc for node. I typically just use ts-node for development, though, and tsc gets to hang out in CI/CD somewhere. I assume ts-node / webpack / etc all use tsc under the hood, though.
Post reply on HN