NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3376 most downloaded on npm
JavaScript parser written in OCaml. Produces ESTree AST
Last release 14 days ago
04 Sep 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
432 releases · first in 2015
Likely to cause new Flow errors:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
react-rule-hook-definitely-not-in-component-or-hook error, if the variable name doesn't conform to hook naming convention. exampleIDE:
Misc:
as casts with function generics and component generics!One column per quarter.
Likely to cause new Flow errors:
Likely to cause new Flow errors:
const foo = {baz: new Dog()};
type Foo = {bar?: string, baz: Animal};
declare function acceptFoo(foo: Foo): void;
acceptFoo(foo); // error
To fix the error, you can either annotate the object
const foo: Foo = {baz: new Dog()};
type Foo = {bar?: string, baz: Animal};
declare function acceptFoo(foo: Foo): void;
acceptFoo(foo);
or make the call site accepts readonly objects:
const foo = {baz: new Dog()};
type Foo = $ReadOnly<{bar?: string, baz: Animal}>;
declare function acceptFoo(foo: Foo): void;
acceptFoo(foo);
We provide a codemod to automate the annotation process. flow codemod annotate-literal-declaration --write --max-type-size 5. (You can adjust the max type size based on your needs).
IDE:
Library Definitions:
React$MixedElement is removed from builtin libdef. It will cause internal-type error since v0.258.0. You should use React.MixedElement instead.* Bug fixes for match
matchSupport for experimental match feature using option experimental.pattern_matching=true
New Features:
match feature using option experimental.pattern_matching=trueLikely to cause new Flow errors:
Likely to cause new Flow errors:
Library Definitions:
PropertyDescriptor type are marked as readonly. If you need a mutable version, you can introduce something like type MutablePropertyDescriptor<T> = {...$Exact<PropertyDescriptor<T>>, ...}Fixed crash when loading saved state.
Notable bug fixes:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
nested-hook and nested-component lint errors which detect nested hook or component syntax within component or hook syntax. This is on by default.Notable bug fixes:
foo in import foo from './bar', but now we will count foo. If the pattern of import foo from './bar' happens a lot, then the autoimport algorithm will be more likely to suggest import foo from './bar' rather than import bar from './bar').react-rule-hook-conditional error for hooks called in a conditionally defined nested component.Prevent non-termination when computing code actions.
Notable bug fixes:
Fixed https://flow.org/try. It was broken from v0.270.0 to v0.272.0.
Notable bug fixes:
`React.forwardRef` is marked as deprecated. We might remove it from our builtin libdef in the future.
Likely to cause new Flow errors:
props param that's a subtype of interface {} will get react-rule-hook-definitely-not-in-component-or-hook error.react-rule-hook-mixed-with-non-hook error instead of react-rule-hook error. Calling functions named like hook but not in hook syntax will now get react-rule-hook-non-hook-syntax instead of react-rule-hook error.Notable bug fixes:
module.exports will correctly jump to the exporting fileParser:
''#!/usr/bin/env node\n'' when generating token listLibrary Definitions:
React.forwardRef is marked as deprecated. We might remove it from our builtin libdef in the future.Multiple levels of export * will now be correctly indexed so that they won't be missing in autoimport results.
Notable bug fixes:
export * will now be correctly indexed so that they won't be missing in autoimport results.Library Definitions
Float16Array typeLikely to cause new Flow errors:
Likely to cause new Flow errors:
React.Node will no longer be treated like components. Thus, all the hooks call in such functions will have react-rule-hook-definitely-not-in-component-or-hook errors.Object.assign will now trigger unsafe-object-assign lint error that's on by default. The type checking behavior for Object.assign will otherwise stay the same for now.react-rule-hook-definitely-not-in-component-or-hook.Parser:
It should have the same behavior as 0.269.0.
It should have the same behavior as 0.269.0.
The Linux x86 build is now built from ubuntu-22.04. It might make Flow not runnable on older linux distributions.
Breaking:
ubuntu-22.04. It might make Flow not runnable on older linux distributions.Likely to cause new Flow errors:
[react-rule-hook-conditional] instead of [react-rule-hook-naming-convention] errors.$Diff support is removed. If you have trouble migrating, you can try to polyfill it by this. However, $Diff has surprising behavior with regard to optional props in the second type parameter, which cannot be easily polyfilled (example).New Features:
react-rule-hook-naming-convention and react-rule-hook-conditional errors unsuppressable, you can add the following to the [options] section in flowconfig:unsuppressable_error_codes=react-rule-hook-naming-convention
unsuppressable_error_codes=react-rule-hook-conditional
Likely to cause new Flow errors:
Likely to cause new Flow errors:
We have updated the way type parameters are instantiated in generic calls, specifically when using upper bounds:
Support for $Rest is removed. Omit should be used instead. If you still have many instances of $Rest, you can replace them with $Diff as a temporary measure, but note that we intend to eventually remove $Diff as well.
React-rule hook errors related to conditional hook calls will now have react-rule-hook-conditional error code.
React-rule hook errors related to naming convention issues will now have react-rule-hook-naming-convention error code.
Notable bug fixes:
const x = 'a'; 'b' as typeof x as 'a'; (try-Flow) to type check without errors. With this fix, Flow will infer singleton literal types for primitive literals in contexts where such precision is required. Examples of this are: const-declarations (e.g. in const x = 42 will infer the type 42 for x), annotation positions (e.g. typeof x is equivalent to the type 42), conditionals (e.g. in if (x.tag === 42) {} Flow will infer the type 42 for the value 42, instead of number). In this part of the rollout, whenever this precision is not required Flow will infer the unsound type it used to infer before (a hybrid between the singleton and general type). Eliminating this unsound type completely will be done soon.flow-remove-types now handles the removal of empty imports after removing type/typeof imports (thanks @jbroma)Fix a bug that causes fixed libdef-override error to stick around after an incremental recheck.
libdef-override error to stick around after an incremental recheck.Likely to cause new Flow errors:
Likely to cause new Flow errors:
$PropertyType and $ElementType has been removed. Now referencing these types will just resolve to a global type if you have your own definition for them, and result in a cannot-resolve-name error otherwise. These types have been replaced by index access types for a long time. You can migrate to index access types by enabling use-indexed-access-type from https://www.npmjs.com/package/eslint-plugin-fb-flow and running the quickfixes. If you are unable to migrate, you can add the following to your global libdefs:type $PropertyType<T, K> = T[K];
type $ElementType<T, K> = T[K];
component()<: component(ref?: ref_prop), Flow will ensure that ref_prop is a subtype of void instead of a subtype of React.RefSetter<void>.React$ComponentType, which was previously given [internal-type] error on every usage, is now removed.React.ComponentType<Props> is now only an alias of component(...Props), instead of some special cased types. This comes with stricter checks and conversions, such as making Props readonly, erroring on the presence the ref prop instead of silently ignoring them, and ensures that Props is a subtype of {...}. In addition, the React$AbstractComponent type is removed.Notable bug fixes:
Library Definitions:
React.lazy and React.memo is now generic over the presence or absence of ref prop.Make @flowtyped resolution support work on Windows.
@flowtyped resolution support work on Windows.We fixed a bug that caused suppressions to not apply for libdef-override errors.
Notable bug fixes:
libdef-override errors.libdef-override errors not being raised even if it's turned on.Likely to cause new Flow errors:
Likely to cause new Flow errors:
[libdef-override]. The error cannot be suppressed without specific error code like $FlowFixMe[libdef-override]. It can be turned off by turning off the libdef-override lint.New Features:
Number static methods Number.isFinite, Number.isInteger, Number.isNaN, and Number.isSafeInteger now apply a refinement that their input is a number. Note that the top level isNaN and isFinite functions (not off of Number) do not apply the same refinement as they first coerce their input to number.Notable bug fixes:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
New Features:
declare namespace is now supported in toplevel library definitions.Notable bug fixes:
Library Definitions:
flow-typed.config.json in the root of your project with the following content:{
"env": ["node", "dom", "bom", "intl", "cssom", "indexeddb", "serviceworkers", "webassembly", "jsx"]
}
Likely to cause new Flow errors:
Likely to cause new Flow errors:
New Features:
declare namespace is now supported in toplevel library definitions.Notable bug fixes:
Library Definitions:
flow-typed.config.json in the root of your project with the following content:{
"env": ["node", "dom", "bom", "intl", "cssom", "indexeddb", "serviceworkers", "webassembly", "jsx"]
}
Likely to cause new Flow errors:
Likely to cause new Flow errors:
React$Component directly will now be an error.React$ComponentType, React$Context and React$RefSetter will now trigger internal-type errors.New Features:
divNotable bug fixes:
ClientRect and ClientRectList with aliases to DOMRect and DOMRectList
This fixes the type definitions for the DOM APIs in Flow, but replacing an nonexistent globals ClientRect and ClientRectList types with just an alias to DOMRect and DOMRectList.React.ComponentType<{}> to be a subtype of component()IDE:
Library Definitions:
flow-typed.config.json in the root of your project with the following content:{
"env": ["node", "dom", "bom", "intl", "cssom", "indexeddb", "serviceworkers", "webassembly"]
}
Fixed a bug that causes incorrect updates to our index that tracks usage of exports, which leads to incorrect autoimport-ranked-by-usage results.
Notable bug fixes:
Fixed a crash after initialization with saved state if the typing for react module is provided as a userland module.
Notable bug fixes:
react module is provided as a userland module.Bigint values inside of template literals now coerce to strings, e.g. `` ${1n} `. Addition with string (e.g. 1n + 'blah'`) is still banned.
New Features:
`${1n}`. Addition with string (e.g. 1n + 'blah') is still banned.["a", null].filter(s => s != null) it will automatically infer that the arrow function encodes a x is string type guard and will apply it on the input array resulting in aArray<string>. (try-Flow)module.system.node.root_relative_dirname will allow conditional mapping like module.system.node.root_relative_dirname='<PROJECT_ROOT>/foo' -> 'bar'. Under such config, import 'a' will only be resolved to <PROJECT_ROOT>/bar/a if import 'a' is in a file in the <PROJECT_ROOT>/foo directory. This feature will be helpful if you want to combine two flow roots with different module.system.node.root_relative_dirname config.Likely to cause new Flow errors:
Notable bug fixes:
true or false. (e.g. try-Flow)Parser:
declare global {...} (using it will still result in an error). The AST will have the shape of{
"type":"DeclareNamespace",
"loc": ...,
"range": ...,
"global":true,
"id":{
"type":"Identifier",
"loc": ...,
"range":...,
"name":"global",
"typeAnnotation":null,
"optional":false
},
"body":{
"type":"BlockStatement",
...
},
}
Library Definitions:
React$PureComponent is removed. If you want to refer to it, it needs to be imported from react.You may now write object literals with Flow Enum values as computed keys. This will result in a dictionary type, keyed by the Flow Enum type. Note tha
New Features:
number typed keys (rather than just number literals) to create objects, these will be treated as dictionaries {[number]: T}Notable bug fixes:
IDE:
Library Definitions:
React$FragmentType is removed from Flow's builtin global type definitions.Fixed a bug that causes experimental auto-import-on-paste to miss imports for component names used in jsx.
Notable bug fixes:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
Notable bug fixes:
IDE:
bar in export {foo as bar} from '...', we will always jump to itselffoo in export {foo} from '...' or export {foo as bar} from '...', we will always jump to the name at the export, if this statement is well typed.foo in export {foo} from '...' or export {foo as bar} from '...', we will jump to itself if the statement is not well-typed.require('...') expression will now jump to the default export of an ESM module if available, or the first export of an ESM module.Library Definitions:
React.Context has been updated to support React 19's context as provider model. Given this change, you might need additional annotations on exports. e.g.Fixed go-to-definition for Meta-specific module references.
IDE:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
react.ref_as_prop=disabled is removed.React$Node and React$MixedElement outside of libdefs will now trigger internal-type errors.Library Definitions:
Array.concat().Flow language server will stop advertising that we can handle all code actions kinds prefixed with "source". It can help to prevent VSCode sending flo
Misc:
"source". It can help to prevent VSCode sending flow irrelevant code actions to handle during save.React.Config type, deprecated in v0.254, is now removed.
Likely to cause new Flow errors:
export const obj = {f: "foo"}; was {f: str<"foo">}, where str<"foo"> was a type that opportunistically and unsoundly behaved either as string or as the singleton type "foo".{f: string} for obj.export const x = "foo"; Flow will export the type "foo".as const modifier.string or any keys. Now, if the computed property is added to some existing objects (e.g. {foo: string, [stringTypedKey]: v}), then we will error on the property. Otherwise, the {[key]: value} will be {[typeof key}: typeof value}[react-rule-unsafe-mutation] errors are raised.(?string) extends string ? true : false is evaluated to true | false instead of false). This is now fixed, and code that depends on the bug might have new errors.typeof x === 'function', and then do typeof x === 'object', the result is now empty as that is impossible.React.Config type, deprecated in v0.254, is now removed.New Features:
'key' in x now refines the type of x to objects which have the property key.
in checks for both own and non-own properties..length instead), and also because Flow doesn't handle array holes.no_unchecked_indexed_access=true in flowconfig, which is equivalent to noUncheckedIndexedAccess from TS. It will add | void to every indexed access with general string key on dictionary objects or number key on arrays.react.ref_as_prop=partial_support, and this is now the default. (To disable it, use react.ref_as_prop=disabled.) Under this mode, ref prop in jsx will be treated as a regular prop for function components, but utility types like React.ElementConfig<...> still won't include the regular ref prop yet.Notable bug fixes:
Library Definitions:
getNotifications and showNotification API for ServiceWorkerRegistrationFixed a limitation when checking intersections of polymorphic types (e.g. tryFlow)
Notable bug fixes:
super in an object method. Such cases are now user-facing errors.If you want exact react elements, the only way that doesn't trigger Flow error is by ExactReactElement_DEPRECATED .
Likely to cause new Flow errors:
React$RendersExactly<typeof Component> type instead of React$Element<typeof Component> type. All existing usages intended to create an exact react element will now error as a result. Using it as type passed to render type, React.PropsOf, React.PropOf and React.RefOf is unaffected and will not be affected in the future. If you want exact react elements, the only way that doesn't trigger Flow error is by ExactReactElement_DEPRECATED<typeof Component>.Library Definitions:
React.Config type is marked as deprecated and will be removed soon. You can create your own equivalent type withtype ReactConfigShim<Props, DefaultProps> = $ReadOnly<{
...Omit<Props, $Keys<DefaultProps>>, ...Partial<DefaultProps>
}>;
Add option to disable experimental configuration
Misc:
Fixed a potential crash when experimental multiplatform support is enabled.
Notable bug fixes:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
Library Definitions:
toSpliced method type (thanks @aph!)Likely to cause new Flow errors:
Likely to cause new Flow errors:
React$ElementRef is now implemented with a conditional type instead of a builtin Flow utility type. You might see new errors with generic React$ElementRef. Most of the times, you should replace React.ElementRef<T> with just T if there are no other uses of generic T.New Features:
@flowtyped like directories via module.declaration_dirnames config. e.g.module.declaration_dirnames=<PROJECT_ROOT>/decl1
module.declaration_dirnames=<PROJECT_ROOT>/decl2
Please note that when you set this, @flowtyped at the root will no longer be considered special, and you will need to explicitly add it like
module.declaration_dirnames=<PROJECT_ROOT>/@flowtyped
Notable bug fixes:
empty.IDE:
includeDeclaration from LSP request for find-references command. In practice, this means that "find all references" in vscode will continue to return both declaration and all uses, while "go to references" will exclude the declaration.Likely to cause new Flow errors:
Likely to cause new Flow errors:
$ReadOnly applied, which might cause new errors.New Features:
Notable bug fixes:
[declarations] section will have all lint errors silenced.Misc: * Performance fix
Misc:
Remove the deprecated React.AbstractComponent type. We recommend replacing them with component types. Since v0.249.0, we have provided a codemod via t…
Likely to cause new Flow errors:
React.AbstractComponent type. We recommend replacing them with component types. Since v0.249.0, we have provided a codemod via the flow-upgrade package to aid larger codebases with this conversion: yarn run flow-codemod eliminateAbstractComponent path/to/src.React.AbstractComponent type, we also removed support for the internal React$AbstractComponent when more than 1 type argument has been passed. Similarly, you should migrate to use component types if you want to specify ref props and renders.New Features:
@flowtyped directory at the root, they can be resolved by the relative path without leading ./ relative to @flowtyped. e.g. <PROJECT_ROOT>/@flowtyped/react.js.flow can be used to type the react package, and <PROJECT_ROOT>/@flowtyped/react/jsx-runtime.js.flow can be used to type react/jsx-runtime module. We now recommend using this approach instead of using declare module in global libdef.Notable bug fixes:
any will now correctly propagate to inferred render type. example.Library Definitions:
React.AbstractComponent. Most of the code won't be affected, but you might have to sometimes make the Props readonly.Likely to cause new Flow errors:
Likely to cause new Flow errors:
Notable bug fixes:
all option is specified in the config of flow-remove-types, we now respect it and will correctly handle Flow-typed files without @flow pragma.React.AbstractComponent is also marked as deprecated. We recommend replacing them with component types. We have provided a codemod via the flow-upgrad…
Likely to cause new Flow errors:
React$AbstractComponent outside library definitions will now trigger internal-type lint error, which is on by default. React.AbstractComponent is also marked as deprecated. We recommend replacing them with component types. We have provided a codemod via the flow-upgrade package to aid larger codebases with this conversion: yarn run flow-codemod eliminateAbstractComponent path/to/src.Notable bug fixes:
StringPrefix and StringSuffix when used as a component syntax prop.as cast support in flow-remove-types.Library Definitions:
React.cloneElement. e.g. React.cloneElement(e, {ref: 'foo'}) will be an error.React$Ref type and various aliases of it are removed.React.Component annotated exported will now also show up in auto-imports in a type position.
IDE:
React.Component annotated exported will now also show up in auto-imports in a type position.Support for long deprecated predicate function (%checks) is removed. It will still parse, but all of them will error with unsupported-syntax, and %che…
Breaking changes:
%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:
$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:
$TEMPORARY$object<{props}> with $ReadOnly<{props}> or {props}$TEMPORARY$array<T> with $ReadOnlyArray<T> or Array<T>$TEMPORARY$number<42> with number or '42'$TEMPORARY$string<"foo"> with string or "foo"flow-upgrade package to aid larger codebases with this conversion: yarn run flow-codemod replaceTemporaryTypes path/to/src.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.contextTypes and childContextTypes in react class components are now empty typed, so declaring legacy context in React will be an error.React.RefSetter<...> type.Parser:
type Foo = (component(x: number) renders Bar);IDE:
renders React.Node on hover.: renders <annot> at the position that expects a render declaration, the quickfix will suggest removing : instead of replacing : with renders.Library Definitions:
util.stripVTControlCharacters for NodeJS.Performance optimization for unions
Misc:
Support for the deprecated $Call type is removed. $Call will now resolve to whatever $Call points to in the global libdef. If you need more time to mi…
Breaking changes:
$Call type is removed. $Call will now resolve to whatever $Call points to in the global libdef. If you need more time to migrate, you can create a shim like $Call<F, T> = $TupleMap<[T], F>[0], but please note that we intend to remove support for $TupleMap eventually.deprecated-type-dollar-call lint is removed, since the support for $Call is removed.react.disable_function_components_default_props config option is removed. It is on by default since v0.238.Likely to cause new Flow errors:
$TupleMap is deprecated and will be soon removed, now that mapped type works on array inputs. Existing $TupleMap will still work in this release, but every use will trigger a deprecated-type lint that is on by default.type A = React$ElementConfig<hook (props: {foo: string}) => void>; will now error.New Features:
Notable bug fixes:
flow-remove-types now correctly handles as cast with generics.IDE:
React.AbstractComponent type will be shown in the component type syntaxLibrary Definitions:
deprecated-type-objmap lint was removed.
Likely to cause new Flow errors:
$ObjMap will resolve to a user-defined $ObjMap global if it's available in your libdef. You can use type $ObjMap<O, F> = {[K in keyof O]: $Call<F, O[K]>} to get most of the same behavior, except that in the mapped type version O[K] will include void for optional props. Please note that this should be considered as a permanent shim, because we intend to eventually remove $Call.flow codemod key-mirror command was removed, since this codemod tries to convert $ObjMap to $KeyMirrordeprecated-type-objmap lint was removed.void as the instance, so React.ElementRef<component> of such component will return void.New Features:
{[K in keyof <array or tuple type>: <mapped type>}.
Notable bug fixes:
IDE:
Library Definitions:
React.Ref is marked as deprecated. Use React.RefSetter instead for ref props, and React.RefObject for returns of useRef.React.RefSetter now includes null and void.Promise.all and Promise.allSettled have been updated to use mapped type instead of $TupleMap. The requirement on the type arguments are slightly changed.The language for invalidated refinement is slightly tweaked. Instead of saying refactoring to a constant, we now say refactoring to a const variable.
Misc:
Refined expressions are now highlighted in try-flow playground. Hovering on refined expressions will show where it's refined, and hovering on some inv
Website:
IDE:
textDocument/prepareName LSP request. This ensures that Flow's rename support can be surfaced when multiple VSCode extension adds rename support for JS files.React.Element type, deprecated in 0.243.0, is now removed.
Likely to cause new Flow errors:
React.Element type, deprecated in 0.243.0, is now removed.New Features:
{ of a JSX attribute value.react.custom_jsx_typing=true. Under this flag, Flow will type check jsx by through your self-defined global type React$CustomJSXFactory type, which should be a function type that accepts arguments according to jsx spec. e.g. You can write a loose one like type React$CustomJSXFactory = (component: any, props: any, ...children: any) => React.MixedElementNotable bug fixes:
globalThis.React.Node being incorrectly unavailable.IDE:
<A /> where A is in component syntax) will no longer be shown in hover with shorthand syntax like A. Instead, it will be shown as React$Element<typeof A>Likely to cause new Flow errors:
Likely to cause new Flow errors:
inexact_tuple_types_syntax option (which was on by default) is now deleted. Make sure you are using hermes-parser and related packages at version >= 0.23.0renders React.Element<React.AbstractComponent<{}, mixed, renders* A>>. Invalid render types will behave like any.React.Fragment.renders* T where T is generic is now banned.Notable bug fixes:
All deprecated-type and untyped-type-import lint are on and at error level by default.
Likely to cause new Flow errors:
deprecated-type and untyped-type-import lint are on and at error level by default.React$ElementConfig vs React.ElementConfig) are now a lint error that's enabled by default. To disable it, set internal-type=off in the lints section of the flowconfig. For now, these types are still allowed in libdef files, but we plan to also disallow it in the future. To codemod existing code, get the latest flow-upgrade package and run yarn run flow-codemod replaceReactDollarUtilityTypesReact$Element type is banned via the internal-type lint. The React.Element alias still exists for now, but it is marked with @deprecated in the jsdoc. Please read the jsdoc for better alternatives. A global alias ExactReactElement_DEPRECATED is added to help you clearly mark the use of exact React element types, and you should use it to replace React.Element that you cannot replace without compromising runtime type safety.New Features:
declare component statement and component type is enabled by default.Notable bug fixes:
Misc:
experimental.namespaces config option is removed. Namespaces support is enabled by default in the previous release.Library Definitions:
.replaceChildren method type definition for dom nodes.Object.getPrototypeof is still special cased, but the special-casing is only available for a syntactic Object.getPrototypeof(...) call. If you try to use Object.getPrototypeof in some other ways (e.g. const f = Object.getPrototypeof; f(...)), you will get a a less precise and accurate typing for it. The Object$GetPrototypeOf type, which was used to back the special case behavior, is removed.For Pick utility type with string literals in the second type argument, go-to-definition on the string literal will jump to corresponding prop's locat
New Features:
Pick utility type with string literals in the second type argument, go-to-definition on the string literal will jump to corresponding prop's locationNotable bug fixes:
Likely to cause new Flow errors:
Likely to cause new Flow errors:
$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== and !=.invalid-render errors can no longer be suppressed without specific error code.$Exact<...> is involved. Some invalid $Exact<...> type will now have not-an-object error code.New Features:
declare namespace support is enabled by default.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:
IDE:
my-package or my-package/foo instead of a relative path import.Library Definitions:
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.No changes from 0.240.0
No changes from 0.240.0
Likely to cause new Flow errors:
Likely to cause new Flow errors:
obj.type === 'foo'. exampleFunction.prototype.apply and Function.prototype.call are now typed using userland types instead of hardcoded builtin support. You might see slight inference differences, error message and code changing as a result..constructor property of object types. (D58538540 pvekris)void, not empty.New Features:
StringPrefix utility type. This is the type of the remainder of the string after the prefix is removed. For example, "$1", "$2" are subtypes of StringPrefix<'$', '1' | '2'>, but "$999" is not. StringPrefix<X> is equivalent to StringPrefix<X, string>$Values utility type to get the type of the elements of an array type or tuple type....args as a union of tuples). [example]Notable bug fixes:
Library Definitions:
String.codePointAt now returns number | voidFixed a bug where IDE services doesn't respect files.implicitly_include_root=false config.
Notable bug fixes:
files.implicitly_include_root=false config.Your coding agent can read these notes before it upgrades. Set up the MCP server →