Skip to content

Releases: facebook/flow

v0.318.0

10 Jun 16:15

Choose a tag to compare

Likely to cause new Flow errors:

v0.317.0

03 Jun 23:43

Choose a tag to compare

New Features:

  • Allow -? (optionality removal) in mapped types.
  • Adds support for utility types ConstructorParameters and InstanceType

Misc:

  • The .flowconfig options component_syntax, enums, and pattern_matching now default to true. To keep the previous behavior, set the corresponding option to =false in your .flowconfig.

v0.316.0

30 May 02:06

Choose a tag to compare

Likely to cause new Flow errors:

  • deprecated-type and deprecated-type-bool errors are now always on (the lints were on by default already). Update any references of the type bool to boolean, and delete references to the lints in your .flowconfig and flowlint comments — the setting is a no-op for this release and will be removed in a future release.

[flow] v0.315.0

28 May 18:37
@gkz gkz

Choose a tag to compare

  • Variance keywords (readonly, writeonly, in, out) on type parameters and object/class properties are now enabled by default. The experimental.allow_variance_keywords is no longer needed to opt in.
  • The deprecated variance sigils error message now suggests the contextually correct keyword (readonly/writeonly for property positions, out/in for type parameter positions) instead of listing both alternatives.

[flow] v0.314.0

13 May 14:56

Choose a tag to compare

Likely to cause new Flow errors:

  • Deleted the implicit-inexact-object lint, it no longer does anything since exact_by_default=false was deprecated.
  • exact_by_default=false is now deprecated in .flowconfig. Read this blog post on how to migrate, and our docs on objects for more. exact_by_default=true is the default (since 2023) so simply delete the option when migrating.

Notable bug fixes:

  • Fixed incorrect enum cast suggestion when using an enum as a type argument

[flow] v0.313.0

06 May 18:07

Choose a tag to compare

Likely to cause new Flow errors:

  • Flow has changed its casting syntax from (x: T) to x as T. The default value of the option casting_syntax is now as, and Flow will error on the old syntax. If you want to preserve the old defualt value, add casting_syntax=both to your .flowconfig. You can use the npm package flow-upgrade to upgade: yarn run flow-codemod typeCastToAsExpression. Read the docs for more.

New Features:

  • Exported class setters no longer require an explicit type annotation: void is used if omitted

Parser:

  • The flow-parser estree output now aligns more with hermes-parser: ArrayExpression gains a trailingComma field, optional chaining is wrapped in a ChainExpression, AssertNonnull (expr!) emits a NonNullExpression instead of an optional node, type-position this emits ThisTypeAnnotation, and TypeParameter.bound is now a bare type node without the TypeAnnotation wrapper.

v0.312.1

04 May 21:01

Choose a tag to compare

  • Fix in saved state checks after a rebase

[flow] v0.312.0

29 Apr 19:26

Choose a tag to compare

Likely to cause new Flow errors:

  • Flow will now error on variance modifiers (+T, -T, in T, out T) on interface method type parameters, matching the existing rejection on class methods and function types

New Features:

  • Declaration merging between declare class and interface of the same name in the same scope.
  • Flow now separates value namespace and type namespace, so code like const A = 1; interface A {} is now accepted.

v0.311.0

22 Apr 22:05

Choose a tag to compare

New Features:

  • Added support for string and number literal properties in declare class and interface

Library Definitions:

  • Change the Record<K, T> utility type's key bound from K: string to K: PropertyKey, allowing number and symbol keys in addition to string
  • Added some TS built-in types that were missing from Flow's core lib

Misc:

  • When experimental.allow_variance_keywords is set to true, we support the keywords in / out / readonly along with +/- for variance

v0.310.0

21 Apr 01:17

Choose a tag to compare

New Features:

  • Support constructor type signatures (new (...) => Type) in interfaces and declare class

Misc:

  • When allow_variance_keywords is set to true, Flow stops erroring for in / out / readonly