Talk: Flow - Am I Your Type?

Flow is an open source tool from Facebook that is "a static type checker, designed to find type errors in JavaScript programs". It supports adding types gradually to variables, parameters, return values, object properties, and array elements. Flow even catches some errors without adding types by using type inference and flow analysis.

Flow supports many types including primitives, functions (with specified signatures), arrays, objects, built-in classes, custom classes, and generic (parameterized) classes.

Flow is similar to Microsoft TypeScript and mostly uses the same syntax for specifying types. However, TypeScript is also a transpiler. One benefit of using Flow is that Babel can be used for transpiling. Babel typically implements new ECMAScript features before TypeScript.

This talk covers everything you need to know to get started using Flow, including integration with Babel and ESLint.

Outline:

  • Static vs. Dynamic Typing
  • Why use types?
  • Why avoid types?
  • Flow Overview
  • TypeScript overview
  • Installing Flow
  • Running Flow
  • Executing Code with Types
  • Flow Analysis
  • Uninitialized References
  • Too Few Arguments
  • Flow Types
  • Basic Types
  • Functions, Arrays, Objects, Classes
  • Type Aliases
  • Generics
  • Interfaces
  • Disjoint Unions
  • Babel Setup
  • ESLint Setup
  • Editor/IDE Setup
  • Project Setup
  • flow-typed
  • Flow Server
  • Declarations
  • React and JSX support
  • Future Goals