Skip to content

Commit 008ee0d

Browse files
committed
upgrade react-native to 0.72.5
This PR does many things : - Upgrade `react-native ` to `0.72.5` - Upgrade `react-native-reanimated` to `3.5.4` - Upgrade `react-native-navigation` to `7.37.0` - `ndkVersion` has been bumped to `25.2.9519653` - `cmakeVersion` has been bumped to `3.22.1` - `kotlinVersion` has been bumped to `1.7.22` - `AGP` has been bumped to `7.4.2` - `Gradle` has been upgraded to `8.0.1` - Android `CompileSDK` and `TargetSDK` have been bumped to 33 - `@react-native-async-storage/async-storage` has been upgraded to `1.19.3` - `@walletconnect/client` has been nuked - some of the old `react-native-reanimated` code has been nuked - `react-native-keychain` fork has been replaced with `8.1.2` - On Android we are currently relying on `Hermes` Engine. - On iOS we are currently relying on JSC - We are not enabling new architecture for now (I have plans for that in the future) ref: #18138 IOS only PR : #16721 Android only PR : #17062 - `make run-metro` now has a target of `android` which was `clojure` earlier, this will increase the time it takes to start metro terminal but this is needed otherwise you will get a nasty error while developing for android locally.
1 parent f155d95 commit 008ee0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5595
-4768
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
};

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ project.xcworkspace
3636
**/android/.project
3737
**/android/.settings/org.eclipse.buildship.core.prefs
3838
local.properties
39+
*.hprof
40+
.cxx/
41+
*.keystore
42+
!debug.keystore
3943

4044
# Atom
4145
.tags*

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ run-clojure: export TARGET := clojure
263263
run-clojure: ##@run Watch for and build Clojure changes for mobile
264264
yarn shadow-cljs watch mobile
265265

266-
run-metro: export TARGET := clojure
266+
run-metro: export TARGET := android
267267
run-metro: ##@run Start Metro to build React Native changes
268268
@scripts/start-react-native.sh
269269

@@ -368,7 +368,7 @@ component-test-watch: ##@ Watch tests and re-run no changes to cljs files
368368
@@scripts/check-metro-shadow-process.sh
369369
rm -rf ./component-spec
370370
yarn install
371-
nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js' -e cljs
371+
nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js --testEnvironment node ' -e cljs
372372

373373
component-test: export TARGET := clojure
374374
component-test: export COMPONENT_TEST := true
@@ -378,7 +378,7 @@ component-test: ##@test Run component tests once in NodeJS
378378
rm -rf ./component-spec
379379
yarn install
380380
yarn shadow-cljs compile component-test && \
381-
jest --config=test/jest/jest.config.js
381+
jest --clearCache && jest --config=test/jest/jest.config.js --testEnvironment node
382382

383383
#--------------
384384
# Other

android/app/build.gradle

Lines changed: 62 additions & 214 deletions
Large diffs are not rendered by default.

android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
3-
android:installLocation="auto"
4-
package="im.status.ethereum">
3+
android:installLocation="auto">
54

65
<!-- non-dangerous permissions -->
76
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
@@ -17,11 +16,11 @@
1716
<uses-feature android:name="android.hardware.camera" />
1817
<uses-feature android:name="android.hardware.camera.autofocus" />
1918
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
20-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
21-
android:maxSdkVersion="28" />
19+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
20+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
2221
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
2322
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
24-
23+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
2524
<uses-permission android:name="android.permission.RECORD_AUDIO" />
2625

2726
<application

android/app/src/main/java/im/status/ethereum/MainActivity.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
import android.os.Bundle;
2424
import android.os.Handler;
2525
import com.facebook.react.ReactActivityDelegate;
26-
import com.facebook.react.ReactRootView;
26+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
27+
import com.facebook.react.defaults.DefaultReactActivityDelegate;
2728
import com.facebook.react.modules.core.DeviceEventManagerModule;
2829
import com.facebook.react.bridge.Arguments;
2930
import com.facebook.react.bridge.WritableMap;
@@ -32,7 +33,6 @@
3233
import com.reactnativenavigation.NavigationActivity;
3334
import com.facebook.react.modules.core.PermissionListener;
3435
import androidx.core.splashscreen.SplashScreen;
35-
import com.facebook.react.ReactActivity;
3636

3737
import java.util.Properties;
3838
import im.status.ethereum.module.StatusThreadPoolExecutor;
@@ -46,6 +46,14 @@ public class MainActivity extends NavigationActivity
4646
private boolean keepSplash = true;
4747
private final int SPLASH_DELAY = 3200;
4848

49+
/**
50+
* Returns the name of the main component registered from JavaScript. This is used to schedule
51+
* rendering of the component.
52+
*/
53+
protected String getMainComponentName() {
54+
return "StatusIm";
55+
}
56+
4957
private static void registerUncaughtExceptionHandler(final Context context) {
5058
final Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
5159
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
package im.status.ethereum;
22

33
import androidx.multidex.MultiDexApplication;
4-
import android.content.Context;
54
import android.webkit.WebView;
6-
import im.status.ethereum.newarchitecture.MainApplicationReactNativeHost;
75
import java.lang.reflect.InvocationTargetException;
86
import com.facebook.react.PackageList;
97

10-
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
118
import com.facebook.react.ReactApplication;
129
import cl.json.RNSharePackage;
1310
import com.facebook.react.ReactNativeHost;
1411
import com.reactnativenavigation.NavigationApplication;
1512
import com.reactnativenavigation.react.NavigationReactNativeHost;
1613
import com.facebook.react.ReactPackage;
17-
import com.facebook.react.config.ReactFeatureFlags;
18-
import com.facebook.react.ReactInstanceManager;
14+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
1915
import com.facebook.react.modules.network.OkHttpClientProvider;
2016
import com.reactnativecommunity.blurview.BlurViewPackage;
2117

@@ -27,7 +23,6 @@
2723
import im.status.ethereum.StatusOkHttpClientFactory;
2824

2925
import com.facebook.react.bridge.JSIModulePackage;
30-
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
3126

3227
public class MainApplication extends NavigationApplication {
3328

@@ -44,7 +39,6 @@ protected List<ReactPackage> getPackages() {
4439

4540
List<ReactPackage> packages = new PackageList(this).getPackages();
4641
packages.add(statusPackage);
47-
packages.add(new ReactNativeDialogsPackage());
4842
packages.add(new RNStatusKeycardPackage());
4943
packages.add(new PushNotificationPackage());
5044
packages.add(new BlurViewPackage());
@@ -56,32 +50,38 @@ protected String getJSMainModuleName() {
5650
return "index";
5751
}
5852

59-
@Override
60-
protected JSIModulePackage getJSIModulePackage() {
61-
return new ReanimatedJSIModulePackage();
62-
}
53+
54+
@Override
55+
protected boolean isNewArchEnabled() {
56+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
57+
}
58+
59+
@Override
60+
protected Boolean isHermesEnabled() {
61+
return BuildConfig.IS_HERMES_ENABLED;
62+
}
63+
6364
};
6465

65-
private final ReactNativeHost mNewArchitectureNativeHost = new MainApplicationReactNativeHost(this);
6666

6767
@Override
6868
public ReactNativeHost getReactNativeHost() {
69-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
70-
return mNewArchitectureNativeHost;
71-
} else {
72-
return mReactNativeHost;
73-
}
69+
return mReactNativeHost;
7470
}
7571

7672
@Override
7773
public void onCreate() {
7874
super.onCreate();
79-
// If you opted-in for the New Architecture, we enable the TurboModule system
80-
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
8175

8276
OkHttpClientProvider.setOkHttpClientFactory(new StatusOkHttpClientFactory());
8377

8478
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG_WEBVIEW == "1");
79+
80+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
81+
// If you opted-in for the New Architecture, we load the native entry point for this app.
82+
DefaultNewArchitectureEntryPoint.load();
83+
}
84+
8585
}
8686

8787
}

android/app/src/main/java/im/status/ethereum/newarchitecture/MainApplicationReactNativeHost.java

Lines changed: 0 additions & 103 deletions
This file was deleted.

android/app/src/main/java/im/status/ethereum/newarchitecture/components/MainComponentsRegistry.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

android/app/src/main/java/im/status/ethereum/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)