They should finally acknowledge the existence of typescript and not push everyone to their flow. Second of all: reduce the size of this starter kit. Other than that I really like the features.
See https://news.ycombinator.com/item?id=14373433 - Microsoft have just released an official starter kit which uses create-react-app. Not tried it myself yet but it looks great and is well documented
Yeah sorry, I linked to the post in the hope that this gains a bit of traction as really want people to be aware that getting started with TS and React is a whole lot easier now! I have a fairly popular blog post on the topic of setting up TS and React that I'll update to point to the Microsoft repo to help spread the word.
No problem, I use TS+React too and definitely support this becoming less of an oddity. Luckily, it's moving in that direction already, with e.g. Jest being far easier to use with TypeScript since Jest 20.
ahh cool, didnt know, typescript is the main thing that would make me have to emmediatly eject since I use it for all my js projects these days, thanks!
It doesn't push Flow, it just mentions it as an option. It's important to note that Flow is purely additive -- you can drop it in a project and get some use out of it. Typescript is not incremental in that way. You probably want to go all-in on it or not at all which is hard to allow for with a starter framework.
Have you actually used TypeScript? It's just as incremental as Flow, especially in newer versions. I converted a 100k line Coffee + ES6 codebase to TS with no issues.
Flow is definitely not a Linter. It is a language, like TypeScript. It also has a typechecker, like TypeScript. Unlike TS, which bundles in its own compiler, Flow relies on projects like Babel to provide a compiler. In either case, compilation is mostly as simple as first linking modules, then typechecking, then stripping away types.
You can use TS on a JS codebase as well (with the --allowJs option), or you can leave JS files to a separate build step if you don't want type inference for them. I have used both approaches in the past.
> Flow is definitely not a Linter. It is a language, like TypeScript
This is absolutely untrue. Have you used Flow? It runs as a completely separate process -- you're literally running Flow as a command which typechecks/lints your code. It does not do any transpilation or modify your code in any way. The only caveat is the Flow type annotations which are A. optional and B. removed at compile time without doing any typechecking. Try it some time -- you can run Flow on existing JS code without modifying either your code or your build process in any way. It'll probably even find some bugs without you needing to add additional type information. This is fundamentally different from Typescript which goes hand-in-hand with a fully-featured transpiler.
To be clear, I use TypeScript and like it a lot -- but there seems to be a persistent perception that Flow and TS are two sides of the same coin. They are not and there are certainly some use cases where Flow fits better.
I think we're saying the same thing. By "linter" I mean a program that only checks for stylistic and defined/undefined errors. To me, anything beyond that is a typechecker. Whereas TS bundles a typechecker with a transpiler, Flow keeps the 2 separate (you still need both if your program is written using Flow syntax).
You are using "linter" more broadly, which may be fair as well.
Additionally, both TS and Flow can be used on JS files with zero modification.
Maybe writing "push" was a bit of an over statement from my side but for how well typescript plays with react and JSX and how much more popular it is compared to flow it should be either supported by them or flow shouldn't be. Currently they are discriminating in favor of flow. Which I mean they have 100% the right to do, its their product but as an end user I simply want to express my desire in that feature being first class.
The reality is not that we don’t want to support TS, but that its pipeline is significantly different from what we use at FB, so we neither have the expertise, nor can integrate the other tools we rely on. This might get better as AST interop between tooling improves.
Yep, and we (Babel) are trying to work with TS on integrating it into Babel similar to how flow works with Babel (parser support + a plugin/preset to strip types). Again, limited resources so if the community really wants it, we would appreciate help in reviewing PRs and testing!
Yeah it's definetely a lot of work on both ends (also means would need to coordinate releases of both like we do with flow) but hopefully this helps the ecosystem that wants to use both (seems to be an increasingly higher number of people).
wrong. typescript is vastly more popular than flow.
>competitor tool
hey if they got that thinking, its fine. its their product but from my user perspective I just want to let them know that I could really use some first class TS support.
I'm guessing you're looking at `flow-bin`, which was not the official way to get the Flow binary for a long time (nor was installing it per-project), because the underlying executable isn't JavaScript. It would be more accurate to measure `babel-preset-flow`: https://www.npmjs.com/package/babel-preset-flow (2M in the last month)
It's open source under the Apache Licence. Worst case scenario, the community would fork it and take over, but I don't think doing so would be remotely in Microsoft's interests. I genuinely believe the Microsoft of today is a totally different company in its attitude to open source software than it was even 10 years ago.