Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -120,60 +120,12 @@ void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled)
RCTTurboModuleManager *turboModuleManager,
const std::shared_ptr<facebook::react::RuntimeScheduler> &runtimeScheduler)
{
#ifndef RCT_REMOVE_LEGACY_ARCH
// Necessary to allow NativeModules to lookup TurboModules
[bridge setRCTTurboModuleRegistry:turboModuleManager];

#if RCT_DEV
/**
* Instantiating DevMenu has the side-effect of registering
* shortcuts for CMD + d, CMD + i, and CMD + n via RCTDevMenu.
* Therefore, when TurboModules are enabled, we must manually create this
* NativeModule.
*/
[turboModuleManager moduleForName:"RCTDevMenu"];
#endif // end RCT_DEV

auto runtimeInstallerLambda = [turboModuleManager, bridge, runtimeScheduler](facebook::jsi::Runtime &runtime) {
if (!bridge || !turboModuleManager) {
return;
}
if (runtimeScheduler) {
facebook::react::RuntimeSchedulerBinding::createAndInstallIfNeeded(runtime, runtimeScheduler);
}
[turboModuleManager installJSBindings:runtime];
};
#if USE_THIRD_PARTY_JSC != 1
return std::make_unique<facebook::react::HermesExecutorFactory>(
facebook::react::RCTJSIExecutorRuntimeInstaller(runtimeInstallerLambda));
#endif
#else
// This method should not be invoked in the New Arch. So when Legacy Arch is removed, we can
// safly return a nullptr.
return nullptr;
#endif
}

std::unique_ptr<facebook::react::JSExecutorFactory> RCTAppSetupJsExecutorFactoryForOldArch(
RCTBridge *bridge,
const std::shared_ptr<facebook::react::RuntimeScheduler> &runtimeScheduler)
{
#ifndef RCT_REMOVE_LEGACY_ARCH
auto runtimeInstallerLambda = [bridge, runtimeScheduler](facebook::jsi::Runtime &runtime) {
if (!bridge) {
return;
}
if (runtimeScheduler) {
facebook::react::RuntimeSchedulerBinding::createAndInstallIfNeeded(runtime, runtimeScheduler);
}
};
#if USE_THIRD_PARTY_JSC != 1
return std::make_unique<facebook::react::HermesExecutorFactory>(
facebook::react::RCTJSIExecutorRuntimeInstaller(runtimeInstallerLambda));
#endif
#else
// This method should not be invoked in the New Arch. So when Legacy Arch is removed, we can
// safly return a nullptr.
return nullptr;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,7 @@ - (RCTRootViewFactory *)createRCTRootViewFactory

configuration.sourceURLForBridge = ^NSURL *_Nullable(RCTBridge *_Nonnull bridge)
{
#ifndef RCT_REMOVE_LEGACY_ARCH
return [weakSelf.delegate sourceURLForBridge:bridge];
#else
// When the Legacy Arch is removed, the Delegate does not have a sourceURLForBridge method
return [weakSelf.delegate bundleURL];
#endif
};

if ([self.delegate respondsToSelector:@selector(extraModulesForBridge:)]) {
Expand All @@ -289,52 +284,6 @@ - (RCTRootViewFactory *)createRCTRootViewFactory
};
}

#ifndef RCT_REMOVE_LEGACY_ARCH
// When the Legacy Arch is removed, the Delegate does not have a extraLazyModuleClassesForBridge method
if ([self.delegate respondsToSelector:@selector(extraLazyModuleClassesForBridge:)]) {
configuration.extraLazyModuleClassesForBridge =
^NSDictionary<NSString *, Class> *_Nonnull(RCTBridge *_Nonnull bridge)
{
return [weakSelf.delegate extraLazyModuleClassesForBridge:bridge];
};
}
#endif

#ifndef RCT_REMOVE_LEGACY_ARCH
// When the Legacy Arch is removed, the Delegate does not have a bridge:didNotFindModule method
// We return NO, because if we have invoked this method is unlikely that the module will be actually registered
if ([self.delegate respondsToSelector:@selector(bridge:didNotFindModule:)]) {
configuration.bridgeDidNotFindModule = ^BOOL(RCTBridge *_Nonnull bridge, NSString *_Nonnull moduleName) {
return [weakSelf.delegate bridge:bridge didNotFindModule:moduleName];
};
}
#endif

#ifndef RCT_REMOVE_LEGACY_ARCH
// When the Legacy Arch is removed, the Delegate does not have a
// loadSourceForBridge:onProgress:onComplete: method
// We then call the loadBundleAtURL:onProgress:onComplete: instead
if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:onProgress:onComplete:)]) {
configuration.loadSourceForBridgeWithProgress =
^(RCTBridge *_Nonnull bridge,
RCTSourceLoadProgressBlock _Nonnull onProgress,
RCTSourceLoadBlock _Nonnull loadCallback) {
[weakSelf.delegate loadSourceForBridge:bridge onProgress:onProgress onComplete:loadCallback];
};
}
#endif

#ifndef RCT_REMOVE_LEGACY_ARCH
// When the Legacy Arch is removed, the Delegate does not have a
// loadSourceForBridge:withBlock: method
// We then call the loadBundleAtURL:onProgress:onComplete: instead
if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:withBlock:)]) {
configuration.loadSourceForBridge = ^(RCTBridge *_Nonnull bridge, RCTSourceLoadBlock _Nonnull loadCallback) {
[weakSelf.delegate loadSourceForBridge:bridge withBlock:loadCallback];
};
}
#endif

configuration.jsRuntimeConfiguratorDelegate = self;

return [[RCTRootViewFactory alloc] initWithTurboModuleDelegate:self hostDelegate:self configuration:configuration];
Expand Down
17 changes: 0 additions & 17 deletions packages/react-native/Libraries/Image/RCTImageShadowView.h

This file was deleted.

28 changes: 0 additions & 28 deletions packages/react-native/Libraries/Image/RCTImageShadowView.mm

This file was deleted.

32 changes: 0 additions & 32 deletions packages/react-native/Libraries/Image/RCTImageView.h

This file was deleted.

Loading
Loading