diff --git a/Changelog.md b/Changelog.md index cbd6ca0b230..d46c634b9a3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,33 @@ +### 0.247.0 + +Breaking changes: +* Support for the deprecated `$Call` type is removed. `$Call` will now resolve to whatever `$Call` points to in the global libdef. If you need more time to migrate, you can create a shim like `$Call = $TupleMap<[T], F>[0]`, but please note that we intend to remove support for `$TupleMap` eventually. +* `deprecated-type-dollar-call` lint is removed, since the support for `$Call` is removed. +* `react.disable_function_components_default_props` config option is removed. It is on by default since v0.238. + +Likely to cause new Flow errors: +* `$TupleMap` is deprecated and will be soon removed, now that mapped type works on array inputs. Existing `$TupleMap` will still work in this release, but every use will trigger a `deprecated-type` lint that is on by default. +* Flow now performs literal subtyping checks for strict equality conditions in non-refinement contexts. [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SQ0Tyo2AABLZ7JyYMRkJyAOT8iBCgDcAB1YMROQBeBXCzCUCWcgD0as5JkoEEonKgEAA7tLciAGiYSHBoEkMvYTCB6UA) +* Fixed destructuring with invalid literal defaults. The following now errors properly: [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SRgD2UcGgAAIYAAKYBQZzYLkAXi5AHJ5FLxfTkFyBUK5eKYMRxVyAD4SzCUGUASnlAB0oPTciAGiYSJyoEkMvYTCB6UA) +* Using string ref on components that are definitely not a class component is now an error. [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SRgD2UcGgAAIAGLEAAUAEoucB6QAdKASgA8fIgXJYMAAvGKQBAhHUVVyAPQAPgA3NqtVzZg1OflBlyIFteFyoBAAO5ckyUCC3fgNEwkTlQJIZewmED0oA) +* React utility types will no longer incorrectly accept hook types when they expect component types. e.g. `type A = React$ElementConfig void>;` will now error. + +New Features: +* Refinements against negated bigint literals should now work. + +Notable bug fixes: +* Mapped type on generic arrays is now supported. Previously it will fail with array is not an object error. +* `flow-remove-types` now correctly handles `as` cast with generics. + +IDE: +* On hover, values that have `React.AbstractComponent` type will be shown in the [component type](https://flow.org/en/docs/react/component-types/) syntax +* Flow now offers a code action to insert inferred render type when you hover on the name of the component. +* Flow now provides keyword completion for component type, hook types and render types. + +Library Definitions: +* Overly restrictive typing of queueMicrotask is now fixed. + + ### 0.246.0 Likely to cause new Flow errors: diff --git a/flow_parser.opam b/flow_parser.opam index b0695455e67..6c59ffd3b93 100644 --- a/flow_parser.opam +++ b/flow_parser.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "flow_parser" -version: "0.246.0" +version: "0.247.0" maintainer: "flow@fb.com" authors: ["Flow Team "] homepage: "https://github.com/facebook/flow/tree/master/src/parser" diff --git a/flowtype.opam b/flowtype.opam index 566fa75826a..a13404fa691 100644 --- a/flowtype.opam +++ b/flowtype.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "flowtype" -version: "0.246.0" +version: "0.247.0" maintainer: "flow@fb.com" authors: "Flow Team " license: "MIT" @@ -15,7 +15,7 @@ depends: [ "camlp-streams" {>= "5.0.1"} "dtoa" {>= "0.3.2"} "fileutils" {>= "0.6.4"} - "flow_parser" {= "0.246.0"} + "flow_parser" {= "0.247.0"} "inotify" {os = "linux" & >= "2.4.1"} "ounit2" {with-test} "lwt" {>= "5.7.0"} diff --git a/packages/flow-parser-bin/package.json b/packages/flow-parser-bin/package.json index 76f2a9f844f..044081dad95 100644 --- a/packages/flow-parser-bin/package.json +++ b/packages/flow-parser-bin/package.json @@ -1,6 +1,6 @@ { "name": "flow-parser-bin", - "version": "0.246.0", + "version": "0.247.0", "description": "The Flow JavaScript parser, via bindings to the native OCaml implementation", "main": "index.js", "repository": "https://github.com/facebook/flow.git", diff --git a/packages/flow-parser/package.json b/packages/flow-parser/package.json index 05342ba62db..3f325ec57f9 100644 --- a/packages/flow-parser/package.json +++ b/packages/flow-parser/package.json @@ -1,6 +1,6 @@ { "name": "flow-parser", - "version": "0.246.0", + "version": "0.247.0", "description": "JavaScript parser written in OCaml. Produces ESTree AST", "homepage": "https://flow.org", "license": "MIT", diff --git a/packages/flow-remove-types/package.json b/packages/flow-remove-types/package.json index 09c0647e469..62c954a092e 100644 --- a/packages/flow-remove-types/package.json +++ b/packages/flow-remove-types/package.json @@ -1,6 +1,6 @@ { "name": "flow-remove-types", - "version": "2.246.0", + "version": "2.247.0", "description": "Removes Flow type annotations from JavaScript files with speed and simplicity.", "author": { "name": "Flow Team", diff --git a/packages/try-flow-website-js/package.json b/packages/try-flow-website-js/package.json index fd61cfc78db..09ce97deb9c 100644 --- a/packages/try-flow-website-js/package.json +++ b/packages/try-flow-website-js/package.json @@ -1,6 +1,6 @@ { "name": "try-flow-website-js", - "version": "0.246.0", + "version": "0.247.0", "description": "An NPM package to hold compiled `flow.js` and libdefs for every Flow version.", "license": "MIT", "repository": "facebook/flow", diff --git a/src/common/flow_version.ml b/src/common/flow_version.ml index cf6e9df1b0a..8500c27ed6e 100644 --- a/src/common/flow_version.ml +++ b/src/common/flow_version.ml @@ -5,4 +5,4 @@ * LICENSE file in the root directory of this source tree. *) -let version = "0.246.0" +let version = "0.247.0" diff --git a/website/docs/install.md b/website/docs/install.md index a5a42491ad3..d1b9e240382 100644 --- a/website/docs/install.md +++ b/website/docs/install.md @@ -126,7 +126,7 @@ npm install --save-dev flow-bin "name": "my-flow-project", "version": "1.0.0", "devDependencies": { - "flow-bin": "^0.246.0" + "flow-bin": "^0.247.0" }, "scripts": { "flow": "flow"