zulip / zulip-mobile

Zulip mobile apps for Android and iOS.
https://zulip.com/apps/
Apache License 2.0
1.28k stars 643 forks source link

Migrate to community ViewPagerAndroid #3569

Open gnprice opened 5 years ago

gnprice commented 5 years ago

This is a followup to the RN v0.59 upgrade #3399. It will be required for an RN v0.61 upgrade when that's out, but isn't required for v0.60.

When launching the app with the debugger, the following message now goes to the console:

Warning: ViewPagerAndroid has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/viewpager' instead of 'react-native'. See https://github.com/react-native-community/react-native-viewpager

In v0.60, the core module is still there; but it's gone in master since facebook/react-native@f8a400a53fd7f336da3809ab87d88be0cd55b1af, which will presumably be in v0.61.

The README doesn't say much about upgrading; hopefully it's smoothly compatible.

At a quick grep, we don't refer to this module ourselves:

$ rg ViewPagerAndroid
$

But it's used in react-native-tab-view:

$ rg ViewPagerAndroid node_modules/
...

Which in turn is pulled in by react-navigation, and I'm guessing is used for the tab navigators.

So most likely what this will come down to is upgrading react-navigation, aka #3573. We're still on a ^1 version; we have partial work in #2702 and #3502 to move to ^2 and then ^3, which is the latest.

gnprice commented 5 years ago

We're now on react-navigation v2 (see #3573), so I looked back at this.

I no longer see the warning!

But I'm a bit puzzled... because when I go back to before the react-navigation upgrade, I no longer see it either. Ditto if I go back to 26.1.124... or even 26.0.123, right after the RN v0.59 upgrade. So I'm not sure what was different when I saw this before.

In any case, the newer react-native-tab-view that react-navigation v2 pulls in, namely 1.4.1, still refers to ViewPagerAndroid in its source. So I'll leave this open, and blocked on an upgrade to v3 (tracked in #3573).