Skip to content

Commit

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

Differential Revision: D64213524

fbshipit-source-id: 5f73061e934087703f96c427cfd8344613a014ad
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Oct 11, 2024
1 parent 13a349f commit e89cda4
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 9 deletions.
32 changes: 32 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
### 0.248.0

Breaking changes:
* Support for long deprecated predicate function (`%checks`) is removed. It will still parse, but all of them will error with unsupported-syntax, and `%checks` will be completely ignored for type checking purpose as if it doesn't exist.
* `$TupleMap` support is now removed. `$TupleMap` will now resolve to the global definition is there is one, or it will fail and the type becomes any.

Likely to cause new Flow errors:
* Support for the unsound `$TEMPORARY$*` types is dropped. If your codebase happens to have any of these types, you can replace them with there sound and well-documented equivalents:
- Replace `$TEMPORARY$object<{props}>` with `$ReadOnly<{props}>` or `{props}`
- Replace `$TEMPORARY$array<T>` with `$ReadOnlyArray<T>` or `Array<T>`
- Replace `$TEMPORARY$number<42>` with `number` or `'42'`
- Replace `$TEMPORARY$string<"foo">` with `string` or `"foo"`
- We have provided a flow-runner codemod via the `flow-upgrade` package to aid larger codebases with this conversion: `yarn run flow-codemod replaceTemporaryTypes path/to/src`.
* The inferred type for `Object.freeze({ A: 'a', B: 'b' })` is now `{+A:'a',+B:'b'}` both locally within a file and when the object is being exported. This replaces an earlier unsound behavior where the type of A would opportunistically behaved either as `string` or `'a'` depending on the context where it appeared.
* [React string refs](https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs) are now banned.
* `contextTypes` and `childContextTypes` in react class components are now empty typed, so declaring [legacy context](https://legacy.reactjs.org/docs/legacy-context.html) in React will be an error.
* Component syntax component and component types' ref prop now must have `React.RefSetter<...>` type.

Parser:
* Component type in parentheses can now be correctly parsed. e.g. `type Foo = (component(x: number) renders Bar);`
* Trailing comma is now allowed after rest parameter in component syntax components and component types.
* The v regex flag is now supported.

IDE:
* We now provide a code action to stub out a react component, at the location of an unbound JSX identifier.
* Component declaration/type without renders clause will no longer show `renders React.Node` on hover.
* Hovering on components will now consistently show its props and renders information. Previously, the information is omitted for component declarations.
* If we see `: renders <annot>` at the position that expects a render declaration, the quickfix will suggest removing `:` instead of replacing `:` with `renders`.

Library Definitions:
* Added type for `util.stripVTControlCharacters` for NodeJS.

### 0.247.1

Misc:
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.247.1"
version: "0.248.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.247.1"
version: "0.248.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.247.1"}
"flow_parser" {= "0.248.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.247.1",
"version": "0.248.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.247.1",
"version": "0.248.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.247.1",
"version": "2.248.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.247.1",
"version": "0.248.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.247.1"
let version = "0.248.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.247.1"
"flow-bin": "^0.248.0"
},
"scripts": {
"flow": "flow"
Expand Down

0 comments on commit e89cda4

Please sign in to comment.