benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.95k stars 346 forks source link

Bump flow-parser from 0.195.0 to 0.208.0 #1318

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Bumps flow-parser from 0.195.0 to 0.208.0.

Release notes

Sourced from flow-parser's releases.

v0.208.0

Likely to cause new Flow errors:

  • Flow will now error on unsupported statements in library definitions, instead of silently ignoring them.
  • Flow will error more consistently when variables of type any and empty are used as types (e.g. try-Flow)

IDE:

  • Get definition request will now consistently jump to the name of the definition for ES module exports.
  • In find local references, if a reference appears in a named import, it will no longer highlight the entire import as reference. Instead, it will only highlight the relevant name.

Notable bug fixes:

  • Parameter types can now refer to previous parameters in the same parameter list (e.g. function f(x: number, y: typeof x) {})
  • Report error when a function parameter is redeclared in its body in functions that have default params (e.g. try-Flow)
  • For all declared names (declare class/var/let/const), we will allow full forward reference. All reads of these values will be considered to be initialized.

Misc:

  • Changed React.Element to support a second type argument, as supported by React$Element

Library Definitions:

  • Updated dom libdefs to allow Trusted Type objects

v0.207.0

Likely to cause new Flow errors:

  • When you pass a generic component type to some React utility type like React.ElementConfig<typeof some_generic_component>, we will replace all the type parameters with their defaults or bounds. It can potentially cause downstream errors. (Example)

New Features:

  • Add built-in (intrisic) element names like div to JSX autocomplete
  • Mapped types now support operating directly over keys, like TypeScript's Pick and Omit (Example). Mapped type support is still experimental; enable experimental.mapped_type=true to try them.

Notable bug fixes:

  • Don't check @noflow files in "all" mode
  • Fixed a source of spurious errors when using refined string keys as computed properties in objects (Example)
  • Improved Go to Definition on export statements

Library Definitions:

  • Added rel as an attribute to HTMLFormElement
  • Added WeakRef class definition
  • Added ariaHidden DOM property

v0.206.0

Likely to cause new Flow errors:

  • React.Element will now accept a second type argument that specifies the props type. JSX will populate this type argument with actual props passed to component, instead of deriving it from the signature. The change will reveal some broken code, e.g. try-Flow example.
  • $Shape is deprecated, use Partial instead. Read this blog post for more.
  • Add a (temporary) option tuple_enhancements to gate our tuple type enhancements (labeled tuple elements, which can be optional or have variance annotations), so we can show a Flow error rather than having users just get syntax errors from various other tooling (e.g. Prettier, ESLint), until all that tooling is updated.
  • experimental.abstract_locations is removed. Setting this config to true improves Flow's performance. The config defaults to true since 0.139.

New Features:

  • Allow opaque types with string supertypes to be used as keys in a dictionary, and have that opaque type be preserved when using Object.keys.
  • To help people familiar with TS, error on and supply a quickfix to the Flow equivalent for the TS types: Readonly, ReadonlyArray, ReadonlyMap, ReadonlySet, NonNullable.

Notable bug fixes:

... (truncated)

Changelog

Sourced from flow-parser's changelog.

0.208.0

Likely to cause new Flow errors:

  • Flow will now error on unsupported statements in library definitions, instead of silently ignoring them.
  • Flow will error more consistently when variables of type any and empty are used as types (e.g. try-Flow)

IDE:

  • Get definition request will now consistently jump to the name of the definition for ES module exports.
  • In find local references, if a reference appears in a named import, it will no longer highlight the entire import as reference. Instead, it will only highlight the relevant name.

Notable bug fixes:

  • Parameter types can now refer to previous parameters in the same parameter list (e.g. function f(x: number, y: typeof x) {})
  • Report error when a function parameter is redeclared in its body in functions that have default params (e.g. try-Flow)
  • For all declared names (declare class/var/let/const), we will allow full forward reference. All reads of these values will be considered to be initialized.

Misc:

  • Changed React.Element to support a second type argument, as supported by React$Element

Library Definitions:

  • Updated dom libdefs to allow Trusted Type objects

0.207.0

Likely to cause new Flow errors:

  • When you pass a generic component type to some React utility type like React.ElementConfig<typeof some_generic_component>, we will replace all the type parameters with their defaults or bounds. It can potentially cause downstream errors. (Example)

New Features:

  • Add built-in (intrisic) element names like div to JSX autocomplete
  • Mapped types now support operating directly over keys, like TypeScript's Pick and Omit (Example). Mapped type support is still experimental; enable experimental.mapped_type=true to try them.

Notable bug fixes:

  • Don't check @noflow files in "all" mode
  • Fixed a source of spurious errors when using refined string keys as computed properties in objects (Example)
  • Improved Go to Definition on export statements

Library Definitions:

  • Added rel as an attribute to HTMLFormElement
  • Added WeakRef class definition
  • Added ariaHidden DOM property

0.206.0

Likely to cause new Flow errors:

  • React.Element will now accept a second type argument that specifies the props type. JSX will populate this type argument with actual props passed to component, instead of deriving it from the signature. The change will reveal some broken code, e.g. try-Flow example.
  • $Shape is deprecated, use Partial instead. Read this blog post for more.
  • Add a (temporary) option tuple_enhancements to gate our tuple type enhancements (labeled tuple elements, which can be optional or have variance annotations), so we can show a Flow error rather than having users just get syntax errors from various other tooling (e.g. Prettier, ESLint), until all that tooling is updated.
  • experimental.abstract_locations is removed. Setting this config to true improves Flow's performance. The config defaults to true since 0.139.

New Features:

  • Allow opaque types with string supertypes to be used as keys in a dictionary, and have that opaque type be preserved when using Object.keys.

... (truncated)

Commits
  • fc60c2b v0.208.0
  • e3347e2 Support multi-file lint suppression cover
  • 957a023 [name-resolver] Return libdef toplevel members as a map
  • 34f62a4 [refactor] Directly call import kits for namespace import outside of libdefs
  • 6896a3e Drop the experimental prefix for conditional type
  • b3ea4d3 Improve use_op for literal subtyping check
  • 064088d [RFC] Force eval util types at the definition site when it's not abstract
  • 641f0c2 [refactor] Make context accept additional severity cover map instead of a sin...
  • 5163950 [libdef] Don't run infer_core for libdef
  • 5c2c580 [libdef] Explicitly error on all unsupported statements in libdef
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 1 year ago

Superseded by #1321.