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.48.0

Published by flow-bot over 7 years ago

New Features:

  • Experimental support for "lazy" typechecking. On large codebases, the Flow
    server will start up faster when using the --lazy flag with flow start or
    flow server, by only computing dependency information and not doing any
    typechecking. Instead, as files are touched, they are typechecked
    incrementally along with files that depend on them (and their
    dependencies). Relatedly, running flow focus-check on a file will only check
    that file and files that depend on it (and their dependencies).

Notable bug fixes:

  • Fixed crash in flow.org/try when using JSX (which was a regression in 0.46)

Misc:

  • Libdef updates! Thanks everyone for the contributions!
  • Removed the libelf dependency from Flow. This helps a few systems, like the
    standard node docker, that doesn't have libelf available.
  • Removed the strip_root .flowconfig option, since it doesn't make sense as a
    project-specific option and complicated IDE integration. Clients (including
    IDEs) can still use the --strip-root CLI flag as needed.
  • Improvements to handling of Object.prototype
  • Improvements to handling promotion of primitives to objects
  • Lots of refactoring to improve stability of commands and the typechecker
flow - v0.47.0

Published by flow-bot over 7 years ago

Likely to cause new Flow errors:

  • We are now sealing the object type that is passed to a React component's props. This means Flow will start complaining if you try and access unknown React props.
  • Strict function call arity checking is now on for everyone! The 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:

  • There are a bunch of flow commands that will quickly try to check a single file, like autocomplete, get-def, check-contents, etc. We're trying to clean up what happens when these commands are given a file with @flow, @noflow, or no pragma. v0.47.0 contains a change intended to avoid doing extra work for files with @noflow or no pragma at all. v0.48.0 should continue to address this.

Misc:

  • Libdef updates! Thanks everyone for the contributions!
  • In a bunch of situations we're now propagating any types and continuing typechecking rather than stopping altogether.
  • Using a function as an object will now give that object a call property

Parser:

  • Optimized parsing of huge list of nested ternary expressions
  • The JS version of the parser now throws proper JS errors in the rare case that an OCaml exception is uncaught
flow - v0.46.0

Published by flow-bot over 7 years ago

Likely to cause new Flow errors:

  • We updated the type for the React.Component constructor, which means Flow
    can now infer the prop types based on the super(props) call in a react
    component constructor. This means components that weren't already declaring
    their prop types may start getting errors if there are any issues with their
    prop types.
  • We fixed the type of Promise.prototype.catch, which means code that uses
    .catch but wasn't properly handling the exceptional behavior might now have
    Flow errors

New Features:

  • We're updating how get-def (the jump to definition feature) works. It will now
    jump straight to the definition, even if it's in another file, rather than to the most recent assignment.
  • Starting in v0.47.0 we're going to complain when you call a function with more arguments than it expects. You can try it out in v0.46.0 with the .flowconfig option experimental.strict_call_arity=true. For more check out this blog post

Notable bug fixes:

  • Fixed a exponential blowup that could happen when using functions as callable objects
  • Fixed a bug where calling a function with a rest param wouldn't flow undefined to unfulfilled parameters.
  • Fixed a bug where declare class classes would be given a default constructor even if they extended another class

Misc:

  • Flow is faster! There are a bunch of perf wins in this release!
  • Lots of updates to library definitions! Thanks to all our contributors!
  • When using the Flow CLI, multiline errors will now show multiple lines of context
  • Replaced --no-suppressions with --include-suppressed which is a little bit more well-behaved.
  • Added --pretty flag to flow check for pretty-printed JSON

Parser:

  • Import expressions that appear in a statement list are now correctly parsed as import expressions (thanks @mikaelbr!)
  • Fixed the location of declare function declarations with predicates
  • Fixed the location of yield expressions with semicolons
  • Fixed the location of declare module declarations
  • Fixed a bug where array pattern with defaults like [a=1, b] = c was parsed like [a=(1, b)] = c.
flow -

Published by flow-bot over 7 years ago

New Features:

  • Flow now has proper unicode support in its parser! 🎉
  • Support for import expressions (Thanks deecewan!)
  • Introducing export type * from ..., an analogue of export * from ...

Notable bug fixes:

  • Fixed incremental checking bug when lib files are added or removed

Misc:

  • libdef and docs updates. Thanks for the PRs! Keep 'em coming!

Parser:

  • Unicode is finally supported! We've moved our lexer from ocamllex to sedlex, which supports unicode!
  • Fixed location of unary operator argument when surrounded by parens
  • Fixed a bug around using tagged templates expressions as call or member expressions
flow - v0.44.1

Published by flow-bot over 7 years ago

Notable bug fixes:

  • Fixed the definition for HTMLBRElement, which extended itself :(
flow - v0.44.0

Published by flow-bot over 7 years ago

New Features:

  • Another big perf win!

Notable bug fixes:

  • Internally, Flow wasn't always propagating the any type, which could suppress certain errors. We've fixed this, and Flow now notices some errors it was missing before

Misc:

  • Lots of libdef and docs PRs merged! Thanks to everyone for the help!
  • Minimum OCaml version is now 4.02
  • Partial support for object type spreads with generics
flow - v0.43.1

Published by gabelevi over 7 years ago

Features:

  • Big perf improvement!
flow - v0.43.0

Published by flow-bot over 7 years ago

Parser:

  • Fixed parser to disallow variance sigil for when using object spread.
  • Cleaned the flow-parser npm package of cruft. Thanks @zertosh!

Notable bug fixes:

  • Some internal refactoring helps Flow find some errors that it was previously missing.

Misc:

  • A ton of libdefs updates and documentation fixes. Thanks for all the PRs!
flow - v0.42.0

Published by flow-bot over 7 years ago

New Features:

  • Object type spread (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.
  • Experimental new 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:

  • Fixed a bug that would cause Flow's recheck to never terminate
  • Fixed a bug that where certain spread arguments caused non-termination

Parser:

  • Support for object type spreads.

Misc:

  • Lots of updates to the builtin flow libs! Many thanks to all our contributors!
  • Object types with dictionaries are now considered sealed (you cannot add new properties to them). This is a minor change, since you can still write to the dictionary.
  • We've relaxed the restriction that React.PropTypes.oneOf must take an array of literals. You can now put non-literal values in the array.
flow - v0.41.0

Published by jeffmo over 7 years ago

Notable bug fixes:

  • Lots of improvements to typing React components (which may uncover previously missed errors). This release primarily focused on these tweaks to React typing
  • Previously Flow did not track much about mixins from React.createClass components (including mixed in proptypes). This has been fix and may uncover new proptypes errors in createClass components
  • The internal React libdef for findDOMNode 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 codebase
  • Lots of updates to builtin flow libs
flow - v0.40.0

Published by flow-bot over 7 years ago

Notable bug fixes:

  • Fixed an edge case when moving .flow files around in a haste project
  • Fixed bug which allowed you to add extra properties to exact objects
  • Fixed pretty printing of methods in type-at-pos and gen-flow-files
  • Fixed the @jsx pragma support's handling of trimming whitespace and filtering empty children. It now matches the behavior of the babel transform
  • Fixed some merge_strict_job exceptions
  • Fixed bug where Flow would ask for annotations in the object passed to React.createClass() even when they were not needed.
  • Fix so now you can use this and super in class method parameter defaults.
  • Optimization around union types

Parser:

  • Fixed a bug where line comments in certain positions were parsed as block comments

Misc:

  • Lots of updates to the builtin flow libs! Many thanks to all our contributors!
  • Some tweaks to error messages to make them easier to understand.
  • We are NOT removing weak mode in this release. See the discussion on #3316
flow - v0.39.0

Published by flow-bot over 7 years ago

Likely to cause new Flow errors:

  • Previous usage of 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)
  • Several significant improvements to the locations Flow points to in error messages about objects and property accesses may move errors that were previously suppressed with a suppression comment to a new location

New Features:

  • You can now pass --no-suppressions to flow check in order to see what errors would show up in your codebase if you deleted all the error suppressions
  • New advanced debugging feature: You can now use the special $Flow$DebugPrint type to make Flow print a JSON representation of a type. Example usage: declare var flowDebug: $Flow$DebugPrint; flowDebug(someVariable);
  • Flow now supports constant-folding of tuple types. In general this means that Flow can now better understand rest elements and array-spreads when tuples are involved.
  • Flow now supports spreading types that are iterable (other than just Arrays)

Notable bug fixes:

Parser:

Misc:

  • A few improvements to error messages relating to React PropTypes
  • Various core libdef updates
flow - v0.38.0

Published by flow-bot almost 8 years ago

Likely to cause new Flow errors:

  • There are some error-position improvements in this release. This means that if you use // $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.
  • The behavior for tuples has changed to strictly enforce arity. This might cause errors depending on how you use tuples.
  • PR #3127 updated the libdef for 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.
  • Local find references command: 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.
  • New shorthand for importing types in the same declaration that imports values: import {someValue, type someType, typeof someOtherValue} from 'foo'
  • Autocomplete now works with exact object types (thanks @vkurchatkin!)
  • Tuple types have been revamped. They now strictly enforce arity (docs). This will enable a bunch of future features around spreads and rest parameters. Stay tuned!
  • $ReadOnlyArray<T> is the common supertype of arrays and tuples. It's basically an array without stuff like push(), pop(), etc
  • A lot of tweaks to error messages to make them easier to understand.
  • You can declare getters/setters in declare class, interface's, object types, etc. They're still not safely checked, though.
  • Set emoji=true in the .flowconfig options and flow status will put emoji in the connection status messages (thanks @zertosh!)

Notable bug fixes:

  • You can now use template strings with require(), (e.g. require(`foo`))
  • Object.keys no longer returns methods since they are not enumerable
  • We've relaxed sentinel checks to allow you to check unknown properties. This is consistent with other conditionals
  • Flow recognizes type mismatches between the LHS and RHS of a sentinel check as always failing
  • Flow recognizes null and undefined checks as sentinel checks too
  • Flow used to assume that an array literal with a single element of type T had the type Array<T>. Now it's Array<*>, which lets you add elements of other types to the array.
  • Fixed $Shape to ignore "shadow properties", which are properties that don't really exist, but which have been referenced somewhere.
  • A few recheck bug fixes. The optimization from 0.37.0 wasn't properly rechecking when property variance changed, when certain locations changed, or when certain files are renamed.
  • Fixed mistake where computed getters and setters weren't erroring with unsafe.enable_getters_and_setters=false

Misc:

  • Lots of updates to the builtin flow libs! Many thanks to all our contributors!
  • make no longer complains if js_of_ocaml is not installed
  • flow check --profile now includes CPU time
  • flow server --profile and flow start --profile now print profiling info to the logs
  • Some optimizations for huge dependency cycles.
  • tests/ which run a flow server now save the .log file when they fail
  • Many tests now run with --no-flowlib, which make them much faster

Parser:

  • Parsing support for object spread properties
  • Fixed kind of a static method named constructor to be "method" rather than "constructor"
  • Support for new import type shorthand
  • OCaml AST for getters and setters is a little cleaner now
  • We now support defaults in setters
  • The bug fix for trailing commas in array lists was accidentally reverted and has been re-committed.
flow -

Published by flow-bot almost 8 years ago

flow - v0.37.3

Published by flow-bot almost 8 years ago

Notable bug fixes:

  • 1 more server recheck fix... Third time's a charm!
flow - v0.37.2

Published by flow-bot almost 8 years ago

Notable bug fixes:

  • Fix more issues in the server with rechecking changed files
flow - v0.37.1

Published by flow-bot almost 8 years ago

Notable bug fixes:

  • Fixed an issue in /try where Flow was using an ocaml regex API that couldn't compile to JS
  • Fixed an issue where a changed "literal" type in a module signature wouldn't cause the Flow server to recheck
  • Fixed an issue where an update of a module in a cycle may not properly recheck all of its dependencies in the Flow server
flow - v0.37.0

Published by flow-bot almost 8 years ago

Likely to cause new Flow errors:

  • There are some error-position improvements in this release, which means that if you use // $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:

  • LOTS of built-in libdef updates.
  • It's now possible to use import type/import typeof inside the body of a declare module to import types between libdefs.

Notable bug fixes:

  • Fixed an issue where dictionary types couldn't flow into a covariant-compatible version of themselves.
  • Fixed an issue where previously any + number would yield number. Now it correctly yields any.
  • Don't try to read from the filesystem at all when using flow check-contents where input is provided via stdin.

Misc:

  • The --old-output-format CLI flag is now gone.
  • Performance optimization that allows us to skip re-checking any recursive dependencies of a changed file when the file's types haven't changed
  • Improved error positions on property assignment type errors.
  • The 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.
  • Things typed as "callable objects" now inherit from Function.prototype rather than Object.prototype.
flow - v0.36.0

Published by flow-bot almost 8 years ago

Likely to cause new Flow errors:

  • We've been working on improving error messages, which often involves moving the errors closer to where the error is likely triggered. If you use error suppressing comments, some of your comments now appear unused, since the error moved.

New Features:

  • Lots of small improvements to error messages
  • flow ls --all will output libs and ignored files too
  • flow ls --explain will explain why Flow cares or doesn't care about a file
  • flow ls dirA/ dirB file.js will only list files under dirA/, files under dirB/, and file.js

Notable bug fixes:

  • Calling a method through computed properties (obj['method']()) is now supported
  • The client no longer consumes retries and waits patiently when the server is busy garbage collecting
  • Errors in lib files with --strip-root set now show context again

Misc:

  • Currently 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.
  • Better error messages for unsupported destructuring.
  • Builtin libdef improvements
  • Fixed a TDZ issue which would allow let x = x;

Parser:

  • Fixed a bug where [...rest, 123] was incorrectly parsed
flow - v0.35.0

Published by flow-bot almost 8 years ago

Likely to cause new Flow errors:

  • Flow now knows that calling 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:

  • Better error messages in a bunch of situations
  • flowtype.org/try now has an AST tab that shows the parsed AST of the example

Notable bug fixes:

  • Bindings that come from imports are now treated as const
  • Found and fixed a few situations where Flow was emitting redundant errors
  • Some if statement refinements were sticking around after the if statement in some situations when they should not have.

Misc:

  • Various libdef fixes and improvements
  • Various docs fixes and improvements
  • If foo has the typed mixed, we now allow foo.bar if you check that foo is not null or undefined.

Parser:

  • Better error message if you try to make a class property optional (currently unsupported)
  • Dropped support for let statements, which never made it into the spec (thanks @andreypopp)