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

Small flow fixes #7634

Merged
merged 1 commit into from Sep 2, 2016
Merged

Small flow fixes #7634

merged 1 commit into from Sep 2, 2016

Conversation

sophiebits
Copy link
Collaborator

Needed for www (and correctness).

@sophiebits sophiebits added this to the 15-next milestone Sep 1, 2016
@sophiebits sophiebits self-assigned this Sep 1, 2016
@@ -16,14 +16,14 @@ import type { ReactPropTypeLocations } from 'ReactPropTypeLocations';

type NamesType = {[key: ReactPropTypeLocations]: string};

var ReactPropTypeLocationNames = {};
var ReactPropTypeLocationNames: NamesType = {};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously, the exported type seemed to be "object literal" and I couldn't index into it with a ReactPropTypeLocations.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the issue that I raised where flow doesn't have a way to have a variable defined only in __DEV__, the workaround is to always set the type to what's in __DEV__ as you just did.

@sophiebits sophiebits assigned vjeux and unassigned sophiebits Sep 1, 2016
@ghost ghost added the CLA Signed label Sep 1, 2016
@sebmarkbage
Copy link
Collaborator

Why wasn't this caught by our Flow? Are we on a different version?

@zpao
Copy link
Member

zpao commented Sep 1, 2016

I'm guessing probably for the same reason #7610 wasn't caught here - no flowified modules flow into here but in www it does happen.

@sophiebits
Copy link
Collaborator Author

Yeah, there are some www (flow) files using these internal modules.

@sebmarkbage
Copy link
Collaborator

sebmarkbage commented Sep 2, 2016

i see. Should we Flowify tests?

@sophiebits sophiebits merged commit 0c62d12 into facebook:master Sep 2, 2016
@vjeux
Copy link
Contributor

vjeux commented Sep 2, 2016

One tricky thing we flow is that if your call sites aren't using flow, you can write wrong annotations and if they do not conflict within the file, flow will let you write them. As you convert the callsites, you start seeing flow errors on those.

The solution for that is to add more flow types so that they get better over time :)

@zpao zpao modified the milestones: 15-next, 15.4.0 Oct 4, 2016
zpao pushed a commit that referenced this pull request Oct 4, 2016
Small flow fixes
(cherry picked from commit 0c62d12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants