Likely to cause new Flow errors:
- Support for
$Compose
and$ComposeReverse
types are removed. We recommend to use overloads to approximate their behavior instead. e.g.
declare export function compose(): <T>(a: T) => T;
declare export function compose<F: (...$ReadOnlyArray<empty>) => mixed>(
f: F,
): F;
declare export function compose<A, T: $ReadOnlyArray<any>, R>(
f1: (a: A) => R,
f2: (...T) => A,
): (...T) => R;
declare export function compose<A, B, T: $ReadOnlyArray<any>, R>(
f1: (b: B) => R,
f2: (a: A) => B,
f3: (...T) => A,
): (...T) => R;
declare export function compose<A, B, C, T: $ReadOnlyArray<any>, R>(
f1: (c: C) => R,
f2: (b: B) => C,
f3: (a: A) => B,
f4: (...T) => A,
): (...T) => R;
declare export function compose<R>(
f1: (b: any) => R,
...funcs: $ReadOnlyArray<(...$ReadOnlyArray<empty>) => mixed>
): (...$ReadOnlyArray<any>) => R;
declare export function compose<R>(
...funcs: $ReadOnlyArray<(...$ReadOnlyArray<empty>) => mixed>
): (...$ReadOnlyArray<any>) => R;
- You might see more errors around type application. example
- Fix subtyping of indexers in instances/interfaces. example
New Features:
- Updated the
isValid
Flow Enums method to use a type guard, allowing it to refine its input to the enum type in a conditional context.
E.g.
enum Status {Active, Off}
const s = "Active";
if (Status.isValid(s)) {
s as Status; // Should work
}
export type Foo = ...
andexport interface Bar {...}
statements are now allowed indeclare module
anddeclare namespace
bodies.- We added a new codemod
flow codemod remove-unnecessary-react-import
which can help remove unnecessary react imports underreact.runtime=automatic
Notable bug fixes:
- Fixed issue when explicitly supplied JSX type arguments are ignored
- Fixed code action output of casting syntax when LHS of
as
oras const
has low precedence
Library Definitions: