Skip to content

Releases: facebook/flow

v0.328.0

Choose a tag to compare

@mvitousek mvitousek released this 14 Aug 22:22

Breaking changes:

New Features:

  • this type guards can now be used on non-static methods of regular classes, not just declare class and 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 WeakMap keys

v0.327.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 12 Aug 16:09

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 class body, 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, and static puts 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 as interface I {[C]: V} is now an error and must use [key: C] to remain an index signature.
  • A computed method key [expr](): T that 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.ts files) and reads as a named method.
  • A bracketed access on an array with a string-literal key (for example arr['map'] or arr[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 any now evaluates to any as 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 component and hook type annotations as the declaration of declare export default

Library Definitions:

  • Add ES2026 Map methods

v0.326.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 05 Aug 21:29

Breaking changes:

  • The following flags are removed since they no longer change anything
    • experimental.channel_mode
    • experimental.channel_mode.windows
    • experimental.long_lived_workers
    • experimental.long_lived_workers.windows
    • gc.worker.custom_major_ratio
    • gc.worker.custom_minor_max_size
    • gc.worker.custom_minor_ratio
    • gc.worker.major_heap_increment
    • gc.worker.minor_heap_size
    • gc.worker.space_overhead
    • gc.worker.window_size
    • sharedmemory.hash_table_pow
    • sharedmemory.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

Choose a tag to compare

@SamChou19815 SamChou19815 released this 30 Jul 01:21

No behavioral changes in this release

v0.324.0

Choose a tag to compare

@gkz gkz released this 24 Jul 20:06

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 with glob: 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

Choose a tag to compare

@mvitousek mvitousek released this 20 Jul 20:35

No behavioral changes in this release

v0.322.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 08 Jul 18:10

Notable bug fixes:

  • Fixed #9448
  • Fixed a crash in pattern matching. (example)
  • Refining a union by instanceof no longer leaks any from members that cannot match the guard (e.g. Foo<string> | Bar<number> refined by instanceof Foo now yields Foo<string> instead of Foo<string> | Foo<any>). This may surface real errors that were previously masked.

v0.321.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 24 Jun 21:00

Parser:

  • flow-parser is now backed by the Rust port parser. It will have public API similar to that of hermes-parser.

v0.320.0

Choose a tag to compare

@SamChou19815 SamChou19815 released this 21 Jun 00:58

Likely to cause new Flow errors:

  • Object operations on class instance types now produce plain object types instead of preserving the class instance's nominal identity. This affects object type spreads and utilities such as Partial, Required, Readonly, Pick, and Omit. Example

v0.319.0

Choose a tag to compare

@facebook-github-tools facebook-github-tools released this 17 Jun 13:53

Likely to cause new Flow errors:

  • The config for casting_syntax is removed. The as casting syntax is the only supported casting syntax. See Modernizing legacy syntax for migration guidance.
  • Flow will now error on T: B in favor of T extends B in type parameters, and error on +/- in favor of readonly/writeonly . See Modernizing legacy syntax for migration guidance.

New Features:

  • Support the global NaN as a match pattern

Notable bug fixes:

  • Fixed negative bigint literal patterns in match being treated as their positive counterpart
  • ConstructorParameters and InstanceType now work on Class<C>, not just typeof C
  • match instance patterns whose constructor is a subclass of the scrutinee type are no longer incorrectly reported as unused.