Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency flow-parser to v0.233.0 #16179

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 28, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
flow-parser (source) 0.229.0 -> 0.233.0 age adoption passing confidence

Release Notes

facebook/flow (flow-parser)

v0.233.0

Compare Source

Likely to cause new Flow errors:

  • Flow will now error on invalid type applications at the declaration site, if the type application does not use another generic type from an outer scope. example
  • We fixed a bug where we incorrectly unwrapped the opaque type to the underlying representation in refinements
  • Predicate functions (%checks) can no longer be recursive
  • Fixed subtyping of indexers in instances/interfaces

Notable bug fixes:

  • We fixed some spurious errors regarding opaque type refinements. example
  • We made a change to method-unbinding errors so that it no longer errors when in an any/mixed context. This allows us to better support jest
  • We fixed an issue where explicitly supplied JSX type arguments were ignored
  • We fixed bigint Flow Enums that do not explicitly speicy of bigint during parsing. We were previously not correctly inferring that this was a bigint enum.
  • flow.org/try now supports go-to-definition, autocomplete, and signature help

Parser:

  • Previously Flow outputs ReadOnlyTypeAnnotation in parser output for annotations like readonly string[]. Now we output it as TypeOperator with "operator": "readonly"

IDE:

  • Fix printer output of casting syntax when LHS of as or as const has low precedence

Library Definitions:

  • We migrated the built-in React library definitions to use component and hook syntax for various React-provided APIs. Look out for a blog post on our medium account for more details and see the React section in our docs

v0.232.0

Compare Source

Likely to cause new Flow errors:

  • Support for $Compose and $ComposeReverse types are removed. We recommend to use overloads to approximate their behavior instead. e.g.
declare export function compose(): <T>(a: T) => T;
declare export function compose<F: (...$ReadOnlyArray<empty>) => mixed>(
  f: F,
): F;
declare export function compose<A, T: $ReadOnlyArray<any>, R>(
  f1: (a: A) => R,
  f2: (...T) => A,
): (...T) => R;
declare export function compose<A, B, T: $ReadOnlyArray<any>, R>(
  f1: (b: B) => R,
  f2: (a: A) => B,
  f3: (...T) => A,
): (...T) => R;
declare export function compose<A, B, C, T: $ReadOnlyArray<any>, R>(
  f1: (c: C) => R,
  f2: (b: B) => C,
  f3: (a: A) => B,
  f4: (...T) => A,
): (...T) => R;
declare export function compose<R>(
  f1: (b: any) => R,
  ...funcs: $ReadOnlyArray<(...$ReadOnlyArray<empty>) => mixed>
): (...$ReadOnlyArray<any>) => R;
declare export function compose<R>(
  ...funcs: $ReadOnlyArray<(...$ReadOnlyArray<empty>) => mixed>
): (...$ReadOnlyArray<any>) => R;
  • You might see more errors around type application. example
  • Fix subtyping of indexers in instances/interfaces. example

New Features:

  • Updated the isValid Flow Enums method to use a type guard, allowing it to refine its input to the enum type in a conditional context.
    E.g.
enum Status {Active, Off}
const s = "Active";
if (Status.isValid(s)) {
  s as Status; // Should work
}
  • export type Foo = ... and export interface Bar {...} statements are now allowed in declare module and declare namespace bodies.
  • We added a new codemod flow codemod remove-unnecessary-react-import which can help remove unnecessary react imports under react.runtime=automatic

Notable bug fixes:

  • Fixed issue when explicitly supplied JSX type arguments are ignored
  • Fixed code action output of casting syntax when LHS of as or as const has low precedence

Library Definitions:

  • Added definitions for the following APIs:
    • window.showOpenFilePicker(): MDN, WICG
    • window.showSaveFilePicker(): MDN, WICG
    • window.showDirectoryPicker(): MDN, WICG
    • DataTransferItem.getAsFileSystemHandle(): MDN, WICG
    • StorageManager.getDirectory(): MDN, WHATWG

v0.231.0

Compare Source

Likely to cause new Flow errors:

  • Fixed subtyping of inline interfaces, e.g. try-flow.

New Features:

  • No longer trigger method-unbinding errors with indexed access types.
  • Add relay_integration.esmodules option. When this option, along with relay_integration, is enabled, Flow will treat graphql fragments/queries/etc. as import default rather than require. Use this when you ouput ESM from Relay's codegen (e.g. eagerEsModules).

Notable bug fixes:

  • Don't error when returning an array, map, etc when an AsyncGenerator<T, void, void> type is expected (e.g. try-Flow)

IDE:

  • Fixed a bug where AUTO332 appeared in the result of string literal type completion.

Library Definitions:

  • Added definitions for FileSystem APIs (thanks @​ZelJin).
  • Added constructor to the StorageManager class (thanks @​ZelJin).
  • Removed checkPropTypes, DOM, createClass, ConcurrentMode from react module.
  • Types in react module can now also be used when React is default imported like import React from 'react', they can also be used without imports, e.g. type N = React.Node.

v0.230.0

Compare Source

Likely to cause new Flow errors:

  • We now put value exports and type exports into two different namespaces. It means that we will now consistently error on places where you try to import, re-export, or use a imported type as a value. This change also makes certain patterns that happen to work in the past no longer work, e.g.
// a.js
export type Foo = string;
// b.js
const A = require('./a');
module.exports = {...A};
// c.js
// previously allowed, no longer allowed
import type {Foo} from './b';
  • We have allowed function parameters to refer to each other for a while now. However, we didn't implement the analysis correctly for exported functions, which causes inconsistent behaviors. This is now fixed e.g.
// a.js
// we incorrectly resolve x to refer to
// be external to the function params,
// which is a global in this case
export function foo(x: string, y: typeof x) {}
// b.js
import {foo} from './a';
foo("", 3); // no error before, errors now
  • Previously, we allowed assignment to any globals, regardless of whether it's a type or value. Therefore, both were allowed in Array = 3; $ReadOnlyArray = 2; Now the latter is banned.
  • Flow now consistently bans referring a type-only global as value
  • Some bad annotations that cause value-as-type or recursive-definition errors will no longer affect which branch to take in overload resolution.

New Features:

  • Flow now supports typeof with type arguments type T = typeof foo<string>. This syntax is supported in prettier since v3.1. If you previously enabled the flag typeof_with_type_arguments=true, you need to remove it.
  • Flow now supports explicit type arguments on JSX. e.g. <Foo<string, _, number >propA='d' />. Note that some type arguments can be inferred using the _ syntax.
  • Flow now supports the same NoInfer intrinsic that will be available in TypeScript 5.4.
  • Under experimental.ts_syntax=true, Flow will
    • Automatically translate TypeScript's readonly on tuple and array types into Flow equivalent $ReadOnly<[...]> and $ReadOnlyArray<...> without error.
    • Automatically translate TypeScript's keyof into Flow equivalent $Keys without error. Note that there are behavior differences between $Keys<> and keyof right now (flow, TS), so use it with caution.
    • Automatically translate TypeScript's unknown never and undefined into Flow equivalent mixed empty and void without error.
    • Support TypeScript's variance annotation readonly in out, in out without error.

Misc:

v0.229.2

Compare Source

Misc:

  • Fixed a potential crash under the experimental flag experimental.blocking_worker_communication=false.

Configuration

📅 Schedule: Branch creation - "after 01:00 on sunday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependency Dependency Upgrade label Mar 28, 2024
Copy link

github-actions bot commented Mar 28, 2024

Size Change: +300 B (0%)

Total Size: 8.31 MB

Filename Size Change
./dist/plugins/flow.js 661 kB +150 B (0%)
./dist/plugins/flow.mjs 660 kB +150 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/bin 4.1 kB
./dist/bin/prettier.cjs 2.15 kB
./dist/doc.d.ts 6.91 kB
./dist/doc.js 53 kB
./dist/doc.mjs 49.3 kB
./dist/index.cjs 35.8 kB
./dist/index.d.ts 26.7 kB
./dist/index.mjs 772 kB
./dist/internal 4.1 kB
./dist/internal/cli.mjs 206 kB
./dist/LICENSE 220 kB
./dist/package.json 6.28 kB
./dist/plugins 4.1 kB
./dist/plugins/acorn.d.ts 109 B
./dist/plugins/acorn.js 149 kB
./dist/plugins/acorn.mjs 149 kB
./dist/plugins/angular.d.ts 177 B
./dist/plugins/angular.js 44.4 kB
./dist/plugins/angular.mjs 43.7 kB
./dist/plugins/babel.d.ts 419 B
./dist/plugins/babel.js 313 kB
./dist/plugins/babel.mjs 313 kB
./dist/plugins/estree.d.ts 11 B
./dist/plugins/estree.js 195 kB
./dist/plugins/estree.mjs 194 kB
./dist/plugins/flow.d.ts 90 B
./dist/plugins/glimmer.d.ts 93 B
./dist/plugins/glimmer.js 138 kB
./dist/plugins/glimmer.mjs 138 kB
./dist/plugins/graphql.d.ts 93 B
./dist/plugins/graphql.js 43.6 kB
./dist/plugins/graphql.mjs 43 kB
./dist/plugins/html.d.ts 139 B
./dist/plugins/html.js 146 kB
./dist/plugins/html.mjs 146 kB
./dist/plugins/markdown.d.ts 127 B
./dist/plugins/markdown.js 150 kB
./dist/plugins/markdown.mjs 149 kB
./dist/plugins/meriyah.d.ts 93 B
./dist/plugins/meriyah.js 120 kB
./dist/plugins/meriyah.mjs 120 kB
./dist/plugins/postcss.d.ts 121 B
./dist/plugins/postcss.js 151 kB
./dist/plugins/postcss.mjs 151 kB
./dist/plugins/typescript.d.ts 96 B
./dist/plugins/typescript.js 1.15 MB
./dist/plugins/typescript.mjs 1.15 MB
./dist/plugins/yaml.d.ts 90 B
./dist/plugins/yaml.js 122 kB
./dist/plugins/yaml.mjs 122 kB
./dist/README.md 4.03 kB
./dist/standalone.d.ts 1.37 kB
./dist/standalone.js 77.5 kB
./dist/standalone.mjs 77.3 kB

compressed-size-action

@renovate renovate bot force-pushed the renovate/flow-parser-0.x branch from 576edde to f8a7367 Compare April 3, 2024 19:55
@renovate renovate bot changed the title chore(deps): update dependency flow-parser to v0.232.0 chore(deps): update dependency flow-parser to v0.233.0 Apr 3, 2024
Copy link
Contributor Author

renovate bot commented Apr 4, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@fisker fisker merged commit 38c0680 into main Apr 4, 2024
30 checks passed
@fisker fisker deleted the renovate/flow-parser-0.x branch April 4, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Dependency Upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants