Skip to content

Releases: facebook/flow

v0.322.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 08 Jul 18:10

Notable bug fixes:

  • Fixed #9448
  • Fixed a crash in pattern matching. (example)
  • Refining a union by instanceof no longer leaks any from members that cannot match the guard (e.g. Foo<string> | Bar<number> refined by instanceof Foo now yields Foo<string> instead of Foo<string> | Foo<any>). This may surface real errors that were previously masked.

v0.321.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 24 Jun 21:00

Parser:

  • flow-parser is now backed by the Rust port parser. It will have public API similar to that of hermes-parser.

v0.320.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 21 Jun 00:58

Likely to cause new Flow errors:

  • Object operations on class instance types now produce plain object types instead of preserving the class instance's nominal identity. This affects object type spreads and utilities such as Partial, Required, Readonly, Pick, and Omit. Example

v0.319.0

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 17 Jun 13:53

Likely to cause new Flow errors:

  • The config for casting_syntax is removed. The as casting syntax is the only supported casting syntax. See Modernizing legacy syntax for migration guidance.
  • Flow will now error on T: B in favor of T extends B in type parameters, and error on +/- in favor of readonly/writeonly . See Modernizing legacy syntax for migration guidance.

New Features:

  • Support the global NaN as a match pattern

Notable bug fixes:

  • Fixed negative bigint literal patterns in match being treated as their positive counterpart
  • ConstructorParameters and InstanceType now work on Class<C>, not just typeof C
  • match instance patterns whose constructor is a subclass of the scrutinee type are no longer incorrectly reported as unused.

v0.318.0

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 10 Jun 16:15

Likely to cause new Flow errors:

v0.317.0

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 03 Jun 23:43

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

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 30 May 02:06

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

Choose a tag to compare

@gkz gkz released this 28 May 18:37
  • 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

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 13 May 14:56

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

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 06 May 18:07

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.