Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
v0.88.0
Reviewed By: dsainati1

Differential Revision: D13371572

fbshipit-source-id: 425c7a9c27045cc3ec8cd32c9f98b46f81c1c830
  • Loading branch information
nmote authored and nmote committed Dec 7, 2018
1 parent b831f5b commit 3836e9e
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 27 deletions.
28 changes: 28 additions & 0 deletions Changelog.md
@@ -1,3 +1,31 @@
### 0.88.0

Likely to cause new Flow errors:

* Made `Function` and `Object` types be aliases for `any`. They were always unsafe types, just like `any`, but they had peculiar behavior. This change revealed places where they were handled improperly within Flow, and ended up surfacing type errors that were previously missed.

New Features:

* Added the experimental Watchman lazy mode (`flow start --lazy-mode watchman`). This improves the lazy mode experience for repositories which use Mercurial and Watchman. We will document it more when/if it proves itself.
* Added `flow config check` which validates the `.flowconfig`.

Misc:

* Made miscellaneous improvements to the AST differ, which improves the output of global rename.
* Made `.flowconfig` parsing less strict (in particular, if the `--ignore-version` flag is passed, do not fatal on unrecognized config options).
* Performed a code cleanup in type normalization that caused some types in `type-at-pos` to be displayed differently.
* Removed redundant information in stored ASTs resulting in a modest reduction in memory usage.
* Flow assigns long string literals type `string`, rather than the singleton type of that literal. Now, this fact is surfaced in error messages.
* Fixed stack overflows:
* When checking a large number of files.
* When a large number of errors are present.

Libdefs:

* Added `React.Suspense`.
* Removed `React.useMutationEffect` hook.


### 0.87.0

Likely to cause new Flow errors:
Expand Down
2 changes: 1 addition & 1 deletion opam
@@ -1,6 +1,6 @@
opam-version: "1.2"
name: "flowtype"
version: "0.87.0"
version: "0.88.0"
maintainer: "flow@fb.com"
homepage: "https://flow.org"
dev-repo: "https://github.com/facebook/flow.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-parser-bin/package.json
@@ -1,6 +1,6 @@
{
"name": "flow-parser-bin",
"version": "0.87.0",
"version": "0.88.0",
"description": "The Flow JavaScript parser, via bindings to the native OCaml implementation",
"main": "index.js",
"repository": "https://github.com/facebook/flow.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "flow-parser",
"version": "0.87.0",
"version": "0.88.0",
"description": "JavaScript parser written in OCaml. Produces ESTree AST",
"homepage": "https://flow.org",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/common/flow_version.ml
Expand Up @@ -5,4 +5,4 @@
* LICENSE file in the root directory of this source tree.
*)

let version = "0.87.0"
let version = "0.88.0"
2 changes: 1 addition & 1 deletion src/parser/META
@@ -1,5 +1,5 @@
name="parser_flow"
version="0.87.0"
version="0.88.0"
requires = "sedlex wtf8"
description="flow parser ocamlfind package"
archive(byte)="parser_flow.cma"
Expand Down
2 changes: 1 addition & 1 deletion src/parser/opam
@@ -1,6 +1,6 @@
opam-version: "1.2"
name: "flow_parser"
version: "0.87.0"
version: "0.88.0"
maintainer: "flow@fb.com"
authors: ["Flow Team <flow@fb.com>"]
homepage: "https://github.com/facebook/flow/tree/master/src/parser"
Expand Down
4 changes: 2 additions & 2 deletions tests/config_check_version/config_check_version.exp
@@ -1,10 +1,10 @@
flow config check:
{
"flowVersion":"0.87.0",
"flowVersion":"0.88.0",
"exit":{
"code":8,
"reason":"Invalid_flowconfig",
"msg":"Wrong version of Flow. The config specifies version ^0.1 but this is version 0.87.0"
"msg":"Wrong version of Flow. The config specifies version ^0.1 but this is version 0.88.0"
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/config_invalid_option/config_invalid_option.exp
Expand Up @@ -28,7 +28,7 @@ flow config check:
"level":"warning"
}
],
"flowVersion":"0.87.0",
"flowVersion":"0.88.0",
"exit":{"code":8,"reason":"Invalid_flowconfig"}
}

Expand Down
24 changes: 12 additions & 12 deletions tests/json2_output/json2_output.exp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/json_exit/json_exit.exp
@@ -1,15 +1,15 @@
{"flowVersion":"0.87.0","exit":{"code":12,"reason":"Could_not_find_flowconfig","msg":"Could not find file or directory pants; canceling search for .flowconfig.\nSee \"flow init --help\" for more info"}}
{"flowVersion":"0.88.0","exit":{"code":12,"reason":"Could_not_find_flowconfig","msg":"Could not find file or directory pants; canceling search for .flowconfig.\nSee \"flow init --help\" for more info"}}
{
"flowVersion":"0.87.0",
"flowVersion":"0.88.0",
"exit":{
"code":12,
"reason":"Could_not_find_flowconfig",
"msg":"Could not find file or directory pants; canceling search for .flowconfig.\nSee \"flow init --help\" for more info"
}
}
{"flowVersion":"0.87.0","exit":{"code":64,"reason":"Commandline_usage_error","msg":"flow: --pants unknown option\nUsage: flow check [OPTION]... [ROOT]\n\nDoes a full Flow check and prints the results.\n\nFlow will search upward for a .flowconfig file, beginning at ROOT.\nROOT is assumed to be the current directory if unspecified.\n\n --all Typecheck all files, not just @flow\n --color Display terminal output in color. never, always, auto (default: auto)\n --debug Print debug info during typecheck\n --declaration Specify one or more patterns, comma separated, for files to treat as declarations\n --flowconfig-name Set the name of the flow configuration file. (default: .flowconfig)\n --from Specify who is calling this CLI command (used by logging)\n --help This list of options\n --ignore Specify one or more ignore patterns, comma separated\n --ignore-version Ignore the version constraint in .flowconfig\n --include Specify one or more include patterns, comma separated\n --include-suppressed Ignore any `suppress_comment` lines in .flowconfig\n --include-warnings Include warnings in the error output (warnings are excluded by default)\n --json Output results in JSON format\n --json-version The version of the JSON format (defaults to 1)\n --lib Specify one or more lib files/directories, comma separated\n --lints Specify one or more lint rules, comma separated\n --max-warnings Warnings above this number will cause a nonzero exit code (implies --include-warnings)\n --max-workers Maximum number of workers to create (capped by number of cores)\n --merge-timeout The maximum time in seconds to attempt to typecheck a file or cycle of files. 0 means no timeout (default: 100)\n --message-width Sets the width of messages but not code snippets (defaults to the smaller of 120 or the terminal width)\n --munge-underscore-members Treat any class member name with a leading underscore as private\n --no-flowlib Do not include embedded declarations\n --no-saved-state Do not load from a saved state even if one is available\n --one-line Escapes newlines so that each error prints on one line\n --pretty Pretty-print JSON output (implies --json)\n --profile Output profiling information\n --quiet Suppress output about server startup\n --saved-state-fetcher Which saved state fetcher Flow should use (none, local) (default: none)\n --saved-state-no-fallback If saved state fails to load, exit (normally fallback is to initialize from scratch)\n --sharedmemory-dep-table-pow The exponent for the size of the shared memory dependency table. The default is 17, implying a size of 2^17 bytes\n --sharedmemory-dirs Directory in which to store shared memory heap (default: /dev/shm/)\n --sharedmemory-hash-table-pow The exponent for the size of the shared memory hash table. The default is 19, implying a size of 2^19 bytes\n --sharedmemory-log-level The logging level for shared memory statistics. 0=none, 1=some\n --sharedmemory-minimum-available Flow will only use a filesystem for shared memory if it has at least these many bytes available (default: 536870912 - which is 512MB)\n --show-all-branches Print all branch errors (the default is to print the most relevant branches)\n --show-all-errors Print all errors (the default is to truncate after 50 errors)\n --strip-root Print paths without the root\n --temp-dir Directory in which to store temp files (default: FLOW_TEMP_DIR, or /tmp/flow/)\n --traces Outline an error path up to a specified level\n --unicode Display terminal output with unicode decoration. never, always, auto (default: auto)\n --untyped Specify one or more patterns, comma separated, for files to treat as untyped\n --verbose Print verbose info during typecheck\n --verbose-depth Recursively print types up to specified depth (default 1, implies --verbose)\n --verbose-flowlib Print verbose info while initializing the flowlib\n --verbose-indent Indent verbose info during typecheck (implies --verbose)\n --weak Typecheck with weak inference, assuming dynamic types by default"}}
{"flowVersion":"0.88.0","exit":{"code":64,"reason":"Commandline_usage_error","msg":"flow: --pants unknown option\nUsage: flow check [OPTION]... [ROOT]\n\nDoes a full Flow check and prints the results.\n\nFlow will search upward for a .flowconfig file, beginning at ROOT.\nROOT is assumed to be the current directory if unspecified.\n\n --all Typecheck all files, not just @flow\n --color Display terminal output in color. never, always, auto (default: auto)\n --debug Print debug info during typecheck\n --declaration Specify one or more patterns, comma separated, for files to treat as declarations\n --flowconfig-name Set the name of the flow configuration file. (default: .flowconfig)\n --from Specify who is calling this CLI command (used by logging)\n --help This list of options\n --ignore Specify one or more ignore patterns, comma separated\n --ignore-version Ignore the version constraint in .flowconfig\n --include Specify one or more include patterns, comma separated\n --include-suppressed Ignore any `suppress_comment` lines in .flowconfig\n --include-warnings Include warnings in the error output (warnings are excluded by default)\n --json Output results in JSON format\n --json-version The version of the JSON format (defaults to 1)\n --lib Specify one or more lib files/directories, comma separated\n --lints Specify one or more lint rules, comma separated\n --max-warnings Warnings above this number will cause a nonzero exit code (implies --include-warnings)\n --max-workers Maximum number of workers to create (capped by number of cores)\n --merge-timeout The maximum time in seconds to attempt to typecheck a file or cycle of files. 0 means no timeout (default: 100)\n --message-width Sets the width of messages but not code snippets (defaults to the smaller of 120 or the terminal width)\n --munge-underscore-members Treat any class member name with a leading underscore as private\n --no-flowlib Do not include embedded declarations\n --no-saved-state Do not load from a saved state even if one is available\n --one-line Escapes newlines so that each error prints on one line\n --pretty Pretty-print JSON output (implies --json)\n --profile Output profiling information\n --quiet Suppress output about server startup\n --saved-state-fetcher Which saved state fetcher Flow should use (none, local) (default: none)\n --saved-state-no-fallback If saved state fails to load, exit (normally fallback is to initialize from scratch)\n --sharedmemory-dep-table-pow The exponent for the size of the shared memory dependency table. The default is 17, implying a size of 2^17 bytes\n --sharedmemory-dirs Directory in which to store shared memory heap (default: /dev/shm/)\n --sharedmemory-hash-table-pow The exponent for the size of the shared memory hash table. The default is 19, implying a size of 2^19 bytes\n --sharedmemory-log-level The logging level for shared memory statistics. 0=none, 1=some\n --sharedmemory-minimum-available Flow will only use a filesystem for shared memory if it has at least these many bytes available (default: 536870912 - which is 512MB)\n --show-all-branches Print all branch errors (the default is to print the most relevant branches)\n --show-all-errors Print all errors (the default is to truncate after 50 errors)\n --strip-root Print paths without the root\n --temp-dir Directory in which to store temp files (default: FLOW_TEMP_DIR, or /tmp/flow/)\n --traces Outline an error path up to a specified level\n --unicode Display terminal output with unicode decoration. never, always, auto (default: auto)\n --untyped Specify one or more patterns, comma separated, for files to treat as untyped\n --verbose Print verbose info during typecheck\n --verbose-depth Recursively print types up to specified depth (default 1, implies --verbose)\n --verbose-flowlib Print verbose info while initializing the flowlib\n --verbose-indent Indent verbose info during typecheck (implies --verbose)\n --weak Typecheck with weak inference, assuming dynamic types by default"}}
{
"flowVersion":"0.87.0",
"flowVersion":"0.88.0",
"exit":{
"code":64,
"reason":"Commandline_usage_error",
Expand Down
2 changes: 1 addition & 1 deletion tests/version/version.exp
@@ -1 +1 @@
Wrong version of Flow. The config specifies version 0.1.0 but this is version 0.87.0
Wrong version of Flow. The config specifies version 0.1.0 but this is version 0.88.0
2 changes: 1 addition & 1 deletion website/en/docs/_install/setup-npm.md
Expand Up @@ -11,7 +11,7 @@ npm install --save-dev flow-bin
"name": "my-flow-project",
"version": "1.0.0",
"devDependencies": {
"flow-bin": "^0.87.0"
"flow-bin": "^0.88.0"
},
"scripts": {
"flow": "flow"
Expand Down

0 comments on commit 3836e9e

Please sign in to comment.