Outliers

We are living at an unprecedented time, where none of us in our life time would have anticipated a pandemic. In fact, most of us would not even be aware that the words ‘pandemic’ and ‘quarantine’…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Improvements to Flow in 2019

The retrospective post we shared last year included a roadmap that spans multiple years. It included three focus areas:

Working from this roadmap, we identified these goals for 2019:

Flow is built for huge codebases: we do types at scale. But Flow wasn’t holding up to Facebook’s enormous scale. Editing code at Facebook grew increasingly unresponsive as more teams moved their code to React, React Native, and Relay. Our JavaScript codebase is tens of millions of lines and growing!

We made changes to optimize performance and memory usage that improved our recheck times by 70%. These changes are built on a rearchitecture called “types-first”. Types-first allows us to tame large dependency cycles, decrease memory usage, and increase IDE responsiveness.

Before types-first, Flow needed to check files in dependency order. That is, if file B depends on file A, then we could not check file B until we have finished checking file A. Types-first avoids this dependency order by first extracting a signature from all files before checking. You can think of these signatures as header files or interface files from other languages, except they are automatically extracted from your code. With these signatures in place, we can check A and B in parallel, since B depends only on the signature of A, not A itself.

Types-first requires more annotations in your codebase, which means it’s not trivial to upgrade your code. But developers at Facebook have found that it’s worth it, and have been very happy with early results of this work as we’ve rolled it out across our codebases. We’ll post more about types-first, along with advice on migrating your code, later this year.

We made all of these commands far more robust and responsive.

We also made Flow act and feel more responsive when you edit code:

We’ll continue to invest throughout 2020 in improving the reliability and responsiveness of editing and browsing features.

The performance, reliability, responsiveness, and type system improvements we delivered in 2019 made great progress towards our goal of providing a delightful developer experience and strong safety guarantees. We hope you’ve enjoyed the improvements we made to Flow in 2019. We’ll build upon these gains in 2020 with an even better editing and browsing experience, continued type system improvements, and better performance and reliability. Keep an eye on this blog for an upcoming roadmap for our planned improvements in 2020.

Add a comment

Related posts:

The Musical Kind

Lori Carlson writes Poetry, Fiction, Articles, Creative Non-Fiction and Personal Essays. Most of her topics are centered around Relationships, Spirituality, Life Lessons, Mental Health, Nature, Loss…

When urban ennui is all too real

Since the past few days, I have been experiencing something I never understood before: the dilemma of having tonnes to do yet no motivation to sit and get it done. Work deadlines are looming, with…

The Hazara Genocide

The Hazaras are an ethnic group predominantly composed of Shia Muslims, unlike the Sunni Muslim majority among which they live and by which they are governed. While this minority group is scattered…