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.106.3

Published by facebook-github-bot about 5 years ago

We found and fixed a bug introduced in 0.105.0. Some internal code was using a hashing function and assumed collisions were far less likely than they proved to be. This could lead to random nonsensical errors which would then disappear, usually involving missing object properties. This likely only affected extremely large projects.

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

Published by facebook-github-bot about 5 years ago

Fixed the stack overflow reported by #8037. Thanks @lukeapage for isolating the repro!

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

Published by facebook-github-bot about 5 years ago

Forgot to cherry-pick [rollouts] (an experimental new .flowconfig section) into v0.106.0

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

Published by facebook-github-bot about 5 years ago

Likely to cause new Flow errors:

  • We're starting to make changes to how Flow models object spreads. For more see this announcement
  • Updated parsing of the experimental nullish coalescing ?? operator. It now has a lower precedence than || and &&, and parentheses are required to nest it with them.
  • Flow wasn't typechecking the properties of certain obscure JSX usage (namespaced identifiers, member expression with @jsx / @csx), so would miss type errors in their expressions (e.g. <a:b prop={"hello" * 10} /> now errors)

Notable bug fixes:

  • Fixed a bug where merge or check jobs would crash when a parse error was added to a file in a cycle. The crash was silent but unintended.
  • Types-first no longer ignores the munge_underscores flowconfig option

Misc:

  • Various libdef updates. Thanks for all the PRs!

Parser:

  • Improved error messages for missing semicolon
  • Comments are now correctly attached to break statements and array patterns
  • libflowparser now supports esproposal_nullish_coalescing as an option
flow - https://github.com/facebook/flow/releases/tag/v0.105.2

Published by facebook-github-bot about 5 years ago

v0.105.0 started running the Flow server in a cgroup on Linux distros that support cgroup v2. However, some versions of systemd, which manages cgroups, contain a bug that caused the Flow server to fail to start. This release avoids using cgroup on these systems. (#8012)

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

Published by facebook-github-bot about 5 years ago

Likely to cause new Flow errors:

  • Types for FileReader properties and methods are now more precise (e.g., some parameters typed
    any are now typed ProgressEvent; some properties now have null added to their types). Thanks, @nwoltman!

  • The value type parameter V of $ReadOnlyMap and $ReadOnlyWeakMap is now covariant. Thanks, @goodmind!

  • Types for the vm module in node.js are now more precise. Thanks, @goodmind!

  • The deprecated $Enum<...> utility type has now been deleted. Use $Keys<...> instead.

  • Indexing tuples with floats is no longer allowed.

New Features:

  • Added support for React.Profiler (React v16.9+). Thanks, @bvaughn!

  • Added a --types flag to flow graph dep-graph to output only "type" dependencies: the subset of
    imports that the types of a module's exports depends on. (Without the flag, we output "code"
    dependencies: the set of all imports of a module.)

  • Preliminary support for automatically inserting annotations on a module's exports through
    LSP. Thanks to @akuhlens (summer intern with the Flow team)!

  • Preliminary support for definite assignment checking of class instance properties. Thanks to
    @pzp1997 (summer intern with the Flow team)!

  • Added an option to .flowconfig for exact-by-default objects.

Perf fixes:

  • Fixed a non-termination issue with a recursive use of mapped types.
  • Fixed an exponential-blowup issue with a combined use of spreads and unions.
  • Fixed an exponential-blowup issue with recursive use of array spreads.

Misc:

  • Fixed LSP init to say codeLens is not supported.
  • Fixed lots of cases of bad error positioning, unblocking improvements to error suppressions and
    error streaming. Thanks to @mvcccccc (summer intern with the Flow team)!

Parser:

  • Improved a bunch of "unexpected" parse errors, providing what was expected in the error message.
  • Fixed a bug in parsing of params in function types.
flow - https://github.com/facebook/flow/releases/tag/v0.104.0

Published by facebook-github-bot about 5 years ago

Likely to cause new Flow errors:

  • Fixed the definition of Function.prototype.apply to only accept array-like objects, not any iterable.
  • Improved error positioning, which may cause previously-suppressed errors to become unsuppressed.

New Features:

  • non-array-spread lint rule: Fires when a non-array iterable is spread. This is useful for modeling the loose: true mode of @babel/plugin-transform-spread, where such code causes a runtime error.

Notable Bug Fixes:

  • Fixed a performance regression when computing dependencies in large projects
  • Fixed built-in library definitions that needed to be explicitly inexact to pass the implicit-inexact-object linter.
  • Improved libdefs for many browser APIs (e.g. Media Streams, MIDI, Permissions, Workers) (#7737, #7805, #7806, thanks @goodmind!)

Misc:

  • Various improvements to the types-first signature generator
  • Improved the name of the server master process in ps
  • Improved the output of flow check --profile

flow-remove-types:

  • Remove opaque types and declare export

Parser:

  • Fixed a bug allowing await to be a parameter in async functions
  • Several improvements to the experimental comment attachment algorithm
flow - v0.103.0

Published by facebook-github-bot over 5 years ago

New Features:

  • Added --types flag to flow cycle, when given only type dependencies are used to compute cycles

Notable bug fixes:

  • Fixed a bug when destructuring unions gave spurious errors [example]
  • Updated for-in/for-of head expressions to be evaluated in the correct scope [example]

Performance:

  • Improved the calculation for what are dependents of a file, reducing work during rechecks

Library definitions:

  • Added support for Array#flatMap (thanks @goodmind)
  • Replaced usages of Object and Function (which are aliases for any) in library definitions with any
  • Removed some usages of any from library definitions
  • Updated Function#apply to accept strictly two arguments (thanks @goodmind)
  • Added SpeechSynthesis definitions (thanks @goodmind)

Misc:

  • Updated/added HTML spec URLs in comments (thanks @kevinSuttle)
  • Fixed parsing of anonymous class implements clause (thanks @goodmind)
  • Added support for printing mixins and implements (thanks @goodmind)
flow - https://github.com/facebook/flow/releases/tag/v0.102.0

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • Function components with no arguments get a sealed empty object type as props.
  • Moved MixedElement export into the module declaration, so it will now need to be qualified as React.MixedElement.

Notable bug fixes:

  • Fixed error positioning around utility types (e.g. $ObjMap).
  • Omit reporting error stack traces to end users over LSP.
  • Fixed bug where Flow would crash when variable has same name as a type (fixes #7825)

Misc:

  • Refactored coverage computation to use the typed AST. This enables coverage results over more locations that earlier.
  • Improved server and monitor error logging.
  • In typing object types as react components, account for the defaultProps property and make them compatible with React.AbstractComponent.
  • Optimized the way module exports are populated to prevent recursion limiter exceptions.
  • Improved error messages for invalid BigInts. (thanks, @goodmind!)
  • Hovering over an imported type alias returns its definition. (thanks, @vicapow!)
  • Fixed semver comparison to allow for suffixes such as rc.

Libdefs:

  • Remove Object type (equivalent to any) from WeakSet and $ReadOnlyWeakSet. (thanks, @goodmind!)
  • Add methods to Node HTTP ServerResponse type definition. (thanks, @chrislloyd!)
  • Add definitions for the Web Animations API. (thanks, @goodmind!)
flow - https://github.com/facebook/flow/releases/tag/v0.101.1

Published by facebook-github-bot over 5 years ago

Notable bug fixes:

  • Fixed a bug with suppressions in the experimental types-first mode.
flow - v0.102.0-rc

Published by facebook-github-bot over 5 years ago

We're starting to publish release candidates! v0.102.0 is scheduled to become final on or around June 19, 2019.

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

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • $Keys now produces a more precise type, which may find errors where incompatible strings were passed to something expecting the $Keys of some object.

New Features:

  • We released a new implicit-inexact-object lint to detect when an inexact object is used without explicitly adding ... to the
    end of the props list. See here for context.
  • Function type parameters may now use default arguments. This is not yet supported by babel.

Notable bug fixes:

  • Fixed a bug with ranges returned by autocomplete
  • Fixed a bug where errors with bad locations reported over the LSP could cause the editor to clear all errors.

Misc:

  • React.memo and React.lazy now both allow you to specify an instance type via React.AbstractComponent.
  • Various performance improvements to union types.
  • Various libdef fixes and improvements.
  • Various improvements to error positioning.
  • The recursion limit is now configurable in the .flowconfig via recursion_limit. Most projects will not need to override this value.

Parser:

  • Forbid private fields named #constructor
  • Fix duplicate private class field validation for getters/setters
  • Fix parsing of private getters and setters
  • Function type parameters may now use default arguments.
flow - https://github.com/facebook/flow/releases/tag/v0.100.0

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • The React$ElementType annotation, which was previously unsafe, is now strict. Before you could create an element given a component with this type using arbitrary props. To annotate any component that accepts some given props, use React$ComponentType instead. Try Flow example
  • The React$ComponentType annotation is now strict when used with refs. Before, it was possible to pass a ref having any type when creating an element from a component using this type. If you need to describe components that accept refs, use the React$AbstractComponent type instead. Try Flow example
  • The $Enum built-in type annotation is now deprecated. Please use the semantically equivalent $Keys type instead.
  • Destructuring patterns could previously include missing properties if the resulting binding was unused. This is now an error even when unused. Try Flow example

New Features:

  • You can now use the built-in type React$MixedElement as the sound superclass of all React elements. This is a type alias for React$Element<React$ElementType>.

Misc:

  • Add decode method to HTMLImageElement (thanks, @vicapow!)

Parser:

  • Handle NonOctalDecimalIntegerLiteral
  • Remove U+180e (Mongolian vowel separator) from list of valid whitespace code points
  • Remove support for legacy octal literals with numeric separators
  • Remove support for legacy octal bigints
  • Fix various issues related to automatic semicolon insertion (ASI) for class properties
flow -

Published by facebook-github-bot over 5 years ago

Notable bug fixes:

  • Fix bug where well-formed-exports errors were reported for unchecked files
flow - https://github.com/facebook/flow/releases/tag/v0.99.0

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • The statics of function types used to be any but are now typed as an empty object.
  • Recursive calls of named function expressions were previously unchecked, but are now checked.
  • $call property syntax, deprecated in Flow v0.75, has finally been removed.

Notable bug fixes:

  • Fix an issue where Flow would not catch certain errors involving React function components with unannotated props.
  • Fix React synthetic mouse events for drag, wheel, pointer events to give the specific native event type. (Thanks, @Kiwka!)

Misc:

  • Improved performance of starting a server from a saved state.

Parser:

  • Fix parsing of function types inside tuples inside arrow function return types.
flow - https://github.com/facebook/flow/releases/tag/v0.98.1

Published by facebook-github-bot over 5 years ago

Notable bug fixes:

  • Do not report bad module uses in unchecked files
flow - https://github.com/facebook/flow/releases/tag/v0.98.0

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • Infer void before typechecking starts for functions without a return statement, lessening the impact of a union typechecking bug (#7322).
  • Fix a bug which prevented Flow from asking for required type annotations.
  • Turn the deprecated-utility lint on by default.
  • Two related changes to type refinements to fix unsoundness:
    • mixed refined to an array produces a read-only array.
    • mixed refined to an object produces a read-only object.

New Features:

  • Add the ability to exclude paths included by a previous pattern in a .flowconfig (#7317).

Notable bug fixes:

  • Fix a bug that led IDEs to report all code as uncovered (#7654).
  • Fix the untyped-import lint rule so that export [type] * from triggers it.
  • Flow now recognizes refinements against negative number literals.

Misc:

  • Exclude deprecated-utility and dynamic-export lints when applying all=setting rules (#7473).
  • Improve client/server version mismatch behavior so that the newest of the two is preserved, rather than the client version.
  • Preserve exactness of the input type when using $ObjMap or $ObjMapi (#7642).
  • Minor changes to metadata in the results of flow type-at-pos --json.
  • Batch DidOpen notifications from the IDE in order to make checking in IDE lazy mode more efficient.
  • When flow lsp automatically starts a server, it prefers the lazy mode set in a .flowconfig to the lazy mode passed on the CLI.
  • Allow lints to be explicitly set to their defaults (normally redundant lint settings are disallowed).
  • Fix spurious missing annotation errors when the this type is used incorrectly.
  • Fix a bug that made React.Element behave differently than React$Element.
  • Fix an edge case where object property assignments were typechecked incorrectly (#7618).
  • Fix an unsoundness with addition or logical operators when combined with generics (#6671, #7070).
  • Fix an issue which allowed read-only arrays to be written to if the index was of type any.
  • Fix a bug which stymied typechecking after try/catch blocks (#7530).

Libdefs:

  • Add document.elementsFromPoint() (#7540).
  • Add ConstantSourceNode (#7543).
  • Remove React.Suspense maxDuration attribute (#7613).
flow - https://github.com/facebook/flow/releases/tag/v0.97.0

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • Refining a variable of type mixed with instanceof A produces type A instead empty which was produced before.
  • Types imported in a declare module are no longer automatically exported from that module as well.

New Features:

  • #7518 Adds support for LSP function parameter completion (thanks @vicapow)

Notable bug fixes:

  • Return a better error message when flow coverage is passed an invalid input path.
  • Fixed a bug in which Flow crashed on very long directory paths.
  • Fixed type-at-pos results when reporting the type of a callable object.

Misc:

  • Improvements in AST utilities: The differ got improved support in several kinds of type annotations (literals, generic identifiers, typeof, tuples and interface types). The mapper got support for qualified identifiers.
  • Introduces a resizable array data structure that is used in union-find.
  • Improved error messages around callable and indexer.
  • Type-at-pos now shows results without evaluating type destructors like object spread, $Diff, etc. This should lead to more compact results.
  • Various refactorings in the internal type language and environment.

Library definition improvements:

  • Updates in Node definitions. The stream definitions were updated to the latest version, and the readline.createInterface definitions were also updated.

Parser:

  • #7471 Adds support for parsing of BigInt (Arbitrary precision integers) (thanks @goodmind)
flow - https://github.com/facebook/flow/releases/tag/v0.96.1

Published by facebook-github-bot over 5 years ago

  • Object literals with spreads can be described by object types with spreads in the signature verifier/builder.
flow -

Published by facebook-github-bot over 5 years ago

Likely to cause new Flow errors:

  • Recently the Object and Function types changed their meaning from "any function type" to "any
    type." Accordingly, various Object and Function annotations that made sense before this
    change have been updated in various library definitions.

  • Various other PRs making improvements in library definitions have been merged in this
    release. These include core definitions like Date and Object as well as other DOM and Node
    definitions.

  • We now issue a error when a value that is clearly not a type could be exported as such.

  • We now issue an error when a function is imported as a type.

Notable bug fixes:

  • Some commands are not expected to update server state. But if such a command is cancelled and we
    run a recheck before rerunning the command, not updating the server state would make it seem like
    that recheck never happened (and lead to spurious future rechecks). This has now been fixed.

  • Fixed node_modules filter for lint warnings, which didn't work on Windows, and didn't respect the
    node_resolver_dirnames config option.

Misc:

  • Results of batch-coverage in lazy mode can be misleading, as it does not account for the fact
    that the currently checked files might not be the ones the user is querying for. Running
    batch-coverage in lazy mode is now disallowed.

  • Fixed an issue with flow lsp where logs would not be flushed.