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-related work on the path to RN v0.64 upgrade, part 3. #4836

Merged
merged 23 commits into from
Jul 2, 2021

Conversation

chrisbobbe
Copy link
Contributor

Parts 1 and 2 were #4518 and #4520.

As I explained at #3452 (comment),

We'll want to fix [#3452] on the path to the RN v0.64 upgrade (#4426). facebook/react-native@050a7dd turns on exact_by_default with the warning that RN code might assume that projects have turned it on.

#4518 has been merged, toward this, and I've just opened #4520.

The first few commits fix a few small things that have crept into our own code since #4520, and then the rest deal with the libdefs.

Fixes: #3452

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks @chrisbobbe ! This all looks good -- glad to have this upgrade to our Flow feature-set completed.

I'm about to merge; I'll just edit a commit message to add the answer to the question I had below.

Comment on lines -1 to -2
// flow-typed signature: 01a139bd4c71685f16dbe4315660c576
// flow-typed version: <<STUB>>/react-native-document-picker_v^3.2.4/flow_v0.92.0
Copy link
Member

Choose a reason for hiding this comment

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

libdefs: Remove two stub libdefs that duplicate non-stub libdefs.

Yeah. So the reason this duplicate is here (and I haven't checked the other one but I'd guess it's the same story) is:

commit 6219e5a
Author: Vishwesh Jainkuniya jainkuniya@gmail.com
Date: Sun Aug 11 14:38:51 2019 +0530

flow: Add dummy libdef for react-native-document-picker.

In e17b1a1ee we replaced the stub libdef for this library with
our own real one.  But `yarn update-libdefs` (and the underlying
`flow-typed update`) doesn't notice our real one, and keeps wanting
to generate a new stub.

It's annoying to have to keep deleting the stub whenever we use
`yarn update-libdefs`, so just let it have its way.  Fortunately
the real libdef takes precedence, empirically: if we artificially
introduce a type error in ComposeMenu.js where this library is
used, Flow indeed catches it.

What was causing the duplicate to get in your way?

… Ah I see, this later commit answers that question:

libdefs: Remove stub libdefs.

And use `$FlowFixMe[untyped-import]` where these stub libdefs were
suppressing complaints from Flow in a way that was harder to notice.

Sounds like a good plan to me!

From experimentation, I don't see any complaints from Flow when I
remove this. Remove it, just for that reason.
And use `$FlowFixMe[untyped-import]` where these stub libdefs were
suppressing complaints from Flow in a way that was harder to notice.
…iends.

In particular, more like `WebViewError, `WebViewMessage`, etc., just
above it.

An instance of zulip#3452.
I'm not so sure we need a libdef for `prettier`, actually.

Anyway, an instance of zulip#3452.
@gnprice gnprice merged commit c96da70 into zulip:master Jul 2, 2021
@chrisbobbe
Copy link
Contributor Author

Thanks for the review!

@chrisbobbe chrisbobbe mentioned this pull request Sep 8, 2021
@chrisbobbe chrisbobbe deleted the rn-64-flow-3 branch November 4, 2021 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert all object types to exact, or explicitly-inexact
2 participants