Adds static typing to JavaScript to improve developer productivity and code quality.
MIT License
Bot releases are visible (Hide)
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.
Published by facebook-github-bot about 5 years ago
Fixed the stack overflow reported by #8037. Thanks @lukeapage for isolating the repro!
Published by facebook-github-bot about 5 years ago
Forgot to cherry-pick [rollouts]
(an experimental new .flowconfig section) into v0.106.0
Published by facebook-github-bot about 5 years ago
Likely to cause new Flow errors:
??
operator. It now has a lower precedence than ||
and &&
, and parentheses are required to nest it with them.<a:b prop={"hello" * 10} />
now errors)Notable bug fixes:
munge_underscores
flowconfig optionMisc:
Parser:
break
statements and array patternslibflowparser
now supports esproposal_nullish_coalescing
as an optionPublished 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)
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:
Misc:
Parser:
Published by facebook-github-bot about 5 years ago
Likely to cause new Flow errors:
Function.prototype.apply
to only accept array-like objects, not any iterable.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:
implicit-inexact-object
linter.Misc:
ps
flow check --profile
flow-remove-types
:
declare export
Parser:
await
to be a parameter in async functionsPublished by facebook-github-bot over 5 years ago
New Features:
--types
flag to flow cycle
, when given only type dependencies are used to compute cyclesNotable bug fixes:
Performance:
Library definitions:
Object
and Function
(which are aliases for any
) in library definitions with any
any
from library definitionsMisc:
Published by facebook-github-bot over 5 years ago
Likely to cause new Flow errors:
MixedElement
export into the module declaration, so it will now need to be qualified as React.MixedElement
.Notable bug fixes:
$ObjMap
).Misc:
defaultProps
property and make them compatible with React.AbstractComponent
.BigInt
s. (thanks, @goodmind!)rc
.Libdefs:
Object
type (equivalent to any
) from WeakSet
and $ReadOnlyWeakSet
. (thanks, @goodmind!)Published by facebook-github-bot over 5 years ago
Notable bug fixes:
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.
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:
...
to theNotable bug fixes:
Misc:
React.memo
and React.lazy
now both allow you to specify an instance type via React.AbstractComponent
.recursion_limit
. Most projects will not need to override this value.Parser:
#constructor
Published by facebook-github-bot over 5 years ago
Likely to cause new Flow errors:
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
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
$Enum
built-in type annotation is now deprecated. Please use the semantically equivalent $Keys
type instead.New Features:
React$MixedElement
as the sound superclass of all React elements. This is a type alias for React$Element<React$ElementType>
.Misc:
decode
method to HTMLImageElement
(thanks, @vicapow!)Parser:
Published by facebook-github-bot over 5 years ago
Likely to cause new Flow errors:
any
but are now typed as an empty object.$call
property syntax, deprecated in Flow v0.75, has finally been removed.Notable bug fixes:
Misc:
Parser:
Published by facebook-github-bot over 5 years ago
Notable bug fixes:
Published by facebook-github-bot over 5 years ago
Likely to cause new Flow errors:
void
before typechecking starts for functions without a return
statement, lessening the impact of a union typechecking bug (#7322).deprecated-utility
lint on by default.mixed
refined to an array produces a read-only array.mixed
refined to an object produces a read-only object.New Features:
.flowconfig
(#7317).Notable bug fixes:
untyped-import
lint rule so that export [type] * from
triggers it.Misc:
deprecated-utility
and dynamic-export
lints when applying all=setting rules (#7473).$ObjMap
or $ObjMapi
(#7642).flow type-at-pos --json
.DidOpen
notifications from the IDE in order to make checking in IDE lazy mode more efficient.flow lsp
automatically starts a server, it prefers the lazy mode set in a .flowconfig
to the lazy mode passed on the CLI.this
type is used incorrectly.React.Element
behave differently than React$Element
.any
.Libdefs:
document.elementsFromPoint()
(#7540).ConstantSourceNode
(#7543).React.Suspense
maxDuration
attribute (#7613).Published by facebook-github-bot over 5 years ago
Likely to cause new Flow errors:
mixed
with instanceof A
produces type A
instead empty
which was produced before.declare module
are no longer automatically exported from that module as well.New Features:
Notable bug fixes:
flow coverage
is passed an invalid input path.Misc:
typeof
, tuples and interface types). The mapper got support for qualified identifiers.$Diff
, etc. This should lead to more compact results.Library definition improvements:
Parser:
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.