Releases: facebook/flow
Releases · facebook/flow
Release list
v0.331.0
Likely to cause new Flow errors:
- Fixed unsound subtyping of instances against indexer in interfaces (example).
- Flow will no longer emit
method-unbindingerrors and instead perform stricter this-type checking (example).
IDE:
- Improve the primary type displayed by hover
- Show a single type in
type-at-posand hover - Truncate oversized hover types and their reference lists
Library Definitions:
React.ReactElementnow matches latest type in@types/react. Added missingReact.JSX.Elementthat makes the type in@types/react.
v0.330.0
Likely to cause new Flow errors:
- Flow will now restrict the allowed syntax forms of
.call/apply/bindcalls. Only expressions of the form<expr>.m.call(<expr>, ...),<expr>.m.apply(<expr>, ...)and<expr>.m.bind(<expr>, ...)are allowed. [untyped]section of flowconfig will use the glob system. See https://flow.org/en/docs/config/untyped/
Notable bug fixes:
v0.329.0
Likely to cause new Flow errors:
- More subtyping errors will print the types that are incompatible. Some errors might have new locations.
- A
unique symbolannotation is now an error unless it is the type of aconstvariable, of areadonlyobject type or interface property, or of astatic readonlyclass field. - Flow will error on legacy variance syntax in library definition files
New Features:
- We have released
flow-parserandflow-eslintpackages that are drop-in replacement forhermes-parserandhermes-eslint. Babel docs and ESLint docs have been updated. - Object properties, class fields, methods, and the members of an interface or
declare classimported from another module, can be keyed by aunique symbol.
Notable bug fixes:
- Prevent a race that can leave server hanging
- Support TypeScript constructor objects in Flow class positions.
keyofover asymbolindex signature is nowsymbolrather thanstring.- A class can extend a value with a construct signature.
x !== undefinedno longer stops refining after a call that passesundefinedas an argument: (e.g. try-Flow)
Library Definitions:
- Well-known symbols on
Symbolare typed asunique symbol, andSymbol.metadatais now available.
v0.328.0
Breaking changes:
[include]and[ignore]sections in flowconfig should use globs instead. Read https://flow.org/en/docs/config/include/ and https://flow.org/en/docs/config/ignore/ for more information.
New Features:
thistype guards can now be used on non-static methods of regular classes, not justdeclare classand interface methods. The method body is checked for consistency against the guard type.
Notable bug fixes:
- Prevent cached IDE results from blocking rechecks.
Library Definitions:
- Allow symbols to be used as
WeakMapkeys
v0.327.0
New Features:
- In an object type, a bracketed key written as a string or number literal, or as the name of a value, is now a computed key naming a single property rather than an index signature, so several such keys can coexist. A key written as a type-only name is unchanged, and the labeled form
[label: K]keeps index-signature semantics. Breaking: a key headed by a value binding is read as a computed key. Thus a class or enum key such as{[C]: V}is now an error, and a qualified type exposed through a class/namespace merge, as in{[C.K]: V}, must use the labeled form{[key: C.K]: V}to remain an index signature. - In an interface or a
declare classbody, a bracketed key written as a string or number literal, or as the name of a value, is now a computed key naming a single property rather than an index signature, so several such keys can coexist, andstaticputs the property on the static side. A key written as a type-only name is unchanged, and the labeled form[label: K]keeps index-signature semantics. Breaking: a key headed by a value binding is read as a computed key, so a class or enum key such asinterface I {[C]: V}is now an error and must use[key: C]to remain an index signature. - A computed method key
[expr](): Tthat resolves to a single literal string or safe-integer number is now accepted in interface,declare class, and object type bodies (previously a parse error outside.d.tsfiles) and reads as a named method. - A bracketed access on an array with a string-literal key (for example
arr['map']orarr[Symbol.iterator]) now reads the corresponding named member instead of erroring that the key is not an array index, and a string key holding a safe integer (arr['0']) indexes the array like the equivalent numeric key.
Notable bug fixes:
keyof anynow evaluates toanyas expected. Spurious errors related to the bug will no longer fire.- Fix a server crash ("thread 'flow-tokio-runtime' has overflowed its stack") when rechecking a file with an attached LSP client
Parser:
- Parse
componentandhooktype annotations as the declaration ofdeclare export default
Library Definitions:
- Add ES2026 Map methods
v0.326.0
Breaking changes:
- The following flags are removed since they no longer change anything
experimental.channel_modeexperimental.channel_mode.windowsexperimental.long_lived_workersexperimental.long_lived_workers.windowsgc.worker.custom_major_ratiogc.worker.custom_minor_max_sizegc.worker.custom_minor_ratiogc.worker.major_heap_incrementgc.worker.minor_heap_sizegc.worker.space_overheadgc.worker.window_sizesharedmemory.hash_table_powsharedmemory.heap_size
Likely to cause new Flow errors:
- General subtyping errors will print the types that are incompatible. Some errors might have new locations.
v0.325.0
No behavioral changes in this release
v0.324.0
New Features:
- .flowconfig's
[include]and[ignore]sections can now be configured using globs, in addition to the current regex based system. Right now, glob items must be specified withglob:prefix. Globs do not support<PROJECT_ROOT>, since they are assumed to start from the project root. - Class fields and methods whose computed key resolves to a literal string or number are now supported and type-checked as named members.
v0.323.0
v0.322.0
Notable bug fixes:
- Fixed #9448
- Fixed a crash in pattern matching. (example)
- Refining a union by
instanceofno longer leaksanyfrom members that cannot match the guard (e.g.Foo<string> | Bar<number>refined byinstanceof Foonow yieldsFoo<string>instead ofFoo<string> | Foo<any>). This may surface real errors that were previously masked.