Releases: facebook/flow
Releases · facebook/flow
v0.19.0
Likely to cause new Flow errors:
- Flow syntax is now disallowed in non-
@flow
files. Use@noflow
to work around this import type * as Foo
is now disallowed in favor ofimport type Foo
require()
can only take a string literal- ES6 react classes without defaultProps should now
extends React.Component<void, Props, State>
(previously it wasextends React.Component<{}, Props, State>)
- ES6 react classes with defaultProps should declare
static defaultProps: DefaultProps;
- Flow notices errors it missed before in
React.createClass()
react components - Flow is now stricter about using uninitialized variables
- Stricter checking of
in
keyword
New Features:
flow coverage
commandnull
type annotation- Support for class field initializers, gated by
.flowconfig
options - You can now override flowlib definitions with local lib files
- Basic support for computed properties
- Declaration files (.flow files). Long story short, if
foo.js
andfoo.js.flow
exist, Flow will prefer the latter and ignore the former. declare export
- a way to declare the exported types in a non-lib file- Array rest destructuring assignment support
Notable Bug Fixes:
- Fix "package not found" error in some symlink situations
- Object indexer should not imply callable signature
- Default param values can reference earlier params
- Fixed a case where we weren't substituting type parameters properly
- Fixed a situation where Flow would prefer an unchecked module over a library definition
Misc:
- Add
--root
arg to most client commands - More repositioning of error locations
flow get-def
: Jump to module named in import statement- Lots of fixes to make flow commands smarter about connecting to the server
- Smarter refinement in a bunch of situations
- freeze imports on all modules, and require() on ES6 modules
- You can now spread classes, like
var {x} = new Foo()
- Interfaces now can be callable
- If you've refined an object property, that refinement survives access through a destructured refinement
- Better autocomplete results for primitives, objects, functions and unions
flow server
will write to log file in addition to stdout/stderr
v0.18.1
v0.17.0
New Features:
- New default error message format shows the code inline (thanks @frantic!)
- Autocomplete will keep trying even if the file fails to parse
- You can configure which file extensions Flow looks for (thanks @eyyub!)
- Support for negative number literal types.
Notable Bug Fixes:
- Incremental
make
on OSX now works whenlib/
files change - Fixed some issues around const destructuring
- Fixed some issues around destructuring in for-of and for-in loops
- Some emacs plugin fixes
- Object spreads are now handled in the correct order
- Generator
return()
andthrow()
methods are now supported - Object types now allow keywords as the object keys (thanks @samwgoldman!)
- importing & exporting
default
using named specifiers is now supported Flow
now understandsthis
in class static methods andthis.constructor
in class instance methods (thanks @popham!)- Fixed bug with array spreads
- Understand that all classes have a static
name
property
Misc:
- Improved
flow find-module
- More error location improvements
Object
can now be called as a function to cast things to objects- We've tried to standardize the error codes with which Flow exits. Some exit codes have changed, but the ones you probably use should be the same. At the moment they're only documented in the code
- Flow understands the value of a negated number literal
v0.16.0
Likely to cause new Flow errors:
- Some module exports that didn't require annotations before may now require annotations
New Features:
- Let/const support! Finally! (Huge props to @samwgoldman...again :] )
- Support for
mixins
ondeclare class
library definitions
Notable Bug Fixes:
- Improvements to types inferred from switch cases that fall through to a default cause
- Further improvements on symlink support
Misc:
- Significant performance improvements (both for initial start-up time and running re-calculation time)
- Improved
--traces
output
v0.15.0
Likely to cause new Flow errors:
- Flow now treats class identifiers as being let bound. You cannot refer to a class before it is defined.
- If you accidentally use a tuple type instead of an array type for a rest param then Flow will complain
- You cannot use
this
beforesuper()
in a derived constructor, per ES6 semantics - Our dictionary property (aka indexer property) support is much more robust and catches things it previously missed.
- We weren't properly enforcing optional properties in
interfaces
anddeclare class
. Now we are.
New Features:
- Generators support, courtesy of @samwgoldman
-
of worker processers is now configurable, defaults to the # of CPUs
- If Flow knows the value of a boolean expression, then it will know the value of that expression negated.
- Flow can remember refinements for things like
if(x.y[a.b])
export type {type1, type2}
syntax
Notable Bug Fixes:
- Fixed issue where Flow would still read package.json for [ignore]'d path
- Fixed some leaky annotations that let data flow through them
- Fixed instance and class types to be considered truthy
- Flow still initializing message now fits in 80 chars, compliments of @spicyj
- No longer will report hoisted declarations as unreachable code
- Fixed issue with how Flow chooses its tmp dir
- An async function can return a
T
or aPromise<T>
and it means the same thing - Fixed Flow forgetting about optional properties after an assignment refinement
- Fixed parser issue around future reserved keywords
- Optional parameters and rest parameters now work better together
Misc:
- Updated error locations. We've spent a lot of time auditing our error locations and trying to move them closer to the actual errors.
- esproposal.decorators option to tell Flow to parse and ignore decorators
- Bunch of updates to the libraries
- Some perf work
- Test output is colorized
v0.14.0
Likely to cause new Flow errors:
- Assignment now triggers a refinement. If you have a variable that is a
?string
and you assign 'hello' to it, Flow refines its type to 'string'.
Likely to fix old Flow errors:
- We now treat missing type parameters as
any
. For example, previouslyReactElement
was treated asReactElement<*, *, *>
. Now it's treated asReactElement<any, any, any>
.
Misc:
- Basic unsafe support for getters & setters, gated behind the config option
unsafe.enable_getters_and_setters
- Support for block comments inside of Flow's comment syntax
- Disable by default munging of class property names that start with an underscore, with an option to enable it
- Lots of small internal fixes and merged PRs
- Basic semver support for the .flowconfig version
- Support for
declare type
in lib files - Type annotations are now opaque - other types will not flow through them
- You can configure the tmp dir that Flow uses
v0.13.1
Likely to cause new Flow errors:
- Restricted
+
and+=
to only allow strings and numbers, and no longer implicitly cast objects, booleans, null or undefined. UseString(x)
to explicitly cast these values. - Fixed a few bugs where types shared between modules may have lost precision or weren't enforced.
Misc:
- Added
import typeof
feature that allows you to import the type of a value export from another module. It is sugar for:import MyThing_tmp from "MyModule"; type MyThing = typeof MyThing_tmp;
(except it removes the need for the intermediateMyThing_tmp
variable) - Added
flow ast
command to print a serialized JSON ESTree AST. (Note that this AST does not include types, just syntactic structure for now) - Added support for class expressions
- Added support for following symlinks
- Added support for number-literal and boolean-literal annotations. (useful for things like enum types and refinements based on tests of equivalence between two variables)
- Added support for ES6 binary and octal integer literals
- Added support for
export type
within a CommonJS module that also uses themodule.exports = ...
pattern - Added support for refining some union types down to their disjoint members
- Added support for covariant Promise type parameters
- Added improved support for understanding ES5-style imperative class definitions (i.e. via functions + prototypes)
- Fixed passing
undefined
to optional parameters - Fixed return-type tracking for tagged template usage
- Fixed an issue where library parse errors would cause the flow server to continuously restart upon initialization without giving an error
v0.12.0
Likely to cause new Flow errors:
- Fixed a bug where declarations from libraries which are exported from one module are not checked properly in the module into which that module is imported (e.g. if
A.foo()
returns aPromise
, and module B requires A and callsA.foo()
, the return type ofA.foo()
was not being checked properly) - Fixed enforcement of Object and Function type annotation arity, so that
Object<K, V>
errors - Restricted valid computed properties, such that only strings and numbers are allowed (notably, disallows
null
andundefined
)
New features:
- Added support for
for-of
and support forIterable
interface(s) - Added support for
async
/await
- Added structural subtyping for interfaces -- anything can be an instance of an interface as long as it looks right
- Added support for type annotations of the form
typeof x
, wherex
is the name of an in-scope variable - Added a new config option
suppress_comment
, a regexp which matches against comments and causes any Flow error on the next line to be suppressed. For example,suppress_comment=.*\$FlowFixMe.*
will cause/* $FlowFixMe */\nvar x : number = "oops";
to not raise an error. - Added a new config option
module.name_mapper
, a regexp -> replacement template tuple to be applied to any matching module names before the Flow system resolves the name and looks it up - Added a
--color=always|never|auto
CLI option, useful when piping toless -R
- Added a
--one-line
CLI option which replaces\n
with\\n
in multiline error messages, useful when piping togrep
Misc:
- Many improvements to library files, especially node and ES6 APIs
- Improved warnings on unsupported class members [PR #461]
- Added support for
export default class
- Fixed
if (x instanceof Array)
- Fixed the type of
x && y
whenx
is an array, object or function - Fixed the
flow get-def
command, especially around imported types - Fixed a bug with
==
and improved comparison-related error messages - Fixed file watching for individual files included via .flowconfig [includes]
- Fixed the build ID, so that the server restarts when accessed from a mismatched client version
- Added a new config option
log.file
which overrides the default log file path
v0.11.0
- We are now syncing Flow's commit history to GitHub. No more huge updating diffs. We'll also filter the changelog to the most important things.
- Big React refactoring to support ES6 React classes
- Do you use
any
to workaround things that you want to fix later? Well, now you can use$FixMe
instead ofany
and easily grep for these workarounds later. - We now report parsing errors in non-@flow files that you are
require()
'ing/import
'ing - Better error messages and better error message positions
- Better error traces, with
flow check --traces N
, whereN
is the trace depth - Basic support for
Object.freeze()
- Assorted fixes and updates to the flow libs
- We're trying to be better about commenting the code
v0.10.0
- Support import/export type
- [PR #412] More fs implementation
- Support for static overloads
- Fix order of args matched with overloads
- Allow methods to have properties
- [PR #405] Make interface-defined modules work with CommonJS/ES6Module interop
- Refine mixed
- Fix typeof null === "object" refinement
- [PR #397] Facilitate debug builds
- [PR #401] Improve error message clarity in a few places
- Remove 'everything is a bool' implicit cast
- Fix issues with optional properties during InstanceT ~> ObjT
- Fix abnormals in catch blocks