4 ms·
Sorry. We needed to prioritize to get this release out because it's already been snowballing for about a year. We actually did have "TypeScript support" on a n
by danabramov 8y ago
Sorry. We needed to prioritize to get this release out because it's already been snowballing for about a year.
We actually did have "TypeScript support" on a nice-to-have list for this two week sprint but unfortunately didn't get to it:
https://i.imgur.com/l0CpdZy.png https://i.imgur.com/l0CpdZy.png (I promise I'm not making this up :-)
I'm confident we'll ship it by the end of this year though.
- andrethegiant 8y agoWhat is the status of Flow in the JS ecosystem?
- ssalka 8y agoEveryone I know who uses it wishes they had gone with TypeScript. Anecdotal for sure, but I wouldn't be surprised if most Flow users felt this way - TS is winning in basically every way.
- root_axis 8y agoFlow offers a more sophisticated type system that is designed to express types that correspond with the sort of idioms you see in JavaScript in the wild. TypeScript is simpler and less flexible, but that simplicity can translate into increased productivity since there are less foot-guns and also less bugs. Strange/buggy behavior and odd performances issues are not totally uncommon with Flow whereas TypeScript doesn't seem to suffer from this as much. Since TypeScript is much more popular, IDE support tends to be a lot better out of the box, but the flow-langauge-server gives you all the same IDE-like features (intelligent autocomplete, jump-to-def, module resolution etc). Personally, I like Flow more, and I also think its easier to integrate into an existing codebase (either as comment annotations or gradually via per-file flow comment header), but at the end of the day, not choosing TypeScript amounts to swimming against the current without much justification.
- paavohtl 8y ago>Flow offers a more sophisticated type system that is designed to express types that correspond with the sort of idioms you see in JavaScript in the wild. TypeScript is simpler and less flexible, but that simplicity can translate into increased productivity since there are less foot-guns and also less bugs. Source? That's the primary design principle behind TypeScript too. TypeScript's type system is powerful enough to practically do arbitrary type-level transformation of data structures, and even do some crazy recursive pure functional type level programming. The only things I'm missing from TypeScript are variadic generics (which can be emulated quite well with TS 3.0) and higher kinded types - and I don't think Flow supports them either.
- root_axis 8y agohttps://flow.org/en/docs/types/utilities/ https://flow.org/en/docs/types/utilities/ Most of that can't be achieved out of the box with TypeScript. TypeScript was designed as a language that would bridge the quality of life gap between es5 and more modern languages, Flow was designed exclusively as a type system for annotating standards compliant JS.
- ng12 8y agoNot true, most of that can be done with TypeScript. $Values might be the only one missing.
- WorldMaker 8y ago$Values should be possible with Typescript 3.0+ conditional infer types, presumably something very similar to the built-in ReturnType<T> conditional infer type. Untested and off the top my head but maybe something like: type Values<T> = T extends { [K keyof T]: infer R } ? R : any
- wyze 8y agoIt works, just need to add `in` in-between `K` and `keyof`.
- ng12 8y agoDoes Flow still run as a separate process? That is a non-starter for me.
- WorldMaker 8y ago> Personally, I like Flow more, and I also think its easier to integrate into an existing codebase (either as comment annotations or gradually via per-file flow comment header) For several versions now, Typescript also supports type annotations in JS comments and an allowJS mode for mixing TS and JS in the same project, or using only JS and JS comment type annotations.
- ggregoire 8y agoThere is already a pull request and it looks promising! https://github.com/facebook/create-react-app/pull/4837 https://github.com/facebook/create-react-app/pull/4837
- jaaames 8y agoThanks for the release regardless!
- aikah 8y ago> Sorry. We needed to prioritize to get this release out because it's already been snowballing for about a year. Why does the project generated by react-native-cli contains some flow syntax by default? this is stupid. Not everybody has a flow plugin for his IDE. And obviously flow type declarations are not valid JavaScript. I understand you want to push your stack onto your users but no need to be that invasive.
- Vinnl 8y ago> I'm confident we'll ship it by the end of this year though. Oh wow, that statement is so much more than I'd have expected - there's something to look forward to!