Skip to content

Commit

Permalink
v0.242.0
Browse files Browse the repository at this point in the history
Reviewed By: alexmckenley

Differential Revision:
D60295113

------------------------------------------------------------------------
(from 2a2cbd7ae17f3f5c95c13fd218d0dd78385b5a07)

fbshipit-source-id: c3dd7ca6f0c9b9cb9bd6bfc068e2109b8572f53e
  • Loading branch information
jbrown215 authored and facebook-github-bot committed Jul 29, 2024
1 parent 9714fc4 commit 9e7df12
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 9 deletions.
26 changes: 26 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
### 0.242.0

Likely to cause new Flow errors:
* Support for special function type `$Flow$DebugPrint` was removed. To see the internal representation of type, use the `flow type-at-pos` command with flag `--debug-print-internal-repr`. Note that this is for debugging purpose only, and you should never depend on the output of `--debug-print-internal-repr`
* More invalid compare errors will be consistently caught when using `==` and `!=`.
* `invalid-render` errors can no longer be suppressed without specific error code.
* Flow can now detect more bad cyclic types, including across module boundaries. [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SRWxgABABhWhPbIAdTgElqABIAGrcGQkdkAXnZwAAOlB2ezICJvBJkOz7KYoAheIrlQBtHa0TXaioIAC6mrFEvaAB5ubywAKhbbcJKAHy8dkAel97MwbBVPNw2XZbNk7KgEAA7irgYHsOyNAtlKVFfSANyKxUaJ5UZO2ezspq4G3ij0Op1hl2CkWVr05qD53CFlXQEskM1SC3NgAUwHZhpI1tL3HZ9IAlOyMFKa-z6+7JVm-QGTJQILd+A0TCQ4NAkhl7CYQPSgA)
* You may see some errors moved around when `$Exact<...>` is involved. Some invalid `$Exact<...>` type will now have `not-an-object` error code.
* Fixed a bug that makes some exported types accidentally any. Previously hidden errors might be exposed.

New Features:
* `declare namespace` support is enabled by default.
* Added "Add Missing Attributes" quickfix for JSX. This is available when the cursor is over the name of a JSX element that is missing a required attribute.
* Added a `StringSuffix` type, which goes along with the recently added `StringPrefix` type. `StringSuffix` can be used to type strings with a specified suffix. E.g. `StringSuffix<'!'>` allows for `'yay!'` and `'woo!'`. The type argument for the suffix must be a string literal. The second, optional, type argument can be used for the type of the remainder of the string after the suffix is removed.

Notable bug fixes:
* Fix a bug that caused Flow to infer incorrect render types for elements of polymorphic components under niche circumstances

IDE:
* Flow now supports symlinked node_modules in autoimports better. If allowed by the node resolution algorithm, autoimport will insert import specifier like `my-package` or `my-package/foo` instead of a relative path import.

Library Definitions:
* CredMgmtCredentialRequestOptions properties are now optional
* `Reflect.setPrototypeof` are no longer special-cased, and the backing special type `Object$SetPrototypeOf` is removed. The new typing is intentionally loose. Similar to `Object.setPrototypeof`, this is inherently unsafe since Flow won't track prototype mutations.
* `Object.assign` is still special cased, but the special-casing is only available for a syntactic `Object.assign(...)` call. If you try to use Object.assign in some other ways (e.g. `const f = Object.assign; f(...)`), you will get a a less precise and accurate typing for it. If you don't like the default fallback type, you can override the `Object$Assign` type. While the special-casing behavior will stay for the syntactic call, you should migrate your code to use the spread syntax instead.

### 0.241.0

No changes from 0.240.0
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.241.0"
version: "0.242.0"
maintainer: "[email protected]"
authors: ["Flow Team <[email protected]>"]
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.241.0"
version: "0.242.0"
maintainer: "[email protected]"
authors: "Flow Team <[email protected]>"
license: "MIT"
Expand All @@ -15,7 +15,7 @@ depends: [
"camlp-streams" {>= "5.0.1"}
"dtoa" {>= "0.3.2"}
"fileutils" {>= "0.6.4"}
"flow_parser" {= "0.241.0"}
"flow_parser" {= "0.242.0"}
"inotify" {os = "linux" & >= "2.4.1"}
"ounit2" {with-test}
"lwt" {>= "5.7.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.241.0",
"version": "0.242.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.241.0",
"version": "0.242.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.241.0",
"version": "2.242.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.241.0",
"version": "0.242.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.241.0"
let version = "0.242.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.241.0"
"flow-bin": "^0.242.0"
},
"scripts": {
"flow": "flow"
Expand Down

0 comments on commit 9e7df12

Please sign in to comment.