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
10 changes: 5 additions & 5 deletions packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import <React/RCTLinkingManager.h>

#import <FBReactNativeSpec/FBReactNativeSpec.h>
#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTLog.h>
#import <React/RCTUtils.h>
Expand Down Expand Up @@ -36,6 +35,8 @@ @implementation RCTLinkingManager

RCT_EXPORT_MODULE()

@synthesize launchOptions = _launchOptions;

+ (void)postNotificationWithURL:(NSURL *)URL
{
NSDictionary<NSString *, id> *payload = @{@"url" : URL.absoluteString};
Expand Down Expand Up @@ -207,11 +208,10 @@ - (void)canOpenURL:(NSString *)urlString
- (void)getInitialURL:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject
{
NSURL *initialURL = nil;
if (self.bridge.launchOptions[UIApplicationLaunchOptionsURLKey] != nullptr) {
initialURL = self.bridge.launchOptions[UIApplicationLaunchOptionsURLKey];
if (self.launchOptions[UIApplicationLaunchOptionsURLKey] != nullptr) {
initialURL = self.launchOptions[UIApplicationLaunchOptionsURLKey];
} else {
NSDictionary *userActivityDictionary =
self.bridge.launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey];
NSDictionary *userActivityDictionary = self.launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey];
if ([userActivityDictionary[UIApplicationLaunchOptionsUserActivityTypeKey] isEqual:NSUserActivityTypeBrowsingWeb]) {
initialURL = ((NSUserActivity *)userActivityDictionary[@"UIApplicationLaunchOptionsUserActivityKey"]).webpageURL;
}
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTBundleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#import <React/RCTBundleURLProvider.h>
#import <React/RCTDevLoadingViewSetEnabled.h>
#import "RCTAssert.h"
#import "RCTBridge+Private.h"
#import "RCTBridge.h"
#import "RCTLog.h"

@implementation RCTBundleConfiguration
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/React/Base/RCTCallableJSModules.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

#import "RCTBridge.h"
#import "RCTBridgeModule.h"

@implementation RCTCallableJSModules {
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/React/Base/RCTJavaScriptLoader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#import <cxxreact/JSBundleType.h>

#import "RCTBridge.h"
#import "RCTConvert.h"
#import "RCTMultipartDataTask.h"
#import "RCTPerformanceLogger.h"
Expand Down
3 changes: 1 addition & 2 deletions packages/react-native/React/Base/RCTLog.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#import <os/log.h>

#import "RCTAssert.h"
#import "RCTBridge+Private.h"
#import "RCTBridge.h"
#import "RCTBridgeModule.h"
#import "RCTDefines.h"
#import "RCTRedBoxSetEnabled.h"
#import "RCTUtils.h"
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTRootView.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#import <objc/runtime.h>

#import "RCTAssert.h"
#import "RCTBridge+Private.h"
#import "RCTBridge.h"
#import "RCTConstants.h"
#import "RCTKeyCommands.h"
#import "RCTLog.h"
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/React/Base/RCTTouchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import <UIKit/UIGestureRecognizerSubclass.h>

#import "RCTAssert.h"
#import "RCTBridge.h"
#import "RCTEventDispatcherProtocol.h"
#import "RCTLog.h"
#import "RCTSurfaceView.h"
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/React/Base/RCTViewRegistry.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import <React/RCTSurfacePresenterStub.h>
#import <React/RCTUIManager.h>

#import "RCTBridge.h"
#import "RCTBridgeModule.h"

@implementation RCTViewRegistry {
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/Surface/RCTSurface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#import <stdatomic.h>

#import "RCTAssert.h"
#import "RCTBridge+Private.h"
#import "RCTBridge.h"
#import "RCTConstants.h"
#import "RCTShadowView+Layout.h"
#import "RCTSurfaceDelegate.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import <objc/runtime.h>

#import "RCTAssert.h"
#import "RCTBridge+Private.h"
#import "RCTBridge.h"
#import "RCTLog.h"
#import "RCTPerformanceLogger.h"
Expand Down
92 changes: 9 additions & 83 deletions packages/react-native/React/CoreModules/RCTDevSettings.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#import <React/RCTDevMenu.h>
#import <React/RCTEventDispatcherProtocol.h>
#import <React/RCTLog.h>
#import <React/RCTProfile.h>
#import <React/RCTReloadCommand.h>
#import <React/RCTUtils.h>
#import <atomic>
Expand Down Expand Up @@ -165,11 +164,6 @@ + (BOOL)requiresMainQueueSetup
return NO;
}

- (BOOL)_isBridgeMode
{
return [self.bridge isKindOfClass:[RCTBridge class]];
}

- (instancetype)initWithDataSource:(id<RCTDevSettingsDataSource>)dataSource
{
if (self = [super init]) {
Expand Down Expand Up @@ -221,36 +215,9 @@ - (void)initialize
#endif

#if RCT_ENABLE_INSPECTOR
if ([self _isBridgeMode]) {
// We need this dispatch to the main thread because the bridge is not yet
// finished with its initialisation. By the time it relinquishes control of
// the main thread, this operation can be performed.
__weak __typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
__typeof(self) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
id dispatchBlock = ^{
__typeof(self) strongSelf2 = weakSelf;
if (!strongSelf2) {
return;
}
NSURL *url = strongSelf2.bundleManager.bundleURL;
[RCTInspectorDevServerHelper connectWithBundleURL:url];
};
[strongSelf.bridge dispatchBlock:dispatchBlock queue:RCTJSThread];
});
} else {
NSURL *url = self.bundleManager.bundleURL;
[RCTInspectorDevServerHelper connectWithBundleURL:url];
}
NSURL *url = self.bundleManager.bundleURL;
[RCTInspectorDevServerHelper connectWithBundleURL:url];
#endif

__weak __typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf _synchronizeAllSettings];
});
}

- (dispatch_queue_t)methodQueue
Expand Down Expand Up @@ -295,11 +262,7 @@ - (void)setIsShakeGestureEnabled:(BOOL)isShakeGestureEnabled
- (BOOL)isDeviceDebuggingAvailable
{
#if RCT_ENABLE_INSPECTOR
if ([self _isBridgeMode]) {
return self.bridge.isInspectable;
} else {
return self.isInspectable;
}
return self.isInspectable;
#else
return false;
#endif // RCT_ENABLE_INSPECTOR
Expand Down Expand Up @@ -341,33 +304,13 @@ - (BOOL)isShakeToShowDevMenuEnabled
- (void)setProfilingEnabled:(BOOL)enabled
{
[self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingProfilingEnabled];
[self _profilingSettingDidChange];
}

- (BOOL)isProfilingEnabled
{
return [[self settingForKey:kRCTDevSettingProfilingEnabled] boolValue];
}

- (void)_profilingSettingDidChange
{
BOOL enabled = self.isProfilingEnabled;
if (self.isHotLoadingAvailable && enabled != RCTProfileIsProfiling()) {
if (enabled) {
[self.bridge startProfiling];
} else {
__weak __typeof(self) weakSelf = self;
[self.bridge stopProfiling:^(NSData *logData) {
__typeof(self) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
RCTProfileSendResult(strongSelf.bridge, @"systrace", logData);
}];
}
}
}

- (void)setHotLoadingEnabled:(BOOL)enabled
{
if (self.isHotLoadingEnabled != enabled) {
Expand Down Expand Up @@ -430,17 +373,12 @@ - (BOOL)isPerfMonitorShown

- (void)setExecutorClass:(Class)executorClass
{
_executorClass = executorClass;
if (self.bridge.executorClass != executorClass) {
// TODO (6929129): we can remove this special case test once we have better
// support for custom executors in the dev menu. But right now this is
// needed to prevent overriding a custom executor with the default if a
// custom executor has been set directly on the bridge
if (executorClass == Nil) {
return;
}

self.bridge.executorClass = executorClass;
if (executorClass == Nil) {
_executorClass = Nil;
return;
}
if (_executorClass != executorClass) {
_executorClass = executorClass;
RCTTriggerReloadCommandListeners(@"Custom executor class reset");
}
}
Expand Down Expand Up @@ -505,15 +443,6 @@ - (void)openDebugger

#pragma mark - Internal

/**
* Query the data source for all possible settings and make sure we're doing the right
* thing for the state of each setting.
*/
- (void)_synchronizeAllSettings
{
[self _profilingSettingDidChange];
}

- (void)jsLoaded:(NSNotification *)notification
{
// In bridge mode, the bridge that sent the notif must be the same as the one stored in this module.
Expand All @@ -530,9 +459,6 @@ - (void)jsLoaded:(NSNotification *)notification
if (!strongSelf) {
return;
}
// update state again after the bridge has finished loading
[strongSelf _synchronizeAllSettings];

// Inspector can only be shown after JS has loaded
if ([strongSelf isElementInspectorShown]) {
#pragma clang diagnostic push
Expand Down
Loading
Loading