From e7c526ed0475e3062c116d4be9558949fa192c4b Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Wed, 28 Aug 2024 12:53:28 +0200 Subject: [PATCH 1/9] feat: enable bridgeless --- .../app/src/main/java/com/expensify/chat/MainApplication.kt | 2 +- ios/NewExpensify/AppDelegate.mm | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) 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 26a28d9955a0..2b5d3a509f46 100644 --- a/android/app/src/main/java/com/expensify/chat/MainApplication.kt +++ b/android/app/src/main/java/com/expensify/chat/MainApplication.kt @@ -57,7 +57,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/ios/NewExpensify/AppDelegate.mm b/ios/NewExpensify/AppDelegate.mm index dc0ef2812031..5608c44823f4 100644 --- a/ios/NewExpensify/AppDelegate.mm +++ b/ios/NewExpensify/AppDelegate.mm @@ -88,11 +88,6 @@ - (NSURL *)bundleURL #endif } -- (BOOL)bridgelessEnabled -{ - return NO; -} - // This methods is needed to support the hardware keyboard shortcuts - (NSArray *)keyCommands { return [HardwareShortcuts sharedInstance].keyCommands; From 23984a616372da9889b07e8a2ed008fbbd29c321 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Fri, 4 Oct 2024 11:55:40 +0200 Subject: [PATCH 2/9] fix: make ios work properly --- ios/NewExpensify/RCTBootSplash.h | 9 - ios/NewExpensify/RCTBootSplash.mm | 177 ++++++------ ...e-firebase+app+12.9.3+002+bridgeless.patch | 50 ++++ ....patch => react-native-config+1.5.3.patch} | 257 ++++++++---------- ...board-controller+1.12.7+001+initial.patch} | 4 +- ...ard-controller+1.12.7+002+bridgeless.patch | 106 ++++++++ patches/react-native-pager-view+6.4.1.patch | 73 +++++ ...ve-quick-sqlite+8.1.0+001+bridgeless.patch | 41 +++ 8 files changed, 460 insertions(+), 257 deletions(-) create mode 100644 patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch rename patches/{react-native-config+1.5.0.patch => react-native-config+1.5.3.patch} (71%) rename patches/{react-native-keyboard-controller+1.12.7.patch => react-native-keyboard-controller+1.12.7+001+initial.patch} (91%) create mode 100644 patches/react-native-keyboard-controller+1.12.7+002+bridgeless.patch create mode 100644 patches/react-native-pager-view+6.4.1.patch create mode 100644 patches/react-native-quick-sqlite+8.1.0+001+bridgeless.patch diff --git a/ios/NewExpensify/RCTBootSplash.h b/ios/NewExpensify/RCTBootSplash.h index 5dc3def635f2..e4037995d666 100644 --- a/ios/NewExpensify/RCTBootSplash.h +++ b/ios/NewExpensify/RCTBootSplash.h @@ -1,16 +1,7 @@ -// -// RCTBootSplash.h -// NewExpensify -// -// Created by Mathieu Acthernoene on 07/01/2022. -// - #import -#import @interface RCTBootSplash : NSObject -+ (void)invalidateBootSplash; + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName rootView:(UIView * _Nullable)rootView; diff --git a/ios/NewExpensify/RCTBootSplash.mm b/ios/NewExpensify/RCTBootSplash.mm index 3e4a086f07b1..8ce5efee92ff 100644 --- a/ios/NewExpensify/RCTBootSplash.mm +++ b/ios/NewExpensify/RCTBootSplash.mm @@ -2,46 +2,34 @@ #import -#if RCT_NEW_ARCH_ENABLED #import #import -#else #import -#endif -static NSMutableArray *_resolveQueue = nil; +static RCTSurfaceHostingProxyRootView *_rootView = nil; + static UIView *_loadingView = nil; -static UIView *_rootView = nil; -static float _duration = 0; +static NSMutableArray *_resolveQueue = [[NSMutableArray alloc] init]; +static bool _fade = false; static bool _nativeHidden = false; -static bool _transitioning = false; @implementation RCTBootSplash RCT_EXPORT_MODULE(); -- (dispatch_queue_t)methodQueue { - return dispatch_get_main_queue(); ++ (BOOL)requiresMainQueueSetup { + return NO; } -+ (void)invalidateBootSplash { - _resolveQueue = nil; - _rootView = nil; - _nativeHidden = false; -} - -+ (bool)isLoadingViewHidden { - return _loadingView == nil || [_loadingView isHidden]; +- (dispatch_queue_t)methodQueue { + return dispatch_get_main_queue(); } -+ (bool)hasResolveQueue { - return _resolveQueue != nil; ++ (bool)isLoadingViewVisible { + return _loadingView != nil && ![_loadingView isHidden]; } + (void)clearResolveQueue { - if (![self hasResolveQueue]) - return; - while ([_resolveQueue count] > 0) { RCTPromiseResolveBlock resolve = [_resolveQueue objectAtIndex:0]; [_resolveQueue removeObjectAtIndex:0]; @@ -49,19 +37,15 @@ + (void)clearResolveQueue { } } -+ (void)hideLoadingView { - if ([self isLoadingViewHidden]) ++ (void)hideAndClearPromiseQueue { + if (![self isLoadingViewVisible]) { return [RCTBootSplash clearResolveQueue]; + } - if (_duration > 0) { + if (_fade) { dispatch_async(dispatch_get_main_queue(), ^{ - _transitioning = true; - - if (_rootView == nil) - return; - [UIView transitionWithView:_rootView - duration:_duration / 1000.0 + duration:0.250 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ _loadingView.hidden = YES; @@ -70,7 +54,6 @@ + (void)hideLoadingView { [_loadingView removeFromSuperview]; _loadingView = nil; - _transitioning = false; return [RCTBootSplash clearResolveQueue]; }]; }); @@ -85,30 +68,9 @@ + (void)hideLoadingView { + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName rootView:(UIView * _Nullable)rootView { - if (rootView == nil -#ifdef RCT_NEW_ARCH_ENABLED - || ![rootView isKindOfClass:[RCTSurfaceHostingProxyRootView class]] -#else - || ![rootView isKindOfClass:[RCTRootView class]] -#endif - || _rootView != nil - || [self hasResolveQueue] // hide has already been called, abort init - || RCTRunningInAppExtension()) + if (RCTRunningInAppExtension()) { return; - -#ifdef RCT_NEW_ARCH_ENABLED - RCTSurfaceHostingProxyRootView *proxy = (RCTSurfaceHostingProxyRootView *)rootView; - _rootView = (RCTSurfaceHostingView *)proxy.surface.view; -#else - _rootView = (RCTRootView *)rootView; -#endif - - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; - - _loadingView = [[storyboard instantiateInitialViewController] view]; - _loadingView.hidden = NO; - - [_rootView addSubview:_loadingView]; + } [NSTimer scheduledTimerWithTimeInterval:0.35 repeats:NO @@ -117,19 +79,43 @@ + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName _nativeHidden = true; // hide has been called before native launch screen fade out - if ([self hasResolveQueue]) - [self hideLoadingView]; + if ([_resolveQueue count] > 0) { + [self hideAndClearPromiseQueue]; + } }]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onJavaScriptDidLoad) - name:RCTJavaScriptDidLoadNotification - object:nil]; + if (rootView != nil) { +#ifdef RCT_NEW_ARCH_ENABLED + _rootView = (RCTSurfaceHostingProxyRootView *)rootView; +#else + _rootView = (RCTRootView *)rootView; +#endif - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onJavaScriptDidFailToLoad) - name:RCTJavaScriptDidFailToLoadNotification - object:nil]; + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; + + _loadingView = [[storyboard instantiateInitialViewController] view]; + _loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _loadingView.frame = _rootView.bounds; + _loadingView.center = (CGPoint){CGRectGetMidX(_rootView.bounds), CGRectGetMidY(_rootView.bounds)}; + _loadingView.hidden = NO; + +#if RCT_NEW_ARCH_ENABLED + [_rootView disableActivityIndicatorAutoHide:YES]; + [_rootView setLoadingView:_loadingView]; +#else + [_rootView addSubview:_loadingView]; +#endif + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(onJavaScriptDidLoad) + name:RCTJavaScriptDidLoadNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(onJavaScriptDidFailToLoad) + name:RCTJavaScriptDidFailToLoadNotification + object:nil]; + } } + (void)onJavaScriptDidLoad { @@ -137,50 +123,49 @@ + (void)onJavaScriptDidLoad { } + (void)onJavaScriptDidFailToLoad { - [self hideLoadingView]; + [self hideAndClearPromiseQueue]; [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (void)hide:(double)duration - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject { - if (_resolveQueue == nil) - _resolveQueue = [[NSMutableArray alloc] init]; +- (NSDictionary *)constantsToExport { + UIWindow *window = RCTKeyWindow(); + __block bool darkModeEnabled = false; - [_resolveQueue addObject:resolve]; + RCTUnsafeExecuteOnMainQueueSync(^{ + darkModeEnabled = window != nil && window.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark; + }); - if ([RCTBootSplash isLoadingViewHidden] || RCTRunningInAppExtension()) - return [RCTBootSplash clearResolveQueue]; + return @{ + @"darkModeEnabled": @(darkModeEnabled) + }; +} - _duration = lroundf((float)duration); +- (void)hideImpl:(BOOL)fade + resolve:(RCTPromiseResolveBlock)resolve { + if (RCTRunningInAppExtension()) { + return resolve(@(true)); + } - if (_nativeHidden) - return [RCTBootSplash hideLoadingView]; + [_resolveQueue addObject:resolve]; + _fade = fade; + + if (_nativeHidden) { + return [RCTBootSplash hideAndClearPromiseQueue]; + } } -- (void)getVisibilityStatus:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject { - if ([RCTBootSplash isLoadingViewHidden]) - return resolve(@"hidden"); - else if (_transitioning) - return resolve(@"transitioning"); - else - return resolve(@"visible"); +- (void)isVisibleImpl:(RCTPromiseResolveBlock)resolve { + resolve(@([RCTBootSplash isLoadingViewVisible])); } -RCT_REMAP_METHOD(hide, - resolve:(RCTPromiseResolveBlock)resolve - rejecte:(RCTPromiseRejectBlock)reject) { - [self hide:0 - resolve:resolve - reject:reject]; +RCT_EXPORT_METHOD(hide:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject) { + [self hideImpl:0 resolve:resolve]; } -RCT_REMAP_METHOD(getVisibilityStatus, - getVisibilityStatusWithResolve:(RCTPromiseResolveBlock)resolve - rejecte:(RCTPromiseRejectBlock)reject) { - [self getVisibilityStatus:resolve - reject:reject]; +RCT_EXPORT_METHOD(isVisible:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject) { + [self isVisibleImpl:resolve]; } @end diff --git a/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch b/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch new file mode 100644 index 000000000000..322bc2597f2c --- /dev/null +++ b/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch @@ -0,0 +1,50 @@ +diff --git a/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m b/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m +index f980834..8937cdf 100644 +--- a/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m ++++ b/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m +@@ -15,7 +15,7 @@ + * + */ + +-#import "RCTVersion.h" ++#import + + // generated file - do not modify or commit + NSString* const RNFBVersionString = @"12.9.3"; +diff --git a/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js b/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js +index 03f001c..cf8410a 100644 +--- a/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js ++++ b/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js +@@ -64,15 +64,15 @@ function nativeModuleWrapped(namespace, NativeModule, argToPrepend) { + if (!NativeModule) { + return NativeModule; + } +- +- const properties = Object.keys(NativeModule); +- +- for (let i = 0, len = properties.length; i < len; i++) { +- const property = properties[i]; +- if (typeof NativeModule[property] === 'function') { +- native[property] = nativeModuleMethodWrapped(namespace, NativeModule[property], argToPrepend); +- } else { +- native[property] = NativeModule[property]; ++ const moduleMethods = ["metaGetAll","jsonGetAll","preferencesSetBool","preferencesSetString","preferencesGetAll","preferencesClearAll","eventsNotifyReady","eventsGetListeners","eventsPing","eventsAddListener","eventsRemoveListener","addListener","removeListeners","initializeApp","setLogLevel","setAutomaticDataCollectionEnabled","deleteApp","getConstants","NATIVE_FIREBASE_APPS","FIREBASE_RAW_JSON","checkForUnsentReports","crash","crashWithStackPromise","deleteUnsentReports","didCrashOnPreviousExecution","log","logPromise","sendUnsentReports","setAttribute","setAttributes","setUserId","recordError","recordErrorPromise","setCrashlyticsCollectionEnabled","isErrorGenerationOnJSCrashEnabled","isCrashlyticsJavascriptExceptionHandlerChainingEnabled","isCrashlyticsCollectionEnabled","getConstants"]; ++ for (let i = 0, len = moduleMethods.length; i < len; i++) { ++ const method = moduleMethods[i]; ++ if (NativeModule[method]) { ++ if (typeof NativeModule[method] === 'function') { ++ native[method] = nativeModuleMethodWrapped(namespace, NativeModule[method], argToPrepend); ++ } else { ++ native[method] = NativeModule[method]; ++ } + } + } + +@@ -133,7 +133,6 @@ function initialiseNativeModule(module) { + } + + Object.freeze(multiModuleRoot); +- + NATIVE_MODULE_REGISTRY[key] = multiModuleRoot; + + return NATIVE_MODULE_REGISTRY[key]; diff --git a/patches/react-native-config+1.5.0.patch b/patches/react-native-config+1.5.3.patch similarity index 71% rename from patches/react-native-config+1.5.0.patch rename to patches/react-native-config+1.5.3.patch index 4b5a597de4dd..d2c093705032 100644 --- a/patches/react-native-config+1.5.0.patch +++ b/patches/react-native-config+1.5.3.patch @@ -1,68 +1,11 @@ -diff --git a/node_modules/react-native-config/README.md b/node_modules/react-native-config/README.md -index 8424402..ca29e39 100644 ---- a/node_modules/react-native-config/README.md -+++ b/node_modules/react-native-config/README.md -@@ -78,13 +78,13 @@ if cocoapods are used in the project then pod has to be installed as well: - **MainApplication.java** - - ```diff -- + import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; -+ + import com.lugg.RNCConfig.RNCConfigPackage; - - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage() -- + new ReactNativeConfigPackage() -+ + new RNCConfigPackage() - ); - } - ``` diff --git a/node_modules/react-native-config/android/build.gradle b/node_modules/react-native-config/android/build.gradle -index c8f7fd4..86b3e1a 100644 +index d3bdb07..1629423 100644 --- a/node_modules/react-native-config/android/build.gradle +++ b/node_modules/react-native-config/android/build.gradle -@@ -15,6 +15,55 @@ def safeExtGet(prop, fallback) { +@@ -15,6 +15,18 @@ def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } -+def resolveReactNativeDirectory() { -+ def reactNativeLocation = safeExtGet("REACT_NATIVE_NODE_MODULES_DIR", null) -+ if (reactNativeLocation != null) { -+ return file(reactNativeLocation) -+ } -+ -+ // monorepo workaround -+ // react-native can be hoisted or in project's own node_modules -+ def reactNativeFromProjectNodeModules = file("${rootProject.projectDir}/../node_modules/react-native") -+ if (reactNativeFromProjectNodeModules.exists()) { -+ return reactNativeFromProjectNodeModules -+ } -+ -+ def reactNativeFromNodeModulesWithRNCConfig = file("${projectDir}/../../react-native") -+ if (reactNativeFromNodeModulesWithRNCConfig.exists()) { -+ return reactNativeFromNodeModulesWithRNCConfig -+ } -+ -+ throw new Exception( -+ "[react-native-config] Unable to resolve react-native location in " + -+ "node_modules. You should add project extension property (in app/build.gradle) " + -+ "`REACT_NATIVE_NODE_MODULES_DIR` with path to react-native." -+ ) -+} -+ -+def getReactNativeMinorVersion() { -+ def REACT_NATIVE_DIR = resolveReactNativeDirectory() -+ -+ def reactProperties = new Properties() -+ file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } -+ -+ def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME") -+ def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger() -+ -+ return REACT_NATIVE_MINOR_VERSION -+} -+ +def isNewArchitectureEnabled() { + // To opt-in for the New Architecture, you can either: + // - Set `newArchEnabled` to true inside the `gradle.properties` file @@ -75,10 +18,10 @@ index c8f7fd4..86b3e1a 100644 + apply plugin: "com.facebook.react" +} + - android { - compileSdkVersion rootProject.ext.compileSdkVersion - -@@ -23,10 +72,23 @@ android { + def supportsNamespace() { + def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.'); + def major = parsed[0].toInteger(); +@@ -44,10 +56,23 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -102,44 +45,45 @@ index c8f7fd4..86b3e1a 100644 } repositories { -@@ -34,5 +96,9 @@ repositories { +@@ -55,5 +80,5 @@ repositories { } dependencies { - implementation "com.facebook.react:react-native:${safeExtGet("reactNative", "+")}" // from node_modules -+ if (isNewArchitectureEnabled() && getReactNativeMinorVersion() < 71) { -+ implementation project(":ReactAndroid") -+ } else { -+ implementation 'com.facebook.react:react-native:+' -+ } ++ implementation 'com.facebook.react:react-native:+' } diff --git a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java -index 0b52515..bef2834 100644 +index 55b853b..2784795 100644 --- a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java +++ b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java -@@ -13,20 +13,32 @@ import java.lang.reflect.Field; +@@ -11,41 +11,58 @@ import java.lang.reflect.Field; import java.util.Map; import java.util.HashMap; -public class RNCConfigModule extends ReactContextBaseJavaModule { +public class RNCConfigModule extends NativeConfigModuleSpec { + public static final String NAME = "RNCConfigModule"; -+ - public RNCConfigModule(ReactApplicationContext reactContext) { - super(reactContext); - } - @Override - public String getName() { -- return "RNCConfigModule"; -+ return NAME; - } +- public RNCConfigModule(ReactApplicationContext reactContext) { +- super(reactContext); +- } ++ public RNCConfigModule(ReactApplicationContext reactContext) { ++ super(reactContext); ++ } - @Override -- public Map getConstants() { +- @Override +- public String getName() { +- return "RNCConfigModule"; +- } ++ @Override ++ public String getName() { ++ return NAME; ++ } ++ ++ @Override + public Map getTypedExportedConstants() { - final Map constants = new HashMap<>(); - ++ final Map constants = new HashMap<>(); ++ + // Codegen ensures that the constants defined in the module spec and in the native module implementation + // are consistent, which is tad problematic in this case, as the constants are dependant on the `.env` + // file. The simple workaround is to define a `constants` object that will contain actual constants. @@ -149,33 +93,64 @@ index 0b52515..bef2834 100644 + // we export { constants: { constant1: "value1", constant2: "value2" } } + // because of type safety on the new arch + final Map realConstants = new HashMap<>(); -+ - try { - Context context = getReactApplicationContext(); - int resId = context.getResources().getIdentifier("build_config_package", "string", context.getPackageName()); -@@ -40,7 +52,7 @@ public class RNCConfigModule extends ReactContextBaseJavaModule { - Field[] fields = clazz.getDeclaredFields(); - for(Field f: fields) { + +- @Override +- public Map getConstants() { +- final Map constants = new HashMap<>(); ++ try { ++ Context context = getReactApplicationContext(); ++ int resId = context.getResources().getIdentifier("build_config_package", "string", context.getPackageName()); ++ String className; ++ try { ++ className = context.getString(resId); ++ } catch (Resources.NotFoundException e) { ++ className = getReactApplicationContext().getApplicationContext().getPackageName(); ++ } ++ Class clazz = Class.forName(className + ".BuildConfig"); ++ Field[] fields = clazz.getDeclaredFields(); ++ for(Field f: fields) { try { -- constants.put(f.getName(), f.get(null)); +- Context context = getReactApplicationContext(); +- int resId = context.getResources().getIdentifier("build_config_package", "string", context.getPackageName()); +- String className; +- try { +- className = context.getString(resId); +- } catch (Resources.NotFoundException e) { +- className = getReactApplicationContext().getApplicationContext().getPackageName(); +- } +- Class clazz = Class.forName(className + ".BuildConfig"); +- Field[] fields = clazz.getDeclaredFields(); +- for (Field f : fields) { +- try { +- constants.put(f.getName(), f.get(null)); +- } catch (IllegalAccessException e) { +- Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); +- } +- } +- } catch (ClassNotFoundException e) { +- Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); + realConstants.put(f.getName(), f.get(null)); } - catch (IllegalAccessException e) { - Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); -@@ -51,6 +63,8 @@ public class RNCConfigModule extends ReactContextBaseJavaModule { - Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); +- return constants; ++ catch (IllegalAccessException e) { ++ Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); ++ } ++ } ++ } ++ catch (ClassNotFoundException e) { ++ Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); } - ++ + constants.put("constants", realConstants); + - return constants; - } ++ return constants; ++ } } diff --git a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java -index 9251c09..2edd797 100644 +index 599a81a..2edd797 100644 --- a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java +++ b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java -@@ -1,29 +1,42 @@ +@@ -1,27 +1,42 @@ package com.lugg.RNCConfig; -import com.facebook.react.ReactPackage; @@ -184,26 +159,24 @@ index 9251c09..2edd797 100644 import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.uimanager.ViewManager; -+import com.facebook.react.module.model.ReactModuleInfo; -+import com.facebook.react.module.model.ReactModuleInfoProvider; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; ++import com.facebook.react.module.model.ReactModuleInfo; ++import com.facebook.react.module.model.ReactModuleInfoProvider; + +-public class RNCConfigPackage implements ReactPackage { +import java.util.HashMap; +import java.util.Map; --public class RNCConfigPackage implements ReactPackage { - @Override - public List createNativeModules(ReactApplicationContext reactContext) { -- return Arrays.asList( -- new RNCConfigModule(reactContext) -- ); +- return Arrays.asList(new RNCConfigModule(reactContext)); - } +public class RNCConfigPackage extends TurboReactPackage { -- public List> createJSModules() { -- return Collections.emptyList(); +- public List> createJSModules() { +- return Collections.emptyList(); + @Override + public NativeModule getModule(String name, ReactApplicationContext reactContext) { + if (name.equals(RNCConfigModule.NAME)) { @@ -336,31 +309,29 @@ index 70866c4..a8f3624 100644 -export const Config = NativeModules.RNCConfigModule || {} export default Config; -diff --git a/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m b/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m -index 04a2f3d..59df625 100644 ---- a/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m -+++ b/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m -@@ -1 +1 @@ -- #define DOT_ENV @{ }; -+ #define DOT_ENV @{ @"ENV":@"dev",@"API_URL":@"http://localhost" }; diff --git a/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h b/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h -index 755d103..5341aca 100644 +index 755d103..4e4c564 100644 --- a/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h +++ b/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h -@@ -1,3 +1,9 @@ +@@ -1,12 +1,15 @@ +-#if __has_include() +-#import +-#elif __has_include("React/RCTBridgeModule.h") +-#import "React/RCTBridgeModule.h" +#ifdef RCT_NEW_ARCH_ENABLED +#import "RNCConfigSpec.h" -+ -+@interface RNCConfigModule : NSObject -+#else -+ - #if __has_include() - #import - #elif __has_include("React/RCTBridgeModule.h") -@@ -7,6 +13,7 @@ - #endif + #else +-#import "RCTBridgeModule.h" +-#endif ++#import ++#endif // RCT_NEW_ARCH_ENABLED - @interface RNCConfigModule : NSObject +-@interface RNCConfigModule : NSObject ++@interface RNCConfigModule : NSObject ++#ifdef RCT_NEW_ARCH_ENABLED ++ ++#else ++ +#endif // RCT_NEW_ARCH_ENABLED + (NSDictionary *)env; @@ -440,10 +411,10 @@ index 0000000..1cacb65 + +@end diff --git a/node_modules/react-native-config/package.json b/node_modules/react-native-config/package.json -index b4d1fba..0a018a7 100644 +index f758725..f338b41 100644 --- a/node_modules/react-native-config/package.json +++ b/node_modules/react-native-config/package.json -@@ -26,6 +26,7 @@ +@@ -27,6 +27,7 @@ "android/", "ios/", "windows/", @@ -451,8 +422,8 @@ index b4d1fba..0a018a7 100644 "index.js", "index.d.ts", "react-native-config.podspec", -@@ -38,11 +39,21 @@ - "semantic-release": "^17.0.4" +@@ -39,11 +40,21 @@ + "semantic-release": "^19.0.5" }, "peerDependencies": { + "react": "*", @@ -474,7 +445,7 @@ index b4d1fba..0a018a7 100644 } } diff --git a/node_modules/react-native-config/react-native-config.podspec b/node_modules/react-native-config/react-native-config.podspec -index 35313d4..56bce4a 100644 +index 449b970..88b14c5 100644 --- a/node_modules/react-native-config/react-native-config.podspec +++ b/node_modules/react-native-config/react-native-config.podspec @@ -4,6 +4,8 @@ require 'json' @@ -486,7 +457,7 @@ index 35313d4..56bce4a 100644 Pod::Spec.new do |s| s.name = 'react-native-config' s.version = package['version'] -@@ -33,8 +35,27 @@ HOST_PATH="$SRCROOT/../.." +@@ -35,8 +37,13 @@ HOST_PATH="$SRCROOT/../.." s.default_subspec = 'App' s.subspec 'App' do |app| @@ -495,21 +466,7 @@ index 35313d4..56bce4a 100644 + app.source_files = 'ios/**/*.{h,m,mm}' + + if fabric_enabled -+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' -+ -+ app.pod_target_xcconfig = { -+ 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"', -+ 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17', -+ } -+ app.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED' -+ -+ app.dependency "React" -+ app.dependency "React-RCTFabric" # This is for fabric component -+ app.dependency "React-Codegen" -+ app.dependency "RCT-Folly" -+ app.dependency "RCTRequired" -+ app.dependency "RCTTypeSafety" -+ app.dependency "ReactCommon/turbomodule/core" ++ install_modules_dependencies(app) + else + app.dependency 'React-Core' + end diff --git a/patches/react-native-keyboard-controller+1.12.7.patch b/patches/react-native-keyboard-controller+1.12.7+001+initial.patch similarity index 91% rename from patches/react-native-keyboard-controller+1.12.7.patch rename to patches/react-native-keyboard-controller+1.12.7+001+initial.patch index 0ea97d3731a1..834c5a4013b5 100644 --- a/patches/react-native-keyboard-controller+1.12.7.patch +++ b/patches/react-native-keyboard-controller+1.12.7+001+initial.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt b/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt -index 83884d8..5d9e989 100644 +index 165df83..73e17a5 100644 --- a/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +++ b/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt -@@ -99,12 +99,12 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R +@@ -104,12 +104,12 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R } private fun goToEdgeToEdge(edgeToEdge: Boolean) { diff --git a/patches/react-native-keyboard-controller+1.12.7+002+bridgeless.patch b/patches/react-native-keyboard-controller+1.12.7+002+bridgeless.patch new file mode 100644 index 000000000000..75e50bf38f48 --- /dev/null +++ b/patches/react-native-keyboard-controller+1.12.7+002+bridgeless.patch @@ -0,0 +1,106 @@ +diff --git a/node_modules/react-native-keyboard-controller/ios/views/KeyboardControllerView.mm b/node_modules/react-native-keyboard-controller/ios/views/KeyboardControllerView.mm +index 6828ccb..c36d057 100644 +--- a/node_modules/react-native-keyboard-controller/ios/views/KeyboardControllerView.mm ++++ b/node_modules/react-native-keyboard-controller/ios/views/KeyboardControllerView.mm +@@ -25,8 +25,6 @@ + #import + #import + +-#import +- + #import "KeyboardControllerModule-Header.h" + #import "RCTFabricComponentsPlugins.h" + +@@ -79,14 +77,11 @@ - (instancetype)initWithFrame:(CGRect)frame + .width = width, + .x = x, + .y = y}}); +- // TODO: use built-in _eventEmitter once NativeAnimated module will use +- // ModernEventEmitter +- RCTBridge *bridge = [RCTBridge currentBridge]; +- if (bridge) { +- FocusedInputLayoutChangedEvent *inputChangedEvent = ++ ++ FocusedInputLayoutChangedEvent *inputChangedEvent = + [[FocusedInputLayoutChangedEvent alloc] initWithReactTag:@(self.tag) event:event]; +- [bridge.eventDispatcher sendEvent:inputChangedEvent]; +- } ++ [self postNotificationForEventDispatcherObserversWithEvent:inputChangedEvent]; ++ + } + } + onTextChangedHandler:^(NSString *text) { +@@ -97,14 +92,9 @@ - (instancetype)initWithFrame:(CGRect)frame + facebook::react::KeyboardControllerViewEventEmitter::OnFocusedInputTextChanged{ + .text = std::string([text UTF8String])}); + +- // TODO: use built-in _eventEmitter once NativeAnimated module will use +- // ModernEventEmitter +- RCTBridge *bridge = [RCTBridge currentBridge]; +- if (bridge) { +- FocusedInputTextChangedEvent *textChangedEvent = ++ FocusedInputTextChangedEvent *textChangedEvent = + [[FocusedInputTextChangedEvent alloc] initWithReactTag:@(self.tag) text:text]; +- [bridge.eventDispatcher sendEvent:textChangedEvent]; +- } ++ [self postNotificationForEventDispatcherObserversWithEvent:textChangedEvent]; + } + } + onSelectionChangedHandler:^(NSDictionary *event) { +@@ -132,15 +122,11 @@ - (instancetype)initWithFrame:(CGRect)frame + .end = facebook::react::KeyboardControllerViewEventEmitter:: + OnFocusedInputSelectionChangedSelectionEnd{ + .x = endX, .y = endY, .position = end}}}); +- // TODO: use built-in _eventEmitter once NativeAnimated module will use +- // ModernEventEmitter +- RCTBridge *bridge = [RCTBridge currentBridge]; +- if (bridge) { +- FocusedInputSelectionChangedEvent *selectionChangedEvent = ++ ++ FocusedInputSelectionChangedEvent *selectionChangedEvent = + [[FocusedInputSelectionChangedEvent alloc] initWithReactTag:@(self.tag) + event:event]; +- [bridge.eventDispatcher sendEvent:selectionChangedEvent]; +- } ++ [self postNotificationForEventDispatcherObserversWithEvent:selectionChangedEvent]; + } + } + onFocusDidSet:^(NSDictionary *data) { +@@ -196,19 +182,14 @@ - (instancetype)initWithFrame:(CGRect)frame + .duration = [duration intValue], + .target = [target intValue]}); + } +- +- // TODO: use built-in _eventEmitter once NativeAnimated module will use ModernEventEmitter +- RCTBridge *bridge = [RCTBridge currentBridge]; +- if (bridge) { +- KeyboardMoveEvent *keyboardMoveEvent = ++ KeyboardMoveEvent *keyboardMoveEvent = + [[KeyboardMoveEvent alloc] initWithReactTag:@(self.tag) + event:event + height:height + progress:progress + duration:duration + target:target]; +- [bridge.eventDispatcher sendEvent:keyboardMoveEvent]; +- } ++ [self postNotificationForEventDispatcherObserversWithEvent:keyboardMoveEvent]; + } + onNotify:^(NSString *event, NSDictionary *data) { + [KeyboardController.shared sendEvent:event body:data]; +@@ -224,6 +205,15 @@ - (instancetype)initWithFrame:(CGRect)frame + return self; + } + ++// TODO: use built-in _eventEmitter once NativeAnimated module will use ModernEventEmitter ++- (void)postNotificationForEventDispatcherObserversWithEvent:(NSObject *)event ++{ ++ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:event, @"event", nil]; ++ [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED" ++ object:nil ++ userInfo:userInfo]; ++} ++ + - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps + { + const auto &oldViewProps = *std::static_pointer_cast(_props); diff --git a/patches/react-native-pager-view+6.4.1.patch b/patches/react-native-pager-view+6.4.1.patch new file mode 100644 index 000000000000..64b2b580ecd3 --- /dev/null +++ b/patches/react-native-pager-view+6.4.1.patch @@ -0,0 +1,73 @@ +--- a/node_modules/react-native-pager-view/ios/Fabric/RNCPagerViewComponentView.mm ++++ b/node_modules/react-native-pager-view/ios/Fabric/RNCPagerViewComponentView.mm +@@ -195,13 +195,10 @@ -(void)scrollViewDidScroll:(UIScrollView *)scrollView { + + strongEventEmitter.onPageScroll(RNCViewPagerEventEmitter::OnPageScroll{.position = static_cast(position), .offset = offset}); + +- //This is temporary workaround to allow animations based on onPageScroll event +- //until Fabric implements proper NativeAnimationDriver +- RCTBridge *bridge = [RCTBridge currentBridge]; +- +- if (bridge) { +- [bridge.eventDispatcher sendEvent:[[RCTOnPageScrollEvent alloc] initWithReactTag:[NSNumber numberWithInt:self.tag] position:@(position) offset:@(offset)]]; +- } ++ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[[RCTOnPageScrollEvent alloc] initWithReactTag:[NSNumber numberWithInt:self.tag] position:@(position) offset:@(offset)], @"event", nil]; ++ [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED" ++ object:nil ++ userInfo:userInfo]; + } + + #pragma mark - Internal methods +diff --git a/node_modules/react-native-pager-view/ios/LEGACY/Fabric/LEGACY_RNCPagerViewComponentView.mm b/node_modules/react-native-pager-view/ios/LEGACY/Fabric/LEGACY_RNCPagerViewComponentView.mm +index 7608645..84f6f60 100644 +--- a/node_modules/react-native-pager-view/ios/LEGACY/Fabric/LEGACY_RNCPagerViewComponentView.mm ++++ b/node_modules/react-native-pager-view/ios/LEGACY/Fabric/LEGACY_RNCPagerViewComponentView.mm +@@ -363,14 +363,10 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { + int eventPosition = (int) position; + strongEventEmitter.onPageScroll(LEGACY_RNCViewPagerEventEmitter::OnPageScroll{.position = static_cast(eventPosition), .offset = interpolatedOffset}); + +- //This is temporary workaround to allow animations based on onPageScroll event +- //until Fabric implements proper NativeAnimationDriver +- RCTBridge *bridge = [RCTBridge currentBridge]; +- +- if (bridge) { +- [bridge.eventDispatcher sendEvent:[[RCTOnPageScrollEvent alloc] initWithReactTag:[NSNumber numberWithInt:self.tag] position:@(position) offset:@(interpolatedOffset)]]; +- } +- ++ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[[RCTOnPageScrollEvent alloc] initWithReactTag:[NSNumber numberWithInt:self.tag] position:@(position) offset:@(interpolatedOffset)], @"event", nil]; ++ [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED" ++ object:nil ++ userInfo:userInfo]; + } + + +diff --git a/node_modules/react-native-pager-view/ios/LEGACY/LEGACY_RNCPagerView.m b/node_modules/react-native-pager-view/ios/LEGACY/LEGACY_RNCPagerView.m +index 5f6c535..fd6c2a1 100644 +--- a/node_modules/react-native-pager-view/ios/LEGACY/LEGACY_RNCPagerView.m ++++ b/node_modules/react-native-pager-view/ios/LEGACY/LEGACY_RNCPagerView.m +@@ -1,5 +1,5 @@ + #import "LEGACY_RNCPagerView.h" +-#import "React/RCTLog.h" ++#import + #import + + #import "UIViewController+CreateExtension.h" +diff --git a/node_modules/react-native-pager-view/ios/RNCPagerView.m b/node_modules/react-native-pager-view/ios/RNCPagerView.m +index 584aada..978496f 100644 +--- a/node_modules/react-native-pager-view/ios/RNCPagerView.m ++++ b/node_modules/react-native-pager-view/ios/RNCPagerView.m +@@ -1,12 +1,12 @@ + + #import "RNCPagerView.h" +-#import "React/RCTLog.h" ++#import + #import + + #import "UIViewController+CreateExtension.h" + #import "RCTOnPageScrollEvent.h" + #import "RCTOnPageScrollStateChanged.h" +-#import "React/RCTUIManagerObserverCoordinator.h" ++#import + #import "RCTOnPageSelected.h" + #import + diff --git a/patches/react-native-quick-sqlite+8.1.0+001+bridgeless.patch b/patches/react-native-quick-sqlite+8.1.0+001+bridgeless.patch new file mode 100644 index 000000000000..8f8a13d684e5 --- /dev/null +++ b/patches/react-native-quick-sqlite+8.1.0+001+bridgeless.patch @@ -0,0 +1,41 @@ +diff --git a/node_modules/react-native-quick-sqlite/ios/QuickSQLite.mm b/node_modules/react-native-quick-sqlite/ios/QuickSQLite.mm +index 519f31a..308f746 100644 +--- a/node_modules/react-native-quick-sqlite/ios/QuickSQLite.mm ++++ b/node_modules/react-native-quick-sqlite/ios/QuickSQLite.mm +@@ -12,12 +12,12 @@ @implementation QuickSQLite + + RCT_EXPORT_MODULE(QuickSQLite) + ++@synthesize bridge = _bridge; + + RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) { + NSLog(@"Installing QuickSQLite module..."); + +- RCTBridge *bridge = [RCTBridge currentBridge]; +- RCTCxxBridge *cxxBridge = (RCTCxxBridge *)bridge; ++ RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge; + if (cxxBridge == nil) { + return @false; + } +@@ -29,7 +29,7 @@ @implementation QuickSQLite + return @false; + } + auto &runtime = *jsiRuntime; +- auto callInvoker = bridge.jsCallInvoker; ++ auto callInvoker = cxxBridge.jsCallInvoker; + + // Get appGroupID value from Info.plist using key "AppGroup" + NSString *appGroupID = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"ReactNativeQuickSQLite_AppGroup"]; +diff --git a/node_modules/react-native-quick-sqlite/src/index.ts b/node_modules/react-native-quick-sqlite/src/index.ts +index b3e7fc7..7d8930a 100644 +--- a/node_modules/react-native-quick-sqlite/src/index.ts ++++ b/node_modules/react-native-quick-sqlite/src/index.ts +@@ -15,7 +15,7 @@ if (global.__QuickSQLiteProxy == null) { + } + + // Check if we are running on-device (JSI) +- if (global.nativeCallSyncHook == null || QuickSQLiteModule.install == null) { ++ if ((!global.nativeCallSyncHook && !global.RN$Bridgeless) || QuickSQLiteModule.install == null) { + throw new Error( + 'Failed to install react-native-quick-sqlite: React Native is not running on-device. QuickSQLite can only be used when synchronous method invocations (JSI) are possible. If you are using a remote debugger (e.g. Chrome), switch to an on-device debugger (e.g. Flipper) instead.' + ); From 815041fc1ccc7c1e16cda3fcc0ff233652fb7e14 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Fri, 4 Oct 2024 14:12:10 +0200 Subject: [PATCH 3/9] fix: make bridgeless work on Android --- .../app/src/main/java/com/expensify/chat/MainApplication.kt | 5 +++++ 1 file changed, 5 insertions(+) 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 57b2c0a7d024..f476ad89c5b4 100644 --- a/android/app/src/main/java/com/expensify/chat/MainApplication.kt +++ b/android/app/src/main/java/com/expensify/chat/MainApplication.kt @@ -11,9 +11,11 @@ import com.expensify.chat.bootsplash.BootSplashPackage import com.expensify.chat.shortcutManagerModule.ShortcutManagerPackage import com.facebook.react.PackageList import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost import com.facebook.react.ReactNativeHost import com.facebook.react.ReactPackage import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.modules.i18nmanager.I18nUtil import com.facebook.soloader.SoLoader @@ -44,6 +46,9 @@ class MainApplication : MultiDexApplication(), ReactApplication { get() = BuildConfig.IS_HERMES_ENABLED }) + override val reactHost: ReactHost + get() = getDefaultReactHost(applicationContext, reactNativeHost) + override fun onCreate() { super.onCreate() ReactFontManager.getInstance().addCustomFont(this, "Expensify New Kansas", R.font.expensify_new_kansas) From ce7ce2ce82df805955f0da9c63066b0b10119494 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Fri, 4 Oct 2024 14:15:03 +0200 Subject: [PATCH 4/9] chore: revert rnconfig patch from this pr --- ....patch => react-native-config+1.5.0.patch} | 257 ++++++++++-------- 1 file changed, 150 insertions(+), 107 deletions(-) rename patches/{react-native-config+1.5.3.patch => react-native-config+1.5.0.patch} (71%) diff --git a/patches/react-native-config+1.5.3.patch b/patches/react-native-config+1.5.0.patch similarity index 71% rename from patches/react-native-config+1.5.3.patch rename to patches/react-native-config+1.5.0.patch index d2c093705032..4b5a597de4dd 100644 --- a/patches/react-native-config+1.5.3.patch +++ b/patches/react-native-config+1.5.0.patch @@ -1,11 +1,68 @@ +diff --git a/node_modules/react-native-config/README.md b/node_modules/react-native-config/README.md +index 8424402..ca29e39 100644 +--- a/node_modules/react-native-config/README.md ++++ b/node_modules/react-native-config/README.md +@@ -78,13 +78,13 @@ if cocoapods are used in the project then pod has to be installed as well: + **MainApplication.java** + + ```diff +- + import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; ++ + import com.lugg.RNCConfig.RNCConfigPackage; + + @Override + protected List getPackages() { + return Arrays.asList( + new MainReactPackage() +- + new ReactNativeConfigPackage() ++ + new RNCConfigPackage() + ); + } + ``` diff --git a/node_modules/react-native-config/android/build.gradle b/node_modules/react-native-config/android/build.gradle -index d3bdb07..1629423 100644 +index c8f7fd4..86b3e1a 100644 --- a/node_modules/react-native-config/android/build.gradle +++ b/node_modules/react-native-config/android/build.gradle -@@ -15,6 +15,18 @@ def safeExtGet(prop, fallback) { +@@ -15,6 +15,55 @@ def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } ++def resolveReactNativeDirectory() { ++ def reactNativeLocation = safeExtGet("REACT_NATIVE_NODE_MODULES_DIR", null) ++ if (reactNativeLocation != null) { ++ return file(reactNativeLocation) ++ } ++ ++ // monorepo workaround ++ // react-native can be hoisted or in project's own node_modules ++ def reactNativeFromProjectNodeModules = file("${rootProject.projectDir}/../node_modules/react-native") ++ if (reactNativeFromProjectNodeModules.exists()) { ++ return reactNativeFromProjectNodeModules ++ } ++ ++ def reactNativeFromNodeModulesWithRNCConfig = file("${projectDir}/../../react-native") ++ if (reactNativeFromNodeModulesWithRNCConfig.exists()) { ++ return reactNativeFromNodeModulesWithRNCConfig ++ } ++ ++ throw new Exception( ++ "[react-native-config] Unable to resolve react-native location in " + ++ "node_modules. You should add project extension property (in app/build.gradle) " + ++ "`REACT_NATIVE_NODE_MODULES_DIR` with path to react-native." ++ ) ++} ++ ++def getReactNativeMinorVersion() { ++ def REACT_NATIVE_DIR = resolveReactNativeDirectory() ++ ++ def reactProperties = new Properties() ++ file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } ++ ++ def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME") ++ def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger() ++ ++ return REACT_NATIVE_MINOR_VERSION ++} ++ +def isNewArchitectureEnabled() { + // To opt-in for the New Architecture, you can either: + // - Set `newArchEnabled` to true inside the `gradle.properties` file @@ -18,10 +75,10 @@ index d3bdb07..1629423 100644 + apply plugin: "com.facebook.react" +} + - def supportsNamespace() { - def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.'); - def major = parsed[0].toInteger(); -@@ -44,10 +56,23 @@ android { + android { + compileSdkVersion rootProject.ext.compileSdkVersion + +@@ -23,10 +72,23 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -45,45 +102,44 @@ index d3bdb07..1629423 100644 } repositories { -@@ -55,5 +80,5 @@ repositories { +@@ -34,5 +96,9 @@ repositories { } dependencies { - implementation "com.facebook.react:react-native:${safeExtGet("reactNative", "+")}" // from node_modules -+ implementation 'com.facebook.react:react-native:+' ++ if (isNewArchitectureEnabled() && getReactNativeMinorVersion() < 71) { ++ implementation project(":ReactAndroid") ++ } else { ++ implementation 'com.facebook.react:react-native:+' ++ } } diff --git a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java -index 55b853b..2784795 100644 +index 0b52515..bef2834 100644 --- a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java +++ b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigModule.java -@@ -11,41 +11,58 @@ import java.lang.reflect.Field; +@@ -13,20 +13,32 @@ import java.lang.reflect.Field; import java.util.Map; import java.util.HashMap; -public class RNCConfigModule extends ReactContextBaseJavaModule { +public class RNCConfigModule extends NativeConfigModuleSpec { + public static final String NAME = "RNCConfigModule"; ++ + public RNCConfigModule(ReactApplicationContext reactContext) { + super(reactContext); + } -- public RNCConfigModule(ReactApplicationContext reactContext) { -- super(reactContext); -- } -+ public RNCConfigModule(ReactApplicationContext reactContext) { -+ super(reactContext); -+ } - -- @Override -- public String getName() { -- return "RNCConfigModule"; -- } -+ @Override -+ public String getName() { + @Override + public String getName() { +- return "RNCConfigModule"; + return NAME; -+ } -+ -+ @Override + } + + @Override +- public Map getConstants() { + public Map getTypedExportedConstants() { -+ final Map constants = new HashMap<>(); -+ + final Map constants = new HashMap<>(); + + // Codegen ensures that the constants defined in the module spec and in the native module implementation + // are consistent, which is tad problematic in this case, as the constants are dependant on the `.env` + // file. The simple workaround is to define a `constants` object that will contain actual constants. @@ -93,64 +149,33 @@ index 55b853b..2784795 100644 + // we export { constants: { constant1: "value1", constant2: "value2" } } + // because of type safety on the new arch + final Map realConstants = new HashMap<>(); - -- @Override -- public Map getConstants() { -- final Map constants = new HashMap<>(); -+ try { -+ Context context = getReactApplicationContext(); -+ int resId = context.getResources().getIdentifier("build_config_package", "string", context.getPackageName()); -+ String className; -+ try { -+ className = context.getString(resId); -+ } catch (Resources.NotFoundException e) { -+ className = getReactApplicationContext().getApplicationContext().getPackageName(); -+ } -+ Class clazz = Class.forName(className + ".BuildConfig"); -+ Field[] fields = clazz.getDeclaredFields(); -+ for(Field f: fields) { ++ + try { + Context context = getReactApplicationContext(); + int resId = context.getResources().getIdentifier("build_config_package", "string", context.getPackageName()); +@@ -40,7 +52,7 @@ public class RNCConfigModule extends ReactContextBaseJavaModule { + Field[] fields = clazz.getDeclaredFields(); + for(Field f: fields) { try { -- Context context = getReactApplicationContext(); -- int resId = context.getResources().getIdentifier("build_config_package", "string", context.getPackageName()); -- String className; -- try { -- className = context.getString(resId); -- } catch (Resources.NotFoundException e) { -- className = getReactApplicationContext().getApplicationContext().getPackageName(); -- } -- Class clazz = Class.forName(className + ".BuildConfig"); -- Field[] fields = clazz.getDeclaredFields(); -- for (Field f : fields) { -- try { -- constants.put(f.getName(), f.get(null)); -- } catch (IllegalAccessException e) { -- Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); -- } -- } -- } catch (ClassNotFoundException e) { -- Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); +- constants.put(f.getName(), f.get(null)); + realConstants.put(f.getName(), f.get(null)); } -- return constants; -+ catch (IllegalAccessException e) { -+ Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); -+ } -+ } -+ } -+ catch (ClassNotFoundException e) { -+ Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); + catch (IllegalAccessException e) { + Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); +@@ -51,6 +63,8 @@ public class RNCConfigModule extends ReactContextBaseJavaModule { + Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); } -+ + + constants.put("constants", realConstants); + -+ return constants; -+ } + return constants; + } } diff --git a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java -index 599a81a..2edd797 100644 +index 9251c09..2edd797 100644 --- a/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java +++ b/node_modules/react-native-config/android/src/main/java/com/lugg/RNCConfig/RNCConfigPackage.java -@@ -1,27 +1,42 @@ +@@ -1,29 +1,42 @@ package com.lugg.RNCConfig; -import com.facebook.react.ReactPackage; @@ -159,24 +184,26 @@ index 599a81a..2edd797 100644 import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.uimanager.ViewManager; --import java.util.Arrays; --import java.util.Collections; --import java.util.List; +import com.facebook.react.module.model.ReactModuleInfo; +import com.facebook.react.module.model.ReactModuleInfoProvider; --public class RNCConfigPackage implements ReactPackage { +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.List; +import java.util.HashMap; +import java.util.Map; +-public class RNCConfigPackage implements ReactPackage { - @Override - public List createNativeModules(ReactApplicationContext reactContext) { -- return Arrays.asList(new RNCConfigModule(reactContext)); +- return Arrays.asList( +- new RNCConfigModule(reactContext) +- ); - } +public class RNCConfigPackage extends TurboReactPackage { -- public List> createJSModules() { -- return Collections.emptyList(); +- public List> createJSModules() { +- return Collections.emptyList(); + @Override + public NativeModule getModule(String name, ReactApplicationContext reactContext) { + if (name.equals(RNCConfigModule.NAME)) { @@ -309,29 +336,31 @@ index 70866c4..a8f3624 100644 -export const Config = NativeModules.RNCConfigModule || {} export default Config; +diff --git a/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m b/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m +index 04a2f3d..59df625 100644 +--- a/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m ++++ b/node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m +@@ -1 +1 @@ +- #define DOT_ENV @{ }; ++ #define DOT_ENV @{ @"ENV":@"dev",@"API_URL":@"http://localhost" }; diff --git a/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h b/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h -index 755d103..4e4c564 100644 +index 755d103..5341aca 100644 --- a/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h +++ b/node_modules/react-native-config/ios/ReactNativeConfig/RNCConfigModule.h -@@ -1,12 +1,15 @@ --#if __has_include() --#import --#elif __has_include("React/RCTBridgeModule.h") --#import "React/RCTBridgeModule.h" +@@ -1,3 +1,9 @@ +#ifdef RCT_NEW_ARCH_ENABLED +#import "RNCConfigSpec.h" - #else --#import "RCTBridgeModule.h" --#endif -+#import -+#endif // RCT_NEW_ARCH_ENABLED - --@interface RNCConfigModule : NSObject -+@interface RNCConfigModule : NSObject -+#ifdef RCT_NEW_ARCH_ENABLED -+ ++ ++@interface RNCConfigModule : NSObject +#else -+ ++ + #if __has_include() + #import + #elif __has_include("React/RCTBridgeModule.h") +@@ -7,6 +13,7 @@ + #endif + + @interface RNCConfigModule : NSObject +#endif // RCT_NEW_ARCH_ENABLED + (NSDictionary *)env; @@ -411,10 +440,10 @@ index 0000000..1cacb65 + +@end diff --git a/node_modules/react-native-config/package.json b/node_modules/react-native-config/package.json -index f758725..f338b41 100644 +index b4d1fba..0a018a7 100644 --- a/node_modules/react-native-config/package.json +++ b/node_modules/react-native-config/package.json -@@ -27,6 +27,7 @@ +@@ -26,6 +26,7 @@ "android/", "ios/", "windows/", @@ -422,8 +451,8 @@ index f758725..f338b41 100644 "index.js", "index.d.ts", "react-native-config.podspec", -@@ -39,11 +40,21 @@ - "semantic-release": "^19.0.5" +@@ -38,11 +39,21 @@ + "semantic-release": "^17.0.4" }, "peerDependencies": { + "react": "*", @@ -445,7 +474,7 @@ index f758725..f338b41 100644 } } diff --git a/node_modules/react-native-config/react-native-config.podspec b/node_modules/react-native-config/react-native-config.podspec -index 449b970..88b14c5 100644 +index 35313d4..56bce4a 100644 --- a/node_modules/react-native-config/react-native-config.podspec +++ b/node_modules/react-native-config/react-native-config.podspec @@ -4,6 +4,8 @@ require 'json' @@ -457,7 +486,7 @@ index 449b970..88b14c5 100644 Pod::Spec.new do |s| s.name = 'react-native-config' s.version = package['version'] -@@ -35,8 +37,13 @@ HOST_PATH="$SRCROOT/../.." +@@ -33,8 +35,27 @@ HOST_PATH="$SRCROOT/../.." s.default_subspec = 'App' s.subspec 'App' do |app| @@ -466,7 +495,21 @@ index 449b970..88b14c5 100644 + app.source_files = 'ios/**/*.{h,m,mm}' + + if fabric_enabled -+ install_modules_dependencies(app) ++ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' ++ ++ app.pod_target_xcconfig = { ++ 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"', ++ 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17', ++ } ++ app.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED' ++ ++ app.dependency "React" ++ app.dependency "React-RCTFabric" # This is for fabric component ++ app.dependency "React-Codegen" ++ app.dependency "RCT-Folly" ++ app.dependency "RCTRequired" ++ app.dependency "RCTTypeSafety" ++ app.dependency "ReactCommon/turbomodule/core" + else + app.dependency 'React-Core' + end From 691ddc9b7e4ac8a377601f923f152ad0226fa210 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Wed, 9 Oct 2024 16:35:47 +0200 Subject: [PATCH 5/9] fix: add patches for events on Android --- ...rnmapbox+maps+10.1.30+001+bridgeless.patch | 83 ++++++++++++ ...ie-react-native+6.5.1+001+recycling.patch} | 0 ...ie-react-native+6.5.1+002+bridgeless.patch | 41 ++++++ ...e+0.75.2+011+textinput-clear-command.patch | 48 +++++++ ...ive-performance+5.1.0+001+bridgeless.patch | 30 ++++ ...4.0.0-beta.13+001+rn75-compatibility.patch | 128 ++++++++++++++++-- 6 files changed, 317 insertions(+), 13 deletions(-) create mode 100644 patches/@rnmapbox+maps+10.1.30+001+bridgeless.patch rename patches/{lottie-react-native+6.5.1.patch => lottie-react-native+6.5.1+001+recycling.patch} (100%) create mode 100644 patches/lottie-react-native+6.5.1+002+bridgeless.patch create mode 100644 patches/react-native-performance+5.1.0+001+bridgeless.patch diff --git a/patches/@rnmapbox+maps+10.1.30+001+bridgeless.patch b/patches/@rnmapbox+maps+10.1.30+001+bridgeless.patch new file mode 100644 index 000000000000..b840e3da7b12 --- /dev/null +++ b/patches/@rnmapbox+maps+10.1.30+001+bridgeless.patch @@ -0,0 +1,83 @@ +diff --git a/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt b/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +index 5bebc1b..80a4be4 100644 +--- a/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt ++++ b/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +@@ -5,6 +5,8 @@ import com.facebook.react.bridge.ReactApplicationContext + import com.facebook.react.uimanager.ThemedReactContext + import com.facebook.react.uimanager.annotations.ReactProp + import com.facebook.react.viewmanagers.RNMBXRasterSourceManagerInterface ++import com.rnmapbox.rnmbx.events.constants.EventKeys ++import com.rnmapbox.rnmbx.events.constants.eventMapOf + import javax.annotation.Nonnull + + class RNMBXRasterSourceManager(reactApplicationContext: ReactApplicationContext) : +@@ -26,7 +28,10 @@ class RNMBXRasterSourceManager(reactApplicationContext: ReactApplicationContext) + } + + override fun customEvents(): Map? { +- return null ++ return eventMapOf( ++ EventKeys.RASTER_SOURCE_LAYER_CLICK to "onMapboxRasterSourcePress", ++ EventKeys.MAP_ANDROID_CALLBACK to "onAndroidCallback" ++ ) + } + + companion object { +diff --git a/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/events/constants/EventKeys.kt b/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/events/constants/EventKeys.kt +index d059b2c..3882f1e 100644 +--- a/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/events/constants/EventKeys.kt ++++ b/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/events/constants/EventKeys.kt +@@ -4,35 +4,37 @@ private fun ns(name: String): String { + val namespace = "rct.mapbox" + return String.format("%s.%s", namespace, name) + } ++ + enum class EventKeys(val value: String) { + // map events +- MAP_CLICK(ns("map.press")), +- MAP_LONG_CLICK(ns("map.longpress")), +- MAP_ONCHANGE(ns("map.change")), +- MAP_ON_LOCATION_CHANGE(ns("map.location.change")), +- MAP_ANDROID_CALLBACK(ns("map.androidcallback")), +- MAP_USER_TRACKING_MODE_CHANGE(ns("map.usertrackingmodechange")), ++ MAP_CLICK("topPress"), ++ MAP_LONG_CLICK("topLongPress"), ++ MAP_ONCHANGE("topMapChange"), ++ MAP_ON_LOCATION_CHANGE("topLocationChange"), ++ MAP_ANDROID_CALLBACK("topAndroidCallback"), ++ MAP_USER_TRACKING_MODE_CHANGE("topUserTrackingModeChange"), + + // point annotation events +- POINT_ANNOTATION_SELECTED(ns("pointannotation.selected")), +- POINT_ANNOTATION_DESELECTED(ns("pointannotation.deselected")), +- POINT_ANNOTATION_DRAG_START(ns("pointannotation.dragstart")), +- POINT_ANNOTATION_DRAG(ns("pointannotation.drag")), +- POINT_ANNOTATION_DRAG_END(ns("pointannotation.dragend")), ++ POINT_ANNOTATION_SELECTED("topMapboxPointAnnotationSelected"), ++ POINT_ANNOTATION_DESELECTED("topMapboxPointAnnotationDeselected"), ++ POINT_ANNOTATION_DRAG_START("topMapboxPointAnnotationDragStart"), ++ POINT_ANNOTATION_DRAG("topMapboxPointAnnotationDrag"), ++ POINT_ANNOTATION_DRAG_END("topMapboxPointAnnotationDragEnd"), + + // source events +- SHAPE_SOURCE_LAYER_CLICK(ns("shapesource.layer.pressed")), +- VECTOR_SOURCE_LAYER_CLICK(ns("vectorsource.layer.pressed")), +- RASTER_SOURCE_LAYER_CLICK(ns("rastersource.layer.pressed")), ++ SHAPE_SOURCE_LAYER_CLICK("topMapboxShapeSourcePress"), ++ VECTOR_SOURCE_LAYER_CLICK("topMapboxVectorSourcePress"), ++ RASTER_SOURCE_LAYER_CLICK("topMapboxRasterSourcePress"), + + // images event +- IMAGES_MISSING(ns("images.missing")), ++ IMAGES_MISSING("topImageMissing"), + + // location events ++ // TODO: not sure about this one since it is not registered anywhere + USER_LOCATION_UPDATE(ns("user.location.update")), + + // viewport events +- VIEWPORT_STATUS_CHANGE(ns("viewport.statuschange")) ++ VIEWPORT_STATUS_CHANGE("topStatusChanged") + } + + fun eventMapOf(vararg values: Pair): Map { diff --git a/patches/lottie-react-native+6.5.1.patch b/patches/lottie-react-native+6.5.1+001+recycling.patch similarity index 100% rename from patches/lottie-react-native+6.5.1.patch rename to patches/lottie-react-native+6.5.1+001+recycling.patch diff --git a/patches/lottie-react-native+6.5.1+002+bridgeless.patch b/patches/lottie-react-native+6.5.1+002+bridgeless.patch new file mode 100644 index 000000000000..059d509afb3a --- /dev/null +++ b/patches/lottie-react-native+6.5.1+002+bridgeless.patch @@ -0,0 +1,41 @@ +diff --git a/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm b/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm +index a4be628..d8f304e 100644 +--- a/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm ++++ b/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm +@@ -40,6 +40,11 @@ - (instancetype) initWithFrame:(CGRect)frame + + #pragma mark - RCTComponentViewProtocol + +++ (BOOL)shouldBeRecycled ++{ ++ return NO; ++} ++ + + (ComponentDescriptorProvider)componentDescriptorProvider + { + return concreteComponentDescriptorProvider(); +diff --git a/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt b/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt +index aa538d3..0185eaf 100644 +--- a/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt ++++ b/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt +@@ -21,6 +21,6 @@ constructor(surfaceId: Int, viewId: Int, private val error: Throwable) : + } + + companion object { +- const val EVENT_NAME = "topAnimationFailureEvent" ++ const val EVENT_NAME = "topAnimationFailure" + } + } +\ No newline at end of file +diff --git a/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationLoadedEvent.kt b/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationLoadedEvent.kt +index f17cff9..4ebe3ba 100644 +--- a/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationLoadedEvent.kt ++++ b/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationLoadedEvent.kt +@@ -16,6 +16,6 @@ class OnAnimationLoadedEvent constructor(surfaceId: Int, viewId: Int) : + } + + companion object { +- const val EVENT_NAME = "topAnimationLoadedEvent" ++ const val EVENT_NAME = "topAnimationLoaded" + } + } diff --git a/patches/react-native+0.75.2+011+textinput-clear-command.patch b/patches/react-native+0.75.2+011+textinput-clear-command.patch index 773dde04ef44..6723d36d6c6c 100644 --- a/patches/react-native+0.75.2+011+textinput-clear-command.patch +++ b/patches/react-native+0.75.2+011+textinput-clear-command.patch @@ -1,3 +1,51 @@ +diff --git a/node_modules/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js b/node_modules/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +index a77e5b4..6c4bbb2 100644 +--- a/node_modules/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js ++++ b/node_modules/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +@@ -412,6 +412,13 @@ export type NativeProps = $ReadOnly<{| + $ReadOnly<{|target: Int32, text: string|}>, + >, + ++ /** ++ * Invoked when the user performs the clear action. ++ */ ++ onClear?: ?BubblingEventHandler< ++ $ReadOnly<{|target: Int32, eventCount: Int32, text: string|}>, ++ >, ++ + /** + * Callback that is called when a key is pressed. + * This will be called with `{ nativeEvent: { key: keyValue } }` +@@ -655,6 +662,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = { + }, + }, + directEventTypes: { ++ topClear: { ++ registrationName: 'onClear', ++ }, + topScroll: { + registrationName: 'onScroll', + }, +@@ -693,6 +703,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = { + textTransform: true, + returnKeyType: true, + keyboardType: true, ++ onClear: true, + multiline: true, + color: {process: require('../../StyleSheet/processColor').default}, + autoComplete: true, +diff --git a/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js b/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js +index 0aa8965..0b14171 100644 +--- a/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js ++++ b/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js +@@ -146,6 +146,7 @@ const RCTTextInputViewConfig = { + lineBreakStrategyIOS: true, + smartInsertDelete: true, + ...ConditionallyIgnoredEventHandlers({ ++ onClear: true, + onChange: true, + onSelectionChange: true, + onContentSizeChange: true, diff --git a/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js b/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js index 0aa8965..3bfe22c 100644 --- a/node_modules/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js diff --git a/patches/react-native-performance+5.1.0+001+bridgeless.patch b/patches/react-native-performance+5.1.0+001+bridgeless.patch new file mode 100644 index 000000000000..7aed8cf57487 --- /dev/null +++ b/patches/react-native-performance+5.1.0+001+bridgeless.patch @@ -0,0 +1,30 @@ +diff --git a/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java b/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java +index 2fa7d5d..10e1ba6 100644 +--- a/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java ++++ b/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java +@@ -17,7 +17,7 @@ import java.util.Queue; + import java.util.concurrent.ConcurrentLinkedQueue; + + // Should extend NativeRNPerformanceManagerSpec when codegen for old architecture is solved +-public class PerformanceModule extends ReactContextBaseJavaModule implements TurboModule, RNPerformance.MarkerListener { ++public class PerformanceModule extends NativeRNPerformanceManagerSpec implements RNPerformance.MarkerListener { + public static final String PERFORMANCE_MODULE = "RNPerformanceManager"; + public static final String BRIDGE_SETUP_START = "bridgeSetupStart"; + +@@ -118,6 +118,16 @@ public class PerformanceModule extends ReactContextBaseJavaModule implements Tur + return PERFORMANCE_MODULE; + } + ++ @Override ++ public void addListener(String eventName) { ++ // needed for spec ++ } ++ ++ @Override ++ public void removeListeners(double count) { ++ // needed for spec ++ } ++ + private void emitNativeStartupTime() { + safelyEmitMark(new PerformanceMark("nativeLaunchStart", StartTimeProvider.getStartTime())); + safelyEmitMark(new PerformanceMark("nativeLaunchEnd", StartTimeProvider.getEndTime())); diff --git a/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch b/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch index 4e0961ec536a..7c585ddf9f27 100644 --- a/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch +++ b/patches/react-native-vision-camera+4.0.0-beta.13+001+rn75-compatibility.patch @@ -729,10 +729,10 @@ index 25e1f55..33b9dd3 100644 + } } diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraViewManager.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraViewManager.kt -index f2b284c..e348e5c 100644 +index f2b284c..4bb2ebc 100644 --- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraViewManager.kt +++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraViewManager.kt -@@ -4,7 +4,10 @@ import com.facebook.react.bridge.ReadableMap +@@ -4,8 +4,18 @@ import com.facebook.react.bridge.ReadableMap import com.facebook.react.common.MapBuilder import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.ViewGroupManager @@ -740,10 +740,18 @@ index f2b284c..e348e5c 100644 import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.CameraViewManagerDelegate +import com.facebook.react.viewmanagers.CameraViewManagerInterface ++import com.mrousavy.camera.types.CameraCodeScannedEvent import com.mrousavy.camera.types.CameraDeviceFormat ++import com.mrousavy.camera.types.CameraErrorEvent ++import com.mrousavy.camera.types.CameraInitializedEvent ++import com.mrousavy.camera.types.CameraShutterEvent ++import com.mrousavy.camera.types.CameraStartedEvent ++import com.mrousavy.camera.types.CameraStoppedEvent ++import com.mrousavy.camera.types.CameraViewReadyEvent import com.mrousavy.camera.types.CodeScannerOptions import com.mrousavy.camera.types.Orientation -@@ -16,10 +19,19 @@ import com.mrousavy.camera.types.Torch + import com.mrousavy.camera.types.PixelFormat +@@ -16,10 +26,19 @@ import com.mrousavy.camera.types.Torch import com.mrousavy.camera.types.VideoStabilizationMode @Suppress("unused") @@ -764,7 +772,28 @@ index f2b284c..e348e5c 100644 public override fun createViewInstance(context: ThemedReactContext): CameraView = CameraView(context) override fun onAfterUpdateTransaction(view: CameraView) { -@@ -46,37 +58,37 @@ class CameraViewManager : ViewGroupManager() { +@@ -29,13 +48,13 @@ class CameraViewManager : ViewGroupManager() { + + override fun getExportedCustomDirectEventTypeConstants(): MutableMap? = + MapBuilder.builder() +- .put("cameraViewReady", MapBuilder.of("registrationName", "onViewReady")) +- .put("cameraInitialized", MapBuilder.of("registrationName", "onInitialized")) +- .put("cameraStarted", MapBuilder.of("registrationName", "onStarted")) +- .put("cameraStopped", MapBuilder.of("registrationName", "onStopped")) +- .put("cameraShutter", MapBuilder.of("registrationName", "onShutter")) +- .put("cameraError", MapBuilder.of("registrationName", "onError")) +- .put("cameraCodeScanned", MapBuilder.of("registrationName", "onCodeScanned")) ++ .put(CameraViewReadyEvent.EVENT_NAME, MapBuilder.of("registrationName", "onViewReady")) ++ .put(CameraInitializedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onInitialized")) ++ .put(CameraStartedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onStarted")) ++ .put(CameraStoppedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onStopped")) ++ .put(CameraShutterEvent.EVENT_NAME, MapBuilder.of("registrationName", "onShutter")) ++ .put(CameraErrorEvent.EVENT_NAME, MapBuilder.of("registrationName", "onError")) ++ .put(CameraCodeScannedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onCodeScanned")) + .build() + + override fun getName(): String = TAG +@@ -46,37 +65,37 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "cameraId") @@ -809,7 +838,7 @@ index f2b284c..e348e5c 100644 if (pixelFormat != null) { val newPixelFormat = PixelFormat.fromUnionValue(pixelFormat) view.pixelFormat = newPixelFormat -@@ -86,27 +98,27 @@ class CameraViewManager : ViewGroupManager() { +@@ -86,27 +105,27 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "enableDepthData") @@ -842,7 +871,7 @@ index f2b284c..e348e5c 100644 if (videoStabilizationMode != null) { val newMode = VideoStabilizationMode.fromUnionValue(videoStabilizationMode) view.videoStabilizationMode = newMode -@@ -116,12 +128,12 @@ class CameraViewManager : ViewGroupManager() { +@@ -116,12 +135,12 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "enablePortraitEffectsMatteDelivery") @@ -857,7 +886,7 @@ index f2b284c..e348e5c 100644 if (format != null) { val newFormat = CameraDeviceFormat.fromJSValue(format) view.format = newFormat -@@ -131,7 +143,7 @@ class CameraViewManager : ViewGroupManager() { +@@ -131,7 +150,7 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "resizeMode") @@ -866,7 +895,7 @@ index f2b284c..e348e5c 100644 if (resizeMode != null) { val newMode = ResizeMode.fromUnionValue(resizeMode) view.resizeMode = newMode -@@ -141,7 +153,7 @@ class CameraViewManager : ViewGroupManager() { +@@ -141,7 +160,7 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "androidPreviewViewType") @@ -875,7 +904,7 @@ index f2b284c..e348e5c 100644 if (androidPreviewViewType != null) { val newMode = PreviewViewType.fromUnionValue(androidPreviewViewType) view.androidPreviewViewType = newMode -@@ -154,17 +166,17 @@ class CameraViewManager : ViewGroupManager() { +@@ -154,17 +173,17 @@ class CameraViewManager : ViewGroupManager() { // We're treating -1 as "null" here, because when I make the fps parameter // of type "Int?" the react bridge throws an error. @ReactProp(name = "fps", defaultInt = -1) @@ -896,7 +925,7 @@ index f2b284c..e348e5c 100644 if (photoQualityBalance != null) { val newMode = QualityBalance.fromUnionValue(photoQualityBalance) view.photoQualityBalance = newMode -@@ -174,22 +186,22 @@ class CameraViewManager : ViewGroupManager() { +@@ -174,22 +193,22 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "videoHdr") @@ -923,7 +952,7 @@ index f2b284c..e348e5c 100644 if (torch != null) { val newMode = Torch.fromUnionValue(torch) view.torch = newMode -@@ -199,17 +211,17 @@ class CameraViewManager : ViewGroupManager() { +@@ -199,17 +218,17 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "zoom") @@ -944,7 +973,7 @@ index f2b284c..e348e5c 100644 if (orientation != null) { val newMode = Orientation.fromUnionValue(orientation) view.orientation = newMode -@@ -219,7 +231,7 @@ class CameraViewManager : ViewGroupManager() { +@@ -219,7 +238,7 @@ class CameraViewManager : ViewGroupManager() { } @ReactProp(name = "codeScannerOptions") @@ -953,7 +982,7 @@ index f2b284c..e348e5c 100644 if (codeScannerOptions != null) { val newCodeScannerOptions = CodeScannerOptions.fromJSValue(codeScannerOptions) view.codeScannerOptions = newCodeScannerOptions -@@ -227,4 +239,8 @@ class CameraViewManager : ViewGroupManager() { +@@ -227,4 +246,8 @@ class CameraViewManager : ViewGroupManager() { view.codeScannerOptions = null } } @@ -981,6 +1010,79 @@ index b9d3f67..cb70963 100644 @Suppress("KotlinJniMissingFunction") // we use fbjni. class VisionCameraProxy(private val reactContext: ReactApplicationContext) { companion object { +diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/types/Events.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/types/Events.kt +index 1ed0355..b8ff7cf 100644 +--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/types/Events.kt ++++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/types/Events.kt +@@ -3,39 +3,61 @@ package com.mrousavy.camera.types + import com.facebook.react.bridge.Arguments + import com.facebook.react.bridge.WritableMap + import com.facebook.react.uimanager.events.Event ++import com.mrousavy.camera.types.CameraInitializedEvent.Companion.EVENT_NAME + + class CameraInitializedEvent(surfaceId: Int, viewId: Int) : Event(surfaceId, viewId) { +- override fun getEventName() = "cameraInitialized" ++ override fun getEventName() = EVENT_NAME + override fun getEventData(): WritableMap = Arguments.createMap() ++ companion object { ++ const val EVENT_NAME = "topInitialized" ++ } + } + + class CameraStartedEvent(surfaceId: Int, viewId: Int) : Event(surfaceId, viewId) { +- override fun getEventName() = "cameraStarted" ++ override fun getEventName() = EVENT_NAME + override fun getEventData(): WritableMap = Arguments.createMap() ++ companion object { ++ const val EVENT_NAME = "topStarted" ++ } + } + + class CameraStoppedEvent(surfaceId: Int, viewId: Int) : Event(surfaceId, viewId) { +- override fun getEventName() = "cameraStopped" ++ override fun getEventName() = EVENT_NAME + override fun getEventData(): WritableMap = Arguments.createMap() ++ companion object { ++ const val EVENT_NAME = "topStopped" ++ } + } + + class CameraShutterEvent(surfaceId: Int, viewId: Int, private val data: WritableMap) : Event(surfaceId, viewId) { +- override fun getEventName() = "cameraShutter" ++ override fun getEventName() = EVENT_NAME + override fun getEventData() = data ++ companion object { ++ const val EVENT_NAME = "topShutter" ++ } + } + + class CameraErrorEvent(surfaceId: Int, viewId: Int, private val data: WritableMap) : Event(surfaceId, viewId) { +- override fun getEventName() = "cameraError" ++ override fun getEventName() = EVENT_NAME + override fun getEventData() = data ++ companion object { ++ const val EVENT_NAME = "topError" ++ } + } + + class CameraViewReadyEvent(surfaceId: Int, viewId: Int) : Event(surfaceId, viewId) { +- override fun getEventName() = "cameraViewReady" ++ override fun getEventName() = EVENT_NAME + override fun getEventData(): WritableMap = Arguments.createMap() ++ companion object { ++ const val EVENT_NAME = "topViewReady" ++ } + } + + class CameraCodeScannedEvent(surfaceId: Int, viewId: Int, private val data: WritableMap) : + Event(surfaceId, viewId) { +- override fun getEventName() = "cameraCodeScanned" ++ override fun getEventName() = EVENT_NAME + override fun getEventData() = data ++ companion object { ++ const val EVENT_NAME = "topCodeScanned" ++ } + } diff --git a/node_modules/react-native-vision-camera/ios/.swift-version b/node_modules/react-native-vision-camera/ios/.swift-version new file mode 100644 index 0000000..ef425ca From 8ae48eec0bb1fb82f3679cbeafb1ef66978bd17f Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Thu, 10 Oct 2024 09:54:59 +0200 Subject: [PATCH 6/9] fix: patch for lottie --- ...ottie-react-native+6.5.1+002+bridgeless.patch | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/patches/lottie-react-native+6.5.1+002+bridgeless.patch b/patches/lottie-react-native+6.5.1+002+bridgeless.patch index 059d509afb3a..854d26f9beb9 100644 --- a/patches/lottie-react-native+6.5.1+002+bridgeless.patch +++ b/patches/lottie-react-native+6.5.1+002+bridgeless.patch @@ -1,19 +1,3 @@ -diff --git a/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm b/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm -index a4be628..d8f304e 100644 ---- a/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm -+++ b/node_modules/lottie-react-native/ios/Fabric/LottieAnimationViewComponentView.mm -@@ -40,6 +40,11 @@ - (instancetype) initWithFrame:(CGRect)frame - - #pragma mark - RCTComponentViewProtocol - -++ (BOOL)shouldBeRecycled -+{ -+ return NO; -+} -+ - + (ComponentDescriptorProvider)componentDescriptorProvider - { - return concreteComponentDescriptorProvider(); diff --git a/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt b/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt index aa538d3..0185eaf 100644 --- a/node_modules/lottie-react-native/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFailureEvent.kt From 52a976a3e1b99ee294fd73b9f856ecc64ca7dd79 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Thu, 10 Oct 2024 17:04:03 +0200 Subject: [PATCH 7/9] fix: patch for react-native-modal on ios --- patches/react-native-modal+13.0.1.patch | 33 +++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/patches/react-native-modal+13.0.1.patch b/patches/react-native-modal+13.0.1.patch index cc9c8531e3a3..bd65871cf5ac 100644 --- a/patches/react-native-modal+13.0.1.patch +++ b/patches/react-native-modal+13.0.1.patch @@ -11,7 +11,7 @@ index b63bcfc..bd6419e 100644 buildPanResponder: () => void; getAccDistancePerDirection: (gestureState: PanResponderGestureState) => number; diff --git a/node_modules/react-native-modal/dist/modal.js b/node_modules/react-native-modal/dist/modal.js -index 80f4e75..5a58eae 100644 +index 80f4e75..46277ea 100644 --- a/node_modules/react-native-modal/dist/modal.js +++ b/node_modules/react-native-modal/dist/modal.js @@ -75,6 +75,13 @@ export class ReactNativeModal extends React.Component { @@ -28,7 +28,18 @@ index 80f4e75..5a58eae 100644 this.shouldPropagateSwipe = (evt, gestureState) => { return typeof this.props.propagateSwipe === 'function' ? this.props.propagateSwipe(evt, gestureState) -@@ -453,10 +460,18 @@ export class ReactNativeModal extends React.Component { +@@ -383,7 +390,9 @@ export class ReactNativeModal extends React.Component { + this.setState({ + isVisible: false, + }, () => { +- this.props.onModalHide(); ++ if (Platform.OS !== 'ios') { ++ this.props.onModalHide(); ++ } + }); + }); + } +@@ -453,10 +462,18 @@ export class ReactNativeModal extends React.Component { if (this.state.isVisible) { this.open(); } @@ -48,7 +59,7 @@ index 80f4e75..5a58eae 100644 if (this.didUpdateDimensionsEmitter) { this.didUpdateDimensionsEmitter.remove(); } -@@ -464,6 +479,9 @@ export class ReactNativeModal extends React.Component { +@@ -464,6 +481,9 @@ export class ReactNativeModal extends React.Component { InteractionManager.clearInteractionHandle(this.interactionHandle); this.interactionHandle = null; } @@ -58,9 +69,21 @@ index 80f4e75..5a58eae 100644 } componentDidUpdate(prevProps) { // If the animations have been changed then rebuild them to make sure we're -@@ -525,7 +543,7 @@ export class ReactNativeModal extends React.Component { +@@ -490,7 +510,7 @@ export class ReactNativeModal extends React.Component { + } + render() { + /* eslint-disable @typescript-eslint/no-unused-vars */ +- const { animationIn, animationInTiming, animationOut, animationOutTiming, avoidKeyboard, coverScreen, hasBackdrop, backdropColor, backdropOpacity, backdropTransitionInTiming, backdropTransitionOutTiming, customBackdrop, children, isVisible, onModalShow, onBackButtonPress, useNativeDriver, propagateSwipe, style, ...otherProps } = this.props; ++ const { animationIn, animationInTiming, animationOut, animationOutTiming, avoidKeyboard, coverScreen, hasBackdrop, backdropColor, backdropOpacity, backdropTransitionInTiming, backdropTransitionOutTiming, customBackdrop, children, isVisible, onModalShow, onBackButtonPress, useNativeDriver, propagateSwipe, style, onDismiss, ...otherProps } = this.props; + const { testID, ...containerProps } = otherProps; + const computedStyle = [ + { margin: this.getDeviceWidth() * 0.05, transform: [{ translateY: 0 }] }, +@@ -523,9 +543,9 @@ export class ReactNativeModal extends React.Component { + this.makeBackdrop(), + containerView)); } - return (React.createElement(Modal, Object.assign({ transparent: true, animationType: 'none', visible: this.state.isVisible, onRequestClose: onBackButtonPress }, otherProps), +- return (React.createElement(Modal, Object.assign({ transparent: true, animationType: 'none', visible: this.state.isVisible, onRequestClose: onBackButtonPress }, otherProps), ++ return (React.createElement(Modal, Object.assign({ transparent: true, animationType: 'none', visible: this.state.isVisible, onRequestClose: onBackButtonPress, onDismiss: () => {onDismiss();if (Platform.OS === 'ios'){this.props.onModalHide();}} }, otherProps), this.makeBackdrop(), - avoidKeyboard ? (React.createElement(KeyboardAvoidingView, { behavior: Platform.OS === 'ios' ? 'padding' : undefined, pointerEvents: "box-none", style: computedStyle.concat([{ margin: 0 }]) }, containerView)) : (containerView))); + avoidKeyboard ? (React.createElement(KeyboardAvoidingView, { behavior: 'padding', pointerEvents: "box-none", style: computedStyle.concat([{ margin: 0 }]) }, containerView)) : (containerView))); From 475a6232830854428d3ec8becceb2c279482fc10 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Tue, 22 Oct 2024 14:10:10 +0200 Subject: [PATCH 8/9] fix: update patch --- ...e-firebase+app+12.9.3+002+bridgeless.patch | 49 +++---------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch b/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch index 322bc2597f2c..a085cdbcfbe2 100644 --- a/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch +++ b/patches/@react-native-firebase+app+12.9.3+002+bridgeless.patch @@ -1,50 +1,13 @@ -diff --git a/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m b/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m -index f980834..8937cdf 100644 ---- a/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m -+++ b/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBVersion.m -@@ -15,7 +15,7 @@ - * - */ - --#import "RCTVersion.h" -+#import - - // generated file - do not modify or commit - NSString* const RNFBVersionString = @"12.9.3"; diff --git a/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js b/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js -index 03f001c..cf8410a 100644 +index 03f001c..23d467d 100644 --- a/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js +++ b/node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js -@@ -64,15 +64,15 @@ function nativeModuleWrapped(namespace, NativeModule, argToPrepend) { - if (!NativeModule) { +@@ -65,7 +65,7 @@ function nativeModuleWrapped(namespace, NativeModule, argToPrepend) { return NativeModule; } -- -- const properties = Object.keys(NativeModule); -- -- for (let i = 0, len = properties.length; i < len; i++) { -- const property = properties[i]; -- if (typeof NativeModule[property] === 'function') { -- native[property] = nativeModuleMethodWrapped(namespace, NativeModule[property], argToPrepend); -- } else { -- native[property] = NativeModule[property]; -+ const moduleMethods = ["metaGetAll","jsonGetAll","preferencesSetBool","preferencesSetString","preferencesGetAll","preferencesClearAll","eventsNotifyReady","eventsGetListeners","eventsPing","eventsAddListener","eventsRemoveListener","addListener","removeListeners","initializeApp","setLogLevel","setAutomaticDataCollectionEnabled","deleteApp","getConstants","NATIVE_FIREBASE_APPS","FIREBASE_RAW_JSON","checkForUnsentReports","crash","crashWithStackPromise","deleteUnsentReports","didCrashOnPreviousExecution","log","logPromise","sendUnsentReports","setAttribute","setAttributes","setUserId","recordError","recordErrorPromise","setCrashlyticsCollectionEnabled","isErrorGenerationOnJSCrashEnabled","isCrashlyticsJavascriptExceptionHandlerChainingEnabled","isCrashlyticsCollectionEnabled","getConstants"]; -+ for (let i = 0, len = moduleMethods.length; i < len; i++) { -+ const method = moduleMethods[i]; -+ if (NativeModule[method]) { -+ if (typeof NativeModule[method] === 'function') { -+ native[method] = nativeModuleMethodWrapped(namespace, NativeModule[method], argToPrepend); -+ } else { -+ native[method] = NativeModule[method]; -+ } - } - } -@@ -133,7 +133,6 @@ function initialiseNativeModule(module) { - } - - Object.freeze(multiModuleRoot); -- - NATIVE_MODULE_REGISTRY[key] = multiModuleRoot; +- const properties = Object.keys(NativeModule); ++ const properties = Object.keys(Object.getPrototypeOf(NativeModule)); - return NATIVE_MODULE_REGISTRY[key]; + for (let i = 0, len = properties.length; i < len; i++) { + const property = properties[i]; From 2ee388f424d82de2f9ade80b838edcfb3a0e953d Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Tue, 22 Oct 2024 16:15:08 +0200 Subject: [PATCH 9/9] fix: prepare bootsplash for hybrid --- ios/NewExpensify/RCTBootSplash.h | 1 + ios/NewExpensify/RCTBootSplash.mm | 43 ++++++++++++++++++------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ios/NewExpensify/RCTBootSplash.h b/ios/NewExpensify/RCTBootSplash.h index e4037995d666..f25f3e28f561 100644 --- a/ios/NewExpensify/RCTBootSplash.h +++ b/ios/NewExpensify/RCTBootSplash.h @@ -2,6 +2,7 @@ @interface RCTBootSplash : NSObject ++ (void)invalidateBootSplash; + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName rootView:(UIView * _Nullable)rootView; diff --git a/ios/NewExpensify/RCTBootSplash.mm b/ios/NewExpensify/RCTBootSplash.mm index 8ce5efee92ff..ddb3f2d047ce 100644 --- a/ios/NewExpensify/RCTBootSplash.mm +++ b/ios/NewExpensify/RCTBootSplash.mm @@ -17,19 +17,32 @@ @implementation RCTBootSplash RCT_EXPORT_MODULE(); +- (dispatch_queue_t)methodQueue { + return dispatch_get_main_queue(); +} + + (BOOL)requiresMainQueueSetup { return NO; } -- (dispatch_queue_t)methodQueue { - return dispatch_get_main_queue(); ++ (void)invalidateBootSplash { + _resolveQueue = nil; + _rootView = nil; + _nativeHidden = false; } + (bool)isLoadingViewVisible { return _loadingView != nil && ![_loadingView isHidden]; } ++ (bool)hasResolveQueue { + return _resolveQueue != nil; +} + + (void)clearResolveQueue { + if (![self hasResolveQueue]) + return; + while ([_resolveQueue count] > 0) { RCTPromiseResolveBlock resolve = [_resolveQueue objectAtIndex:0]; [_resolveQueue removeObjectAtIndex:0]; @@ -85,11 +98,7 @@ + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName }]; if (rootView != nil) { -#ifdef RCT_NEW_ARCH_ENABLED _rootView = (RCTSurfaceHostingProxyRootView *)rootView; -#else - _rootView = (RCTRootView *)rootView; -#endif UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; @@ -99,12 +108,8 @@ + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName _loadingView.center = (CGPoint){CGRectGetMidX(_rootView.bounds), CGRectGetMidY(_rootView.bounds)}; _loadingView.hidden = NO; -#if RCT_NEW_ARCH_ENABLED [_rootView disableActivityIndicatorAutoHide:YES]; [_rootView setLoadingView:_loadingView]; -#else - [_rootView addSubview:_loadingView]; -#endif [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onJavaScriptDidLoad) @@ -142,16 +147,18 @@ - (NSDictionary *)constantsToExport { - (void)hideImpl:(BOOL)fade resolve:(RCTPromiseResolveBlock)resolve { - if (RCTRunningInAppExtension()) { - return resolve(@(true)); - } + if (_resolveQueue == nil) + _resolveQueue = [[NSMutableArray alloc] init]; - [_resolveQueue addObject:resolve]; - _fade = fade; + [_resolveQueue addObject:resolve]; - if (_nativeHidden) { - return [RCTBootSplash hideAndClearPromiseQueue]; - } + if (![RCTBootSplash isLoadingViewVisible] || RCTRunningInAppExtension()) + return [RCTBootSplash clearResolveQueue]; + + _fade = fade; + + if (_nativeHidden) + return [RCTBootSplash hideAndClearPromiseQueue]; } - (void)isVisibleImpl:(RCTPromiseResolveBlock)resolve {