Breaking Changes:
no_flowliboption is removed. Usebuiltin_lib=flowlib(default) orbuiltin_lib=preludeinstead.
Likely to cause new Flow errors:
- Render types no longer accept exact react element as arguments. See https://flow.org/en/docs/react/render-types/ for supported cases
- Flow will now always infer a react jsx element to be a render type if it's an element of a component-syntax component, or
React.MixedElementotherwise. Legacy code that requires exact react element will see new errors. - Add an option for rejecting dynamic imports in Haste modules.
New Features:
Symbol()andSymbol.for()create aunique symbolwhen they initialize aconst, so symbols can be used as property keys without explicit declarations.
Notable bug fixes:
- Bound error type normalization to prevent excessive memory use
- Release temporary signature-hash graphs after Flow merges.
- Using
import typeofof a generic value without type arguments keeps its polymorphism instead of reporting missing-type-args, andrendersacceptsimport typeofof a generic component.
Parser:
- Parse deferred imports:
import defer * as ns from "m"andimport.defer("m")now set the ESTreephaseproperty to"defer".
IDE:
- Hover on members accessed through
supershows the declaration - Hover on destructuring keys shows the member declaration
- Hover on enum members shows the member declaration
- Hover on signature labels and indexer keys shows the parameter
- Hover on component attribute names shows the prop declaration
- Hover on import/export sources shows the module
- Hover on this-parameters shows the parameter
- Hover on indexed-access literals shows the member
- Hover on polymorphic JSX elements no longer exposes overly precise literal types when no annotation demands that precision
- Hover on a call to an overloaded function reports how many other signatures the function has
- Hover lists the signatures of an overloaded declaration instead of printing their intersection
- Component hovers no longer drop indexer rest props
- Align multiline union members in hover type declarations
- Render hover definition links in a compact Rust-style navigation row.
- Expand rest-prop aliases in top-level component hovers.
Library Definitions:
- React ref callbacks now have a stricter return type
import.metawill no longer haveurlproperty and arbitrary unknown property. To add them back, you can do so through declaration merging (e.g. addinginterface ImportMeta { url: string }to your global library definitions.ArrayLikeandArrayBuffernow follow TypeScript definitions- Stricter typing for
Array(length)andArray(items)