r/programming • • Jul 30 '18

Announcing TypeScript 3.0

https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/
1.5k Upvotes

357 comments sorted by

View all comments

Show parent comments

2

u/scaleable Jul 30 '18

Either way you are fucked up. You rely on support from the project mantainers, be them on facebook or microsoft. BTW lack of support one of the main reasons people have been wildly jumping out of the flow train.

Comment syntax would be the only real argument but you are not even using it.

1

u/djcraze Jul 31 '18

Yes, Facebook could drop flow, but in the end I still have valid JavaScript. I don't have to rewrite my code to another language.

3

u/scaleable Jul 31 '18

If you are not using the comment syntax, then it is not valid javascript.

2

u/djcraze Jul 31 '18

Yup. That is correct. My point is when using the comment syntax. Regardless, if you end up using type annotations without comments, you can easily strip them if you team decides to not use Flow anymore.

1

u/chasecaleb Jul 31 '18

That applies to TypeScript too though, so I don't see how that's a benefit of Flow. TypeScript is JavaScript with static types - just remove the type declarations and you have JavaScript.

4

u/djcraze Jul 31 '18 edited Jul 31 '18

Actually no. TypeScript adds extra syntax sugar to the language. I just read up on their syntax and here are the differences I could find:

enums, export =, namespaces, mixins, triple slash directives.

There may be more.

1

u/holloway Jul 31 '18 edited Jul 31 '18

Exactly this, it's not easily transpiled to plain JS.

I wonder if the people more aware of this were burnt by CoffeeScript

1

u/ISNT_A_NOVELTY Jul 31 '18

Mixins aren't a language feature, they're just a pattern of writing code. Triple slash directives are a feature of the type system, and they're just comments, so you don't even have to remove them. export/import = are for easy interop with CommonJS modules - find/replace them with module.exports = and require(\1)

2

u/djcraze Jul 31 '18

Mixins are supported by TypeScript but not by the ES standard.

You’re right about the directives. I misunderstood what they did.