Fixed zoom issue Fixed Fabric (new arch) compile issues on both platforms Fixed included broken codegen lib code Fixed broken .h import paths to avoid setting custom build settings Fixed potential memory issue by disabling view recycling Added Fabric (new arch) support for camera view component Added RN 0.81 for example Added RN 0.79 for main lib Added helper for re-running codegen Added gitignore for Android codegen making a podspec Added support for scanThrottleDelay on Android Added includesGeneratedCode to package.json to indicate changes Rewrote optional int props to use -1 instead due to RN bug Moved to Obj-C with C++ support (.mm) to avoid C++ compile issues
52 lines
1.4 KiB
Plaintext
52 lines
1.4 KiB
Plaintext
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import "RCTModuleProviders.h"
|
|
#import <ReactCommon/RCTTurboModule.h>
|
|
#import <React/RCTLog.h>
|
|
|
|
@implementation RCTModuleProviders
|
|
|
|
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
|
|
{
|
|
static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
|
|
static dispatch_once_t onceToken;
|
|
|
|
dispatch_once(&onceToken, ^{
|
|
NSDictionary<NSString *, NSString *> * moduleMapping = @{
|
|
|
|
};
|
|
|
|
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
|
|
|
|
for (NSString *key in moduleMapping) {
|
|
NSString * moduleProviderName = moduleMapping[key];
|
|
Class klass = NSClassFromString(moduleProviderName);
|
|
if (!klass) {
|
|
RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
|
|
continue;
|
|
}
|
|
|
|
id instance = [klass new];
|
|
if (![instance respondsToSelector:@selector(getTurboModule:)]) {
|
|
RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
|
|
continue;
|
|
}
|
|
|
|
[dict setObject:instance forKey:key];
|
|
}
|
|
|
|
providers = dict;
|
|
});
|
|
|
|
return providers;
|
|
}
|
|
|
|
@end
|