From 11cac142560eda72c34445bef5d725f33f05309e Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Tue, 29 Oct 2024 16:43:37 +0100 Subject: [PATCH 1/2] fix: remove devmenu lib and enable bridgeless again --- __mocks__/react-native-dev-menu.ts | 11 ----------- .../main/java/com/expensify/chat/MainApplication.kt | 2 +- android/settings.gradle | 2 -- ios/Podfile.lock | 8 -------- package-lock.json | 8 -------- package.json | 1 - src/components/CustomDevMenu/index.native.tsx | 4 ++-- 7 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 __mocks__/react-native-dev-menu.ts diff --git a/__mocks__/react-native-dev-menu.ts b/__mocks__/react-native-dev-menu.ts deleted file mode 100644 index 0d35d5c32723..000000000000 --- a/__mocks__/react-native-dev-menu.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type {addItem} from 'react-native-dev-menu'; - -type ReactNativeDevMenuMock = { - addItem: typeof addItem; -}; - -const reactNativeDevMenuMock: ReactNativeDevMenuMock = { - addItem: jest.fn(), -}; - -export default reactNativeDevMenuMock; diff --git a/android/app/src/main/java/com/expensify/chat/MainApplication.kt b/android/app/src/main/java/com/expensify/chat/MainApplication.kt index 942304c80445..f476ad89c5b4 100644 --- a/android/app/src/main/java/com/expensify/chat/MainApplication.kt +++ b/android/app/src/main/java/com/expensify/chat/MainApplication.kt @@ -64,7 +64,7 @@ class MainApplication : MultiDexApplication(), ReactApplication { SoLoader.init(this, /* native exopackage */false) if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. - load(bridgelessEnabled = false) + load() } if (BuildConfig.DEBUG) { FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false) diff --git a/android/settings.gradle b/android/settings.gradle index 4f758f27d255..1347572bcc91 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -10,8 +10,6 @@ include ':react-native-config' project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android') include ':react-native-plaid-link-sdk' project(':react-native-plaid-link-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-plaid-link-sdk/android') -include ':react-native-dev-menu' -project(':react-native-dev-menu').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dev-menu/android') include ':app' includeBuild('../node_modules/@react-native/gradle-plugin') includeBuild('../node_modules/react-native') { diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9a706cc4e8aa..add6c0f1b793 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2329,10 +2329,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNDevMenu (4.1.1): - - React-Core - - React-Core/DevSupport - - React-RCTNetwork - RNFBAnalytics (12.9.3): - Firebase/Analytics (= 8.8.0) - React-Core @@ -2824,7 +2820,6 @@ DEPENDENCIES: - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - "RNCPicker (from `../node_modules/@react-native-picker/picker`)" - RNDeviceInfo (from `../node_modules/react-native-device-info`) - - RNDevMenu (from `../node_modules/react-native-dev-menu`) - "RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`)" - "RNFBApp (from `../node_modules/@react-native-firebase/app`)" - "RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics`)" @@ -3085,8 +3080,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-picker/picker" RNDeviceInfo: :path: "../node_modules/react-native-device-info" - RNDevMenu: - :path: "../node_modules/react-native-dev-menu" RNFBAnalytics: :path: "../node_modules/@react-native-firebase/analytics" RNFBApp: @@ -3263,7 +3256,6 @@ SPEC CHECKSUMS: RNCClipboard: c84275d07e3f73ff296b17e6c27e9ccdc194a0bb RNCPicker: 21ae0659666767a5c1253aef985ee5b7c527e345 RNDeviceInfo: 130237d8e97a89b68f2202d5dd18ac6bb68e7648 - RNDevMenu: 72807568fe4188bd4c40ce32675d82434b43c45d RNFBAnalytics: f76bfa164ac235b00505deb9fc1776634056898c RNFBApp: 729c0666395b1953198dc4a1ec6deb8fbe1c302e RNFBCrashlytics: 2061ca863e8e2fa1aae9b12477d7dfa8e88ca0f9 diff --git a/package-lock.json b/package-lock.json index 4b9fe381928e..46ba9fec24ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,6 @@ "react-native-blob-util": "0.19.4", "react-native-collapsible": "^1.6.2", "react-native-config": "1.5.3", - "react-native-dev-menu": "^4.1.1", "react-native-device-info": "10.3.1", "react-native-document-picker": "^9.3.1", "react-native-draggable-flatlist": "^4.0.1", @@ -34478,13 +34477,6 @@ } } }, - "node_modules/react-native-dev-menu": { - "version": "4.1.1", - "license": "MIT", - "peerDependencies": { - "react-native": ">=0.61.0" - } - }, "node_modules/react-native-device-info": { "version": "10.3.1", "license": "MIT", diff --git a/package.json b/package.json index 042f25cf4da4..3033cd59e305 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,6 @@ "react-native-blob-util": "0.19.4", "react-native-collapsible": "^1.6.2", "react-native-config": "1.5.3", - "react-native-dev-menu": "^4.1.1", "react-native-device-info": "10.3.1", "react-native-document-picker": "^9.3.1", "react-native-draggable-flatlist": "^4.0.1", diff --git a/src/components/CustomDevMenu/index.native.tsx b/src/components/CustomDevMenu/index.native.tsx index 968f97b9e91f..55ab64205587 100644 --- a/src/components/CustomDevMenu/index.native.tsx +++ b/src/components/CustomDevMenu/index.native.tsx @@ -1,12 +1,12 @@ import {useEffect} from 'react'; -import DevMenu from 'react-native-dev-menu'; +import {DevSettings} from 'react-native'; import toggleTestToolsModal from '@userActions/TestTool'; import type CustomDevMenuElement from './types'; const CustomDevMenu: CustomDevMenuElement = Object.assign( () => { useEffect(() => { - DevMenu.addItem('Open Test Preferences', toggleTestToolsModal); + DevSettings.addMenuItem('Open Test Preferences', toggleTestToolsModal); }, []); // eslint-disable-next-line react/jsx-no-useless-fragment return <>; From 3e89faaf1f21687896b2333d244b2258b88e83aa Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Thu, 31 Oct 2024 12:26:53 +0100 Subject: [PATCH 2/2] chore: dont enable bridgeless in the end --- android/app/src/main/java/com/expensify/chat/MainApplication.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/expensify/chat/MainApplication.kt b/android/app/src/main/java/com/expensify/chat/MainApplication.kt index f476ad89c5b4..942304c80445 100644 --- a/android/app/src/main/java/com/expensify/chat/MainApplication.kt +++ b/android/app/src/main/java/com/expensify/chat/MainApplication.kt @@ -64,7 +64,7 @@ class MainApplication : MultiDexApplication(), ReactApplication { SoLoader.init(this, /* native exopackage */false) if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. - load() + load(bridgelessEnabled = false) } if (BuildConfig.DEBUG) { FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false)