Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

v0.197.0

Compare
Choose a tag to compare
Loading
@facebook-github-botfacebook-github-bot released this 15 Jan 00:31
· 4508 commits to main since this release

Local Type Inference:

We are releasing a new inference mode calledlocal type inference. You can enable this new mode in your codebase by addinginference_mode=lti to the[options] section in the flowconfig. We will describe more details on this inference mode in an upcoming blog post.

Likely to cause new Flow errors:

  • Unannotated class properties initialized with null will now errors.
  • We now require all generic functions to be fully annotated.
  • bool is a deprecated alias forboolean. Added adeprecated-type-bool lint andflow fix --error-codes deprecated-type codemod to help migrate toboolean. This lint is also included in thedeprecated-type lint; ifdeprecated-type is enabled, you can opt out withdeprecated-type-bool=off

New Features:

  • Tuple improvements:
    • $ReadOnly utility makes tuples read-only. E.g.$ReadOnly<[string, number]> is the same as[+a: string, +b: number].
    • Tuple elements can now have their variance annotated, when the element is labeled. E.g.type T = [+foo: number, +bar: string] creates a read-only tuple.
    • You can now label tuple elements (like TypeScript allows). The labels have no type-checking effect, they just help with self documentation (like indexer labels). When a function argument rest element is a tuple type, the labels work like parameter names in signature help.
    • We now parse tuple spread elements, but type checking of this feature is still unsupported.
    • These new features are now supported in Flow, but we have not upgraded related tools yet. For example, Prettier won't be able to format your code that uses variance annotations on tuples.
  • Allowmixed orany as an annotation to acatch parameter (but not anything else)
  • When typing in a class body, method signatures from super classes and interfaces will be suggested to make overriding/implementing these methods easier.

Notable bug fixes:

  • Improve the parser's error recovery when in the middle of adding type parameters.
  • Trigger autocomplete in JSX tags, JSX attribute values, and private class fields.
  • Improves performance of bigints in big union checks

Misc:

  • Inferred recursive types are shown asany (instead ofV$n) in hover types.

Parser:

  • symbol is now a reserved type
  • for (async of []) is now a parse error

Library Definitions:

  • UpdatedAbortController andAbortSignal signatures
  • Actually exposeReactSetStateFunction type introduced in the last release.
Assets9
Loading
mirek reacted with thumbs up emojiyanndinendal reacted with eyes emoji
2 people reacted

[8]ページ先頭

©2009-2025 Movatter.jp