flow

Adds static typing to JavaScript to improve developer productivity and code quality.

MIT License

Downloads
42.1M
Stars
22.1K
Committers
931

Bot releases are visible (Hide)

flow - https://github.com/facebook/flow/releases/tag/v0.222.0

Published by facebook-github-bot 11 months ago

New Features:

  • Go-to-definition now works for private names
  • Find references and rename now work for private names

Notable bug fixes:

  • Documentation will now show up for declare export statements in hover and autocomplete. This means that jsdoc for exports in declare module will finally show up in IDE services.

Library Definitions:

  • Added USBConnectionEvent
  • Added SecurityPolicyViolationEvent
  • Added crypto.randomUUID, http$Server.closeAllConnections, http$Server.closeIdleConnections
flow -

Published by facebook-github-bot 12 months ago

Likely to cause new Flow errors:

  • Changed the signature of React.Fragment to only accept children and the key prop.
  • Changed the signature of React.useRef to return an opaque type.
  • Fixed a case where, in some cases, contextually-typed callbacks being passed as props would be typed as any rather than producing underconstrained-implicit-instantiation errors. This will result in new underconstrained errors, but removes a source of untracked unsoundness.
  • Banned non-tuple arrays from being spread into tuple types. It previously resulted in any without error.

Notable bug fixes:

  • Improved signature help support for optional chaining calls and intersection types. Now we will show all possible signature possibilities for overloaded functions.

Performance:

  • Incremental error collation, which helps IDE performance when you have a lot of suppressed errors, is now the default.
  • Optimized the way we generate global types for normal source files. You might see a reduction in checking times (3-9% as measured internally at Meta).
  • Optimized the way we analyze syntactic environment required for type checking. On a large file like this, it improves the checking time from 4s to 2s.
  • Optimized substitution performance when conditional type and mapped types are operating on large and deep objects.

Library Definitions:

  • Updated IntersectionObserver types.
  • IndexedDB transaction now allows consuming storeNames as DOMStringList.
  • Added options to IndexedDB transaction.
  • Added durability to IDBTransaction.
flow - https://github.com/facebook/flow/releases/tag/v0.220.1

Published by facebook-github-bot 12 months ago

Notable bug fixes:

  • We will now provide auto type import for default-exported classes.
  • We no longer suggest defined values when doing auto complete in object keys when we are under a type annotation.
flow - https://github.com/facebook/flow/releases/tag/v0.220.0

Published by facebook-github-bot 12 months ago

Likely to cause new Flow errors:

  • Fixed an issue where access of optional tuple element was not considered | void
  • We rewrote how we generate types for library definitions, which makes the validation of libdef files stricter. You might see more errors as a result of the stricter validation. e.g. all unbound names in libdef files will cause an error, instead of the first reference of the unbound name.

Notable bug fixes:

  • Fixed a bug in "refactor to react component" code actions. Previously, it would incorrectly replace all jsx children with the newly refactored JSX elements
  • Fixed signature help when the function called is typed as an alias (e.g. try-Flow)
  • Fixed some spurious errors in generic calls when the solution involves unions (e.g. try-Flow)
  • Fixed a bug that caused weird errors when you try to use indexed access in export positions. example
flow - https://github.com/facebook/flow/releases/tag/v0.219.5

Published by facebook-github-bot 12 months ago

Misc:

  • Bug fixes in preparation of new feature rollout
flow - https://github.com/facebook/flow/releases/tag/v0.219.4

Published by facebook-github-bot 12 months ago

Misc:

  • Bug fixes in preparation of new feature rollout
flow - https://github.com/facebook/flow/releases/tag/v0.219.3

Published by facebook-github-bot almost 1 year ago

Misc:

  • Bug fixes in preparation of new feature rollout
flow - https://github.com/facebook/flow/releases/tag/v0.219.2

Published by facebook-github-bot about 1 year ago

Misc:

  • Bug fixes in preparation of new feature rollout
flow - https://github.com/facebook/flow/releases/tag/v0.219.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • We changed the upper bound of React.Element to be an inexact empty object, effectively making it opaque.
    React doesn't recommend inspecting children and React.Element, so we make the change to increase friction. See https://react.dev/reference/react/Children#alternatives for alternatives.
    To keep existing code type safe, you can add a function like the following to explicitly expose the internal of React.Element:
export default function DangerouslyAccessReactElementInternals_DO_NOT_USE_IN_NEW_CODE<
  E: React$ElementType,
  P,
>(e: React$Element<E, P>): {
  +key: React$Key | null,
  +props: P,
  +ref: any,
  +type: C,
} {
  return e;
}
  • Conditional types will now only distribute over a union if A in A extends B ? C : D is a generic type. This is a behavior change that might cause new errors (example). Previously, we distribute over unions in more cases, which contradicts what we said in the docs, and caused some weird behavior that's fixed in this version.
  • If an exported class contains unannotated propTypes, Flow will now emit signature-verification-failure.

New Features:

  • Hovering on enum members in IDE now show documentation if it's available.
  • Added casting_syntax option which can be colon (current), as, or both. If setting is both, both (x: T) and x as T are allowed. If set to colon or as, only (x: T) and x as T are allowed respectively.

Notable bug fixes:

  • Previously, when Flow cannot decide which branch to take in a generic conditional type, Flow will produce a abstract type that's unusable almost everywhere. Now Flow will still produce an abstract type, but it will be bounded above by a union type of both branches of conditional type. example.

Misc:

  • Flow's insert type quickfix in IDE will stop inserting very specific React.Element types. Instead, it will insert general types like React.MixedElement.

Library Definitions:

  • Add type definition for CanvasRenderingContext2D.roundRect.
  • Add tagName to DOM element declarations (thanks @aselbie).
flow - https://github.com/facebook/flow/releases/tag/v0.218.1

Published by facebook-github-bot about 1 year ago

New Features:

  • Error collation during rechecks should become faster thanks to incremental computation. (Available with the flag --incremental-error-collation.)
flow - https://github.com/facebook/flow/releases/tag/v0.218.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • We start to validate variance inside $ReadOnly, which is previously completely unchecked. It also results in Flow complaining about some incorrect bounds. example

New Features:

  • Hover types will now show a specialized version of the callee expression at a call to a generic or intersection-typed function.

Notable bug fixes:

  • improve coverage accuracy for the element access portion on element calls, obj[m](arg).

Misc:

  • We slightly optimized Flow's performance of subtyping check between two union types.

Library Definitions:

  • Add defintions Array.prototype.findLastIndex(), String.prototype.at(), TypedArray.prototype.at() and Object.hasOwn() (thanks @pascalduez).
  • Update URL defintions (thanks @pascalduez).
  • Add typing for cause option in Error constructor.
flow - https://github.com/facebook/flow/releases/tag/v0.217.2

Published by facebook-github-bot about 1 year ago

This is same as 0.217.1, but we have some issue publishing 0.217.1 to npm, so we will publish this new version instead.

flow - https://github.com/facebook/flow/releases/tag/v0.217.1

Published by facebook-github-bot about 1 year ago

Notable bug fixes:

  • Previously, while global find ref/rename (experimental.global_find_ref=true/experimental.global_rename=true) is ongoing, all other IDE services will be blocked. We fixed it so that other IDE requests can still be served.
flow - https://github.com/facebook/flow/releases/tag/v0.217.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • Flow will now ban variance annotations in function or function type parameters. example
  • React.Element is now opaque, but we still expose some of its internal structure via the bound on the opaque type. You should not depend on the internal structure. In a future release, we plan to make React.Element truly opaque.
  • Fixed an issue with implicit instantiation in operations over unions that caused many errors to be missed.
  • Changed the ref params on forwardRef and useImperativeHandle to be write-only. Patterns that rely on refining these params to an object and reading the ref field are misusing these APIs. example
  • React.ElementProps is now more precise when applied to AbstractComponents, resulting in the config type of the component rather than mixed. This will cause errors when elements of components with different props are passed into React.Element<> types.

Parser:

  • We now parse type arguments after typeof annotations. e.g. typeof MyGenericClass<string, number>. Type checking for this syntax is still not supported.

Library Definitions:

  • Update URLSearchParams definitions (thanks @pascalduez).
  • Update AbortSignal definitions (thanks @pascalduez).
  • Add Array copying methods (toReversed, toSorted, toSpliced and with) the $ReadOnlyArray class definitions (thanks @pascalduez).
flow - https://github.com/facebook/flow/releases/tag/v0.216.1

Published by facebook-github-bot about 1 year ago

Notable bug fixes:

  • We fixed local find references for namespace imported variables. It will no longer error or return empty results.
flow - https://github.com/facebook/flow/releases/tag/v0.216.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • The ability to configure module.system.haste.use_name_reducers=false is removed. For now this option defaults to true and can only be set to true. The option to set the only possible value will be removed in a future release.

Notable bug fixes:

  • Fixed cases where hovering over a parser error could cause the Flow server to appear to hang.

Library Definitions:

flow - https://github.com/facebook/flow/releases/tag/v0.215.1

Published by facebook-github-bot about 1 year ago

Notable bug fixes:

  • We fixed a bug that causes us to insert extra quote in autocomplete string literal in indexed access types.
flow - https://github.com/facebook/flow/releases/tag/v0.215.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • Improved analysis determining if a function has an implicit void return. As a result, some incorrectly typed code will no longer type check. (example)
  • Fixed a bug where global assignments in generics wouldn't flag errors. (example)

New features:

  • Flow now supports contextual typing for class private property assignments. (example)

IDE:

  • Local find all references will now return a more comprehensive result list.
  • Go to definition now supports indexed access types.

Library Definitions:

flow - https://github.com/facebook/flow/releases/tag/v0.214.0

Published by facebook-github-bot about 1 year ago

Likely to cause new Flow errors:

  • Flow now has stricter behavior with $Call, $ObjMap, $ObjMapi, $ObjMapConst, $TupleMap. Previously hidden type errors might be revealed now.
  • You can no longer disable tuple_ehancements, conditional_type, mapped_type, type_guards in flowconfig, since these options have been removed. They were enabled by default since v0.212.0.

IDE:

  • We now provide a new refactor that extracts JSX elements into a new React component.
  • Extract to constant refactors now works for nested JSX elements and fragments.

Notable bug fixes:

  • Added default type arguments for the built-in React$AbstractComponent to match the React.AbstractComponent type alias in our libdefs. [try-flow]

Library Definitions:

  • Added parseArgs to the Node.js util module library definition
flow - v0.213.1

Published by facebook-github-bot about 1 year ago

Notable bug fixes:

  • Fixed a bug where local find references do not return references in jsx props.