Adds static typing to JavaScript to improve developer productivity and code quality.
MIT License
Bot releases are visible (Hide)
Published by flow-bot over 7 years ago
New Features:
flow start
orflow server
, by only computing dependency information and not doing anyflow focus-check
on a file will only checkNotable bug fixes:
Misc:
Published by flow-bot over 7 years ago
Likely to cause new Flow errors:
experimental.strict_call_arity
option has been removed. For more, see https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/
Notable bug fixes:
Misc:
any
types and continuing typechecking rather than stopping altogether.Parser:
Published by flow-bot over 7 years ago
Likely to cause new Flow errors:
React.Component
constructor, which means Flowsuper(props)
call in a reactPromise.prototype.catch
, which means code that uses.catch
but wasn't properly handling the exceptional behavior might now haveNew Features:
.flowconfig
option experimental.strict_call_arity=true
. For more check out this blog post
Notable bug fixes:
undefined
to unfulfilled parameters.declare class
classes would be given a default constructor even if they extended another classMisc:
--no-suppressions
with --include-suppressed
which is a little bit more well-behaved.--pretty
flag to flow check
for pretty-printed JSONParser:
declare function
declarations with predicatesyield
expressions with semicolonsdeclare module
declarations[a=1, b] = c
was parsed like [a=(1, b)] = c
.New Features:
import
expressions (Thanks deecewan!)export type * from ...
, an analogue of export * from ...
Notable bug fixes:
Misc:
Parser:
Published by flow-bot over 7 years ago
Notable bug fixes:
HTMLBRElement
, which extended itself :(Published by flow-bot over 7 years ago
New Features:
Notable bug fixes:
Misc:
Published by gabelevi over 7 years ago
Features:
Published by flow-bot over 7 years ago
Parser:
Notable bug fixes:
Misc:
Published by flow-bot over 7 years ago
New Features:
type TypeB = { ...TypeA };
). You can now spread one object type into another! It is designed to mimic the behavior of spreading an object value in an object initializer, where only own properties are copied over.flow ide
command, through which an IDE can establish a permanent connection with Flow. The IDE can send commands through this connection and Flow can push changes to the IDE.Notable bug fixes:
Parser:
Misc:
React.PropTypes.oneOf
must take an array of literals. You can now put non-literal values in the array.Published by jeffmo over 7 years ago
Notable bug fixes:
React.createClass
components (including mixed in proptypes). This has been fix and may uncover new proptypes errors in createClass componentsfindDOMNode
has been updated to include null
in its return-type now (since this function can, indeed, return null
)Misc:
flow get-importers
has been removed. It was rarely used and added an incredible amount of complexity to the codebasePublished by flow-bot over 7 years ago
Notable bug fixes:
React.createClass()
even when they were not needed.this
and super
in class method parameter defaults.Parser:
Misc:
Published by flow-bot over 7 years ago
Likely to cause new Flow errors:
ReactElement<*>
as a return type for render functions in React may now cause new errors now that a type propogation bug has been fixed. The general solution for this is to remove the return type for functions that return a React element (return types can be inferred by Flow, and Flow has never had a good way to express the type of a specific React element)New Features:
--no-suppressions
to flow check
in order to see what errors would show up in your codebase if you deleted all the error suppressions$Flow$DebugPrint
type to make Flow print a JSON representation of a type. Example usage: declare var flowDebug: $Flow$DebugPrint; flowDebug(someVariable);
Notable bug fixes:
yield
expression
Function.prototype.bind()
wasn't working properly on variables typed as "callable objects" in Flowimplements
could cause a "Did not expect BoundT"
error
TERM
environment variable wasn't set (Thanks @SamirTalwar!)Parser:
+
tokens in object types (like it already did for object literals)"use strict"
)
Misc:
Published by flow-bot almost 8 years ago
Likely to cause new Flow errors:
// $FlowFixMe
(or any kind of suppress_comment
), there's a chance the error may have moved out from under the suppression comment. You may see some unused error suppressions and some previously suppressed errors.document
to match the spec. A few popular properties, like document.body
and document.activeElement
, may be null
. In addition, document.getElementById()
may return null
. Since Flow was not enforcing this before, you may see new errors in your code.New Features:
implements
- classes can now implement one or more interfaces and Flow will verify that the class properly implements the interfaces.flow find-refs file line column
- if there is a variable x
at file:line:column
, then this command returns the location of x
's definition and the location of all reads and writes to x
.import {someValue, type someType, typeof someOtherValue} from 'foo'
$ReadOnlyArray<T>
is the common supertype of arrays and tuples. It's basically an array without stuff like push()
, pop()
, etcdeclare class
, interface
's, object types, etc. They're still not safely checked, though.emoji=true
in the .flowconfig
options and flow status
will put emoji in the connection status messages (thanks @zertosh!)Notable bug fixes:
require()
, (e.g. require(`foo`)
)Object.keys
no longer returns methods since they are not enumerableT
had the type Array<T>
. Now it's Array<*>
, which lets you add elements of other types to the array.$Shape
to ignore "shadow properties", which are properties that don't really exist, but which have been referenced somewhere.unsafe.enable_getters_and_setters=false
Misc:
make
no longer complains if js_of_ocaml
is not installedflow check --profile
now includes CPU timeflow server --profile
and flow start --profile
now print profiling info to the logstests/
which run a flow server now save the .log
file when they fail--no-flowlib
, which make them much fasterParser:
kind
of a static method named constructor
to be "method"
rather than "constructor"
import type
shorthandPublished by flow-bot almost 8 years ago
Notable bug fixes:
Published by flow-bot almost 8 years ago
Notable bug fixes:
Published by flow-bot almost 8 years ago
Notable bug fixes:
Published by flow-bot almost 8 years ago
Likely to cause new Flow errors:
// $FlowFixMe
(or any kind of suppress_comment
), there's a chance the error may have moved out from under the suppression comment to a different location that's more indicative of the error position.New Features:
import type
/import typeof
inside the body of a declare module
to import types between libdefs.Notable bug fixes:
any + number
would yield number
. Now it correctly yields any
.flow check-contents
where input is provided via stdin.Misc:
--old-output-format
CLI flag is now gone.parse()
function in the flow-parser
NPM module now takes either 1 or 2 arguments. Previously it would require both arguments in order to work.Published by flow-bot almost 8 years ago
Likely to cause new Flow errors:
New Features:
flow ls --all
will output libs and ignored files tooflow ls --explain
will explain why Flow cares or doesn't care about a fileflow ls dirA/ dirB file.js
will only list files under dirA/
, files under dirB/
, and file.js
Notable bug fixes:
obj['method']()
) is now supported--strip-root
set now show context againMisc:
flow coverage
and flow check-contents
default to treating all input as if it has the @flow
pragma. We will change this in a future version. To make this transition easier, both commands now have the flags --all
and --respect-pragma
, where --all
is the current behavior and --respect-pragma
is the future behavior.let x = x;
Parser:
[...rest, 123]
was incorrectly parsedPublished by flow-bot almost 8 years ago
Likely to cause new Flow errors:
addEventListener()
with 'click' and 'dblclick'
will pass a MouseEvent
to the listener. This means you might need to update foo.addEventListener('click', (e) => bar())
to foo.addEventListener('click', (e: MouseEvent) => bar())
.New Features:
Notable bug fixes:
Misc:
foo
has the typed mixed
, we now allow foo.bar
if you check that foo
is not null
or undefined
.Parser:
let
statements, which never made it into the spec (thanks @andreypopp)