1/5/2024 0 Comments Producteev vs flow![]() But I guess, that's a way to contribute back to the community. The big issue with TypeScript, at least for us is that from time to time, we decide to use a component or a library that does not have the type definitions, so we have to create them ourselves. Even here on SO, the tag TypeScript has more than 4K followers and it's rare to have an unanswered question. Some people prefer to have the code explicitly typed, others prefer to type less and have a stronger type inference.Ībout, the technologies I'd say TypeScript is a safe bet, Microsoft is pushing the language ( there will be a version 2 soon), Angular is using it as well and there are a lot of Angular developers. Sure, for what I have seen, the Flow syntax is cleaner than TypeScript, but you can add your types using TypeScript incrementally. We have all the benefits I imagine you already know about, like refactoring, type safety, autocompletion, etc. But, we are using React and TypeScript at work and it works great. I'm going to start this answer saying that I have never used Flow, so I can't say much about it. So, I think TypeScript is a much more pragmatic choice than Flow in 2019.Īs to whether it's even worth using any type checker at all, I'd say it depends on the project size. Even yarn, Facebook's package manager, is moving away from Flow, to TypeScript. TypeScript has much bigger community than Flow.TypeScript's type inference has improved.In most situations, no additional code is needed. They make type-checking your code much easier. I believe the recommendation above got out of date and is no longer relevant. ![]() TL DR: If you plan to use any type checker, I recommend using Flow. JS is a dynamically typed language, get over it :) All the additional typing is rarely worth it. Most of the time, you don't need types at all.And it works 100 % with React Native, TypeScript is not even 50 % there yet. Also, there's great plugin for VS Code (no idea why it has only 3/5 rating). Best of all, it finally works on Windows. Flow has come a long way, it has been improved a lot, it can catch some things that TS can't.Wishing to get type hints for the latest version of some library? Wait a month, or two, maybe more. Thinking about using that fancy new ES7 stage 3 feature? Nope, you can't. ![]() The problem is that the JavaScript world just moves so fast that TypeScript keeps lagging behind. TypeScript is still painful to use to this very day.Having more than a year of experience with daily use of TypeScript, and playing with Flow for a while, I've came to the following conclusions: So, I guess the question would be: Is it safe to use the React + TypeScript combo, or will I run into some difficulties? What about Flow? Are there some other similar tools I should check out? Which approach would you recommend? He also mentions it doesn't play well with Babel? ![]() The author states some issues he's run into when using both of the options and concludes that TypeScript is "the best bet right now" (November 2015), especially because the Flow project has many issues and receives low developer activity from Facebook. I've also found two articles about using React + Flow and React + TypeScript. However, to me, it appears to be quite outdated as it is about 10 months old now. I've managed to find a discussion on Reddit with pros and cons about going the React + TypeScript / React + Flow way. On the other hand, many people seem to be using Flow, which is a project backed by Facebook (and I guess they also use it). There also doesn't seem to be many articles about developing using this combo. The thing is, there aren't many tutorials about using React + TypeScript. And I know that I can make it work with React by using typings + DenifitelyTyped. Visual Studio Code also offers a really nice code completion. I think it reduces the pain of developing JavaScript applications quite a lot, thanks to type checking and other neat features. However, there's one thing that's been bothering me regarding development of robust React applications - what tools do developers use for static type checking? I'm currently learning React and I think I understand it pretty well.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |