3 ms·
I think the issue is that TS is non-modular and dictates javascripts reach. It behaves like no other tool and blocks others from working. Take something like Re
by mlsarecmg 10y ago
I think the issue is that TS is non-modular and dictates javascripts reach. It behaves like no other tool and blocks others from working. Take something like React/Redux for instance, which are built around modern day javascript, but if you transpile any example on the official Redux page right now you will see TS bail out because it can't understand some of the syntax.
Flow on the other hand solves one problem and solves it well. It behaves as any other tool would.
- bcherny 10y agoNot sure I understand. Can you give a concrete example?
- mlsarecmg 10y agoYou can only do as much as TS allows you to, unless you route through babel in a second pass. TS is a tool that controls to which extend you can use language features that are drafted. They do pick drafts here and there, but others they omitt, object spread for instance which is very common for Redux. As i said, try to transpile this in TS: http://redux.js.org/docs/basics/ExampleTodoList.html http://redux.js.org/docs/basics/ExampleTodoList.html This is why they made Flow.
- bcherny 10y agoStill not sure I understand. All the code in that link is valid TS - TS is just a superset of JS. Object spread is not part of the ES7 spec. It is a proposal which has not made it to stage 3 yet, and might still be dropped. That said, there is a TS issue tracking adding support for it: https://github.com/Microsoft/TypeScript/issues/2103 https://github.com/Microsoft/TypeScript/issues/2103.