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

WIP: Upgrade to RN 0.59 #3422

Closed
wants to merge 6 commits into from
Closed

WIP: Upgrade to RN 0.59 #3422

wants to merge 6 commits into from

Conversation

borisyankov
Copy link
Contributor

@borisyankov borisyankov commented Mar 20, 2019

Addresses #3399

Fixes #3381

@borisyankov borisyankov added P1 high-priority blocked on other work To come back to after another related PR, or some other task. labels Mar 20, 2019
@gnprice gnprice added the review label Mar 20, 2019
@gnprice
Copy link
Member

gnprice commented Mar 20, 2019

Thanks @borisyankov !

Just reviewed #3296 and made some comments there; looks quite close.

This branch is marked WIP, so I won't review in detail. High-level feedback:

  • Would you add a few words about how you determined each of these changes? E.g., why this particular set of version upgrades, and why these particular changes to the Babel config files?

  • Ideally this would meaning explaining the motivation for these changes, and what they mean.

    If you're not sure of those and it's hard to figure them out: how did you determine the changes? Did you use a tool -- if so, what commands did you use?

  • Do things actually work after the version-upgrade commit? Or if not: what's broken?

    As you know, my strong preference is to keep things not-broken at every commit. Sometimes an upgrade like this can make that hard... but if we do make exceptions, it's important that they be super explicit. That way at least the effect on trying to read and understand the changes is mitigated.

@borisyankov
Copy link
Contributor Author

The JavaScriptCore.framework commit is definitely needed for iOS to work.
There are few changes needed for Android that are more complicated as our config does not match the default RN one anymore.

@gnprice
Copy link
Member

gnprice commented Mar 22, 2019

The JavaScriptCore.framework commit is definitely needed for iOS to work.

Thanks, good to know!

Can that commit come before the upgrade?

(There isn't much of a commit message in this WIP version -- and I don't really understand what the change is doing.)

If so, that'd be much preferable. (But as above, at a bare minimum if we can't do any better then this fact should be super explicit in the commit message where we do the upgrade.)

@borisyankov
Copy link
Contributor Author

It might be. I will explore that.
The WebView upgrade become a bit more complicated so focusing on that first.

@borisyankov borisyankov force-pushed the rn59_1 branch 2 times, most recently from 833618c to 6edfc39 Compare March 25, 2019 21:08
@gnprice gnprice removed the blocked on other work To come back to after another related PR, or some other task. label Mar 27, 2019
@gnprice
Copy link
Member

gnprice commented Mar 27, 2019

Just merged #3296, which was blocking this.

@gnprice
Copy link
Member

gnprice commented Mar 27, 2019

As I mentioned on #3428, I just spent a bit of time looking at the Flow aspect of this. Folding in here the relevant points:

  • At the tip of the branch, there are 188 errors, and 130 of them are related to react-redux's connect.
  • I've previously spent some time digging into that rather gnarly type -- which, it turns out, isn't even right. Let's have me pick that part of the problem up, to make use of my previous investigations. Looks like it's triggered just by upgrading Flow, even with no other changes.
  • Handy command for summarizing Flow errors: node_modules/.bin/flow --json | jq '.errors|map(.message[0].descr)|.[]' -r | sort | uniq -c

Another thought:

  • In general the bulk of the Flow errors seem independent of the upgrade of anything but Flow itself. And I expect nearly all of them will be compatible with the old Flow version. So the fixes for those are all excellent candidates for merging before the upgrade.
    • Though actually upgrading Flow may have to be in tandem with upgrading RN -- because it finds errors in the old version of RN itself!

@gnprice
Copy link
Member

gnprice commented Mar 27, 2019

I just pushed one of these commits that had a Flow fix (4851f34) as well as a few other Flow 0.92 fixes that I spotted when poking at this. Thanks!

And I'll bump the connect issue up to my near-term todo list.

@gnprice
Copy link
Member

gnprice commented Apr 4, 2019

I have a branch at gnprice/zulip-mobile@connect that upgrades to the new libdef for connect; and I've pushed a couple series of commits now to fix type errors that that exposes. ✨ (2da96e7^..f89f317 today, and more in the previous few days.)

At this point I think it's reduced to just one issue, which is that the new libdef seems not to take into account the funky semantics of defaultProps -- I get a bunch of errors like

Cannot create Screen element because property autoFocus is missing in
MergeOPSP [1] but exists in object type [2] in type argument Props [3].

where, say, Screen is invoked without mentioning the (optional! has a default!) prop autoFocus.

So, next up is I'll dig into that. Then connect should be a go! We might even be able to upgrade the libdef before the big upgrades (of Flow version, and of RN itself) -- the reason we don't already get it on yarn update-libdefs is that it's marked in the flow-typed repo as only being for Flow versions v0.89+, but seems to WFM just fine on our v0.78.

@gnprice gnprice mentioned this pull request Jul 18, 2019
gnprice added a commit to gnprice/zulip-mobile that referenced this pull request Jul 25, 2019
Fixes zulip#3399!

The bulk of the work of this upgrade went into a large number of
commits previous to this one.  The majority of the last few dozen
commits, after 1c86488^, were part of the upgrade; some discussion
in zulip#3561.  An earlier wave of effort focused on getting things working
with the upgrade of Flow to v0.92; see zulip#3450 and especially f8c9810,
and then zulip#3453 and zulip#3442.  Some other early discussion is at zulip#3422.

This commit itself was done mainly by running:

  $ tools/upgrade rn v0.59.10

Then, that tool needs a bit of an update for changes upstream.
Because I'm feeling pressed to get this upgrade out the door (and
to deal with the various separate trouble on iOS), I just took
care of the other relevant packages by hand: updated `@babel/core`
and `metro-react-native-babel-preset` in package.json according to
the diff seen in `rn-diff-purge`, then reran `yarn`.
@gnprice
Copy link
Member

gnprice commented Jul 26, 2019

#3399 is now complete! Closing this version.

@gnprice gnprice closed this Jul 26, 2019
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.

Cannot scroll to the bottom in buddy list
2 participants