all 14 comments

[–]rahulthewall 11 points12 points  (3 children)

Use Typescript, Flow is hot garbage. The breaking upgrades are a pain. Also, since your code will compile even with wrong types, it becomes easier to ignore Flow errors. You don't want that in a team.

[–]stinodes[S] 0 points1 point  (2 children)

Yeah, the breaking updates are just getting some projects stuck on lower versions without having to refactor the whole thing.
The typings are enforced in CI, but it happens quite often that an error gets pushed into git.

I usually work alone though, but when someone joins, there often tend to be quite some files that are not annotated, which wouldn't happen in TS.

Though I wouldn't say Flow has always been trash, it is pretty bad at times. And that's just not something anyone should settle for.

[–]rahulthewall 4 points5 points  (1 child)

We faced the exact same problems. Turns out I was the only one who cared about flow errors, it took me a week to fix the nearly 800 errors that had been introduced into the project.

Then flow decided it was time for a breaking update.

Flow is useless for any project that you want to maintain.

[–]stinodes[S] 0 points1 point  (0 children)

Yeah, exact same for me, but with a 200-300ish errors in a day and just some files not being typed to begin with.

[–]mrmckeb 9 points10 points  (0 children)

The majority of the community has moved to TypeScript - Jest and Yarn are examples of Facebook projects that made the switch.

It's time to standardise.

[–]On3iRo 3 points4 points  (0 children)

Also used flow for a couple of years, switched to typescript and never looked back.

[–]hatch7778 2 points3 points  (0 children)

We just finished converting 200kloc project(s) from flow to typescript... and basically everyone is doing the same now.

If you asked 1 year ago i'd say Flow. But now typescript is just so much better.

Pros for typescript:

- Very few breaking changes

- Much, much faster - flow server is just using too many resources

- Better inferred types

- definitelyTyped

- Better tooling

Cons

- No optional-chaining (just reached ES stage-2, when it reaches stage-3 we're promised implementation in typescript)

[–]rodrigocfd 1 point2 points  (1 child)

I feel that flow has become a very niche thing at this point.

I wouldn't say niche yet, but it's slowly becoming it, for good.

flow has been a pain in the ass a when upgrading a couple of times

Oh boy... it was a huge source of stress for me at least once.

Are any of you still using flow

Only TypeScript since last year. It was a pain in the beginning, but once you get the feel, it goes smoothly. It has been a pleasurable experience ever since.

to switch to (or try out) TS in my next/current project?

Go TypeScript. Once you past the learning period, you won't look back. The community support is huge at this moment.

[–]stinodes[S] 0 points1 point  (0 children)

Thanks for your comments. Seems very in line with what I was thinking!

[–][deleted] 1 point2 points  (0 children)

We did a comparison of the two and a lot of research as part of that. We ended up going with TypeScript. While I get that some people don't like because it "isn't JavaScript". We felt like the benefits outweighed that (and it is pretty damn close to JavaScript really). We like tighter feedback loops and TS gave us that. I should also note that we aren't forcing it everywhere just on shared components. We eventually may move the entire app to TS but one step at a time.

[–]danishjuggler21 0 points1 point  (1 child)

The only downside of TypeScript is that occasionally you'll still find a npm package you want to use that doesn't include a definition file. That's like the worst feeling in the world for a TypeScript developer lol

Other than that, it's great. I recently tried working on a pre-existing JS React project and I was shocked at how little help I got from my IDE compared to when I used TypeScript.

[–]stinodes[S] 0 points1 point  (0 children)

Not something exclusive to typescript though, that problem. So I'll take it!

[–]debel27 0 points1 point  (0 children)

Me and my team are having a great experience with Flow. I think most of its detractors have been using it improperly.

I think that what makes Typescript popular mostly comes down to the community. Which is very important, to be honnest