Kris Guzman
1 min readMar 16, 2020

--

I certainly agree with you. There are use cases (such as the one you mentioned) where typed JavaScript has major benefits that not even IDEs and linting can provide.

But… this can easily go sideways and become brittle and difficult to maintain. When you have a constantly evolving API, out of date types are guaranteed. It has happened on every project I’ve worked on using Flow or TypeScript.

The best solution is to generate these types using some kind of generator (apollo-code-gen for graphQL comes to mind), that way the client always has up to date types for your API.

Unfortunately, this isn’t always available.

--

--

Kris Guzman
Kris Guzman

Written by Kris Guzman

Front end developer. On a mission to explore the world & build amazing software. Connect with me on LinkedIn: https://www.linkedin.com/in/kristopher-guzman/

Responses (1)