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

Upgrade react-native to 0.68.2 #435

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

ofreyssinet-ledger
Copy link
Contributor

@ofreyssinet-ledger ofreyssinet-ledger commented Jun 22, 2022

Disclaimer

Yes I know that RN 0.69.0 was released last week 😬 but I was already working on this and it's a 1st step forward that is needed to unblock us on some topics (see below).

📝 Description

I'm doing this because we would like to be ready for [email protected] (which requires [email protected]) when it releases (right now it's in alpha) as it will solve a dependency conflict with storyly-react-native which we would like to use.

Main changes:

  • Upgraded react-native to 0.68.2, following this guide and picked what works for us:
    • we don't upgrade Flipper as it crashes on runtime
    • we don't upgrade gradle as it builds fine like this and v7 didn't work out of the box
    • we don't keep react-native-gradle-plugin as it's only necessary for the new architecture..
    • we don't change AppDelegate.m to the new AppDelegate.mm as it's only useful for the new RN arch which we aren't using yet + it was a pain to migrate the existing config (Firebase, Flipper, splash screen)
  • Upgraded react-native-reanimated to 2.8.0
  • Upgraded lottie-react-native to 5.1.3 as it was not building on iOS without upgrading -> I tested the device lotties in the "Debug Lottie" menu and it seems to work fine.
  • Upgraded react-native-gesture-handler to 2.5.0 & Migrating off RNGHEnabledRootView as its setup on Android (in MainActivity.java) might conflict with react-native stuff later on
  • Fixed an issue in the portfolio where if there was no assets, scrolling was crashing the app on iOS. This is a mysterious issue and the logs are similar to this issue [iOS] ScrollView event fatal crash software-mansion/react-native-reanimated#2285, for now it has been solved by removing the animation of a border width (border which anyway was invisible so the animation was pointless).

What I tested:

I didn't test much of the app after fixing the obvious crashes & issues, just tested the very basic functionality of the app on real device for both platforms + things known to be susceptible to break while upgrading react-native (following list). A full round of non-regression testing will have to be done on both platforms before merging.

  • Android (tested on OnePlus 8, staging build from https://github.com/LedgerHQ/ledger-live/actions/runs/2591069426)

    • QR code scanning → tested with an import account from LLD flow
    • Bluetooth pairing
    • Camera access → tested with an import account from LLD flow
    • Password lock
    • Fingerprint lock
    • dApp correct render → tested with Paraswap
    • Deeplinks -> tested with all deeplinks from testing page (pnpm mobile test-deep-links)
  • iOS (tested on iPhone X, staging build from: https://github.com/LedgerHQ/ledger-live-build/actions/runs/2623892281)

    • QR code scanning → tested with an import account from LLD flow
    • Bluetooth pairing
    • Camera access → tested with an import account from LLD flow
    • Password lock
    • dApp correct render → tested with Paraswap
    • Deeplinks -> tested with all deeplinks from testing page (pnpm mobile test-deep-links)

TODO

Issues detected but not a regression (already happening on prev versions of RN):

❓ Context

  • Impacted projects: ledger-live-mobile
  • Linked resource(s): FAT-165

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

A full round of non-regression testing will have to be done on both platforms before merging.

📸 Demo

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

@live-github-bot
Copy link
Contributor

@ofreyssinet-ledger

Unfortunately this PR does not comply with the Contributing Conventions and will be closed automatically.

Feel free to reopen this PR once you have browsed through the guidelines.


Found Issues:

  • the description is missing or you removed or overrode one or more sections of the pull request template

@changeset-bot
Copy link

changeset-bot bot commented Jun 22, 2022

🦋 Changeset detected

Latest commit: 8319ff4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
live-mobile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@live-github-bot live-github-bot bot closed this Jun 22, 2022
@vercel
Copy link

vercel bot commented Jun 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
live-common-tools ✅ Ready (Inspect) Visit Preview Jul 18, 2022 at 0:49AM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Jul 18, 2022 at 0:49AM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Jul 18, 2022 at 0:49AM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Jul 18, 2022 at 0:49AM (UTC)

@github-actions github-actions bot added the mobile Has changes in LLM label Jun 22, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 22, 2022

@ofreyssinet-ledger

Screenshots: ✅

There are no changes in the screenshots for this PR. If this is expected, you are good to go.

@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #435 (8319ff4) into develop (bad1450) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop     #435      +/-   ##
===========================================
- Coverage    47.69%   47.68%   -0.01%     
===========================================
  Files          613      613              
  Lines        27277    27277              
  Branches      6827     6827              
===========================================
- Hits         13009    13008       -1     
- Misses       14208    14209       +1     
  Partials        60       60              
Flag Coverage Δ
test 47.68% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
libs/ledger-live-common/src/range.ts 94.87% <0.00%> (-2.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bad1450...8319ff4. Read the comment docs.

@@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbh I don't know what this is and why it changed 😬

return new ReactActivityDelegateWrapper(this, new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See following section in PR description:

  • Upgraded react-native-gesture-handler to 2.5.0 & Migrating off RNGHEnabledRootView as its setup on Android (in MainActivity.java) might conflict with react-native stuff later on

@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
Copy link
Contributor Author

@ofreyssinet-ledger ofreyssinet-ledger Jun 28, 2022

Choose a reason for hiding this comment

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

file taken from upgrade tool

@@ -121,7 +121,7 @@ - (void)applicationDidEnterBackground:(UIApplication *)application {
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix necessary to build on RN 0.68.2, see facebook/react-native#33451 (comment)

@@ -183,7 +183,7 @@ function App({ importDataString }: AppProps) {
});

return (
<View style={styles.root}>
<GestureHandlerRootView style={styles.root}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See following section of PR description

  • Upgraded react-native-gesture-handler to 2.5.0 & Migrating off RNGHEnabledRootView as its setup on Android (in MainActivity.java) might conflict with react-native stuff later on

@@ -96,38 +96,13 @@ function PortfolioHeader({
};
}, [graphCardEndPosition]);

const ContainerStyle = useAnimatedStyle(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See following section of PR description:

Copy link
Contributor

@Justkant Justkant left a comment

Choose a reason for hiding this comment

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

LGTM, tested on a real android device and the ios simulator

Copy link
Contributor

@elbywan elbywan left a comment

Choose a reason for hiding this comment

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

LGTM! 👍 👌

@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from 3dcd365 to 59fce81 Compare June 30, 2022 15:36
@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from 59fce81 to ebeed76 Compare July 6, 2022 17:20
@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from ebeed76 to 9358832 Compare July 7, 2022 14:03
@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from 9358832 to b1cb93d Compare July 15, 2022 09:58
@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from b1cb93d to 79250a5 Compare July 15, 2022 10:20
@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from 79250a5 to ea9fdcf Compare July 15, 2022 13:24
@ofreyssinet-ledger ofreyssinet-ledger force-pushed the support/upgrade-rn-0.68.2 branch from deb8ba0 to e2c6267 Compare July 15, 2022 13:45
@gre
Copy link
Contributor

gre commented Jul 15, 2022

very impressive work @ofreyssinet-ledger , i hope you manage to fix all remaining topics 🤞

@ofreyssinet-ledger
Copy link
Contributor Author

@gre haha thanks! It's painful work but I think I'm finally done 🤞 at least with what QA detected in their last test:

  • an issue with Cosmos send: that was because of a wrong conflict resolution of the pnpm lock file when I rebased countless times this PR on develop 😅 That caused the installation of a wrong version of the Cosmos SDK I believe.
  • there was another issue with an animation in the RatingsModal on iOS, probably due to the upgrade of react-native-reanimated, I just fixed it.

use JDK 11 in build-mobile


tmp fix for flow error (#663)


flow


Fix anim issue in RatingsModal


Fix post rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation CI/CD stuff mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants