6 ms·
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
by oyvey 9y ago
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.
- davedx 9y agoWhere are they pushing flow in create-react-app?
- oyvey 9y agohttps://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md https://github.com/facebookincubator/create-react-app/blob/m... They are supporting flow but not TS. 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.
- danabramov 9y agoThe 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.
- hzoo 9y agoYep, 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! https://github.com/babel/babylon/issues/320 https://github.com/babel/babylon/issues/320, https://github.com/babel/babylon/issues/523 https://github.com/babel/babylon/issues/523
- Vinnl 9y agoThat's awesome, I didn't even know that was a potentially viable route! Thanks for sharing :)
- hzoo 9y agoYeah 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).
- slackingoff2017 9y agoTypescript is the best thing to happen in JS land in years. It finally makes large applications possible without a large element of chaos.
- tomduncalf 9y agoSee https://news.ycombinator.com/item?id=14373433 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
- Vinnl 9y agoThat's pretty sweet, especially because they do so without having to eject. Direct link: https://github.com/Microsoft/TypeScript-React-Starter https://github.com/Microsoft/TypeScript-React-Starter
- tomduncalf 9y agoYeah 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. Here's the package that adds the TS functionality to create-react-app FYI: https://github.com/wmonk/create-react-app-typescript https://github.com/wmonk/create-react-app-typescript
- rpwverheij 9y agoahh 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!
- 9y ago
- ng12 9y agoIt 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.
- n42 9y agoTypeScript is now incremental in that way: https://blogs.msdn.microsoft.com/typescript/2017/04/27/announcing-typescript-2-3/ https://blogs.msdn.microsoft.com/typescript/2017/04/27/annou...
- bcherny 9y agoHave 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.
- ng12 9y ago> It's just as incremental as Flow No, because TypeScript is a transpiler and Flow is a linter. You don't have to convert your codebase with Flow -- you can just run it on existing JS.
- bcherny 9y agoFlow 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.
- ng12 9y ago> 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.
- msmm 9y agoI wouldn't use M$ product. There is no guarantee that they either abandon it or start charging an arm and leg for use
- tomduncalf 9y agoIt'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.
- msmm 9y agoThey are not. They sold me VS knowing well it will be obsolete in couple of months time and won't refund or discount upgrade. Absolutely vile company.
- coldtea 9y agoIt's been close to 2 decades since the "M$" moniker had any relevance. This is not 1997 and we are not in the "browser wars".
- coldtea 9y ago>They should finally acknowledge the existence of typescript and not push everyone to their flow. They should support a niche third party competitor tool on their freely available and FOSS tooling?
- oyvey 9y ago>niche 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.
- coldtea 9y ago>wrong. typescript is vastly more popular than flow. Irrelevant, as both are still niche.
- bcherny 9y agoAccording to npmjs.com: - TypeScript: 4,745,783 downloads in the last month - Flow: 889,612 downloads in the last month
- exogen 9y agoI'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 https://www.npmjs.com/package/babel-preset-flow (2M in the last month)
- bcherny 9y agoGood catch. I also couldn't get numbers for `brew install flow` - are these tracked somewhere?
- 9y ago