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

Flow: fix errors in 'flatMap.js' on old Flow versions #2137

Merged
merged 1 commit into from
Aug 27, 2019

Conversation

IvanGoncharov
Copy link
Member

Fixes #2136

@IvanGoncharov IvanGoncharov added the PR: bug fix 🐞 requires increase of "patch" version number label Aug 27, 2019
@IvanGoncharov IvanGoncharov merged commit 8ab6524 into graphql:master Aug 27, 2019
@@ -5,11 +5,14 @@ declare function flatMap<T, U>(
fn: (item: T, index: number) => $ReadOnlyArray<U> | U,
): Array<U>;

// Workaround to make older Flow versions happy
const flatMapMethod = (Array.prototype: any).flatMap;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedwards1211 We enabled Flow warnings in config:

include_warnings=true

So flow generate warnings for ignored $FlowFixMe.
It also possible that other projects using include_warnings=true
So I decided to just use any since it works in all Flow versions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, yeah the fact that ignore comments may not work when the package is used as a dependency is a real shortcoming of Flow right now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I released 14.5.4 📦 with this fix included.
Sorry for the delay.

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.

2 participants