NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #3376 most downloaded on npm
JavaScript parser written in OCaml. Produces ESTree AST
Latest stable
0.339.0
Last release 15 days ago
07 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
440 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
Rename typeParameters to typeArguments on ESTree GenericTypeAnnotation, InterfaceExtends, and ClassImplements, including WASM flow-parser output. Decl
Breaking Changes:
typeParameters to typeArguments on ESTree GenericTypeAnnotation, InterfaceExtends, and ClassImplements, including WASM flow-parser output. Declaration parameters and Babel output retain their existing names.PropertyDescriptor and Object.getOwnPropertyDescriptor are no longer generic. Remove type arguments from PropertyDescriptor<T> annotations and Object.getOwnPropertyDescriptor<T>(...) calls.Likely to cause new Flow errors:
react-rule-hook-class, and calls in deeper nested anonymous callbacks inside components or hooks use react-rule-hook-conditional, instead of react-rule-hook. Update suppressions to the new codes. Hook calls directly in class property initializers are also rejected when the enclosing function would otherwise permit them.undefined.o.x++, o.x--, ++o.x, and --o.x) now invalidate narrowings of the property through aliases, as assignments already do.break, continue, return, and throw paths through finally are no longer dropped. Flow now reports variables left unassigned and narrowings that do not hold on these paths.x?: T, with experimental.tslib_syntax) now have type T | void. Reads may return undefined, and assigning undefined is allowed.in out in TypeScript files are now invariant rather than covariant.use* declared in TypeScript files are now treated as hooks. This fixes calls from Flow hook syntax, but calls outside a component or hook can now report Rules of Hooks errors.parseInt, parseFloat, and eval now require a string; isNaN and isFinite require a number; and builtin Error constructors require a string message, matching TypeScript.Object.getOwnPropertyDescriptor, Object.defineProperty, Object.prototype.hasOwnProperty, and Object.prototype.propertyIsEnumerable now require PropertyKey (string | number | symbol) keys. PropertyDescriptorMap is also keyed by PropertyKey.DataView.byteLength and byteOffset, numeric typed array byteLength, byteOffset, and length, and RegExp.source, global, ignoreCase, and multiline are now read-only. RegExp.prototype.compile now requires a pattern.Array.prototype.splice uses separate removal and insertion overloads, so inserting items requires a deleteCount.Array and ReadonlyArray reduce and reduceRight now have an overload whose initial value and accumulator use the element type. Calls intending a different accumulator type may need an explicit type argument, e.g. reduce<number>(...).Promise.prototype.then and catch now use TypeScript-style signatures. then has separate fulfillment and rejection type parameters; calls whose inferred result is unsuitable may need explicit type arguments.RegExpMatchArray.index and input are now optional, and its first element is declared as 0: string. Check optional fields on match results, and use RegExpExecArray for exec and matchAll results.Error.stack is now optional, matching TypeScript.subarray methods, including Uint8Array.prototype.subarray, return their corresponding typed array rather than this. Subclasses that return their own type should declare their own override.New Features:
translateFlowTypeToTSType to flow-api-translator for type-node translation.void is expected, matching TypeScript. Flow-declared function types retain their existing return checks.Notable bug fixes:
flow check hanging when their output is piped or captured, even after the command exits (#9519).experimental.tslib_syntax.empty, as they already do for string, number, and boolean literals.declare const x = -1.infer, conditional types nested inside distributive conditional types, and type applications that expand to types mentioning the inferred parameters..//foo and ..//foo resolve like ./foo and ../foo.match in unreachable code.this parameter in a class expression or a class declared in a callback.f();.enums=true.constructor, including TypeScript's ['constructor'] fields, now types x.constructor without shadowing the constructor used by new and super().module.exports has multiple call signatures or is an overloaded function merged with a namespace.flow-upgrade transformations preserve type arguments with both legacy and current parser AST fields.Misc:
flow-parser and Prettier's built-in Flow parser without an external parser plugin.Parser:
Program source locations and ranges span the entire input, including whitespace and comments.flow-parser preserves optionality on constructor parameter properties.flow-estree types for unannotated object type properties, readonly type operators, combined in out variance, optional Program.tokens, sparse-array elements, and JSX namespaced attributes. Sparse-array parent repair and traversal preserve holes.typeof type arguments from ESTree output, including WASM-decoded nodes and detached builders.export default.flow-parser type stripping preserves function parameter defaults and side-effect imports.flow-transform preserves leading #! lines.flow-eslint scope analysis handles TypeScript parameter properties, class member decorators, and declare global.IDE:
const, properties, or parameters, and on construction of polymorphic classes shows the instantiated type arguments.dump-types, and error messages print any without its kind, e.g. any instead of any (explicit).Library Definitions:
encodeURIComponent also accepts numbers and booleans.Symbol.prototype.valueOf returns symbol instead of ?symbol.arguments.callee and Function.prototype.caller are typed as Function, and function prototype properties are typed as any.TemplateStringsArray is an interface extending ReadonlyArray<string>.ImportCallOptions, ImportAssertions, and ImportAttributes interfaces.Date.prototype.toString declares a Date receiver rather than inheriting an Object receiver.String, Number, and Date use overloads and Intl option types.EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError returns its own type rather than Error.JSON.parse reviver and JSON.stringify replacer callbacks accept any this and receive a string key.JSON.stringify returns string; its replacer is a function or a read-only array of strings and numbers.RegExp statics such as RegExp.$1 and RegExp.lastMatch.ArrayBuffer.isView is a type guard that refines its argument to ArrayBufferView.ArrayBufferView is a structural interface rather than a union of typed arrays and DataView. Libraries can extend ArrayBufferTypes to add buffer types to ArrayBufferLike.PromiseConstructorLike and ConcatArray.ThisType<T> marker interface. Flow does not give it TypeScript's contextual this behavior.thisArg?: any, and their static from methods accept mapping functions from any element type.ReactDOM$UserVisibleString to change the type accepted by user-visible React DOM string attributes such as aria-label, title, alt, and placeholder.Boolean() accepts no argument.Object.defineProperty and Object.defineProperties return their first argument's type.Object.getPrototypeOf, Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.getOwnPropertySymbols, Object.isSealed, Object.isFrozen, and Object.isExtensible accept any argument.Object.prototype.valueOf returns Object instead of unknown.String.prototype.matchAll yields RegExpExecArray for string patterns as well as regular expressions.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Flowconfig option experimental.assertion_functions is removed. Assertion functions have been on by default and the option only accepted true since 0.3
Breaking Changes:
experimental.assertion_functions is removed. Assertion functions have been on by default and the option only accepted true since 0.337.experimental.disable_invariant_special_casing is removed. It has been on by default and only accepted true since 0.337.experimental.function_and_object_type_is_no_longer_any is removed. It has been on by default and only accepted true for a while.experimental.builtin_ts_libdef_dynamic_discovery is removed. It has been on by default and only accepted true.experimental.declare_global_support is removed. It has been on by default and only accepted true.Likely to cause new Flow errors:
Readonly, Partial, Required, $Exact, Omit and mapped types over an interface now include its methods and the members it inherits.Array<any>, {data: any}, Map<string, any> and similar types to the guarded type, e.g. Array<string>, which can surface errors in code that relied on any.keyof of an object with a template literal indexer no longer widens the indexer key to string in conditional types like Exclude.New Features:
readonly and writeonly modifiers.if (result.done) now refine unions of classes and interfaces by fields with literal types, as === checks already did.isString?.(x). When the callee or receiver is nullable, only the true branch narrows.ExactObjectType, the supertype of every exact object type and a subtype of {...}.Notable bug fixes:
Uint8Array<ArrayBuffer>.E & E) to the enum's representation type no longer errors.new Array<T>(...).declare global support with regular Flow..d.ts) object type, matching TypeScript.underconstrained-implicit-instantiation errors for generic calls passed as arguments to other generic calls.a in [readonly a: unknown, ...T] stays read-only.First in [infer First, ...infer Rest] is now inferred instead of unknown.string | number refines to "" | 0.x: A | B refined by x is A is now A rather than A | (A & B).x: T | number refined by !isT(x) with isT: (x: unknown) => x is T is now number.any now stays any instead of becoming empty, and boolean is refined to the literal the guard does not cover.flow check-contents and flow autocomplete.React.MouseEvent<T>, now compare type parameters without a variance annotation covariantly, as type applications already did.x instanceof C no longer refines a value of an intersection type to empty.Misc:
Parser:
flow-parser taking minutes to parse JS files over ~1 MB."in out" for the ESTree variance kind of in out type parameters.NonNullExpression nodes..mjs/.mts files in flow-parser.const keyword in const enum declaration locations.IDE:
?() => void instead of ?(() => void).Library Definitions:
Symbol.toStringTag, Symbol.match, Symbol.toPrimitive, ...) with TypeScript.Map and WeakMap set, and Set and WeakSet add, now return this.RegExp flags/sticky/unicode and Number.EPSILON/MAX_SAFE_INTEGER/MIN_SAFE_INTEGER are now read-only; String.prototype.normalize accepts the normalization form literals and the legacy HTML methods (bold, link, ...) are declared.Array.prototype.copyWithin returns this, so subclasses of Array keep their type.Array.prototype.sort returns this, so subclasses of Array keep their type.Math constants (Math.PI, Math.E, ...) are read-only.Number.MAX_VALUE, MIN_VALUE, NaN, NEGATIVE_INFINITY and POSITIVE_INFINITY are read-only.String#split requires a separator, String#replace has separate overloads for a string and a function replacement, and String#length is read-only, as in TypeScript.flatMap union order and inference.includes definitions while keeping Flow's element refinement.Generator.prototype.return now requires a value of the generator's return type.React.CSSProperties, typed by csstype.Set.prototype.union.Map, Set, WeakMap and WeakSet definitions. size is now read-only.done is now optional in the non-final branch of IteratorResult, as in TypeScript.ArrayIterator, MapIterator, SetIterator and StringIterator are now interfaces, and StringIterator takes a type argument.@types/react, such as React.MouseEvent, React.HTMLAttributes and React.JSX.IntrinsicElements.React.ComponentProps of a string that is not a JSX intrinsic is empty in roots that define their own $JSXIntrinsics.reduce without an initial value now requires the reducer to return the iterator's element type.Array, ReadonlyArray and typed array toLocaleString now accept locales and formatting options.Likely to cause new Flow errors:
Likely to cause new Flow errors:
Function.prototype.bind is now typed with TypeScript's CallableFunction.bind overloads, so errors in bound arguments are reported at bind, and a bound function's remaining parameters are a tuple type.Function and Object no longer mean any and no longer trigger unclear-type errors. They are now interpreted as the prototypes of functions and objects. Code that assumed they meant any may get new errors.Function$Prototype$Bind is removed.bind now uses the declared Function.prototype.bind overloads. Bound methods may now report tuple arity errors when used as callbacks that ignore extra arguments or omit nullable parameters, because their inferred parameters are represented as tuple rest parameters.New Features:
invariant, give it an asserts signature.flow-node.this and super, including receiver assertions.Readonly now supports Array and ReadonlyArray types.Notable bug fixes:
Recursion limit exceeded errors when checking conditions, match and other expressions whose type is a trivially recursive generic type alias.(cond ? A : B).T via a local) now look up the type in each namespace instead of reporting it as missing.Misc:
Parser:
implicitDeclare is now omitted unless true.TypeParameter.bound as a bare type node or null in ESTree output. Babel output retains the TypeAnnotation wrapper, and the TypeScript-to-Flow API translator generates extends bounds.EnumBody node with string-or-null explicitType. Babel output retains its existing enum body types.readonly T[] in unlabeled tuple elements and require parentheses when optional.Library Definitions:
Intl.Segmenter and Intl.supportedValuesOf.Intl.NumberFormat.prototype.formatRange and formatRangeToParts, and the ES2023 NumberFormat options; format accepts bigint and numeric strings.String.prototype.localeCompare, toLocaleLowerCase and toLocaleUpperCase accept Intl.LocalesArgument; matchAll with a RegExp returns RegExpExecArray matches.Float16Array.prototype.toLocaleString takes Intl.NumberFormatOptions.ArrayBuffer resizing, transfer, and constructor options.Reflect APIs with TypeScript property, descriptor, key, and constructor definitions.Float16Array declarations while preserving Flow covariance and callback compatibility.Proxy APIs with TypeScript and check array elements against numeric interface indexers.Likely to cause new Flow errors:
Likely to cause new Flow errors:
Array.from can now infer narrower literal types, requiring explicit annotations where broader types are needed. Unconstrained class type arguments now use their bounds instead of empty.ref compatibility for JSX tags typed as string, exposing refs that assume a more specific element type.this parameters on methods in library definitions no longer need to accept the instance type.(input: string, ...args: Array<unknown>) => void no longer satisfies (...args: TArgs) => R when TArgs is inferred as Array<unknown> (Try Flow example).const [first, ...rest] = t, now excludes preceding elements' types from rest.type T<out X> = [string, ...[X]] is an error.New Features:
[string, ...Array<number>]. Array literals ending in array spreads and arguments collected by rest parameters can flow to these types.Notable bug fixes:
declare class now preserves variance annotations.declare namespace blocks now see members merged across blocks and library files.Function and Object values.B in [...A, ...B], are now inferred instead of left underconstrained.infer on rest parameters now preserve the matched function's optional parameters and rest element in the inferred tuple, e.g. [number, ...Array<boolean>]. Matching functions with fewer parameters than the pattern and no rest parameter no longer produces underconstrained errors.Misc:
flow-upgrade now uses Flow parser packages and requires Node 18 and Prettier 3.Parser:
IDE:
Go to links no longer include the hovered declaration itself.Library Definitions:
Intl is now a builtin namespace with TypeScript-compatible definitions through ES2020, including Collator, NumberFormat, DateTimeFormat, PluralRules, RelativeTimeFormat, Locale, DisplayNames, getCanonicalLocales, and formatToParts for dates and numbers.Intl$CollatorOptions, Intl$DateTimeFormatOptions, and Intl$NumberFormatOptions aliases now match TypeScript. Intl.DateTimeFormatPartTypes includes 'unknown', and locale-aware Date methods accept Intl.LocalesArgument and Intl.DateTimeFormatOptions.LocalesArgument type is now Intl.LocalesArgument. Library declarations such as flow-typed's declare var Intl hide the builtin namespace and must be removed.React.ElementConfig is removed; use React.ComponentProps instead.findLast, findLastIndex, toReversed, toSorted, and with, and their constructors can be called without arguments. For types other than Float16Array, findLast narrows its result with a type-guard callback. Callbacks to findLast and findLastIndex can no longer annotate this.Float16Array now matches TypeScript's declaration, including its from overloads. length, byteLength, and byteOffset are read-only, find and findIndex predicates must return boolean, and callbacks can no longer annotate this.Error.isError, Promise.try, Atomics.pause, and additional ArrayBuffer and Date constructor signatures.Array.fromAsync.AggregateError.prototype.errors is now typed any[], matching TypeScript.ClassDecorator accepts classes, decorator context and metadata types are available, and Function includes [Symbol.metadata].DisposableStack, AsyncDisposableStack, SuppressedError, Disposable, and AsyncDisposable. AsyncGenerator now extends AsyncIteratorObject and includes [Symbol.asyncDispose].Deprecated syntax now consistently causes errors, including in library definition files.
Breaking Changes:
builtin_lib=flowlib and builtin_lib=flowlib-with-lib-dom-d-ts options.exact_by_default, experimental.always_generalize_jsx, experimental.fast_symlink_resolution, experimental.importable_global_libdefs, experimental.interface_dictionary_typing_fix, experimental.new_this_typing, experimental.opaque_type_new_bound_syntax, saved_state.allow_reinit, saved_state.direct_serialization, and saved_state.reinit_on_lib_change. These options had been enabled by default and only accepted true.Likely to cause new Flow errors:
Symbol and Promise now use TypeScript-style instance and constructor interfaces. Code relying on their previous class typing may see different errors.unknown.unknown. More underconstrained errors may appear.String.prototype.replaceAll now has separate overloads for a replacement string and a replacer function, matching TypeScript. Passing a union of these types is an error.RegExpMatchArray.groups is now optional and cannot be null, and RegExp.prototype.dotAll is read-only, matching TypeScript.new $ReadOnlyArray now causes an error.Symbol() now only accepts a string | number description, and Symbol.keyFor returns string | void, matching TypeScript.React.PropsOf now uses React.ComponentProps to find component props. Additional errors may occur.New Features:
undefined type can be used in library definitions, where it means void.flow-remove-types supports abstract classes, abstract members, override modifiers, satisfies, optional class fields, and additional type-only imports and exports.const declarations and annotated initializers.Notable bug fixes:
as const on template literals infers template literal types like TypeScript.React.ComponentProps and other conditional types with infer.this parameter in error messages and hovers.this-typed methods inherited from builtins such as typed arrays now return the subclass.declare class declarations extending builtins such as Error, Map, Set, or Date now inherit the builtin's statics and constructor.new X(...) are now contextually typed when X is annotated with the typeof of a constructor interface value.typeof x === 'function' now refines builtin constructors such as Map and Symbol, and interfaces with call signatures, as functions.asserts call signatures.instanceof and declare class ... extends now use the prototype of a constructor interface that has no construct signature, instead of narrowing to empty or reporting "not inheritable".Misc:
React.ElementConfig is deprecated in this version and will be removed in the next version. Use React.ComponentProps instead.unnecessary-invariant lint is renamed to unnecessary-assertion; the old name is still accepted.null and void separately instead of "null or undefined".Partial, Required, or mapped type).Parser:
typeAnnotation and emit value: null.IDE:
Map, Set, Error, and Date now show the builtin's instance members.React.ComponentProps in generated type annotations.Library Definitions:
React.ComponentProps<'div'> now includes the optional ref prop.Promise.withResolvers.Map.groupBy are now ordered <K, T>, matching TypeScript.RegExp.prototype[Symbol.matchAll] is now a method and RegExpStringIterator an interface, matching TypeScript.Likely to cause new Flow errors:
Likely to cause new Flow errors:
Number, String, RegExp, Date, native errors, maps, and sets now use TypeScript-style instance and constructor interfaces, while Math, JSON, and Atomics use named interfaces. Existing code relying on their previous class or object typing may produce new errors.New Features:
Notable bug fixes:
Parser:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
react module will always resolve to Flow's builtin react type definitions. If you use a custom react typing module, you might see errors.Notable bug fixes:
unique symbol types and signed mapped-property variance.Parser:
ImportType ESTree field from argument to source.Library Definitions:
lib.dom.d.ts by default. If your project is not supposed to run in the browser, you can switch back to the old behavior with builtin_lib=core-only in flowconfig's [options] section.Iterable and ArrayLike type now align with those from TypeScript. You might see errors when your existing code assumes the old typing.no_flowlib option is removed. Use builtin_lib=flowlib (default) or builtin_lib=prelude instead.
Breaking Changes:
no_flowlib option is removed. Use builtin_lib=flowlib (default) or builtin_lib=prelude instead.Likely to cause new Flow errors:
React.MixedElement otherwise. Legacy code that requires exact react element will see new errors.New Features:
Symbol() and Symbol.for() create a unique symbol when they initialize a const, so symbols can be used as property keys without explicit declarations.Notable bug fixes:
import typeof of a generic value without type arguments keeps its polymorphism instead of reporting missing-type-args, and renders accepts import typeof of a generic component.Parser:
import defer * as ns from "m" and import.defer("m") now set the ESTree phase property to "defer".IDE:
super shows the declarationLibrary Definitions:
import.meta will no longer have url property and arbitrary unknown property. To add them back, you can do so through declaration merging (e.g. adding interface ImportMeta { url: string } to your global library definitions.ArrayLike and ArrayBuffer now follow TypeScript definitionsArray(length) and Array(items)Likely to cause new Flow errors:
Likely to cause new Flow errors:
method-unbinding errors and instead perform stricter this-type checking (example).IDE:
type-at-pos and hoverLibrary Definitions:
React.ReactElement now matches latest type in @types/react. Added missing React.JSX.Element that makes the type in @types/react .Likely to cause new Flow errors:
Likely to cause new Flow errors:
.call/apply/bind calls. 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:
instanceof refinement of constructor objects.Partial no longer strip readonly-ness of dictionaries. (example)Likely to cause new Flow errors:
Likely to cause new Flow errors:
unique symbol annotation is now an error unless it is the type of a const variable, of a readonly object type or interface property, or of a static readonly class field.New Features:
flow-parser and flow-eslint packages that are drop-in replacement for hermes-parser and hermes-eslint. Babel docs and ESLint docs have been updated.declare class imported from another module, can be keyed by a unique symbol.Notable bug fixes:
keyof over a symbol index signature is now symbol rather than string.x !== undefined no longer stops refining after a call that passes undefined as an argument: (e.g. try-Flow)Library Definitions:
Symbol are typed as unique symbol, and Symbol.metadata is now available.[include] and [ignore] sections in flowconfig should use globs instead. Read https://flow.org/en/docs/config/include/ and https://flow.org/en/docs/con
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:
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:
Library Definitions:
WeakMap keysIn 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 ra
New Features:
[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.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.[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.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.Parser:
component and hook type annotations as the declaration of declare export defaultLibrary Definitions:
The following flags are removed since they no longer change anything
Breaking changes:
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_sizeLikely to cause new Flow errors:
No behavioral changes in this release
No behavioral changes in this release
.flowconfig's [include] and [ignore] sections can now be configured using globs, in addition to the current regex based system. Right now, glob items
New Features:
[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.No behavioral changes in this release
No behavioral changes in this release
Fixed https://github.com/facebook/flow/issues/9448
Notable bug fixes:
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.flow-parser is now backed by the Rust port parser. It will have public API similar to that of hermes-parser.
Parser:
flow-parser is now backed by the Rust port parser. It will have public API similar to that of hermes-parser.Likely to cause new Flow errors:
Likely to cause new Flow errors:
Partial, Required, Readonly, Pick, and Omit. ExampleLikely to cause new Flow errors:
Likely to cause new Flow errors:
casting_syntax is removed. The as casting syntax is the only supported casting syntax. See Modernizing legacy syntax for migration guidance.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:
NaN as a match patternNotable bug fixes:
match being treated as their positive counterpartConstructorParameters and InstanceType now work on Class<C>, not just typeof Cmatch instance patterns whose constructor is a subclass of the scrutinee type are no longer incorrectly reported as unused.Flow will now error on all deprecated utility types. See Modernizing legacy syntax for migration guidance.
Likely to cause new Flow errors:
Allow -? (optionality removal) in mapped types.
New Features:
-? (optionality removal) in mapped types.ConstructorParameters and InstanceTypeMisc:
.flowconfig options component_syntax, enums, and pattern_matching now default to true. To keep the previous behavior, set the corresponding option to =false in your .flowconfig.deprecated-type and deprecated-type-bool errors are now always on (the lints were on by default already). Update any references of the type bool to bo…
Likely to cause new Flow errors:
deprecated-type and deprecated-type-bool errors are now always on (the lints were on by default already). Update any references of the type bool to boolean, and delete references to the lints in your .flowconfig and flowlint comments — the setting is a no-op for this release and will be removed in a future release.The deprecated variance sigils error message now suggests the contextually correct keyword (readonly/writeonly for property positions, out/in for type…
readonly, writeonly, in, out) on type parameters and object/class properties are now enabled by default. The experimental.allow_variance_keywords is no longer needed to opt in.readonly/writeonly for property positions, out/in for type parameter positions) instead of listing both alternatives.Deleted the implicit-inexact-object lint, it no longer does anything since exact_by_default=false was deprecated.
Likely to cause new Flow errors:
implicit-inexact-object lint, it no longer does anything since exact_by_default=false was deprecated.exact_by_default=false is now deprecated in .flowconfig. Read this blog post on how to migrate, and our docs on objects for more. exact_by_default=true is the default (since 2023) so simply delete the option when migrating.Notable bug fixes:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
(x: T) to x as T. The default value of the option casting_syntax is now as, and Flow will error on the old syntax. If you want to preserve the old defualt value, add casting_syntax=both to your .flowconfig. You can use the npm package flow-upgrade to upgade: yarn run flow-codemod typeCastToAsExpression. Read the docs for more.New Features:
void is used if omittedParser:
ArrayExpression gains a trailingComma field, optional chaining is wrapped in a ChainExpression, AssertNonnull (expr!) emits a NonNullExpression instead of an optional node, type-position this emits ThisTypeAnnotation, and TypeParameter.bound is now a bare type node without the TypeAnnotation wrapper.Fix in saved state checks after a rebase
Likely to cause new Flow errors:
Likely to cause new Flow errors:
+T, -T, in T, out T) on interface method type parameters, matching the existing rejection on class methods and function typesNew Features:
declare class and interface of the same name in the same scope.const A = 1; interface A {} is now accepted.Added support for string and number literal properties in declare class and interface
New Features:
declare class and interfaceLibrary Definitions:
Record<K, T> utility type's key bound from K: string to K: PropertyKey, allowing number and symbol keys in addition to stringMisc:
experimental.allow_variance_keywords is set to true, we support the keywords in / out / readonly along with +/- for varianceNew Features:
declare class and interfaceLibrary Definitions:
Record<K, T> utility type's key bound from K: string to K: PropertyKey, allowing number and symbol keys in addition to stringParser:
writeonly property variance keywordMisc:
experimental.allow_variance_keywords is set to true, we support the keywords in / out / readonly / writeonly along with +/- for varianceSupport constructor type signatures (new (...) => Type) in interfaces and declare class
New Features:
new (...) => Type) in interfaces and declare classMisc:
allow_variance_keywords is set to true, Flow stops erroring for in / out / readonlyNo significant changes.
No significant changes.
The 5 enum body ESTree node types (EnumBooleanBody, EnumNumberBody, EnumStringBody, EnumSymbolBody, EnumBigIntBody) have been replaced with a single E
Parser:
EnumBooleanBody, EnumNumberBody, EnumStringBody, EnumSymbolBody, EnumBigIntBody) have been replaced with a single EnumBody node. Its members property is a flat array of per-type member nodes (EnumBooleanMember, EnumNumberMember, EnumStringMember, EnumBigIntMember, EnumDefaultedMember). The explicitType property is now a string ("boolean", "number", "string", "symbol", "bigint") or null (previously a boolean). hasUnknownMembers remains a boolean. Several enum validation errors are no longer reported by the parser and are instead reported by the type checker.Library Definitions:
RegExp.escape()Misc: Store exports index in saved state
Support numeric literal object keys when importing/exporting object literals
Notable bug fixes:
infer to appear as member names in qualified type access (e.g. type S = O.infer;).readonly, keyof, infer, etc.) as function type parameter namesParser:
? optional modifier in various places this does not make sense, e.g. const x? = 1;Misc:
flow check becomes an alias of flow status. You can use flow full-check to trigger a full foreground check of a Flow root.Fix in Meta-internal saved state logic
Support for using well-known symbols as property names in types - the form should be exactly Symbol.iterator.
New Features:
Symbol.iterator.Notable bug fixes:
Library Definitions:
Fix in saved state on projects including files outside the project root.
Add autofix for colon-style type parameter bounds to extends-style type parameter bounds
Misc:
Fixed analysis of number literal keys in object destructuring rest type computation
Notable bug fixes:
Adds a new stylex_shorthand_prop flowconfig option that enables syntactic sugar for StyleX on lowercase (intrinsic) JSX elements. When set to a prop n
New Features:
stylex_shorthand_prop flowconfig option that enables syntactic sugar for StyleX on lowercase (intrinsic) JSX elements. When set to a prop name (e.g. stylex_shorthand_prop=sx), <div sx={[styles.foo, styles.bar]} /> desugars to <div {...stylex.props(styles.foo, styles.bar)} />.Fix https://github.com/facebook/flow/issues/9357
Notable bug fixes:
Misc:
IDE:
For React autoimport, it will now always be in the form of import * as React from 'react'
IDE:
React autoimport, it will now always be in the form of import * as React from 'react'Minor changes to the flow-upgrade script
Misc:
Support export declare, like declare export
Parser:
export declare, like declare exportcomponent in implicit declare context, the ast we produce will include implicitDeclare: trueLikely to cause new Flow errors:
Likely to cause new Flow errors:
Parser:
filename in the option objectdeclare keyword can be omitted for declare function under declaration context (.flow file, declare module, declare namespace)
New Features:
declare keyword can be omitted for declare function under declaration context (.flow file, declare module, declare namespace)Fix parsing of experimental record expressions that are multiline
Parser:
The declare keyword can be omitted for declare const/let/var variable: type and declare component under a declaration context (libdef file, .js.flow f
Declarations:
declare keyword can be omitted for declare const/let/var variable: type and declare component under a declaration context (libdef file, .js.flow file, declare module, declare namespace)declare component now requires the rest props to be named - matching normal component declarationsMisc:
Omit<O, K> utility type will no longer enforce that the provided keys K need to be part of OSupport 4 well-known symbols (Symbol.iterator, Symbol.asyncIterator, Symbol.dispose, Symbol.asyncDispose) in class methods. For now, the computed meth
New Features:
Symbol.iterator, Symbol.asyncIterator, Symbol.dispose, Symbol.asyncDispose) in class methods. For now, the computed method name needs to be exactly in the form of Symbol.iterator (or other 3 names) to be recognized.Notable bug fixes:
Misc:
yarn run flow-codemod convertLegacyUtilityTypes)Parser:
Support second argument of import expressions
Parser:
Bug Fixes:
use_mixed_in_catch_variables option was renamed use_unknown_in_catch_variables because mixed is being renamed to unknown
Config:
use_mixed_in_catch_variables option was renamed use_unknown_in_catch_variables because mixed is being renamed to unknownLikely to cause new Flow errors:
Likely to cause new Flow errors:
Parser:
Flow now provides a code action to fix all invalid-type-cast-syntax errors in the file.
IDE:
invalid-type-cast-syntax errors in the file.Likely to cause new Flow errors:
Likely to cause new Flow errors:
type O_loop = { p: 0, __proto__: O_loop } will cause an error.Notable bug fixes:
import { | } from 'a'; will only suggest values, not types.IDE:
Library Definitions:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
$NonMaybeType, NonNullable, $ReadOnly, Readonly, $Keys, $Values, Values, $ReadOnlyMap, ReadonlyMap, $ReadOnlySet, ReadonlySet.Notable bug fixes:
StringPrefix/StringSuffix to be included in object initializers with other non-overlapping keys (example try-Flow)Library Definitions:
act: 19.0: https://react.dev/reference/react/actcaptureOwnerStack: 19.1: See https://react.dev/reference/react/captureOwnerStackuseEffectEvent: 19.2: https://react.dev/reference/react/useEffectEvent<Activity />: 19.2: See https://react.dev/reference/react/Activity
UpdateduseDeferredValue: 19.0: Accepts a second argument for initial valueuseTransition: 19.0: Accepts an async action functionstartTransition: 19.0: Accepts an async action functionLikely to cause new Flow errors:
Likely to cause new Flow errors:
React.ElementProps is removed. You should use React.ElementConfig instead.react-rule-hook-non-hook-syntax errors. To fix, annotate them with hook annotation. exampleReact$RefSetter<...> and and React$Context are removed. It continues to be available in the form of React.RefSetter<...> and React.Context<...>, regardless of whether you have imported React.React$ElementRef<...> was removed. It continues to be available in the form of React.ElementRef<...>, regardless of whether you have imported React.Breaking Changes:
max_literal_length was removed. Flow will always decide whether to infer a specific or general type of string literal based on the natural inference algorithm.Notable bug fixes:
@@dispose and @@asyncDispose in your library typings. You can access the respective properties with obj[Symbol.dispose] and obj[Symbol.asyncDispose].Library Definitions:
ExactReactElement will be populated by React.ElementConfig<C> instead of React.ElementProps<C>. Most of the code that doesn't depend on exact react element types won't be affected.The deprecated React$Element type is now removed. You should use React.Node or React.MixedElement in most cases. If you really want exact react elemen…
Breaking Changes:
hermes-parser package, which is running on wasm.Likely to cause new Flow errors:
React$Element type is now removed. You should use React.Node or React.MixedElement in most cases. If you really want exact react elements, you can use ExactReactElement_DEPRECATEDNew Features:
IDE:
Starting from this version, flow-bin will only contain ARM64 binaries for macOS.
Breaking Changes:
flow-bin will only contain ARM64 binaries for macOS.Likely to cause new Flow errors:
React.ElementConfig<...> and React.PropsOf<...> will now always include the ref prop in the props object type.react.ref_as_prop=partial_support is removed, and Flow now has better support for React 19's ref-as-prop behavior:
declare function id<Props: {...}, Ref>(c: component(ref?: Ref, ...Props)): component(ref?: Ref...Props)
now it must be written as
declare function id<Props: {...}>(c: component(...Props)): component(...Props)
Fix type of useActionState hook in React. Type should be Awaited instead of Promise (the opposite operation).
Library Definitions:
useActionState hook in React. Type should be Awaited instead of Promise (the opposite operation).Object.groupBy and Map.groupBy
Bug fixes:
experimental.ts_utility_syntax=true, imported Readonly, ReadonlyArray, NonNullable, ReadonlyMap, ReadonlySet types are considered any.One column per quarter.