Skip to content

Commit 14bc972

Browse files
Alex Taylor (alta)facebook-github-bot
Alex Taylor (alta)
authored andcommitted
v0.246.0
Summary: happyflow Reviewed By: gkz Differential Revision: D62649129 fbshipit-source-id: 09f9b5d50382938f5981c8371ec6915ecb70bb6b
1 parent 2aa45a5 commit 14bc972

File tree

9 files changed

+36
-9
lines changed

9 files changed

+36
-9
lines changed

Diff for: Changelog.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
### 0.246.0
2+
3+
Likely to cause new Flow errors:
4+
* Support for $ObjMap has been completely removed. This change means that:
5+
* `$ObjMap` will resolve to a user-defined `$ObjMap` global if it's available in your libdef. You can use `type $ObjMap<O, F> = {[K in keyof O]: $Call<F, O[K]>}` to get most of the same behavior, except that in the mapped type version `O[K]` will include void for optional props. Please note that this should be considered as a permanent shim, because we intend to eventually remove `$Call`.
6+
* `flow codemod key-mirror` command was removed, since this codemod tries to convert `$ObjMap` to `$KeyMirror`
7+
* `deprecated-type-objmap` lint was removed.
8+
* Component syntax components without ref prop will have `void` as the instance, so `React.ElementRef<component>` of such component will return void.
9+
10+
New Features:
11+
* Mapped types now support array and tuple types in the form of `{[K in keyof <array or tuple type>: <mapped type>}`.
12+
* With this support, we intend to deprecate $TupleMap in the next release and remove the support for $TupleMap eventually
13+
* You can now refine against variables and member expressions with a literal type, not just literal themselves.
14+
15+
Notable bug fixes:
16+
* Flow now only reports one error when two disjoint large enum-like unions are compared ([example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SQAOlANE8qNgAASAnn4ZA84G0ADc7PZMAeyjg0B5C3sAEYABQASh5wHZPO18tWPIAKoqeQBeHkAcgwirNPIAPua0FbbeawFbxVAdbrjAaAEwm80Yb3Wu1mtCBp0hgDMZrdWp1+GFJANRowif13tFPIA9JmeQAhTQQFjy2q0nmUtjyiA8lgSISUd0RnkmSiFxOLHlQCAAdx5cAkPK7cGOPIGtB5OBHX1j2vjKZ9CaTGezeYLRYkJcT5cr1d2dYbTeorZ57c7Pb7A6HuEng3HvOg2HZ9PZuRADRMJFlUCSDQADFZvQALAArFYiogPSQA)).
17+
18+
IDE:
19+
* Code actions on component syntax components will produce smaller targeted edits, rather than reprint the entire component.
20+
* Deprecated utility type like $Call are no longer suggested in autocomplete.
21+
* Flow will now provide a quick fix when the spread prop of a component with component syntax redefines some already defined props.
22+
23+
Library Definitions:
24+
* `React.Ref` is marked as deprecated. Use `React.RefSetter` instead for ref props, and `React.RefObject` for returns of `useRef`.
25+
* `React.RefSetter` now includes null and void.
26+
* `Promise.all` and `Promise.allSettled` have been updated to use mapped type instead of `$TupleMap`. The requirement on the type arguments are slightly changed.
27+
128
### 0.245.2
229

330
Misc:

Diff for: flow_parser.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "flow_parser"
3-
version: "0.245.2"
3+
version: "0.246.0"
44
maintainer: "[email protected]"
55
authors: ["Flow Team <[email protected]>"]
66
homepage: "https://github.com/facebook/flow/tree/master/src/parser"

Diff for: flowtype.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "flowtype"
3-
version: "0.245.2"
3+
version: "0.246.0"
44
maintainer: "[email protected]"
55
authors: "Flow Team <[email protected]>"
66
license: "MIT"
@@ -15,7 +15,7 @@ depends: [
1515
"camlp-streams" {>= "5.0.1"}
1616
"dtoa" {>= "0.3.2"}
1717
"fileutils" {>= "0.6.4"}
18-
"flow_parser" {= "0.245.2"}
18+
"flow_parser" {= "0.246.0"}
1919
"inotify" {os = "linux" & >= "2.4.1"}
2020
"ounit2" {with-test}
2121
"lwt" {>= "5.7.0"}

Diff for: packages/flow-parser-bin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-parser-bin",
3-
"version": "0.245.2",
3+
"version": "0.246.0",
44
"description": "The Flow JavaScript parser, via bindings to the native OCaml implementation",
55
"main": "index.js",
66
"repository": "https://github.com/facebook/flow.git",

Diff for: packages/flow-parser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-parser",
3-
"version": "0.245.2",
3+
"version": "0.246.0",
44
"description": "JavaScript parser written in OCaml. Produces ESTree AST",
55
"homepage": "https://flow.org",
66
"license": "MIT",

Diff for: packages/flow-remove-types/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-remove-types",
3-
"version": "2.245.2",
3+
"version": "2.246.0",
44
"description": "Removes Flow type annotations from JavaScript files with speed and simplicity.",
55
"author": {
66
"name": "Flow Team",

Diff for: packages/try-flow-website-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "try-flow-website-js",
3-
"version": "0.245.2",
3+
"version": "0.246.0",
44
"description": "An NPM package to hold compiled `flow.js` and libdefs for every Flow version.",
55
"license": "MIT",
66
"repository": "facebook/flow",

Diff for: src/common/flow_version.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* LICENSE file in the root directory of this source tree.
66
*)
77

8-
let version = "0.245.2"
8+
let version = "0.246.0"

Diff for: website/docs/install.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ npm install --save-dev flow-bin
126126
"name": "my-flow-project",
127127
"version": "1.0.0",
128128
"devDependencies": {
129-
"flow-bin": "^0.245.2"
129+
"flow-bin": "^0.246.0"
130130
},
131131
"scripts": {
132132
"flow": "flow"

0 commit comments

Comments
 (0)