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

Published by facebook-github-bot almost 3 years ago

Notable bug fixes:

  • Fix crash when moving a module introduced in v0.167.0
flow - https://github.com/facebook/flow/releases/tag/v0.167.0

Published by facebook-github-bot almost 3 years ago

Notable bug fixes:

  • Error on invalid @flow modes

Misc:

  • Remove the --profile, --json and --pretty flags from flow force-recheck
  • Reduce usage of shared heap space

Library Definitions:

  • Add support for Node inspector
  • Improve Document definition
  • Add document.contentType
  • Add 'navigate' as valid request ModeType (Thanks @comp615)
flow - https://github.com/facebook/flow/releases/tag/v0.166.1

Published by facebook-github-bot almost 3 years ago

  • Fix a crash introduced in 0.166.0
flow - v0.166.0

Published by facebook-github-bot almost 3 years ago

  • Improve recheck performance on large projects
  • No longer support flow check-contents on non-Flow files by default; pass --all to force it.
  • No longer attempt to provide LSP documentHighlight on non-Flow files.
  • Remove legacy "weak" mode. The --weak CLI flag and weak=true flowconfig option have been removed.
flow - https://github.com/facebook/flow/releases/tag/v0.165.1

Published by facebook-github-bot almost 3 years ago

Notable bug fixes:

  • Improve performance of signature help
  • Fix a bug that caused rechecks to be unnecessarily invalidated and restarted
flow -

Published by facebook-github-bot almost 3 years ago

Likely to cause new Flow errors:

  • The Flow parser now requires that variables declared using the declare var syntax be annotated with a type. declare var x; is now illegal.

Notable bug fixes:

  • No longer attempt to provide autocomplete or flow autocomplete on non-Flow files.
  • Fix a crash when deleting a file in lazy mode
  • Fix a bug that prevented some code actions from adding type imports for export default class definitions
flow - https://github.com/facebook/flow/releases/tag/v0.164.0

Published by facebook-github-bot almost 3 years ago

New Features:

  • exports/module.exports can no longer be read from in a module (e.g. exports.foo) to eliminate this usage of unsealed objects - you can refactor your code to directly reference foo instead, or just use ES modules (e.g. export const foo = ...)
  • Improved autocomplete for the targets of typeof type annotations.
  • Support for finding references and renaming has been removed. While these features often worked well, they also caused extremely bad performance and crashes. We hope to reimplement these features as soon as we can.
  • When displaying types, always use indexed access types for $ElementType and $PropertyType utilities.
  • Remove indexed_access option, it's always enabled now (was on by default before if the option was omitted).

Notable bug fixes:

  • Fix an issue where the refactor code-action would hang on large inputs.
  • The exports of a file with no value exports are typed as an exact empty object rather than an unsealed object. Common errors which resulted from this are accidentally doing import typeof Foo rather than import type {Foo}
  • Fix error causing LSP requests to fail.
  • Fix calling watchman on Windows.
  • Fix soundness issue when comparing polymorphic types (example try-Flow).
  • Fix handling of duplicate bindings in signature builder.
  • Improve error messages and type-at-pos results around $ExactT<...> type annotations.
  • Fix referencing this in a JSX title member.
  • flow coverage now returns 0% for non-@flow files; pass --all to also check non-@flow files.
  • No longer attempt to provide definition or flow get-def on non-Flow files.
  • No longer attempt to provide hover or flow type-at-pos on non-Flow files
  • Update to latest LSP 3.17 beta definition of CompletionItemLabelDetail

Library Definitions:

  • Fix navigator.clipboard.write type and add ClipboardItem (thanks @Egrodo).
  • Add node.js fs.copyFile overload to support the case where the mode param is not specified (thanks @Brianzchen).

Misc:

  • Removed the flow suggest command.
  • Improve codemod CLI error handling (Thanks @gnprice).
  • Changed scheduling of LSP commands in parallel with typechecking, to prioritize commands.
  • Removed flow find-refs command.
  • Removed the --expand-type-aliases flag from all Flow commands, it has caused several performance and non-termination issues without providing much value.
  • Improved codebase quality (thanks @gnprice).

Parser:

  • Invalid typeof type annotations, where the argument to typeof is a not a variable or member expression, are now parse errors rather than type errors.
flow - https://github.com/facebook/flow/releases/tag/v0.163.0

Published by facebook-github-bot almost 3 years ago

New Features:

  • The deprecated * type is now an alias to any. You can use flow codemod replace-existentials, which is available in previous versions of Flow, to upgrade your codebase to not use *. This codemod command will not be available in the current or future versions of Flow.
  • Add (experimental) codemod to annotate variables that cause constrained write errors in future Flow versions.
  • Add (experimental) codemod rename variable names that are reused with different types.
  • Add --include-comments and --include-locs flags to the flow ast command.
  • Add $ObjMapConst<O, T> builtin type, alias for $ObjMap<O, () => T>.

Notable bug fixes:

  • Fix bug in $KeyMirror so that it respects the optionality of its arguments.
  • Type JSON as object rather than a class. This prevents code such as new JSON() which is a runtime error.

Library Definitions:

  • Add InputEvent.dataTransfer
  • Declare AggregateError class - fixes #8764 (thanks @lachlanhunt).
  • Improve UIEvent, InputEvent and KeyboardEvent types.

Misc:

  • Fix typo in CONTRIBUTING.md (thanks @jereef).
  • Clarify comments for ConcretizeTypeAppsT logic after Subtyping_kit refactor (thanks gnprice).

Parser:

  • Fix a bug that allowed comments after the # in private identifiers.
flow - https://github.com/facebook/flow/releases/tag/v0.162.1

Published by facebook-github-bot about 3 years ago

  • Fix a bug where errors in node_modules were shown in lazy mode. It is now consistent with non-lazy mode.
flow - https://github.com/facebook/flow/releases/tag/v0.162.0

Published by facebook-github-bot about 3 years ago

Likely to cause new Flow errors:

  • As part of our work on Local Type Inference, unannotated variables now require a non-null value to be assigned to them at some point in the program. If a variable is intentionally only null, it can be annotated with null (let x: null = null); if only undefined, then it can be annotated with void (let x: void;).
  • Function and class names can no longer be reassigned, even when not exported
  • Fix positioning of [missing-type-arg] errors

New Features:

  • Add $Partial utility type. This utility converts all of an object's or interface's named fields to be optional, while maintaining all the object's other properties (exactness, sealedness, etc).

Notable bug fixes:

  • Improve performance of strict_es6_import_export
  • Fix an infinite recheck loop when deleting a file when using saved state
  • Fix a bug where the server would stop after running a CLI command if the server was starting with --autostop

Misc:

  • Type import.meta as object
  • Fix jsdoc support on imported declare function
  • Make string literal autocomplete obey format.single_quotes setting
  • Improve reliability of "refactor" code actions
flow -

Published by facebook-github-bot about 3 years ago

Likely to cause new Flow errors:

  • Only consider variables as "constlike" if their assignments are within their declarations. This fixes cases of unsoundness. example.

New Features:

  • Add hierarchical document symbol support to the LSP. Improves VS Code's Outline pane, breadcrumbs and symbol search.
  • Autocomplete now includes primitive types like string and number, as well as utility types like $Call and $Keys.

Notable changes:

  • Significantly improved overall performance.

Notable bug fixes:

  • Unknown or redundant settings in the flowconfig [lints] section are now ignored when passing --ignore-version.
  • Improve results of type-at-pos on $ReadOnly types.

flow-remove-types:

  • Added a Jest transformer, flow-remove-types/jest
flow - https://github.com/facebook/flow/releases/tag/v0.160.2

Published by facebook-github-bot about 3 years ago

  • The fix in 0.160.1 didn't fully fix the regression in 0.160.0. It, and the original "fix" from 0.160.0 are reverted.
flow - https://github.com/facebook/flow/releases/tag/v0.160.1

Published by facebook-github-bot about 3 years ago

  • Fix a regression in 0.160.0 that caused suppressions to be ignored upon editing files in some cases when using lazy mode.
flow -

Published by facebook-github-bot about 3 years ago

New Features:

  • The ide, fs and watchman lazy modes have been merged into a single mode. The new mode is now SCM-aware with or without Watchman; when the server starts, it queries Git or Mercurial and checks all existing local changes (changes since the mergebase).

    The file_watcher.watchman.mergebase_with config option has been renamed to file_watcher.mergebase_with; set this to the name of your default remote branch (e.g. origin/main).

    Flowconfig setting migration:

    • lazy_mode=watchman -> lazy_mode=true, file_watcher=watchman
    • lazy_mode=fs -> lazy_mode=true
    • lazy_mode=ide -> lazy_mode=true
    • lazy_mode=none -> lazy_mode=false
  • Added parser support for import.meta

  • Added type checking support for new.target and import.meta as mixed

Library Definitions:

  • Add type for queueMicrotask

Notable bug fixes:

  • Improve codemod performance on large codebases
  • Fix a bug that could cause "unused suppression" warnings to appear incorrectly when using lazy mode
flow - https://github.com/facebook/flow/releases/tag/v0.159.0

Published by facebook-github-bot about 3 years ago

New Features:

  • Add support for git to watchman lazy mode. Git projects using file_watcher=watchman and lazy_mode=fs can now upgrade to lazy_mode=watchman.
  • Add codemod to convert $ObjMapi<T, <K>(K) => K> to $KeyMirror<T>. Run it via flow codemod key-mirror [OPTION]... [FILE].

Library Definitions:

  • Add devicePixelRatio global (thanks @Brianzchen)
flow - https://github.com/facebook/flow/releases/tag/v0.158.0

Published by facebook-github-bot about 3 years ago

New Features:

  • Add support for private class methods, implementing both the instance and static proposals! (thanks to our intern, @SamChou19815)
  • Add an "Organize Imports" code action which sorts and groups the imports at the top of the file.
  • Add an "Add all missing imports" code action which auto-imports all unambiguously undefined variables in the given file.

Notable changes:

  • Fix a bug where private class fields like #foo: () => 'foo' could not be called, leading to workarounds like this.#foo.call(this)
  • Fix a crash when hovering over a type annotation that is recursive in a parameter default
  • Fix a crash when autocompleting inside an object literal with a recursive type
  • Fix order of auto-import code actions
  • Fix issue with utility types nested in $NonMaybeType<...>
  • Fix Go to Definition on module reference strings (e.g. if module.system.haste.module_ref_prefix=m#, "m#Foo" will jump to the Foo module)
  • The file_watcher.watchman.survive_restarts setting is now true by default. This setting is deprecated and will be removed in a future version.
  • The --retry-if-init CLI flag has been removed. Setting it to false previously caused the command to error if the server was already running but not yet ready. Instead, use --timeout to avoid waiting too long.

Parser:

  • Significantly improved parser performance
  • Private methods are no longer a parse error

flow-remove-types:

  • Fix to remove variance sigils on class properties (thanks @mischnic)
flow - https://github.com/facebook/flow/releases/tag/v0.157.0

Published by facebook-github-bot about 3 years ago

Likely to cause new Flow errors:

  • Add a new error for unreachable code occuring in a loop after a conditional with mixed break and continue branches.

New Features:

  • LSP extract to function/method/constant/class fields/type alias is enabled by default. These refactors will show up under after selecting some code. They can be disabled by adding experimental.refactor=false to the .flowconfig.
  • Add an eslint plugin, eslint-plugin-fb-flow, for eslint rules from the Flow team. The first rule is use-indexed-access-type to encourage the use of indexed access types (https://flow.org/en/docs/types/indexed-access/).
  • Add another eslint rule to lint against explicit exact by default syntax (fixes #8612).
  • Add a command to update-suppressions to the flow tool (fixes #8384).

Library Definitions:

  • Better coverage of the MediaTrackSettings API.
  • Improve types for ResizeObserver (fixes #8693).

Misc:

  • Upgrade to OCaml 4.10.2.
flow - https://github.com/facebook/flow/releases/tag/v0.156.0

Published by facebook-github-bot about 3 years ago

New Features:

  • Cross-module autocompletion and code actions that fix missing import declarations are now enabled by default. This was experimental since 0.143.0. Can be disabled per project with the autoimports=false flowconfig option, or per user with the flow.suggest.autoImports LSP configuration.

Library Definitions:

  • Enhance the builtin Node.js module types (thanks @isker).
flow - https://github.com/facebook/flow/releases/tag/v0.155.1

Published by facebook-github-bot over 3 years ago

Fix bug in shared memory garbage collection which caused Flow to crash.

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

Published by facebook-github-bot over 3 years ago

Likely to cause new Flow errors:

Notable bug fixes:

  • Fix a bug with name collisions in declared modules (fixes #8604).
  • Prevent showing identifiers for autocomplete of method names.
  • Preserve interfaces when used with the $ReadOnly utility

Library Definitions:

  • Add support for fs promises (thanks @atabel).