Skip to content

Commit

Permalink
v0.232.0
Browse files Browse the repository at this point in the history
Reviewed By: panagosg7

Differential Revision: D55372763

fbshipit-source-id: 1ff7258b4a47216b0fe1983f70b05a334d3cef05
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Mar 26, 2024
1 parent 13e0d2c commit ece9dff
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 9 deletions.
65 changes: 65 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
### 0.232.0

Likely to cause new Flow errors:

* Support for `$Compose` and `$ComposeReverse` types are removed. We recommend to use overloads to approximate their behavior instead. e.g.

```
declare export function compose(): <T>(a: T) => T;
declare export function compose<F: (...$ReadOnlyArray<empty>) => mixed>(
f: F,
): F;
declare export function compose<A, T: $ReadOnlyArray<any>, R>(
f1: (a: A) => R,
f2: (...T) => A,
): (...T) => R;
declare export function compose<A, B, T: $ReadOnlyArray<any>, R>(
f1: (b: B) => R,
f2: (a: A) => B,
f3: (...T) => A,
): (...T) => R;
declare export function compose<A, B, C, T: $ReadOnlyArray<any>, R>(
f1: (c: C) => R,
f2: (b: B) => C,
f3: (a: A) => B,
f4: (...T) => A,
): (...T) => R;
declare export function compose<R>(
f1: (b: any) => R,
...funcs: $ReadOnlyArray<(...$ReadOnlyArray<empty>) => mixed>
): (...$ReadOnlyArray<any>) => R;
declare export function compose<R>(
...funcs: $ReadOnlyArray<(...$ReadOnlyArray<empty>) => mixed>
): (...$ReadOnlyArray<any>) => R;
```

* You might see more errors around type application. [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+IFkolXpUCWewUEAwhCQgRDH8wEH4hMnwROHlsNnw4KHwwSLAAC3wANyo4LFxscWQuHgMNZmwsiRSAWglaY1cq-hIAa2wJXNpG4Vxcdvdu3v7B0RxKUYMhKDBSqmbWwIq3eagoOrKSKgH0wtMMPznY7d2SfcoBiEZ-aG5G3Ix085AF-ZhsRoRehqUEiNMgSQHlSruBZxJrMcJwMhzAC+-EgGiCLWMAAIAGLEAA8ABUAHxYgC8WOAWJgxGQWMJWKRAG4ADp+NZYgBCVCJpIpVMwlDpDOZbLZmOwXIwXSJ5KxiWSbD5uIJ3MovOJrKgbI0Syokts9ix8jp3JlmrZ8ixGBIUpl2BED1omqxAHpXVioBAsSZKBBKFj0liAAxWABMAGYAIxWYO8H3Uf2eiAAdzpCpSWPxAD9SQ6nWyYiB8iYSHBoEF8qHIzHgyAkUA)
* Fix subtyping of indexers in instances/interfaces. [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+IFkolXpUCWewUEAwhCQgRDH8wEH4hMnwROHlsNnw4KHwwSLAAC3wANyo4LFxscWQuHgMNZmwsiRSAWglaY1cq-hIAa2wJXNpG4Vxcdvdu3v7B0RxKUYMhKDBSqmbWwIq3eagoOrKSKgH0wtMMPznY7d2SfcoBiEZ-aG5G3Ix085AF-ZhsRoRehqUEiNMgSQHlSruBZxJrMcJwMhzAC+-EgGiCGiWVGwAAJbPYcfJkDj0oCuGBccAANr2UxQBAAXWJwhEMxxAB8cbT0ggkQBuAA6UHkOIwJBJfhM5MpNKkPKZOJZM35OIA9KqcQA5CAAdxxJkoECBMRA+RMJDg0CCEXsJhASKAA)

New Features:
* Updated the `isValid` Flow Enums method to use a type guard, allowing it to refine its input to the enum type in a conditional context.
E.g.

```
enum Status {Active, Off}
const s = "Active";
if (Status.isValid(s)) {
s as Status; // Should work
}
```

* `export type Foo = ...` and `export interface Bar {...}` statements are now allowed in `declare module` and `declare namespace` bodies.
* We added a new codemod `flow codemod remove-unnecessary-react-import` which can help remove unnecessary react imports under `react.runtime=automatic`

Notable bug fixes:
* Fixed issue when explicitly supplied JSX type arguments are ignored
* Fixed code action output of casting syntax when LHS of `as` or `as const` has low precedence

Library Definitions:
* Added definitions for the following APIs:
* `window.showOpenFilePicker()`: [MDN](https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker), [WICG](https://wicg.github.io/file-system-access/#api-showopenfilepicker)
* `window.showSaveFilePicker()`: [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker), [WICG](https://wicg.github.io/file-system-access/#api-showsavefilepicker)
* `window.showDirectoryPicker()`: [MDN](https://developer.mozilla.org/en-US/docs/Web/API/window/showDirectoryPicker), [WICG](https://wicg.github.io/file-system-access/#api-showdirectorypicker)
* `DataTransferItem.getAsFileSystemHandle()`: [MDN](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFileSystemHandle), [WICG](https://wicg.github.io/file-system-access/#dom-datatransferitem-getasfilesystemhandle)
* `StorageManager.getDirectory()`: [MDN](https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/getDirectory), [WHATWG](https://fs.spec.whatwg.org/#dom-storagemanager-getdirectory)

### 0.231.0

Likely to cause new Flow errors:
Expand Down
2 changes: 1 addition & 1 deletion flow_parser.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "flow_parser"
version: "0.231.0"
version: "0.232.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 flowtype.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "flowtype"
version: "0.231.0"
version: "0.232.0"
maintainer: "flow@fb.com"
authors: "Flow Team <flow@fb.com>"
license: "MIT"
Expand All @@ -15,7 +15,7 @@ depends: [
"core_kernel" {>= "v0.14.1" & <= "v0.16.0"}
"dtoa" {>= "0.3.2"}
"fileutils" {>= "0.6.3"}
"flow_parser" {= "0.231.0"}
"flow_parser" {= "0.232.0"}
"inotify" {os = "linux" & >= "2.4.1"}
"ounit2" {with-test}
"lwt" {>= "5.4.0"}
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-parser-bin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flow-parser-bin",
"version": "0.231.0",
"version": "0.232.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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flow-parser",
"version": "0.231.0",
"version": "0.232.0",
"description": "JavaScript parser written in OCaml. Produces ESTree AST",
"homepage": "https://flow.org",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-remove-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flow-remove-types",
"version": "2.231.0",
"version": "2.232.0",
"description": "Removes Flow type annotations from JavaScript files with speed and simplicity.",
"author": {
"name": "Flow Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/try-flow-website-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "try-flow-website-js",
"version": "0.231.0",
"version": "0.232.0",
"description": "An NPM package to hold compiled `flow.js` and libdefs for every Flow version.",
"license": "MIT",
"repository": "facebook/flow",
Expand Down
2 changes: 1 addition & 1 deletion src/common/flow_version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* LICENSE file in the root directory of this source tree.
*)

let version = "0.231.0"
let version = "0.232.0"
2 changes: 1 addition & 1 deletion website/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ npm install --save-dev flow-bin
"name": "my-flow-project",
"version": "1.0.0",
"devDependencies": {
"flow-bin": "^0.231.0"
"flow-bin": "^0.232.0"
},
"scripts": {
"flow": "flow"
Expand Down

0 comments on commit ece9dff

Please sign in to comment.