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 3 years ago
Likely to cause new Flow errors:
this
parameters of functions (see https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e).New Features:
*
). It can be run via flow codemod replace-existentials --write .
.Notable bug fixes:
Library Definitions:
Misc:
experimental.this_annot
config option and permanently enable now that our core lib defs rely on this feature.new_check
config option for the new check mode that uses significantly less RAM for large projects.Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
this
typing by banning the unbinding of class methods (see https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e).New Features:
// flowlint-next-line require-explicit-enum-switch-cases:error
.flow fix
command to apply autofixes from the command line to a list of files.Notable bug fixes:
--ignore-version
flag also prevents Flow from crashing when an invalid option is in the .flowconfig
.Library Definitions:
options
parameter for require.resolve
. (thanks @skeggse)void
from TypedArray sort
function. (thanks @goodmind)DOMStringList
instead of a string array from IDBDatabase.objectStoreNames
. (thanks @bnelo12)Misc:
--binary
to the flow version
command to see the path to the current binary..flowconfig
.method-unbinding
error to replace the method with an arrow function.class-object-subtyping
error to replace the object type with an interface.Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
Notable bug fixes:
Library Definitions:
Symbol.asyncIterator
(thanks @goodmind)HTMLTableSectionElement
(thanks @vitoreiji)MediaRecorder
constructor optionscrypto
types (thanks @juodumas)cluster.worker
type (thanks @magicmark)Published by facebook-github-bot over 3 years ago
New Features:
getName(value: TEnum): string
method. Given a value of the enum type, this returns the string representation of the name of the member. You will also need to update to the latest flow-enums-runtime
package.Notable bug fixes:
annotate-exports
codemod to add lowercase react
instead of React
(thanks @meandmax!).Misc:
README.md
.cache_live_errors_artifacts
and cache_signature_help_artifacts
config options by default.super
outside of class
methods added in 0.148.0
has been removed.Library Definitions:
Map
, WeakMap
, Set
and WeakSet
constructors' iterable param to be optional as per the ECMAScript spec.PageTransitionEvent
as per the HTML spec (thanks @bripkens!).stepUp
and stepDown
in HTMLInputElement
declaration as per the HTML spec.Published by facebook-github-bot over 3 years ago
New Features:
Notable bug fixes:
package.json
to have a valid Flow extension for the file to be considered..js
extensions even when a module name looks like a resource file (e.g. ./a.svg
will look to ./a.svg.js
).this
parameter with a generic.$NonMaybeType<empty>
evaluate to empty
.PointerCapture
library definitions (thanks @malectro!).Misc:
observedBits
param to React's useContext
libdef.format.bracket_spacing
option which affects code output (such as code actions).Published by facebook-github-bot over 3 years ago
New Features:
Notable bug fixes:
package.json
to have a valid Flow extension for the file to be considered..js
extensions even when a module name looks like a resource file (e.g. ./a.svg
will look to ./a.svg.js
).this
parameter with a generic.$NonMaybeType<empty>
evaluate to empty
.PointerCapture
library definitions (thanks @malectro!).Misc:
observedBits
param to React's useContext
libdef.format.bracket_spacing
option which affects code output (such as code actions).New Features:
Notable bug fixes:
obj[Symbol.iterator]
. This is now correctly typed as the object type's @@iterator
property.Misc:
esproposal.class_instance_fields
, esproposal.class_static_fields
, esproposal.decorators
, esproposal.export_star_as
, esproposal.nullish_coalescing
and esproposal.optional_chaining
flowconfig options which have been deprecated since v0.135.Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
x instanceof null
. This catches 'instanceof' is not an object
runtime errors.super
outside of class methods, e.g. in arrow and function properties, is now an error.Library Definitions:
static from
to stream$Readable
(thanks @agalatan).Notable bug fixes:
null
from being a subtype of an empty interface e.g. (null: interface {}) // Error
(thanks @mrtnzlml for the report).Misc:
flow refactor
experimental command removed. Instead, use the LSP textDocument/rename
request.experimental.new_signatures
flowconfig option as well as the --old-signatures
opt-out command line flag.Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
?{c: number}
did not properly error when used with utility types $PropertyType
and $ElementType
. null
and undefined
do not have properties nor elements.Object.prototype
properties like toString
and hasOwnProperty
are no longer allowed to be accessed as global variables, which was previously allowed because window
is an object.New Features:
flow-bin
.Notable bug fixes:
null
and undefined
flow lsp
on symlinked root directoriesMisc:
@flow weak
, which was a rarely-used mode in which missing annotations were treated as any
. It is equivalent to suppressing any type errors that result from just using @flow
. So to migrate, suppress the new errors and remove weak
.flow.suggest.autoImports
LSP setting to disable autoimport suggestions in autocomplete (currently requires autoimports=true
to be enabled in .flowconfig
)Library definitions:
assert
strict mode (thanks @goodmind).webp
resources (thanks @TomasBarry)tty.WriteStream
(thanks @reyronald)process.exit
to return empty
Parser:
Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
interface {}
is no longer a supertype of void
and mixed
Notable bug fixes:
.
were sometimes being ignored by Flow, which has now been fixedLibrary Definitions:
PerformanceResourceTiming
library definition (thanks @MIGreenberg)withFileTypes
option to readdir
and readdirSync
(thanks @mrtnzlml)composedPath
function to Event
library definition (thanks @Brianzchen)Event
library definition and made most properties read-onlyMisc:
gc.worker.custom_major_ratio
, gc.worker.custom_minor_ratio
, gc.worker.custom_minor_max_size
, gc.worker.minor_heap_size
, gc.worker.major_heap_increment
, gc.worker.space_overhead
, and gc.worker.window_size
.Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
function i({name = 1}: {| name?: string |}) {}
was previously not an error.New Features:
flow_parser.js
to support configuring comment output. comments
enables comment attachment and all_comments
enables the legacy list of all comments.Notable bug fixes:
node_modules
for auto imports.Published by facebook-github-bot over 3 years ago
generate_tests=true
flowconfig option have now been removed.&&
, ||
, ??
) and union typeslet {foo, ...rest} = obj
) now retain the indexer of the object being destructured. In this example, if obj
is {[string]: string}
, then rest
is also {[string]: string}
.autoimports=true
flowconfig option.touch
-ing the .flowconfig
without changing itPublished by facebook-github-bot almost 4 years ago
Notable bug fixes:
Published by facebook-github-bot almost 4 years ago
Likely to cause new Flow errors:
types_first
and well_formed_exports
flowconfig options are no longer recognized. See https://medium.com/flow-type/types-first-a-scalable-new-architecture-for-flow-3d8c7ba1d4eb/ for more about Types-First mode.New Features:
autoimports=true
flowconfig option.--sharedmem-heap-size
CLI flag and FLOW_SHAREDMEM_HEAP_SIZE
environment variable, which can be used instead of the sharedmem.heap_size
flowconfig option for setting the amount of shared memory available.Misc:
ErrorEvent
library definition (thanks @kegluneq)Published by facebook-github-bot almost 4 years ago
Likely to cause new Flow errors:
Notable bug fixes:
No available version of ocaml-base-compiler satisfies the constraints
error from make all-homebrew
(thanks @bayandin).Published by facebook-github-bot almost 4 years ago
Array
methods. For example, given [1, 2].map(a => a).forEach(b => b)
, Flow now infers that b
is a number
rather than any | number
._
=
in JSX attributes that already have onePublished by facebook-github-bot almost 4 years ago
Likely to cause new Flow errors:
generate_tests=true
in a flowconfig if desired. See https://medium.com/flow-type/flows-improved-handling-of-generic-types-b5909cc5e3c5 for more about Flow's new handling of generic types.Notable bug fixes:
Parser:
Misc:
ShadowRoot
library definition (thanks @Brianzchen)Published by facebook-github-bot almost 4 years ago
New Features:
this
annotations in functions, like function f(this: {foo: string}, param1: string): string { return this.foo; }
experimental.abstract_locations
config option is now true
by default, as it enables significant performance improvements. This option is now deprecated and will be removed in a coming version.Notable bug fixes:
K: string
flows into $Keys<{[K]: ...}>
K: 'literal'
is checked against itself like k === 'literal'
Misc:
flow-remove-types
to support this
parametersPublished by facebook-github-bot almost 4 years ago
Likely to cause new Flow errors:
Bug Fixes:
$Exact
Editor Integration:
all=true
(thanks @mochja)flow
CLI at the same time as VS Code caused by case-insensitivity of Windows pathsLibrary Definitions:
inputType
to InputEvent
(thanks @Brianzchen)intersectsNode
to Range
(thanks @Brianzchen)Misc:
/tmp/flow/flowlibs_<HASH>
, to take up less space.Published by facebook-github-bot almost 4 years ago
New Features:
Notable bug fixes:
Library Definitions:
Buffer.write
to number
(thanks @fedotov).Misc: