Releases: facebook/flow
Releases · facebook/flow
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.
v0.312.1
- Fix in saved state checks after a rebase
[flow] v0.312.0
Likely to cause new Flow errors:
- Flow will now error on variance modifiers (
+T,-T,in T,out T) on interface method type parameters, matching the existing rejection on class methods and function types
New Features:
- Declaration merging between
declare classandinterfaceof the same name in the same scope. - Flow now separates value namespace and type namespace, so code like
const A = 1; interface A {}is now accepted.
v0.311.0
New Features:
- Added support for string and number literal properties in
declare classandinterface
Library Definitions:
- Change the
Record<K, T>utility type's key bound fromK: stringtoK: PropertyKey, allowingnumberandsymbolkeys in addition tostring - Added some TS built-in types that were missing from Flow's core lib
Misc:
- When
experimental.allow_variance_keywordsis set totrue, we support the keywordsin/out/readonlyalong with+/-for variance
v0.310.0
New Features:
- Support constructor type signatures (
new (...) => Type) in interfaces anddeclare class
Misc:
- When
allow_variance_keywordsis set to true, Flow stops erroring forin/out/readonly