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

Published by facebook-github-bot over 4 years ago

Notable bug fixes:

  • Fixed a bug that would cause Flow to crash on some rechecks.
flow - https://github.com/facebook/flow/releases/tag/v0.119.0

Published by facebook-github-bot over 4 years ago

New Features:

  • Implemented LSP textDocument/signatureHelp, which shows parameter hints when you are within an argument list in a call or new expression.

Misc:

  • Removed the minimal_merge flag
  • Added optional callback for node dgram socket.close function (thanks @davidnaas!)

Parser:

  • Made arguments on new expressions optional
flow - https://github.com/facebook/flow/releases/tag/v0.118.0

Published by facebook-github-bot over 4 years ago

New Features:

  • Autocomplete for nullable objects will now suggest completions with optional chaining syntax
  • Added a new lint, unsafe-addition, which warns if either operand of an addition is null or void

Breaking change:

  • The output of flow autocomplete --json no longer includes location information. This might affect some IDE integrations which have not yet updated to Flow's LSP server. The LSP integration is unaffected.

Misc:

  • Added the dir field to the Document libdef (Thanks, @lukeapage!)
flow - https://github.com/facebook/flow/releases/tag/v0.117.1

Published by facebook-github-bot over 4 years ago

  • Improved timeouts related to Watchman that could cause the server to fail to start if Watchman is slow to respond. Added a file_watcher_timeout .flowconfig option and --file-watcher-timeout argument to flow start and flow server, which defaults to 120 seconds.
flow - https://github.com/facebook/flow/releases/tag/v0.117.0

Published by facebook-github-bot over 4 years ago

Notable bug fixes:

  • Improved the behavior of $Diff and other type destructors when applied to unions.

Misc:

  • Improved error messages when attempting to use watchman without watchman installed.
  • Removed uses of Symbol from libdefs in favor of symbol.
  • Fixed definition of fs.promises.mkdir (thanks @gabrielrumiranda!)
flow - https://github.com/facebook/flow/releases/tag/v0.116.1

Published by facebook-github-bot almost 5 years ago

Notable bug fixes:

  • Fix #8259.
flow - https://github.com/facebook/flow/releases/tag/v0.116.0

Published by facebook-github-bot almost 5 years ago

New Features:

  • Flow now suggests similar names (if applicable) when issuing missing property errors.

Misc:

  • Added a rudimentary libdef for Array.prototype.flat (#8237, thanks @nnmrts!).
  • Fixed a bug that in certain specific cases led to an expression getting typed as empty rather than any.

Parser:

  • > and } in JSX child text is a parse error.
flow - https://github.com/facebook/flow/releases/tag/v0.115.0

Published by facebook-github-bot almost 5 years ago

Likely to cause new Flow errors:

  • In Types First mode, exported classes and functions cannot be reassigned.
  • Added similar checking of symbol in non-strict equality as other primitive types (example). We allow for non-strict equality checks between two symbol types, and between a symbol and null/void (example).
  • We now write properties to unsealed objects recorded during speculative checking, after speculation has succeeded.
  • Added more complete handling for indexers in spreads:
    • Use the indexer on the right, when the left is empty, exact and has no indexer. [example]
    • Allow matching indexers to be spread. [example]
  • Removed the non-array-spread lint, and replaced it with a new .flowconfig option, babel_loose_array_spread.

Notable bug fixes:

  • Improved union optimization for non-enum union equality checks.
  • Fixed a bug in which $Exact<T> failed when T resolved to a Shape<T>. [example]

Misc:

  • Improved performance of calculating the set of files that need to be checked.
  • Cached the typed AST as part of the persistent connection client info, to speed up requests coming from an LSP client (DefinitionRequest, Hover, TypeCoverage).
  • Improved dependency graph construction times, by using Hashtbl and mutable back edges.
  • Improved tool add-comments by
    • using flowlint-next-line instead of adding full $FlowFixMe suppressions on lints, and
    • making the rule for inserting comments inside JSX elements also apply to JSX fragments.
  • Upgraded to sedlex 2.1.
flow - https://github.com/facebook/flow/releases/tag/v0.114.0

Published by facebook-github-bot almost 5 years ago

Likely to cause new Flow errors:

  • Fixed the order of evaluation of JSX attributes and children to match runtime, so that refinements work properly. This can lead to new errors if refined values are used as children, and a function is called within an attribute, because the refinements are now invalidated in a different order. On the other hand, calling a function in a child no longer incorrectly invalidates values used as attributes. [example]
  • Added support for refinements on optional chains! Now, examples like if (x?.y) and if (x?.y === 42) understand that x is truthy in the consequent. Flow also now refines subexpressions of optional chains. For example, given obj?.fun(obj.value), the second obj is known to be truthy since it is only reachable if the earlier obj?.fun is also truthy; therefore, you don't need to optional-chain it again (obj?.value).

New Features:

  • Added typechecking support for symbol! Note that just like number is not a Number, and vice versa, symbol is not a Symbol. In the core lib defs, we change usage of Symbol to symbol & Symbol. Eventually, it will just be symbol. The symbol & Symbol is temporary for one version to allow for existing usage of the : Symbol to be codemodded to : symbol.

Bug fixes:

  • Optimized typechecking pointwise-equal unions, from O(n^2) to O(n)
  • Optimized reverse dependency computation, greatly reducing the time spent computing what needs to be rechecked after an edit
  • Fixed an error message that pointed at the definition of a write-only property instead of the callsite that tried to read it [example]
  • Fixed an issue where coverage results could be incorrect in Types First mode when a file is rechecked
  • Fixed an issue when Flow prints evaluated types like $ElementType, that led to printing empty instead. This improves hover tooltips.
  • Fixed several issues causing various processes to die uncleanly while exiting.
flow - https://github.com/facebook/flow/releases/tag/v0.113.0

Published by facebook-github-bot almost 5 years ago

Bug fixes:

  • Fixed autocomplete when at the end of file
  • Stopped filtering lints (e.g. signature-verification-failure) out when running flow check-contents

Parser:

  • Added support for export default class implements Foo {} [example]
  • Added support for type parameters in anonymous class expressions [example] (thanks @nicolo-ribaudo)

Library definitions:

  • Fixed type of navigator.mediaDevices.getUserMedia (thanks @thecotne)
  • Added missing InputEvent to removeEventListener
  • Updated type of ServiceWorkerContainer.getRegistration

Misc:

  • Added module.system.node.main_field option (see #8128 for more details)
flow - https://github.com/facebook/flow/releases/tag/v0.112.0

Published by facebook-github-bot almost 5 years ago

Likely to cause new Flow errors:

  • JSX expressions now use the new spread semantics added in v0.111.0
  • Attempting to write to or update a read-only property using operator assignment is now a type error

New Features:

  • New ambiguous-object-type lint warning against use of {} object types (prefer {||} or {...} instead, even when exact-by-default is enabled).
  • Improved support for optional chaining

Notable bug fixes:

  • Malformed type annotations no longer trigger the unclear-type lint error
  • Builtin classes can no longer be extended

Misc:

  • Improved performance for utility types and refinements in unions
  • Various improvements to autocomplete and get-def IDE services
  • Add useDeferredValue and useTransition to React library definitions
  • Add bytesWritten funciton to library definition (thanks @farzonl)
flow - https://github.com/facebook/flow/releases/tag/v0.111.3

Published by facebook-github-bot almost 5 years ago

Notable bug fixes:

  • 0.111.2 did not include the commit that bumped the Flow version inside of Flow. (@jbrown215 was a clown)
flow - v0.111.2

Published by facebook-github-bot almost 5 years ago

Notable bug fixes:

  • Spread performance improvements that can prevent timeouts in extreme cases.
flow - https://github.com/facebook/flow/releases/tag/v0.111.1

Published by facebook-github-bot almost 5 years ago

New features:

  • Add module.system.node.root_relative_dirname to allow you to configure where root relative paths resolve to

Notable bug fixes:

  • Fixed the regex generator that handles the magic string in Flow suppression comments
  • Allow spreads of bools, strings, and numbers to support common React Native patterns
flow - v0.111.0

Published by facebook-github-bot almost 5 years ago

Likely to cause new Flow errors:

New features:

  • Introduced an experimental flag (experimental.minimal_merge) that speeds up rechecks when the experimental types-first mode is in use. This flag will be turned on by default and then removed in future releases.
  • Turned on experimental.allow_skip_direct_dependents by default. The flag will be removed next release. This flag speeds up rechecks when the experimental types-first mode is in use.

Notable bug fixes:

  • Fixed a bug where the ocaml representation of union types caused crashes in rare scenarios
  • Fixed a bug in node module resolution which allowed module.system.node.resolve_dirname=.. For those who relied on this bug to import modules using root-relative paths, you can now use module.system.node.allow_root_relative=true. See #8156 for more details.

Misc:

  • Add getElementById to DocumentFragment
  • Add missing methods to Blob (thanks @lyleunderwood!)
  • Allow clients of flow status, flow check, etc. to choose character offset style
  • Support length refinement on tuples (thanks @ilya-bobyr)

Parser:

  • Allow => in objects in return types of arrow functions
flow - https://github.com/facebook/flow/releases/tag/v0.110.1

Published by facebook-github-bot almost 5 years ago

Notable bug fixes:

  • No longer show live Flow errors for files without @flow, unless all=true in the .flowconfig
  • No longer show live Flow errors for ignored files
  • Re-generate live errors after a recheck
flow - v0.110.0

Published by facebook-github-bot almost 5 years ago

New Features:

  • Flow will now send type errors as you type to LSP clients. To disable this behavior, add experimental.disable_live_non_parse_errors=true to the [options] section of your .flowconfig.

Notable bug fixes:

  • Fixed file descriptor leak leading to LSP connection refusal in some cases
  • Improved the behavior of the [declarations] configuration in the presence of dependency cycles (thanks @STRML!)

Misc:

  • Added --evaluate-type-destructors to type-at-pos command.
  • Added --evaluate-type-destructors and --expand-type-aliases to dump-types command (thanks @goodmind!)
  • Changed proceses.env values from ?string to string|void (thanks @FireyFly!)
  • Improved detection of rebases when using watchman file watcher
  • Improved positions for error messages involving the deprecated * type
flow - v0.109.0

Published by facebook-github-bot about 5 years ago

Likely to cause new Flow errors:

  • Flow was previously not typechecking delete, but now does
  • Object.defineProperty and similar methods now adhere more closely to the spec
  • Allow defaults for properties that may not exist in React components

Notable bug fixes:

  • $NonMaybeType<mixed> no longer includes null and undefined (Thanks @goodmind)

Misc:

  • Deprecated $Supertype and $Subtype utilities are now removed entirely
  • flow-upgrade should now use https over git (Thanks @lukeapage)
  • Autocomplete now fires on spaces in JSX
  • Better error messages when a value is used as a type

Performance:

  • Reduced memory usage by using a more compact representation for code locations
  • Types-first should no longer check direct dependents of files where the signature has not changed

Library Definitions

  • Add a number of CSSOM interfaces + fix HTMLStyleElement.sheet type (Thanks @kof)
  • Add AsyncIterator to node.js (Thanks @goodmind)
  • Add undefined to prelude (Thanks @goodmind)
  • Add String.prototype.matchAll (Thanks @goodmind)
flow - https://github.com/facebook/flow/releases/tag/v0.108.0

Published by facebook-github-bot about 5 years ago

Notable bug fixes:

  • Batch coverage info now persists through rechecks.
  • When a file with @preventMunge is in a cycle with a file that does not, the un-munged file no longer has exported munged properties checked for annotations.
  • Fixed a bug where autocomplete would not be triggered in a file with Windows-style line endings.
  • Improved error messages for uses of $ObjMap, $ObjMapi, $TupleMap, and $Call with incorrect arity.

Misc:

  • The deprecated flow ide command and associated machinery have been removed.

Library definitions:

  • Added the missing parts of the Pointer Lock spec to libdefs.
  • Thanks to @lyleunderwood for adding scrolling support to libdefs.
  • Thanks to @goodmind for adding a definition for undefined to the prelude.
flow - https://github.com/facebook/flow/releases/tag/v0.107.0

Published by facebook-github-bot about 5 years ago

New Features:

  • Implement type refinements for property accesses through brackets (#7597, thanks @goodmind).

Notable bug fixes:

  • Fix several issues with autocomplete that prevented optional properties, type aliases to utility types, types with default type arguments, and several other edge cases from being autocompleted.
  • Fix Not_expects_bounds crash with %checks (#7863).

Misc:

  • Make the LSP textDocument/documentHighlight request serviceable while Flow is in the middle of a recheck.
  • Fix minor off-by-one error which caused some parts of traces to be pruned when using the --traces flag.
  • A minor improvement in error messages when undefined is involved.
  • Reduce memory usage slightly when abstract locations are enabled.
  • Prevent log spew when flow lsp is started while the server is initializing.
  • Improve completeness of sighashing. We recently observed an incremental bug caused by incomplete sighashing. This speculatively addresses similar potentially problematic cases.

Library Definitions:

  • Add webkitGetAsEntry to DataTransferItem.
  • Switch several properties to optional in Notification and NotificationOptions (#8032, thanks @pauldijou).
  • Map/Set fix symbols (#7560, thanks @goodmind).
  • Fix Array#reduce and Array#reduceRight (#7902, thanks @goodmind).