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

fix: added FlowFixMe on Array.prototype.flatMap #2131

Merged
merged 1 commit into from Aug 26, 2019

Conversation

Michael-M-Judd
Copy link
Contributor

  • Fix for flow-bin 0.96, which complains about flatMap not existing.

When on flow-bin 0.96, we get flow complaints with the flatMap polyfill:

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/graphql/polyfills/flatMap.js.flow:12:30

Cannot get Array.prototype.flatMap because property flatMap is missing in Array [1].

     node_modules/graphql/polyfills/flatMap.js.flow
       9│ // $FlowFixMe
      10│ const flatMap = Array.prototype.flatMap
      11│   ? function(list, fn) {
      12│       return Array.prototype.flatMap.call(list, fn);
      13│     }
      14│   : function(list, fn) {
      15│       let result = [];

     /private/tmp/flow/flowlib_3d33be40/core.js
 [1] 242│ declare class Array<T> extends $ReadOnlyArray<T> {

I believe line 10, the first $FlowFixMe there does the exact same thing as well. It's worth noting that the latest version of flow-bin does not have this problem.

- Fix for flow-bin 0.96, which complains about flatMap not existing.
@IvanGoncharov IvanGoncharov merged commit d884237 into graphql:master Aug 26, 2019
@IvanGoncharov
Copy link
Member

@Michael-M-Judd Thanks for PR 👍
This happened because Flow v0.103.0 finally added flatMap definition and I was too eager in removing $FlowFixMe:
https://github.com/facebook/flow/releases/tag/v0.103.0

Added support for Array#flatMap

@IvanGoncharov IvanGoncharov added the PR: bug fix 🐞 requires increase of "patch" version number label Aug 26, 2019
@IvanGoncharov
Copy link
Member

@Michael-M-Judd I also plan to include a few other fixes and release 14.5.4 today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bug fix 🐞 requires increase of "patch" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants