Skip to content

v0.199.0

Compare
Choose a tag to compare
@facebook-github-bot facebook-github-bot released this 02 Feb 01:28
· 2545 commits to main since this release

Likely to cause new Flow errors:

  • Support for spread argument in the builtin special-cased $Compose function is dropped. If you need this, you can write it yourself:
declare function compose<T>(
  fns:...$ReadOnlyArray<T=>T>,
): T;
  • Flow now consistently disallows implicit coercion of dates to numbers. Prefer explicit conversion with getTime().
  • When a type argument is inferred from type argument bound or default, and such inference causes error downstream, we will provide better explanations in the error message where the type is coming from. Examples in try Flow.
  • We fixed a bug under LTI that causes us to incorrectly skip checking for some function expressions Example. Some previously hidden errors might be revealed.
  • We fixed a bug that causes some empty arrays to be incorrectly inferred as Array<empty> under LTI. e.g. Array.from(nullableStringArray ?? []). As a result, previously hidden errors might be revealed.
  • Errors for bad == or === comparisons will now consistently show up. Previously, some errors might be hidden when some optimizations are hit, which heavily depends on the implementation details. Example
  • More missing-local-annot error might be shown in cases when we cannot resolve overload. Example
  • We fixed a bug where an unannotated parameter does not cause a missing-local-annot error under LTI. e.g.
declare function id<T>(T): T;
id([(item) => 1]); // now errors

New Features:

  • Improved behavior of string literal autocomplete. Results will be provided regardless of the quote style used, and extra quotes won't be inserted when one is already typed.
  • Add support for declare let and declare const. These work like declare var, but follow the rules of let and const respectively.

Notable bug fixes:

  • We will no longer emit escaped-generic errors for predicate function bodies.
  • $Compose now works under LTI mode.
  • Remove spurious illegal-this error when a this annotation is used in contextual typing.
  • Under LTI mode, we will no longer emit spurious incompatibility errors in invalid predicate function like function f({a: b}): boolean %checks { return typeof b === 'string'; }. Instead, you will only get error on this unsupported syntax.
  • Fix type created by tagged template literals and String.raw. (Closes #7580. Fixes #5705. Fixes #2616.)
  • We will emit fewer underconstrained-implicit-instantiation errors, when we decide that using type parameter default or bound won't cause downstream errors.
  • Fixed a bug in LTI where some errors in utility types were not properly shown. Example
  • Fix IDE services that stopped working while a file contained a setter with the wrong number of parameters.
  • Fix an issue with lazy mode where deleting a file before the server starts did not check files that were depending on the deleted file.

Misc:

Parser:

  • Parse bigint object keys (but type checking is not support yet).