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 - https://github.com/facebook/flow/releases/tag/v0.180.1

Published by facebook-github-bot over 2 years ago

Notable bug fixes:
Reverted changes that cause Flow to generate a corrupted saved-state when libdef changes.

flow - v0.180.0

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Generator functions without return type annotations now default the type of the next parameter to void. If a non-void next type is desired for a function, it will have to be annotated.
  • When experimental.enforce_local_inference_annotations is enabled, Flow now requires annotations on functions returned from async or generator functions.
  • Return statements that return objects no longer widen the object type to match the return annotation, if present. This may lead to additional errors, which can be addressed by adding annotations onto variables that are returned.

New Features:

  • Optimize initialization from saved state.
  • When experimental.enforce_local_inference_annotations is enabled, Flow now has a code action to auto-annotate parameters of functions that have missing-local-annot errors.

Notable bug fixes:

  • Fix broken IDE services when the file contains certain invalid type annotations, import type * ..., export async ... statements or nameless named exports.
  • Fix some potential deadlocks on Windows.

Misc:

  • Add --no-enums flag to flow ast.

Parser:

  • Fix a runtime exception when parsing regexes via the JS version of the parser.
  • Fix crash when the input is a lone quote.
  • Fix missing syntax errors when functions with non-simple params contain "use strict"

Library Definitions:

  • Add type signature for Navigator.canShare().
flow - https://github.com/facebook/flow/releases/tag/v0.179.0

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Improve the type checking of function parameters that use destructuring, have an annotation, and also have a default value.

Notable bug fixes:

  • Fix IDE services in the presence of certain types of parse errors.
  • Fix crash when encountering an unexpected \/. This could have broken IDE integrations while typing.
  • Fix crash with invalid for-await loops.

Parser:

Library Definitions:

  • Add void to the React$Node type.
flow - https://github.com/facebook/flow/releases/tag/v0.178.1

Published by facebook-github-bot over 2 years ago

Notable Bug Fixes:

  • [fix] Fix a crash during incremental recheck when an empty string import (e.g. import '') is added.
  • [fix] Fix a stackoverflow caused by extremely large objects
  • [fix] Fix an incremental update issue where Flow would sometimes resolve requires to stale Haste modules which have no provider files
flow - https://github.com/facebook/flow/releases/tag/v0.178.0

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Improve type incompatibility error messages on default function parameters
  • Invalidate refinements on calls of require, since requiring a module can have side effects

New Features:

  • Add types for React 18 hooks: useId, useInsertionEffect and useSyncExternalStore

Notable bug fixes:

  • x instanceof A when x is typed as any refines it to A instead of empty
  • Fix an issue with [include] entries containing both globs and relative paths on Windows
  • Fix crash when declaring a destructured binding in a library definition
  • Fix missing autocomplete results for JSX component properties when the component's type is recursive
  • Fix analysis of unreachable += expressions
  • Fix incremental typechecking bug when adding files in Haste mode

Parser:

  • Fix parser exception when parsing export interface ... or export enum ...
flow - https://github.com/facebook/flow/releases/tag/v0.177.0

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Fix a bug where refinements should be invalidated when going through multiple control flow branches (thanks @gnprice)
  • Make catch parameters explicitely any typed
  • Ban object spreads of numbers and strings
  • Fix a bug that makes Flow consider some function names to have the empty type
  • Numbers, booleans, and enums are no longer subtypes of the empty interface interface {}
  • Previously incorrectly missing errors might appear in expressions of the form name === 'literal' and name.prop === 'literal' complaining that literal is incompatible with the type of name or name.prop.
  • Update input type of Object.{values,entries} to be interface {} rather than $NotNullOrVoid; number and boolean inputs will now error

New Features:

  • Add codemod to add explicit type arguments to useState when it is called with an empty object. Use with flow codemod annotate-use-state
  • Continue type checking files with indeterminate module types.

Notable bug fixes:

  • Do not add further errors when we already errored on the illegal reassignment.
  • Flow now checks whether literal is a subtype of expr in expr === literal, regardless of whether expr === literal can be applied as a refinement
  • Fix a crash when deleting a file or saving a file with parse errors in certain circumstances
  • Fix a rare crash when files are deleted during rechecks
  • Fix a parser bug that allowed missing commas between object properties (regression in 0.175.0)

Parser:

  • Improve error recovery when in the middle of adding a property to an object type literal

Library Definitions:

  • Add NotificationEvent to service workers API
flow - v0.176.3

Published by facebook-github-bot over 2 years ago

Notable bug fixes:

  • The Haste module resolver now chooses Haste modules before node_modules, to match what Metro does. That is, if you use module.system=haste and have both a @providesModule foo file (or use "haste paths" to derive the module name from its filename) and a node_modules/foo folder, require('foo') will now resolve to the Haste module, even when node_modules/foo is in that file's parent directories. This is also a significant perf improvement because resolving a Haste module is much cheaper than searching for node_modules.
  • Fix several bugs responsible for crashes
  • Fix bugs responsible for some LSP "server is stopped" errors
flow - https://github.com/facebook/flow/releases/tag/v0.176.2

Published by facebook-github-bot over 2 years ago

Revert changes that are causing bugs in non-lazy mode.

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

Published by facebook-github-bot over 2 years ago

Fix crash when comparing abstract and concrete locations when simplifying normalized types.

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

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Banned usage of new on functions. Move usages of this pattern to use ES6 classes instead. If the pattern exists in third-party code that cannot be changed directly, you can use a declaration file to type the legacy pattern with a declare class.
  • Error on type annotations nested inside of destructuring - these were always invalid, we just ignored them before

Notable changes:

  • Removed special support for React.createClass from Flow. It is now just typed as any. Migrate any components using it to class components or function components.
  • Added the module.missing_module_generators option, which can be used (multiple times) to specify 'regex' -> 'command' pairs. When a module is missing, if its name matches one of the regexes, we will add a suggestion in the error message to run command to generate it (and resolve the error).
  • Fixed bugs responsible for some LSP "server is stopped" errors
  • Fixed a bug that could cause the server to become unresponsive on Windows
flow - https://github.com/facebook/flow/releases/tag/v0.175.1

Published by facebook-github-bot over 2 years ago

Bug fixes:

  • Fix an incremental bug which would sometimes cause Flow to choose the wrong provider for a haste module, most commonly when one of those providers is a .js.flow file.
  • Fix ability of flow stop to kill stuck servers
  • Fix rare crashes when processes exit unexpectedly
flow - v0.175.0

Published by facebook-github-bot over 2 years ago

Notable changes:

  • Improve error messages when using a type as a value
  • Improve error messages in for loops
  • Correctly determine the scope of default expressions in function params
  • Add FLOW_CONFIG_NAME env as alternative to passing --flowconfig-name
  • Add file_watcher.mergebase_with.{git,hg} configs to support projects accessible via multiple VCSs (e.g. git mirrors of hg repositories)

IDE integration:

  • Surface deprecated autocompletion results so they appear with a strikethrough in VS Code
  • Fix a bug where changing libdefs, package.json files or the .flowconfig multiple times will cause the IDE to report "server is stopped".
  • Fix a bug where the IDE is unable to start the server if it is downgraded
  • Improve suggestions when autocompleting keys in an object literal
  • Fix an exception when autocompleting a result that would add to an import to an existing require()

flow-remove-types:

  • Fix handling of this param with trailing commas
flow - https://github.com/facebook/flow/releases/tag/v0.174.1

Published by facebook-github-bot over 2 years ago

Fix crash when Flow receives duplicate file deletion notifications introduced in v0.174.

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

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Flow now detects sketchy null errors that arise via optional chaining, and which involve opaque types, type aliases, or generics.
  • Fixed an issue that caused us to previously miss some errors when the type involved was an intersection.

New Features:

  • Access from a union of exact objects, on a property that is on one but not all of the objects, now results in the type of that property or void, instead of an error.
  • Add type checking support for logical assignment operators.

Notable bug fixes:

  • Fix a crash when using the default file watcher (dfind) on Windows if an [include] directory doesn't exist.
  • Do not attempt to unify the type of a declare function that comes after a function declaration of the same name (try-Flow).
  • Improve wording of class-extends errors (try-Flow).
  • Don't report this-in-exported-function for functions with a this parameter.

Misc:

  • Added --list-files flag to status and check commands. This will dump a list of files that contain errors instead of the error messages.
  • The default file watcher (dfind) now logs to a .dfind_log file alongside the .log and .monitor_log files.
  • Changed the way Flow computes coverage for type parameters with uncovered upper bounds. Previously, a type parameter was always considered covered when it appeared in a function signature, class declaration, or type alias, even if the type parameter's upper bound was any. With this change, such type parameters are now considered to be uncovered. This results in Flow now computing a lower coverage percentage on modules where this pattern is present or that import types from other modules that use this pattern.
flow - https://github.com/facebook/flow/releases/tag/v0.173.0

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Modified the behavior of instanceof checks and other refinements to more consistently detect when impossible or invalid refinements are made. This will result in new errors in such cases.

New Features:

  • Improved error messages by providing a suggested property when properties are missing in a conditional context.

Notable bug fixes:

  • Fix "matching property" checks with generic inputs (try-Flow). Thanks @gnprice for bringing up this issue and exploring potential causes!
  • Fixed a bug where the use of certain utility types in polymorphic functions caused errors to not be reported (e.g. try-Flow)
  • Fix a bug where the [method-unbinding] error was reported twice

Misc:

  • OCaml version 4.12.1 is required to build Flow
  • React default exports are now inexact, as technically this can include unknown properties (experimental features)

Parser:

  • Fixed a bug where type parameter instantiations that start with < (e.g., f<<T>()=>S>()) would be incorrectly parsed as the left shift operator.

Library Definitions:

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

Published by facebook-github-bot over 2 years ago

Bug Fixes:

  • Exact objects are treated as truthy in logical expressions
  • Add support for operations on $Values<> types in an export position (e.g. Try Flow)
  • Respect the order of module.file_ext when resolving imports. Before, they were tried alphabetically.

Misc:

  • Change signature-verification-failure from a lint to a normal error. It is no longer valid in the [lints] section of .flowconfig.
  • Improve performance of IDE commands when Flow is busy typechecking
flow -

Published by facebook-github-bot over 2 years ago

Likely to cause new Flow errors:

  • Disallow duplicate member names in classes.
  • Error if an interface is imported as a value.
  • The experimental.new_merge option becomes true by default. This is an internal change in the way file signatures are computed, but may cause new [invalid-exported-annotation] errors when a file exports types that include certain kinds of complex operations, such as projections over complex utility types like $ObjMap. These errors can be fixed by replacing these complex types with simpler ones. In certain cases, the newly added $KeyMirror and $ObjMapConst types (that are exempt of this restriction) can be used instead.

Notable bug fixes:

  • Fix Watchman file watcher on Windows when an include path doesn't exist.
  • Fix a parse error when a newline appears after a class method definition's name.

Parser:

  • Add support for parsing logical assignment operators (thanks @strub).
  • Fix compliance with estree: export * as x from 'y' is now an ExportAllDeclaration with an exported key.
  • Permanently enable parsing of nullish coalescing, and remove the esproposal_nullish_coalescing option.
  • Permanently enable parsing of optional chaining, and remove the esproposal_optional_chaining option.
  • Permanently enable parsing of class static fields, and remove the esproposal_class_static_fields option.
  • Permanently enable parsing of class instance fields, and remove the esproposal_class_instance_fields option.

Library Definitions:

  • Make some options parameters in node's fsPromises optional.
flow - https://github.com/facebook/flow/releases/tag/v0.170.0

Published by facebook-github-bot over 2 years ago

Another light release due to the new year. Changes are mainly internal --
refactoring or progress towards future features.

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

Published by facebook-github-bot almost 3 years ago

This release is light on changes due to the holidays. Happy New Year!

  • Improve performance
flow - https://github.com/facebook/flow/releases/tag/v0.168.0

Published by facebook-github-bot almost 3 years ago

Notable bug fixes:

  • Improve performance of IDE requests when using lazy mode and saved state
  • Improve performance of checking union types by optimizing enums more aggressively