8000 Upgrade to RN 0.72.12 by zatteo · Pull Request #1161 · cozy/cozy-flagship-app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upgrade to RN 0.72.12 #1161

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

Merged
merged 23 commits into from
Jul 2, 2024
Merged

Upgrade to RN 0.72.12 #1161

merged 23 commits into from
Jul 2, 2024

Conversation

zatteo
Copy link
Member
@zatteo zatteo commented Feb 7, 2024

Prerequisites

Android

✅ Build
✅ Start

iOS

✅ Build
✅ Start

Todo (dev)

Todo (test)

Extensive tests on real devices

On a real Android

  • biometry
  • backup
  • share
  • send to app
  • deep link
  • scanner
  • enabling geolocation
  • CCC

On a real iPhone

  • biometry
  • backup
  • share
  • send to app
  • deep link
  • scanner
  • enabling geolocation
  • CCC

@zatteo zatteo force-pushed the play-with-rn-upgrade branch from 7553e4d to 9c0f6b4 Compare April 5, 2024 14:08
@zatteo zatteo changed the title Play with RN 0.72 Upgrade to RN 0.72.12 Apr 5, 2024
@zatteo zatteo force-pushed the play-with-rn-upgrade branch from 9c0f6b4 to 96b1daa Compare April 5, 2024 14:27
@zatteo zatteo force-pushed the play-with-rn-upgrade branch 4 times, most recently from 82195be to 186917a Compare May 30, 2024 16:36
@zatteo zatteo marked this pull request as ready for review May 30, 2024 16:51
@zatteo zatteo requested review from acezard and Ldoppea as code owners May 30, 2024 16:51
@zatteo zatteo force-pushed the play-with-rn-upgrade branch from 186917a to dfce6dc Compare May 31, 2024 09:16
zatteo added 19 commits June 27, 2024 09:59
Automatically added during pod install.
I had to create a "release" folder to add the new empty
ReactNativeFlipper.java. It is not possible to put it in our
product flavor "main" folder because in this case
gradle complains about duplicate classes.

See facebook/react-native#36362 (comment)
"In new react-native 0.71.* have been change implementation of
AppDelegate.mm to simplify future upgrade process, that hide access
to rootView under the hood."

We need to get the "rootView" from
self.window.rootViewController.view according to this issue which
became the official solution :
zoontek/react-native-bootsplash#421
addEventListener()

AppState.removeEventListener has been removed in RN0.71.
As stated in the README "Using react-native >= 0.71? install
react-native-restart@0.0.27 and above", so let's update.
zatteo added 3 commits June 27, 2024 09:59
React Native <= 0.70 was polyfilling global.Promise. They removed it
(which is good), but it breaks some of our tests. So let's add it
again for the moment so we can finish this upgrade.

https://github.com/facebook/react-native/pull/34659/files#diff-759a02c8fa99d555891bb2a2d3ae2495a2295dc1e1183dc8ba6281b0e172208a
@testing-library/react-hooks does not support React 18. renderHook has been moved to @testing-library/react and @testing-library/react-native.

Migrated tests using it.
@zatteo zatteo force-pushed the play-with-rn-upgrade branch from dfce6dc to c736efb Compare June 27, 2024 08:00
@@ -1010,14 +1010,15 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't remember what are the consequences of this ?

Copy link
Member
@Ldoppea Ldoppea left a comment

Choose a reason for hiding this comment

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

With this upgrade we break support with iOS 11 as the new minimum is 12.4

Before merging this PR we should discuss how we want to handle this (i.e. announcement?)

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

namespace "io.cozy.flagship.mobile"
Copy link
Member

Choose a reason for hiding this comment

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

With namespace declared here, should we remove the one on defaultConfig in line 100?

Copy link
Member Author

Choose a reason for hiding this comment

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

I kept this one to be as close as default React Native configuration.

Tested building and running both brand app successfully.

@@ -46,10 +45,10 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should check how our app behaves on split screens as it seems to be the default configuration now

Cf: https://developer.android.com/guide/topics/large-screens/multi-window-support

Copy link
Member Author
@zatteo zatteo Jul 1, 2024

Choose a reason for hiding this comment

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

Looks good. Tested logging in, navigating between apps and some apps (Drive, Notes, Settings, CoachCO2, mespapiers).

We keep the namespace from React Native default configuration.
@zatteo zatteo merged commit 68f1e6f into master Jul 2, 2024
1 check passed
@zatteo zatteo deleted the play-with-rn-upgrade branch July 2, 2024 08:07
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.

2 participants
0