-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79bee08
commit e87df8c
Showing
20 changed files
with
2,199 additions
and
672 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby '2.7.5' | ||
ruby ">= 2.6.10" | ||
|
||
gem 'cocoapods', '~> 1.11', '>= 1.11.2' | ||
gem 'cocoapods', '~> 1.13' | ||
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare module '*.svg' { | ||
import type React from 'react'; | ||
import type { SvgProps } from 'react-native-svg'; | ||
|
||
const content: React.FC<SvgProps>; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
presets: ['module:@react-native/babel-preset'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export NODE_BINARY=$(command -v node) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#import <React/RCTBridgeDelegate.h> | ||
#import <RCTAppDelegate.h> | ||
#import <UIKit/UIKit.h> | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate> | ||
|
||
@property (nonatomic, strong) UIWindow *window; | ||
@interface AppDelegate : RCTAppDelegate | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,33 @@ | ||
#import "AppDelegate.h" | ||
|
||
#import <React/RCTBridge.h> | ||
#import <React/RCTBundleURLProvider.h> | ||
#import <React/RCTRootView.h> | ||
#import <CodePush/CodePush.h> | ||
|
||
#import <React/RCTAppSetupUtils.h> | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
#import <React/CoreModulesPlugins.h> | ||
#import <React/RCTCxxBridgeDelegate.h> | ||
#import <React/RCTFabricSurfaceHostingProxyRootView.h> | ||
#import <React/RCTSurfacePresenter.h> | ||
#import <React/RCTSurfacePresenterBridgeAdapter.h> | ||
#import <ReactCommon/RCTTurboModuleManager.h> | ||
|
||
#import <react/config/ReactNativeConfig.h> | ||
|
||
static NSString *const kRNConcurrentRoot = @"concurrentRoot"; | ||
|
||
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> { | ||
RCTTurboModuleManager *_turboModuleManager; | ||
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; | ||
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig; | ||
facebook::react::ContextContainer::Shared _contextContainer; | ||
} | ||
@end | ||
#endif | ||
|
||
@implementation AppDelegate | ||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
RCTAppSetupPrepareApp(application); | ||
|
||
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
_contextContainer = std::make_shared<facebook::react::ContextContainer const>(); | ||
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>(); | ||
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig); | ||
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; | ||
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; | ||
#endif | ||
self.moduleName = @"RnDiffApp"; | ||
// You can add your custom initial props in the dictionary below. | ||
// They will be passed down to the ViewController used by React Native. | ||
self.initialProps = @{}; | ||
|
||
NSDictionary *initProps = [self prepareInitialProps]; | ||
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"NegativeHarmony", initProps); | ||
|
||
if (@available(iOS 13.0, *)) { | ||
rootView.backgroundColor = [UIColor systemBackgroundColor]; | ||
} else { | ||
rootView.backgroundColor = [UIColor whiteColor]; | ||
} | ||
|
||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ||
UIViewController *rootViewController = [UIViewController new]; | ||
rootViewController.view = rootView; | ||
self.window.rootViewController = rootViewController; | ||
[self.window makeKeyAndVisible]; | ||
return YES; | ||
} | ||
|
||
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. | ||
/// | ||
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html | ||
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). | ||
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. | ||
- (BOOL)concurrentRootEnabled | ||
{ | ||
// Switch this bool to turn on and off the concurrent root | ||
return true; | ||
return [super application:application didFinishLaunchingWithOptions:launchOptions]; | ||
} | ||
|
||
- (NSDictionary *)prepareInitialProps | ||
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge | ||
{ | ||
NSMutableDictionary *initProps = [NSMutableDictionary new]; | ||
|
||
#ifdef RCT_NEW_ARCH_ENABLED | ||
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); | ||
#endif | ||
|
||
return initProps; | ||
return [self getBundleURL]; | ||
} | ||
|
||
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge | ||
- (NSURL *)getBundleURL | ||
{ | ||
#if DEBUG | ||
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; | ||
#else | ||
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; | ||
return [CodePush bundleURL]; | ||
#endif | ||
} | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
|
||
#pragma mark - RCTCxxBridgeDelegate | ||
|
||
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge | ||
{ | ||
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge | ||
delegate:self | ||
jsInvoker:bridge.jsCallInvoker]; | ||
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); | ||
} | ||
|
||
#pragma mark RCTTurboModuleManagerDelegate | ||
|
||
- (Class)getModuleClassFromName:(const char *)name | ||
{ | ||
return RCTCoreModulesClassProvider(name); | ||
} | ||
|
||
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name | ||
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker | ||
{ | ||
return nullptr; | ||
} | ||
|
||
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name | ||
initParams: | ||
(const facebook::react::ObjCTurboModule::InitParams &)params | ||
{ | ||
return nullptr; | ||
} | ||
|
||
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass | ||
{ | ||
return RCTAppSetupDefaultModuleFromClass(moduleClass); | ||
} | ||
|
||
#endif | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.