flow

Adds static typing to JavaScript to improve developer productivity and code quality.

MIT License

Downloads
42.1M
Stars
22.1K
Committers
931

Bot releases are visible (Hide)

flow - v0.34.0

Published by flow-bot almost 8 years ago

Likely to cause new Flow errors:

  • Dictionary types (i.e. {[key: string]: ValueType}) were previously covariant which proved to be a significant source of unsoundness. Dictionary types are now invariant by default in order to fall into consistency with other collection types. It is possible to opt in to explicit covariance with new syntax: {+[key: string]: ValueType}, but note that this is now enforced covariance -- which means the dictionary can no longer be written into (only read from). For mutable collections, consider using Map/Set/etc. Please see this blog post for more information on variance.
  • Object property types are now invariant by default. New syntax allows explicit opt-in to enforced covariance: type T = {+covariantProp: string}. Please see this blog post for more information on variance.
  • Object method types are now covariant by default. So this: type T = {covariantMethod(): string} is the same as type T = {+covariantMethod: () => string}. Please see this blog post for more information on variance.

New features:

  • New empty type annotation. This is the "bottom type" which is the type that has no possible values. This is mostly useful for asserting impossible types right now (see the commit description for more details).
  • All server commands now have a --quiet flag to suppress server-status information that would otherwise be printed to stderr.
  • It's now possible to specify an "@jsx" pragma to override the implicit default of React.createElement. See the commit message for more details.
  • async iteration is now Stage 3, so Flow now supports async generators and for-await-of statements.

Notable bug fixes:

  • Calling get-def and autocomplete on specifiers in import statements now works properly and links in to where the specifier is exported in the other file.
  • Generator.prototype.return now returns a possibly-unfinished IteratorResult object rather than a definitely-done iterator result. See #2589 for more details.
  • Fixed an issue with inferring the proper return-type of iterators coming from a generator with multiple return-types. See #2475 for more details.
  • Fixed an issue where a non-polymorphic class-instance used as a CommonJS export wasn't omitting underscore-prefixed members when the munge_underscores config option is set to true.
  • Fixed an issue where Flow would previously not consider non-@flow files when re-calculating type dependencies on a change to the filesystem. This caused sporadic issues where Flow might think that a module is missing that actually is not! This is now fixed.

Misc:

  • Significant memory usage optimizations by normalizing common aspects of the many "reason" structures stored in memory to use ocaml variants.
  • Significant memory usage optimization by compressing the contents of the shared heap used by the persistent server.
  • Parser now allows for duplicate properties and accessors in objects per the latest ES spec.
  • Flow parser is now tested against esprima3 tests
  • yield expressions no longer evaluate to an optional type. This is unsound, but the inconvenience was so prevalent that we decided to relax the issue for now. See #2080 for more details.
  • Various core libdef updates.

Parser breaking changes:

  • Updated the parser to use the latest ExportNamedDeclaration and ExportDefaultDeclaration nodes from ESTree rather than the outdated ExportDeclaration node.
  • export default class {} now correctly emits a ClassDeclaration rather than ClassExpression per this estree issue.
  • Updated ExportSpecifier property names from id -> local and name -> exported per the latest ESTree spec.
  • Update ExportBatchSpecifier to a ExportNamespaceSpecifier node per the latest ESTree spec.
  • Renamed SpreadElementPattern -> RestElement per the latest ESTree spec.
  • Node-properties of ObjectPattern are now named Property and RestProperty per the latest ESTree spec.
  • Use a Super node now instead of an Identifier node per the latest ESTree spec.
  • {ImportNamedSpecifier and ImportDefaultSpecifier nodes now use proper local and remote property names, per the latest ESTree spec.
  • The mixed type annotation is now represented with a special MixedTypeAnnotation node (same as Babylon has been for a while).
  • The NullTypeAnnotation annotation node is now called NullLiteralTypeAnnotation in order to match Babylon.
flow - v0.33.0

Published by about 8 years ago

Likely to cause new Flow errors:

  • Its now an error to add mixed to number

New features:

  • suppress_comment now defaults to matching // $FlowFixMe if there are no suppress_comments listed in a .flowconfig
  • The Flow server no longer restarts itself when a package.json file is changed
  • The Flow server no longer restarts itself if a libdef file is touched, but not actually changed
  • Added support for using Iterables with Promise.all() (thanks @vkurchatkin!)

Notable bug fixes:

  • Fixed an issue where some predicates could cause Flow to crash
  • Fixed an issue where we weren't propertly looking things up on Function.prototype and Object.prototype
  • Fixed an issue where Flow could crash when extracting coverage on empty types
  • Fixed an issue where long paths that are ignored could give a bunch of warnings on Windows
  • Fixed an issue where flow get-def wouldn't hop to the location of a type coming through an import type
  • Fixed an issue with dictionary types where using an any-typed variable as a computed-property lookup results in the wrong property-value type
  • Fixed some issues where Flow wouldn't allow defininition of properties or methods called "static" on classes
  • Fixed an issue where Flow wouldn't permit throws at the toplevel of a module
  • Fixed an issue where adding a file to [libs] with an extension not listed in module.file_exts, it would previously be silently ignored
  • Fixed an issue where import * as on a declare module.exports: any; libdef would not result in a module with every possible named export
  • Fixed a parsing issue where "JSX attributes must only be assigned a non-empty expression" syntax errors sometimes point to the wrong line
  • Fixed parsing of setter methods with destructured parameters
  • Fixed a parsing issue where it wasn't possible to use get or set in object short notation
  • Fixed a parsing issue where we previously weren't allowing strings in async method names: x = { async 123() { await y; } }
  • Fixed an issue where the parser previously wouldn't recognize the u regex flag

Misc:

  • Various built-in libdef improvements
  • Various significant shared memory optimizations
  • When a package.json key is read by Flow during module resolution, don't wrap it in quotes
  • Added parser (but not yet typechecker) support for new.target
  • Added --pretty flag to all commands that have a --json flag
  • Flow now prints an exception instead of segfaulting if there is a heap overflow
  • Only print JSON for flow coverage when --json is passed (thanks @aackerman!)

Parser breaking changes:

  • Removed 'lexical' property from SwitchStatement
  • Removed guardedHandlers from TryStatement
  • Use AssignmentPattern for function param defaults to match ESTree
  • Use RestElement for function rest params to match ESTree
  • Fixed the location info for ExpressionStatement
  • Fixed the location info for CallExpression and MemberExpression
flow - v0.32.0

Published by about 8 years ago

Likely to cause new Flow errors:

  • If you check that an object obj has a property foo that Flow doesn't know about, Flow will now refine obj.foo to the type mixed. If you then try to use obj.foo in an unsafe way (like as a function), you might start seeing errors mentioning property foo of unknown type. The fix is to either fix the type of obj to include an optional property foo, or to rewrite code like obj.foo && obj.foo(x) to typeof obj.foo === "function" && obj.foo(x)
  • We've fixed the type of Array.prototype.find to reflect the fact that it can return undefined
  • We've tightened up the checking of tuple types

New Features:

  • New syntax for exact object types: use {| and |} instead of { and }. Where {x: string} contains at least the property x, {| x: string |} contains ONLY the property x.
  • Flow now watches for .css, .jpg, .png, .gif, .eot, .svg, .ttf, .woff, .woff2, .mp4 and .webm files (this list is not configurable at the moment). We call them resource files. If you require a resource file, you get a string (except for .css files, for which you get an Object). You should still be able to use module.name_mapper to map a resource file to a mock, if you prefer.
  • We're starting work on flow gen-flow-files, which consumes Flow code and outputs .flow files containing only the types exported. It's alpha-level and we're still iterating on it, so use at your own peril!

Notable bug fixes:

  • Fixed a bug where, if a module has a CommonJS export of type any, then the types it exported were also given type any
  • v0.31.0 contained a regression where arrays and promises required more annotations than they should. This is fixed.
  • Fixed use of tagged unions with intersections and generics.
  • Jump to definition for overridden methods was jumping to the wrong method. This is now fixed.
  • flow coverage had a non-termination bug. This is now fixed.

Misc:

  • Lots of improvements to the builtin libdefs! Thanks for all the pull requests!
flow - v0.31.0

Published by about 8 years ago

Likely to cause new Flow errors:

  • Fixed an issue where an any type could actually prevent errors from showing up in places that actually should surface errors
  • Array.isArray() now refines arrays to Array<mixed> instead of Array<any>

New Features:

  • When the munge_underscores option is set, Flow no longer requires annotations on exported classes with munged methods. (thanks @pvolok!)
  • Added a new "magic" type called $PropertyType<T, 'x'>. This utility extracts the type of the property 'x' off of the type T.
  • It is now possible to use leading-| and & on any type annotation, not just in type aliases

Notable bug fixes:

  • Signficant perf improvements on checking disjoint unions
  • Fixed an issue where flow start would sometimes hang on Windows
  • Fixed an issue where flow get-def on a react element would always point to the internal react libdef (rather than the component that defines the element)
  • Error messages for builtin types are now more descriptive in more scenarios
  • Fixed the order in which destructured function params were processed. This previously caused issues with variable references within the destructuring
  • Error messages for union type errors now point to more helpful locations in some cases
  • Fixed a long-standing confusing error message blaming property accesses on the "global object" (when the global object isn't actually involved at all)
  • Improved error message when trying to import a named export from a module that only has a default export
  • Fixed an issue where Promise.resolve(undefined) would not always error as it should
  • Fixed an issue where async functions that return void do not properly enforce their return type
  • Fixed an issue where aliased object types may not error when an invalid property is accessed on them
  • Fix flow coverage when reporting coverage on empty files
  • Printed types in some circumstances (autocomplete, type-at-pos, etc) are now capped on size to prevent overflows in tools that consume them. When the size overflows the cap, ... will be printed as an overflow placeholder
  • Various built-in libdef updates
flow - v0.30.0

Published by about 8 years ago

Likely to cause new Flow errors:

  • Fixed React.PureComponent's definition, so previously missed errors are now reported
  • The definition of console in the build-in libdef has been filled out and is no longer any.

New Features:

  • Forward references in type annotations: you can now reference a class in a type annotation before the class is declared
  • T is now covariant in Class<T>. So if class B extends class A, then Class<B> is now a subtype of Class<A>
  • Flow now lets you destructure objects with computed keys.
  • flow check-contents --respect-pragma - check-contents checks whatever you give it, regardless of @flow or @noflow. This option changes the behavior to respect the pragma.
  • flow check-contents will now report parsing errors too (thanks @nmote!)

Notable bug fixes:

  • Fixed --trace behavior when we unify types
  • Fixed situation where the client could spin-wait for the server
  • Fixed non-termination triggered by certain calls to Function.prototype.{apply,call}
  • Fixed issue where "Duplicate module provider" errors would stick around even after being fixed.
  • (Windows) Fixed how the flow client tails the flow server's logs
  • (Windows) Fixed the log rotating
  • (Windows) Fixed issues where Flow would report Process Handles instead of Process IDs, leading to bad messages and a non-functional flow stop
  • (Windows) Fixed build outside of a git or hg repository
  • (Windows) Better error messages when you have paths that are too long

Misc:

  • undefined is now just a global variable declared in the libdefs
  • Various built-in libdef improvements
  • Nifty PR from @nmn which teaches flow that nullableArr.filter(Boolean) is non-nullable
flow - v0.29.0

Published by over 8 years ago

New features:

  • Tagged unions of interfaces should now work in the same way that tagged unions of type aliases work.

Notable bug fixes:

  • Building Flow outside of a git or hg repo should work now
  • If you declare an overloaded function with one overload that handles a string argument and one overload that handles a number overload, then passing in a union string | number should now work.
  • Annotations for destructured patterns now work like non-destructured patterns. Types no longer flow through these annotations, rather they are checked against the annotations and then the annotations are used instead.
  • Allow import {type} from "Foo"
  • We had a bug where Flow wouldn't complain about duplicate haste modules. This is now fixed
  • Fix for edge case hit when using experimental.strict_type_args=false and type parameter upper bounds.

Misc:

  • Various built-in libdef improvements
  • Some error location fixes
  • Lots of Windows support work. Should build and mostly work, but not fully stable yet.
  • Some performance wins
  • flow check --json --profile now includes profiling info in the JSON response
flow - v0.28.0

Published by over 8 years ago

Likely to cause new Flow errors:

  • Significant fix to matching members of union types. This fix very likely surfaces typechecking issues that were missed before. Check out the blog post for more details
  • Variables in template literals are now subject to the same rules as variables being concatenated with a string using +. This may surface template strings with variables that may not safely coerce to a string.
  • Type arguments are now required to be specified for type annotations that have type arguments. Previously they were implicitly filled in as any -- but now this must be explicit. This behavior is toggleable via experimental.strict_type_args=false, but this config option will be removed in a near-term future release. There is also a codemod to help you automatically update old code.

New Features:

  • Support for declare export within declare module bodies. When declare export is used, the module being declared is inferred as an ES module. This enables the ability to export both named and default exports using declare module.

Notable bug fixes:

  • Fixed a bug on OSX where Flow might crash in rare circumstances
  • Fixed an issue where automatic semicolon insertion for class properties wasn't behaving properly in some circumstances.
  • It is no longer required to annotate a property on an exported class if an initializer value is present. Instead, the initializer value itself can be directly annotated. This makes annotation of class properties that are functions much less cumbersome.
  • Fixed a race-condition where Flow may not properly error when it encounters two modules with the same name (using the "haste" module system)

Misc:

  • Flow now looks for @flow in all comments at the top of the file (rather than just the first). It's also possible to configure this using a new max_header_tokens .flowconfig option.
  • Various built-in libdef improvements
  • Performance improvements for the flow coverage command
flow - v0.27.0

Published by over 8 years ago

Notable bug fixes:

  • Fixed a filesystem race condition where Flow would note that a directory exists just before it is deleted, then try to read the directory
  • Fixed some issues with disjoint unions that have complex definitions
  • Fixed an issue where functions that come after a return aren't analyzed (even though they are hoisted)
  • A few updates to the Node.js library definitions
  • Fixed a race condition when adding specific properties to dictionary types
  • Various performance improvements
  • --strip-root is now applied to the output of --verbose
  • Fixed an issue where duplicate method declarations weren't understood correctly
flow - v0.26.0

Published by over 8 years ago

Likely to cause new Flow errors:

  • Flow now understands stateless functional React components, which may reveal many errors if you use them heavily.

New Features:

  • Support for stateless functional React components!
  • Support for the exponentiation operator (**)
  • New flow ls command to list the files that Flow can see.

Notable bug fixes:

  • Fixed parsing of /x/* 5 */y/ - that's no comment!
  • Fixed parsing of newlines or comments at the end of a template literal.
  • Fixed an incremental bug where Flow didn't notice new JSON files in certain situations
  • Fixed a parsing service crash when a file appears and disappears suddenly.

Misc:

  • Restored a bunch of deprecated/experimental/browser-specific APIs to the builtin flowlib and made them optional
  • Fixed up parser tests and further integrated them into CI.
  • Lots of refactoring!
flow - v0.25.0

Published by over 8 years ago

Likely to cause new Flow errors:

  • @marudor made a tremendous effort to clean up the builtin flowlib definitions, adding missing things, fixing annotations, and removing non-standard and deprecated features. If you're relying on these things, then you may have new errors.

  • In the past, generic types could leave off the type arguments. Flow is moving towards making these required. Applying type arguments to a polymorphic type (e.g. Map<string, number>) is like calling a function. If writing my_function was the same thing as writing my_function(), it would be really difficult to pass functions as values. Similarly, by making type arguments required, it frees us up to do more with our polymorphic types. If you have a polymorphic type with default types, like type Foo<T = number>, you can now write Foo<> to apply 0 type arguments to the polymorphic type Foo.

    To ease migration, v0.25.0 still allows you to omit type arguments by default. v0.26.0 will start enforcing that type arguments are always supplied. To enable this behavior in v0.25.0, you can add experimental.strict_type_args=true to the .flowconfig.

New Features:

  • New flow ls command to list the files that Flow can see.
  • declare module.exports: type; <-- this is the new syntax to declare the CommonJS export type. Previously, you had to write declare var exports: type;. This can be used in .flow files and in declare module declarations.

Notable bug fixes:

  • fix parsing of /x/* 5 */y/ - that's no comment!

Misc:

  • Now Flow builds on OCaml 4.03.0
  • Fixed up the parser tests (thanks for the help @marudor!) and have started running those in CI
  • A ton of refactoring and clean up
flow -

Published by over 8 years ago

  • Fixed a bug where Flow might run out of memory in a repository with a lot of non-flow files
flow -

Published by over 8 years ago

  • Fixed a bug where autocomplete can show internal variable names for files that use destructuring
flow -

Published by over 8 years ago

New features:

  • Many common errors now have more contextual error messages. Check out the test file changes to see what this looks like!
  • If a <PROJECT_ROOT>/flow-typed/ directory exists, Flow will now assume it is a [libs] directory by default to help reduce the amount of out-of-the-box configuration that is necessary. (Thanks @splodingsocks!)
  • Support for specifying a default on a type parameter declaration. For example: type Iterator<Yield, Return=void, Next=void> = ....

Notable bug fixes:

  • Fixed the flow coverage command.
  • Fixed crashes when running type-at-pos and dump-types over destructuring.
  • Fixed a refinement bug when evaluating a method call on a refined variable in some cases.
  • Fixed an issue where some system commands could throw if Flow attempts to read a directory that it doesn't have permission to read.
  • Fixed a bug where the inferred return type of some functions that might return void could end up as exactly void (rather than a union of the possible return types).
  • Fixed a bug where the server would crash if a .json file is deleted after a server was already running.
  • Type applications that don't have the right number of type parameters (i.e. Map<number>) now emit a more clear error.
  • Lots of dom/bom improvements sent in from contributors! (big thanks to @marudor for lots of these!)

Misc:

  • Better locations for logical operator errors
  • Better error message sorting:
    • Sorts errors in .json files by name coalesced with .js files
    • Sorts all internal errors before parse errors before type/inference errors
    • Sorts lib file errors before source file errors
  • Perf improvements for some comparisons of polymorphic types
flow -

Published by over 8 years ago

  • Fixed parsing of JSON files with duplicate object keys
flow - v0.23.0

Published by gabelevi over 8 years ago

Likely to cause new Flow errors:

  • When you refine a mixed variable with typeof myVar === 'object', we used to refine the type of myVar to null | Object. Now it is refined to null | {[key: string]: mixed}. This means myVar.prop has the type mixed rather than any.
  • Removed non-standard Promise methods. Previous versions of Flow specified the type of Promise.prototype.done and Promise.cast, which are not standard or implemented in browsers. If you rely on a polyfill that does provide these methods, you can redeclare the Promise class in your project's local libs folder. Note that you need to copy the entire class declaration from lib/core.js in order to add methods and properties. It's not currently possible to extend the builtin declarations, but it is possible to redefine them.

New features:

  • Errors involving union or intersection types now include more information about why the various branches failed
  • flow init now has more command line flags to specify what should be in the created .flowconfig
  • flow ast now can parse JSON files
  • Comments are now supported in .flowconfig files. Lines starting with # or ; are ignored
  • In the [ignore] section of a .flowconfig you can now ignore a relative path with <PROJECT_ROOT>/path/to/ignored
  • Most flow commands have an --ignore-version flag to skip the version check specified in the .flowconfig.
  • Added a module.use_strict option to the .flowconfig. When it is true, Flow will treat every file as if it has the "use strict"; directive.
  • Using strict equality, you can now refine the number type into number literal types. (e.g. after x === 0 Flow now knows that x has the type 0)
  • Flow no longer requires return type annotations for exported functions if Flow can fully infer the type.
  • flow force-recheck FILE1 FILE2 command tells the flow server that FILE1 and FILE2 have changed and that it should recheck. This is intended for tooling that might be racing the file system notifications.
  • Flow is smarter about what !x evaluates to for various types of x.
  • <Foo /> is now allowed when Foo is a string. If $JSXIntrinsics is defined, Foo must be a subtype of $Keys<$JSXIntrinsics>
  • Support for class decorators in addition to property decorators (also gated behind the esproposal.decorators config option). Thanks @marudor!

Notable bug fixes:

  • Disallow (obj: SomeClass) except for when obj instanceof SomeClass
  • Fixed setting temp dir via the .flowconfig
  • Added missing all flag to the .flowconfig
  • Fixed a bug when destructuring a non-literal object type using a pattern with defaults
  • Fixed the --strip-root flag for displaying errors
  • Classes can now have properties named async
  • Fixed refinements like if (foo[0]) { ... }, which should work like if (foo["prop"]) { ... } does. That is, Flow should remember that foo[0] exists and is truthy.
  • Fixed parsing docblocks with CRLF line endings
  • Fixed autocomplete within if statements

Misc:

  • Added more info and structure to JSON output, without removing or existing fields
  • Loads of improvements to the builtin libraries
  • Bunch of perf improvements
  • Clarified some errors messages and error locations
  • flow start --json will start a server and output a JSON blob with info about the new server
  • Slowly improving tracking side effects in switch statements
  • Some improvements to pretty printing errors
  • Object.values() and Object.entries return Array<mixed> and Array<[string, mixed]> respectively, since Flow currently is never sure that it knows about every property in an object.
flow - v0.22.1

Published by jeffmo over 8 years ago

A patch release to fix some JSON parsing issues that went out in v0.22.0

flow - v0.22.0

Published by jeffmo over 8 years ago

Likely to cause new Flow errors:

  • Several updates to Flow's understanding of React's APIs. Some of these updates remove old/deprecated React APIs.

New features:

  • Flow now gives precedence to library definitions over non-@flow implementation files. This means that it should no longer be necessary to specify a node_modules dependency in the [ignore] section of your .flowconfig if you have a library definition defined for that dependency.
  • Significant improvements to Promise.all: We now preserve the type of each item in the array passed to Promise.all() so that it may be propagated through to the resulting .then() handler.
  • We no longer try to parse files that are not marked with an @flow pragma. We anticipate this will improve performance for projects with large, non-Flow node_modules directories.
  • Classes with static members are now subtype-compatible with structural object types
  • It is now possible to specify a leading | or & for type aliases of long unions/intersections. This is useful, as one example, for disjoint unions with a large number of members (where each member sits on a new line):
type MyDisjointUnion =
  | {type: 'TypeOne', ...}
  | {type: 'TypeTwo', ...}
  | {type: 'TypeThree', ...}
  ...
;

Bug fixes:

  • Fixed an issue where an intersection of two object types did not always properly combine to match objects with members on both sides (https://github.com/facebook/flow/issues/1327)
  • Fixed an issue where an object of some intersection type could not be used with the spread operator (https://github.com/facebook/flow/issues/1329)
  • Fixed an issue where refinement-testing on an object of an intersection type wouldn't always work (https://github.com/facebook/flow/issues/1366)
  • Fixed an issue where an intersection of function types with a common return type should type check against function types with union of param types
  • Fixed an issue where refining obj['abc'] didn't behave quite the same as refining obj.abc
  • Fixed an issue where usage of flow get-def on the left-hand side of a require() wouldn't hop through the require() and to the actual location of the definition
  • Fixed an issue where Flow would not give a clear error when trying to use import type to get a non-type export
  • Fixed an issue flow dump-types --json was not as robust as it could be against outputting valid JSON in the event of certain kinds of errors
  • Fixed an issue where Flow would not give a parse error if multiple ES exports with the same name are exported from a single ES module
  • declare class declarations now properly define a built-in name property (like real class declarations do)
flow - v0.21.0

Published by gabelevi over 8 years ago

Likely to cause new Flow errors:

  • ES6 react classes without state should now extends React.Component<DefaultProps, Props, void> (previously it was extends React.Component<DefaultProps, Props, {}>)
  • ES6 react classes with state should declare state: State;

New features:

  • Autocomplete for jsx properties
  • Typed JSX intrinsics. This means you can list which jsx intrinsics exist (like div, span, etc) and specify which properties they have.
  • Syntax for declaring variance at definition. For example, interface Generator<+Yield,+Return,-Next> {...}. Still pending transpiler support though.
  • Refining string and union types with string equality now properly refines the types.
  • Support for export * as from @leebyron's Stage1 proposal. Babel support here

Notable bug fixes:

  • Fixed bug with class expressions due to this type
  • Fixed autocomplete for this
  • Recognizes exhaustiveness in switch statements with default case.
  • Fixed "Did not expect BoundT" errors
  • Fixed infinite loop in certain recursive types
  • Fixed an incremental mode issue with deleted files
  • Fixed an incorrect refinement when assigning an object to a variable.

Misc:

  • Some internal errors now will be made user visibile instead of silently failing. They generally mean that Flow has some bug or is making an untrue assumption/assertion. If you see these please report them!
  • Improvements to how we report certain types (type application, optional types) via our APIs
  • Various sentinel improvements, including boolean sentinels
  • Various improvements to the buildin flow libraries (thanks everyone for the pull requests!)
flow - v0.20.1

Published by gabelevi almost 9 years ago

Bug fixes:

  • Ironed out some issues with the this type

Misc:

  • find package.json using normal parsing phase
flow - v0.20.0

Published by jeffmo almost 9 years ago

New features:

  • Initial support for a this return type for class methods
  • Big improvements on error messages for unions and intersections
  • import typeof * as now allows for concise access to the type of the ModuleNamespace object
  • Flow now understands how to require()/import a .json file

Bug fixes:

  • Fixed an issue where nested unions and intersections might not typecheck as expected
  • Fixed issue where declare type wouldn't work in a declare module that has an exports entry
  • Fixed an issue where the error formatter could fatal in some rare cases
  • Fixed a bug where Function.prototype.bind would lose the types of the params on the function it output
  • Fixed some variance bugs in the built-in Array.prototype library definitions
  • Fixed a bug where using a list that doesn't contain ".js" in module.file_ext would cause internal flow libs to be ignored
  • Fixed autocomplete to work better with general Function types
  • Fixed some issues with const refinement
  • Fixed various issues with export * from (it should work fully now)
  • Fixed a bug where Flow might crash when an export has a wildcard typeparam

Misc:

  • Some improvements to DOM and Node libdefs
  • Various error position relevancy improvements
  • Significantly improved general understanding of special functions like Function.prototype.{bind,call,apply}
  • Improved error messages for import statements where the remote exports don't exist (or may be typo'd)
  • Improvements to understanding of deferred initialization of let variables
  • flow get-def will now hop through lvalues in variable assignments for more fine-grained "hop-tracing" of a variable back to its definition
  • Objects with a callable signature can now be passed in to type positions that expect a function with a matching signature
  • Significant improvements to efficiency/perf when recalculating types based on a change to a file with an already-running Flow server