Releases: facebook/flow
Releases · facebook/flow
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
v0.9.2
v0.9.1
- Unbreak the command line for "flow path/to/root" (thanks @samwgoldman for the report!)
v0.9.0
- Add Video-, Audio and TextTrackList (+ dependencies)
- Refine switch cases
- Better Not_found error
- [PR #333] Partial fs module implementation
- Update parser to match esprima-fb
- [PR #370] Dom canvas context
- [PR #393] Symbol should be called statically. Fix #391
- Fix havoc_env to copy the
for_type
value - add bash completion
- rewrite all the commands to use CommandSpec
- json_of_t
- [PR #384] Env printer
- [PR #383] Add some build/test artifacts to .gitignore
- [PR #377] Add missing HTMLImageElement properties
- [PR #367] Re-add merged out oneOfType proptype implementation
- Allow users to pin their .flowconfig to a specific version
- colorize test failure diffs
- Object spread fix
- [PR #322] Add type signature for node "url", "querystring" and "path" modules
- command parsing library
- look for package.json in include paths
- clear module errors properly
- add verbose mode
v0.8.0
- [PR #356] Add React.version to lib/react.js
- [PR #331] node http.get() implementation
- Fixes for indexers in object types and objects used as dictionaries
- Flow server speedup
- Support both commas and semicolons in object type patterns
- Fix object assign for unresolved objects
- Add prerr_endlinef
- Fix support for the mixin pattern of specifying super
- Incremental typechecking fix
- Fix up promises interface definition + more tests
- Perf win by loading master_cx once per job
- Support for-in of null and undefined
- Support typeof x === 'boolean'
- Refine true and false literals
- Fix refinement unit test
- Type declarations for Geolocation interface
- [PR #321] Support for React.cloneElement in 0.13
- Refine simple assignments (things like while (x = x.parent) { x.doStuff(); })
v0.7.0
- Initial support for ES6 import/export (with CommonJS interop)
- Updates to CSS/CSSOM interface definitions
- propTypes in React components now dictate the concrete type signature for this.props
- Show errors in type-at-pos output
- Flow now watches include paths specified in .flowconfig for file changes
- Interpret
x != undefined
andx != null
as the same refinement - Use Object.prototype.hasOwnProperty() calls as a refinement
- Updates to Element and HTMLElement interface definitions