-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Flow or TypeScript typing to repo #1272
Comments
I don't have much experience with either, though I'm happy to learn. I'll find an area in this project or another, to do a proof of concept. Any suggestions? The frontend perhaps? It's really important that this project have a wide base of developers. There are lots and lots of package repositories and CI services for all sorts of different developer communities, and it's better to empower and enable all those developers to build out the features they use. This means lots of non-JS devs are hacking on this code. So, I think we should decide whether to do this based on how likely it makes people to contribute. If we think we'll get more contributors by doing this, let's do it. If we think we'll get fewer, let's look at options involving ES6/ES7/ES8. Another possibility is that we use a type system in the frontend and not in the server. React devs – |
I was thinking it'd be good for the server, because there's several data structures in use that are mostly undocumented and would benefit from type checking (for example, the Maybe a good starting point is to add types to a few of the smaller files in the With Flow, you opt-in per-file by adding an |
Cool, I'll take that on once #963 is merged. |
I vote for TypeScript! I could give some pointers or review a PR. See my repo styfle/react-server-example-tsx for an example implementation. |
Yeah I think either one is fine. I'm more familiar with Flow (as it's what we use at Facebook) and it tends to handle React a bit better, but they're both good 😃 |
I'm working on a PR for Danger, which uses TypeScript. So I'm getting some exposure! |
After working on that PR for Danger, my overall impression is that the types make working with code faster, and avoid common problems. It makes many things self-documenting, and forces you to think about how to model your data, which is awesome. It took me longer to make some changes, probably that is in part because I'm still learning the type system. The tooling is different and was initially unfamiliar, and that took me a good bit of time to adapt. For a project like this, it's a difficult decision. I think it's really important that our backend code is welcoming to developers with all kinds of backgrounds. We've received many contributions in the last year by people who have never written JavaScript before. And I think that's really important for a project like this, which supports a really broad development community. Overall I would optimize for an easy learning curve. That suggests keeping with ES6. |
It would be nice to have either Flow or TypeScript in the codebase, to better understand return types for some of the more complex functions.
The text was updated successfully, but these errors were encountered: