Adds static typing to JavaScript to improve developer productivity and code quality.
MIT License
Bot releases are visible (Hide)
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
module.system=haste
, it will now be an error if a .js.flow
file shadows a .js
file with a different path prefix.Notable bug fixes:
Parser:
as
/satisfies
casts in a row.Library Definitions:
Intl.Locale
classPublished by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
$NonMaybeType
, and $ReadOnly
. You might see new errors revealed as a result.$Pred
and $Refine
have been deleted. These are replaced by type guards.New Features:
Pick
and Omit
to work on interfaces and instances.Notable bug fixes:
IDE:
require
, go-to-definition will now jump to the location of the original definition's name.Published by facebook-github-bot over 1 year ago
Notable bug fixes:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
Notable bug fixes:
Parser:
Library Definitions:
Omit
type implementation. Now it will preserve the optionality and the variance of the input object. example
Published by facebook-github-bot over 1 year ago
Notable bug fixes:
autoimports_ranked_by_usage=true
) to sort autoimports by how often they are imported was influencing the sorting even when the option was not enabled. This was likely an improvement, but it was a bug to not obey the option.Published by facebook-github-bot over 1 year ago
Misc:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
New Features:
Notable bug fixes:
void
would appear in autocomplete suggestions more than onceMisc:
Parser:
Library Definitions:
replace
and replaceSync
arrayBuffers
to Node libdefs for process.memoryUsage()
's return typePublished by facebook-github-bot over 1 year ago
Misc:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
React$PropType$Primitive
are deleted. React has deprecated PropTypes since v15.5.const x: typeof x = ...
). An exception is when the name of the variable appears under an object type constructor. For example, the annotation const o: { f: typeof o } = ...
is allowed.Notable bug fixes:
Library Definitions:
e.g. [1, [1,2]].flat()
will now correctly have inferred type of Array<number>
.Published by facebook-github-bot over 1 year ago
Notable bug fixes:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
IDE:
Notable bug fixes:
function f(x: number, y: typeof x) {}
)Misc:
Library Definitions:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
React.ElementConfig<typeof some_generic_component>
, we will replace all the type parameters with their defaults or bounds. It can potentially cause downstream errors. (Example)New Features:
div
to JSX autocompleteexperimental.mapped_type=true
to try them.Notable bug fixes:
@noflow
files in "all" modeexport
statementsLibrary Definitions:
rel
as an attribute to HTMLFormElement
WeakRef
class definitionariaHidden
DOM propertyPublished by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
React.Element
will now accept a second type argument that specifies the props type. JSX will populate this type argument with actual props passed to component, instead of deriving it from the signature. The change will reveal some broken code, e.g. try-Flow example.$Shape
is deprecated, use Partial
instead. Read this blog post for more.tuple_enhancements
to gate our tuple type enhancements (labeled tuple elements, which can be optional or have variance annotations), so we can show a Flow error rather than having users just get syntax errors from various other tooling (e.g. Prettier, ESLint), until all that tooling is updated.experimental.abstract_locations
is removed. Setting this config to true improves Flow's performance. The config defaults to true since 0.139.New Features:
string
supertypes to be used as keys in a dictionary, and have that opaque type be preserved when using Object.keys
.Readonly
, ReadonlyArray
, ReadonlyMap
, ReadonlySet
, NonNullable
.Notable bug fixes:
[invalid-computed-prop]
errors. try-Flow.Partial
/Required
caused errors to be positioned poorly.Misc:
mixed
instead of a generic type if that generic type has a default bound of mixed
. try-Flow.Published by facebook-github-bot over 1 year ago
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
flow get-imports
CLI command.Arrays are invariantly typed
explanations are now correctly removed.New Features:
Required
and Partial
to list of utility types to autocomplete in the IDE.Notable bug fixes:
new Foo()
).any
might have caused this issue.Library Definitions:
process.hrtime.bigint()
.Published by facebook-github-bot over 1 year ago
Notable bug fixes:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
*
, it's just an alias for any
New Features:
{[k in keyof T]: ?T[k]}
! (Example). Look out for a blog post, documentation and support in other tools in the near future. You can try mapped types in your project by setting the experimental.mapped_type=true
flag in the options
section of your flowconfig.Notable bug fixes:
super.|
)o.m(|)
)unused-promise
lint false positives for logical and conditional expressions:
with inferred predicates in flow-remove-types
Parser:
static prototype
fieldsLibrary Definitions:
Published by facebook-github-bot over 1 year ago
Misc:
Published by facebook-github-bot over 1 year ago
Likely to cause new Flow errors:
$Partial
has been renamed to Partial
, use the latter instead. Read the blog post for more details.inference_mode
config and related infra such as codemods were removed. You should follow the instructions in the Local Type Inference for Flow blog post to switch to use LTI before upgrading if you haven't already done so.$Call
and $ObjMap
during the check of a polymorphic function call. As a result, more underconstrained errors or type incompatibility errors might appear.sharedmemory.log_level
flowconfig option and the --sharedmemory-log-level
command line option.IDE:
$Partial
to Partial
.Notable bug fixes:
empty
. e.g. try Flow example..constructor
accesses. e.g. try Flow example.underconstrained-implicit-instantiation
errors are raised in overloaded function calls. e.g. try Flow example
any
to instance types' type arguments. As a result, some spurious errors under LTI might be fixed (e.g. try Flow example), and some new errors might be revealed.Misc:
Parser:
(
, &
and |
are now included in intersection and union ranges, respectively.Library Definitions:
setState
in React lib defs to use $ReadOnly<Partial<T>>
instead of $Shape<T>
.$ReadOnlySet
entry type covariant.Performance
typing with the eventCounts
property, according to the W3C standard.mark
and measure
properties on Performance
interface according to the W3C standard.Published by facebook-github-bot over 1 year ago
Misc:
experimental.channel_mode=socket
on WindowsParser: