flow

Adds static typing to JavaScript to improve developer productivity and code quality.

MIT License

Downloads
42.1M
Stars
22.1K
Committers
931

Bot releases are visible (Hide)

flow - v0.213.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • Builtin idx support is removed. idx functions can now be typed with conditional type and mapped type. The v3 release of idx contains these typing changes.
  • When using module.system=haste, it will now be an error if a .js.flow file shadows a .js file with a different path prefix.

Notable bug fixes:

  • Fixed a bug that used to cause spurious internal errors when you have non-binding patterns. example

Parser:

  • Fixed parsing of multiple as/satisfies casts in a row.

Library Definitions:

  • Added support for Intl.Locale class
flow - https://github.com/facebook/flow/releases/tag/v0.212.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • Flow is now stricter with regards to type checking of spreads, $NonMaybeType, and $ReadOnly. You might see new errors revealed as a result.
  • Experimental utility types $Pred and $Refine have been deleted. These are replaced by type guards.

New Features:

  • Updated Pick and Omit to work on interfaces and instances.
  • Conditional types, mapped types, type guards, and tuple enhancements are now enabled by default.

Notable bug fixes:

  • Prevented hover and go-to-definition requests that infinitely loop.

IDE:

  • For imported names using require, go-to-definition will now jump to the location of the original definition's name.
flow - https://github.com/facebook/flow/releases/tag/v0.211.1

Published by facebook-github-bot over 1 year ago

Notable bug fixes:

  • Improve fuzzy matching of autoimports
flow - https://github.com/facebook/flow/releases/tag/v0.211.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • We fixed an issue where the intersection of two identical object types are turned into empty in spreads. As a result, more errors might be revealed. example

Notable bug fixes:

  • We fixed an eager evaluation bug that can lead to some bad interactions between conditional type and mapped type. (example)

Parser:

  • We fixed the parser size regression since 0.210.0.

Library Definitions:

  • We rewrote the Omit type implementation. Now it will preserve the optionality and the variance of the input object. example
flow - https://github.com/facebook/flow/releases/tag/v0.210.2

Published by facebook-github-bot over 1 year ago

Notable bug fixes:

  • Fix a bug where autocompleting a keyword deleted the next 7 characters on the same line
  • "Fix" sorting of autoimports. An experimental option (autoimports_ranked_by_usage=true) to sort autoimports by how often they are imported was influencing the sorting even when the option was not enabled. This was likely an improvement, but it was a bug to not obey the option.
flow - https://github.com/facebook/flow/releases/tag/v0.210.1

Published by facebook-github-bot over 1 year ago

Misc:

  • Improvements in preparation of new feature rollout
flow - v0.210.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • We further strictified React.Element and React refs related typing. You might also see some existing errors related to React.Element and React ref moved around. Example

New Features:

  • Added Pick, Omit, and Record utility types. [try-flow]

Notable bug fixes:

  • Fixed a bug where void would appear in autocomplete suggestions more than once

Misc:

  • Improved keyword autocomplete ordering

Parser:

Library Definitions:

  • Added missing CSSOM replace and replaceSync
  • Added arrayBuffers to Node libdefs for process.memoryUsage()'s return type
flow - https://github.com/facebook/flow/releases/tag/v0.209.1

Published by facebook-github-bot over 1 year ago

Misc:

  • Bug fixes in preparation of new feature rollout
flow - https://github.com/facebook/flow/releases/tag/v0.209.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • We removed support for React PropTypes. All related Flow builtin types like React$PropType$Primitive are deleted. React has deprecated PropTypes since v15.5.
  • We will now catch errors related to generic indexed access types. Example
  • Fixed issues with indexed access on interfaces/instances. Access with string literals will now access named properties. example
  • We now require annotation for computed access of instances, when that access is directly exported.
  • The return annotation of a function can now reference a parameter name (e.g try-Flow). This may cause new errors if the return type used to reference a name that aliases a parameter name. This will now be captured by the parameter and cause a [value-as-type] error.
  • We now error when using the name of a variable in its own annotation (e.g. const x: typeof x = ...). An exception is when the name of the variable appears under an object type constructor. For example, the annotation const o: { f: typeof o } = ... is allowed.

Notable bug fixes:

  • Fix a bug in the previous version that makes declare let/const function scoped. We fixed it to be lexically scoped again.

Library Definitions:

flow - https://github.com/facebook/flow/releases/tag/v0.208.1

Published by facebook-github-bot over 1 year ago

Notable bug fixes:

  • Fixed a crash when we are trying to produce a quick fix for missing imports. The autofix for missing imports broken in the previous release would be working again now.
flow - https://github.com/facebook/flow/releases/tag/v0.208.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • Flow will now error on unsupported statements in library definitions, instead of silently ignoring them.
  • Flow will error more consistently when variables of type any and empty are used as types (e.g. try-Flow)

IDE:

  • Get definition request will now consistently jump to the name of the definition for ES module exports.
  • In find local references, if a reference appears in a named import, it will no longer highlight the entire import as reference. Instead, it will only highlight the relevant name.

Notable bug fixes:

  • Parameter types can now refer to previous parameters in the same parameter list (e.g. function f(x: number, y: typeof x) {})
  • Report error when a function parameter is redeclared in its body in functions that have default params (e.g. try-Flow)
  • For all declared names (declare class/var/let/const), we will allow full forward reference. All reads of these values will be considered to be initialized.

Misc:

  • Changed React.Element to support a second type argument, as supported by React$Element

Library Definitions:

  • Updated dom libdefs to allow Trusted Type objects
flow - https://github.com/facebook/flow/releases/tag/v0.207.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • When you pass a generic component type to some React utility type like React.ElementConfig<typeof some_generic_component>, we will replace all the type parameters with their defaults or bounds. It can potentially cause downstream errors. (Example)

New Features:

  • Add built-in (intrisic) element names like div to JSX autocomplete
  • Mapped types now support operating directly over keys, like TypeScript's Pick and Omit (Example). Mapped type support is still experimental; enable experimental.mapped_type=true to try them.

Notable bug fixes:

  • Don't check @noflow files in "all" mode
  • Fixed a source of spurious errors when using refined string keys as computed properties in objects (Example)
  • Improved Go to Definition on export statements

Library Definitions:

  • Added rel as an attribute to HTMLFormElement
  • Added WeakRef class definition
  • Added ariaHidden DOM property
flow - https://github.com/facebook/flow/releases/tag/v0.206.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • React.Element will now accept a second type argument that specifies the props type. JSX will populate this type argument with actual props passed to component, instead of deriving it from the signature. The change will reveal some broken code, e.g. try-Flow example.
  • $Shape is deprecated, use Partial instead. Read this blog post for more.
  • Add a (temporary) option tuple_enhancements to gate our tuple type enhancements (labeled tuple elements, which can be optional or have variance annotations), so we can show a Flow error rather than having users just get syntax errors from various other tooling (e.g. Prettier, ESLint), until all that tooling is updated.
  • experimental.abstract_locations is removed. Setting this config to true improves Flow's performance. The config defaults to true since 0.139.

New Features:

  • Allow opaque types with string supertypes to be used as keys in a dictionary, and have that opaque type be preserved when using Object.keys.
  • To help people familiar with TS, error on and supply a quickfix to the Flow equivalent for the TS types: Readonly, ReadonlyArray, ReadonlyMap, ReadonlySet, NonNullable.

Notable bug fixes:

  • Error more consistently with [invalid-computed-prop] errors. try-Flow.
  • Fixed cases where uses of Partial/Required caused errors to be positioned poorly.

Misc:

  • To improve clarity of error messages we will display mixed instead of a generic type if that generic type has a default bound of mixed. try-Flow.
  • Object property type incompatibility errors will now contain additional explanations when the error only arises due to object property invariant subtyping.
flow - https://github.com/facebook/flow/releases/tag/v0.205.1

Published by facebook-github-bot over 1 year ago

  • Fix over-eager IDE autocompletion of types after typing a space.
flow - https://github.com/facebook/flow/releases/tag/v0.205.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • Remove the flow get-imports CLI command.
  • Some duplicate errors with Arrays are invariantly typed explanations are now correctly removed.

New Features:

  • Added type-aware autocomplete in IDE for switch cases.
  • Added signature help to IDE for constructor calls.
  • Go-to-definition in the IDE can now provide multiple options if the target is defined in multiple locations (for example, in a union).
  • Add Required and Partial to list of utility types to autocomplete in the IDE.
  • Added quick fix in the IDE for missing "this." on class member access.
  • To use the extract to expression/type alias IDE refactors, you no longer need to do exact selections to trigger it. Any selections that include extra whitespaces will be OK too.

Notable bug fixes:

  • Fix go-to-definition in IDE for constructors (e.g., new Foo()).
  • When considering a function as a callable object type, we now also check the statics of the function against the object. This may cause new errors. For example, the code in this try-Flow will now error.
  • We now error more consistently when nested union types are being spread. Before, a bug was causing legitimate errors to not be surfaced. Example with [cannot-spread-inexact] errors: try-Flow. Example with type incompatibility: try-Flow.
  • Some spurious underconstrained-implicit-instantiation errors might be removed. Previously, some classes that extend any might have caused this issue.
  • Fix over-eager IDE autocompletion of keywords after typing a space.

Library Definitions:

  • Added NodeJS process.hrtime.bigint().
  • Many built-in react components and intrinsics props are now readonly.
flow - https://github.com/facebook/flow/releases/tag/v0.204.1

Published by facebook-github-bot over 1 year ago

Notable bug fixes:

  • Fix a crash that could happen when canceling a recheck during module resolution
flow - https://github.com/facebook/flow/releases/tag/v0.204.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • Some heap refinements might be invalidated more aggressively, when method calls appear in conditionals. This brings us closer to what happens in the case of the regular function call. (Example)
  • Always error on the deprecated existential type *, it's just an alias for any

New Features:

  • Experimental support for Mapped Types like {[k in keyof T]: ?T[k]}! (Example). Look out for a blog post, documentation and support in other tools in the near future. You can try mapped types in your project by setting the experimental.mapped_type=true flag in the options section of your flowconfig.

Notable bug fixes:

  • Fix autocomplete for super members (e.g., super.|)
  • Fix hover type of JSX attribute names
  • Fix showing documentation in signature help for member expressions (e.g., o.m(|))
  • Fix unused-promise lint false positives for logical and conditional expressions
  • Fix spurious error in overloaded generic calls when a contextual type is available (Example)
  • Properly remove the : with inferred predicates in flow-remove-types

Parser:

  • Error on classes with static prototype fields
  • Fix missing parse error for class constructors that are async, generators or accessors. The former two were previously type errors rather than syntax errors.

Library Definitions:

  • Add NodeJS stream promises (thanks @moroine)
flow - https://github.com/facebook/flow/releases/tag/v0.203.1

Published by facebook-github-bot over 1 year ago

Misc:

  • Add useful information to poorly located error messages. For example, for code like this try-Flow where the error points to a library definition, the error message will show the file that caused the error.
flow - https://github.com/facebook/flow/releases/tag/v0.203.0

Published by facebook-github-bot over 1 year ago

Likely to cause new Flow errors:

  • $Partial has been renamed to Partial, use the latter instead. Read the blog post for more details.
  • Support for inference_mode config and related infra such as codemods were removed. You should follow the instructions in the Local Type Inference for Flow blog post to switch to use LTI before upgrading if you haven't already done so.
  • We replaced the implementation which checks nested $Call and $ObjMap during the check of a polymorphic function call. As a result, more underconstrained errors or type incompatibility errors might appear.
  • Removed the sharedmemory.log_level flowconfig option and the --sharedmemory-log-level command line option.

IDE:

  • Implement linked editing for JSX elements.
  • Added code actions for adding/removing braces from arrow functions.
  • Adds a quick fix from the deprecated $Partial to Partial.

Notable bug fixes:

  • Fixed a bug that caused instances of nested utility types to be considered equivalent to empty. e.g. try Flow example.
  • Make Flow's behavior more consistent by not erroring on .constructor accesses. e.g. try Flow example.
  • Fixed the file watcher not reacting to any changes on Windows.
  • Improve the error messages when underconstrained-implicit-instantiation errors are raised in overloaded function calls. e.g. try Flow example
  • We now propagate any to instance types' type arguments. As a result, some spurious errors under LTI might be fixed (e.g. try Flow example), and some new errors might be revealed.
  • Fixed the hover type result when an enum object type appears nested in another type structure. e.g. try Flow example.
  • Fixed the hover type on certain kinds of union types. e.g. try Flow example.
  • Fixed the hover type on class constructors.

Misc:

Parser:

  • Leading (, & and | are now included in intersection and union ranges, respectively.
  • Improve error recovery for mismatched JSX tags.

Library Definitions:

  • Change setState in React lib defs to use $ReadOnly<Partial<T>> instead of $Shape<T>.
  • Make $ReadOnlySet entry type covariant.
  • Expand the Performance typing with the eventCounts property, according to the W3C standard.
  • Adjust the type definitions of the mark and measure properties on Performance interface according to the W3C standard.
flow - https://github.com/facebook/flow/releases/tag/v0.202.1

Published by facebook-github-bot over 1 year ago

Misc:

  • Fix a crash when using experimental.channel_mode=socket on Windows

Parser:

  • Add "ObjectTypeMappedTypeProperty" node for mapped types
  • Change "ConditionalType" and "InferType" nodes to "ConditionalTypeAnnotation" and "InferTypeAnnotation"