1

Errors encountered upgrading Flow v0.85

 2 years ago
source link: https://lihautan.com/errors-encountered-upgrading-flow-0.85/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Background

Despite seeing the JS community slowly moving away from Flow to TypeScript, Shopee Web Frontend codebase is still very much stuck with Flow. 😨

After some silence, Flow has come back and committed to be a more efficient, reliable and friendly tool. Thus, we decided to give Flow a final chance. However, in order to enjoy the improvements that Flow has made in recent days, we have to upgrade Flow from 0.83 (since our last update) to v0.97 (latest to date), which meant that we need to upgrade past v0.85, which meant hell to codebase that uses react-redux extensively.

One of our brave developer, Gao Wei took up the challenge and decided to bring us to the bright side of Flow. 😅. She twitted and wrote an article on how she fixed the errors arose in the process.

To put the problem in perspective, from Flow 0.85 onwards, Flow is asking for required annotations for implicit annotations. Or less technical, if you are trying to export something that was created from a generic class (eg: class Foo<T>) or functions (eg: function foo<T>(){}), without explicit type arguments (eg: new Foo<Type>() or foo<Type>()), Flow is going to give you an error.

Or in layman terms, if your repo is full of HOCs or connect(), you are f**ked. So, be sure the check Gao Wei's blog if you are one of the brave souls upgrading a Flow project.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK