Releases: facebook/flow
Releases · facebook/flow
Release list
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.
v0.321.0
Parser:
flow-parseris now backed by the Rust port parser. It will have public API similar to that ofhermes-parser.
v0.320.0
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, andOmit. Example
v0.319.0
Likely to cause new Flow errors:
- The config for
casting_syntaxis removed. Theascasting syntax is the only supported casting syntax. See Modernizing legacy syntax for migration guidance. - Flow will now error on
T: Bin favor ofT extends Bin type parameters, and error on+/-in favor ofreadonly/writeonly. See Modernizing legacy syntax for migration guidance.
New Features:
- Support the global
NaNas amatchpattern
Notable bug fixes:
- Fixed negative bigint literal patterns in
matchbeing treated as their positive counterpart ConstructorParametersandInstanceTypenow work onClass<C>, not justtypeof Cmatchinstance patterns whose constructor is a subclass of the scrutinee type are no longer incorrectly reported as unused.
v0.318.0
Likely to cause new Flow errors:
- Flow will now error on all deprecated utility types. See Modernizing legacy syntax for migration guidance.
v0.317.0
New Features:
- Allow
-?(optionality removal) in mapped types. - Adds support for utility types
ConstructorParametersandInstanceType
Misc:
- The
.flowconfigoptionscomponent_syntax,enums, andpattern_matchingnow default totrue. To keep the previous behavior, set the corresponding option to=falsein your.flowconfig.
v0.316.0
Likely to cause new Flow errors:
deprecated-typeanddeprecated-type-boolerrors are now always on (the lints were on by default already). Update any references of the typebooltoboolean, and delete references to the lints in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.
[flow] v0.315.0
- Variance keywords (
readonly,writeonly,in,out) on type parameters and object/class properties are now enabled by default. Theexperimental.allow_variance_keywordsis no longer needed to opt in. - The deprecated variance sigils error message now suggests the contextually correct keyword (
readonly/writeonlyfor property positions,out/infor type parameter positions) instead of listing both alternatives.
[flow] v0.314.0
Likely to cause new Flow errors:
- Deleted the
implicit-inexact-objectlint, it no longer does anything sinceexact_by_default=falsewas deprecated. exact_by_default=falseis now deprecated in.flowconfig. Read this blog post on how to migrate, and our docs on objects for more.exact_by_default=trueis the default (since 2023) so simply delete the option when migrating.
Notable bug fixes:
- Fixed incorrect enum cast suggestion when using an enum as a type argument
[flow] v0.313.0
Likely to cause new Flow errors:
- Flow has changed its casting syntax from
(x: T)tox as T. The default value of the optioncasting_syntaxis nowas, and Flow will error on the old syntax. If you want to preserve the old defualt value, addcasting_syntax=bothto your.flowconfig. You can use the npm packageflow-upgradeto upgade:yarn run flow-codemod typeCastToAsExpression. Read the docs for more.
New Features:
- Exported class setters no longer require an explicit type annotation:
voidis used if omitted
Parser:
- The flow-parser estree output now aligns more with hermes-parser:
ArrayExpressiongains atrailingCommafield, optional chaining is wrapped in aChainExpression,AssertNonnull(expr!) emits aNonNullExpressioninstead of an optional node, type-positionthisemitsThisTypeAnnotation, andTypeParameter.boundis now a bare type node without theTypeAnnotationwrapper.