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
16 changes: 0 additions & 16 deletions packages/react-native/Libraries/Image/RCTImageLoader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1323,22 +1323,6 @@ - (void)queryCache:(NSArray *)uris resolve:(RCTPromiseResolveBlock)resolve rejec
}
@end

/**
* DEPRECATED!! DO NOT USE
* Instead use `[_bridge moduleForClass:[RCTImageLoader class]]`
*/
@implementation RCTBridge (RCTImageLoader)

- (RCTImageLoader *)imageLoader
{
RCTLogWarn(
@"Calling bridge.imageLoader is deprecated and will not work in newer versions of RN. Please update to the "
"moduleForClass API or turboModuleRegistry API.");
return [self moduleForClass:[RCTImageLoader class]];
}

@end

@implementation RCTBridgeProxy (RCTImageLoader)

- (RCTImageLoader *)imageLoader
Expand Down
9 changes: 0 additions & 9 deletions packages/react-native/Libraries/Image/RCTImageStoreManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,6 @@ - (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(UIImage *image))

@end

@implementation RCTBridge (RCTImageStoreManager)

- (RCTImageStoreManager *)imageStoreManager
{
return [self moduleForClass:[RCTImageStoreManager class]];
}

@end

@implementation RCTBridgeProxy (RCTImageStoreManager)

- (RCTImageStoreManager *)imageStoreManager
Expand Down
9 changes: 0 additions & 9 deletions packages/react-native/Libraries/Network/RCTNetworking.mm
Original file line number Diff line number Diff line change
Expand Up @@ -856,15 +856,6 @@ - (void)clearCookies:(RCTResponseSenderBlock)responseSender

@end

@implementation RCTBridge (RCTNetworking)

- (RCTNetworking *)networking
{
return [self moduleForClass:[RCTNetworking class]];
}

@end

@implementation RCTBridgeProxy (RCTNetworking)

- (RCTNetworking *)networking
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ let reactCore = RNTarget(
path: "React",
searchPaths: [
"React/I18n",
"React/Profiler",
"ReactCommon/react/runtime/platform/ios", // explicit header search path to break circular dependency. RCTHost imports `RCTDefines.h` in ReactCore, ReacCore needs to import RCTHost
],
linkedFrameworks: ["CoreServices"],
Expand Down
69 changes: 0 additions & 69 deletions packages/react-native/React/Base/RCTBridge+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import <React/RCTBridge.h>

@class RCTModuleRegistry;
@class RCTModuleData;
@protocol RCTJavaScriptExecutor;

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
Expand All @@ -18,23 +17,9 @@ RCT_EXTERN void RCTRegisterModule(Class);

@interface RCTBridge ()

// Used for the profiler flow events between JS and native
@property (nonatomic, assign) int64_t flowID;
@property (nonatomic, assign) CFMutableDictionaryRef flowIDMap;
@property (nonatomic, strong) NSLock *flowIDMapLock;

// Used by RCTDevMenu
@property (nonatomic, copy) NSString *bridgeDescription;

+ (instancetype)currentBridge;
+ (void)setCurrentBridge:(RCTBridge *)bridge;

/**
* Bridge setup code - creates an instance of RCTBachedBridge. Exposed for
* test only
*/
- (void)setUp;

/**
* This method is used to invoke a callback that was registered in the
* JavaScript application context. Safe to call from any thread.
Expand All @@ -48,17 +33,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
*/
@property (atomic, strong) RCTBridge *batchedBridge;

/**
* The block that creates the modules' instances to be added to the bridge.
* Exposed for RCTCxxBridge
*/
@property (nonatomic, copy, readonly) RCTBridgeModuleListProvider moduleProvider;

/**
* Used by RCTDevMenu to override the `hot` param of the current bundleURL.
*/
@property (nonatomic, strong, readwrite) NSURL *bundleURL;

/**
* An object that allows one to require NativeModules/TurboModules.
* RCTModuleRegistry is implemented in bridgeless mode and bridge mode.
Expand All @@ -70,17 +44,6 @@ RCT_EXTERN void RCTRegisterModule(Class);

@interface RCTBridge (RCTCxxBridge)

/**
* Used by RCTModuleData
*/

@property (nonatomic, weak, readonly) RCTBridge *parentBridge;

/**
* Used by RCTModuleData
*/
@property (nonatomic, assign, readonly) BOOL moduleSetupComplete;

/**
* Called on the child bridge to run the executor and start loading.
*/
Expand All @@ -92,41 +55,9 @@ RCT_EXTERN void RCTRegisterModule(Class);
*/
- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue;

/**
* Get the module data for a given module name. Used by UIManager to implement
* the `dispatchViewManagerCommand` method.
*/
- (RCTModuleData *)moduleDataForName:(NSString *)moduleName;

/**
* Registers additional classes with the ModuleRegistry.
*/
- (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules;

/**
* Updates the ModuleRegistry with a pre-initialized instance.
*/
- (void)updateModuleWithInstance:(id<RCTBridgeModule>)instance;

/**
* Systrace profiler toggling methods exposed for the RCTDevMenu
*/
- (void)startProfiling;
- (void)stopProfiling:(void (^)(NSData *))callback;

/**
* Synchronously call a specific native module's method and return the result
*/
- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params;

/**
* Hook exposed for RCTLog to send logs to JavaScript when not running in JSC
*/
- (void)logMessage:(NSString *)message level:(NSString *)level;

/**
* Allow super fast, one time, timers to skip the queue and be directly executed
*/
- (void)_immediatelyCallTimer:(NSNumber *)timer;

@end
1 change: 0 additions & 1 deletion packages/react-native/React/Base/RCTBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#import "RCTModuleData.h"
#import "RCTPausedInDebuggerOverlayController.h"
#import "RCTPerformanceLogger.h"
#import "RCTProfile.h"
#import "RCTReloadCommand.h"
#import "RCTUtils.h"

Expand Down
7 changes: 0 additions & 7 deletions packages/react-native/React/Base/RCTDisplayLink.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#import "RCTAssert.h"
#import "RCTFrameUpdate.h"
#import "RCTProfile.h"

#define RCTAssertRunLoop() \
RCTAssert(_runLoop == [NSRunLoop currentRunLoop], @"This method must be called on the CADisplayLink run loop")
Expand Down Expand Up @@ -81,8 +80,6 @@ - (void)_jsThreadUpdate:(CADisplayLink *)displayLink
{
RCTAssertRunLoop();

RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"-[RCTDisplayLink _jsThreadUpdate:]", nil);

// This always runs on the JS thread run loop, which is the queue the frame
// update observer expects its callbacks on, so dispatch inline.
RCTFrameUpdate *frameUpdate = [[RCTFrameUpdate alloc] initWithDisplayLink:displayLink];
Expand All @@ -91,10 +88,6 @@ - (void)_jsThreadUpdate:(CADisplayLink *)displayLink
}

[self updateJSDisplayLinkState];

RCTProfileImmediateEvent(RCTProfileTagAlways, @"JS Thread Tick", displayLink.timestamp, 'g');

RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"objc_call");
}

- (void)updateJSDisplayLinkState
Expand Down
9 changes: 0 additions & 9 deletions packages/react-native/React/Base/RCTEventDispatcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@
return eventName;
}

@implementation RCTBridge (RCTEventDispatcher)

- (id<RCTEventDispatcherProtocol>)eventDispatcher
{
return [self moduleForName:@"EventDispatcher" lazilyLoadIfNecessary:YES];
}

@end

@implementation RCTBridgeProxy (RCTEventDispatcher)

- (id<RCTEventDispatcherProtocol>)eventDispatcher
Expand Down
6 changes: 0 additions & 6 deletions packages/react-native/React/Base/RCTModuleMethod.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#import "RCTLog.h"
#import "RCTManagedPointer.h"
#import "RCTParserUtils.h"
#import "RCTProfile.h"
#import "RCTUtils.h"

typedef BOOL (^RCTArgumentBlock)(RCTBridge *, NSUInteger, id);
Expand Down Expand Up @@ -471,12 +470,7 @@ - (void)processMethodSignature
- (SEL)selector
{
if (_selector == NULL) {
RCT_PROFILE_BEGIN_EVENT(
RCTProfileTagAlways,
@"",
(@{@"module" : NSStringFromClass(_moduleClass), @"method" : @(_methodInfo->objcName)}));
[self processMethodSignature];
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
}

return _selector;
Expand Down
14 changes: 0 additions & 14 deletions packages/react-native/React/Base/RCTPerformanceLogger.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
#import "RCTLog.h"
#import "RCTPerformanceLogger.h"
#import "RCTPerformanceLoggerLabels.h"
#import "RCTProfile.h"
#import "RCTRootView.h"

using namespace facebook::react;

@interface RCTPerformanceLogger () {
int64_t _data[RCTPLSize][2];
NSInteger _cookies[RCTPLSize];
}

@end
Expand All @@ -46,12 +44,6 @@ @implementation RCTPerformanceLogger

- (void)markStartForTag:(RCTPLTag)tag
{
#if RCT_PROFILE
if (RCTProfileIsProfiling()) {
NSString *label = RCTPLLabelForTag(tag);
_cookies[tag] = RCTProfileBeginAsyncEvent(RCTProfileTagAlways, label, nil);
}
#endif
const NSTimeInterval currentTime = CACurrentMediaTime() * 1000;
_data[tag][0] = currentTime;
_data[tag][1] = 0;
Expand All @@ -65,12 +57,6 @@ - (void)markStartForTag:(RCTPLTag)tag

- (void)markStopForTag:(RCTPLTag)tag
{
#if RCT_PROFILE
if (RCTProfileIsProfiling()) {
NSString *label = RCTPLLabelForTag(tag);
RCTProfileEndAsyncEvent(RCTProfileTagAlways, @"native", _cookies[tag], label, @"RCTPerformanceLogger");
}
#endif
const NSTimeInterval currentTime = CACurrentMediaTime() * 1000;
if (_data[tag][0] != 0 && _data[tag][1] == 0) {
_data[tag][1] = currentTime;
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/React/Base/RCTRootView.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#import "RCTKeyCommands.h"
#import "RCTLog.h"
#import "RCTPerformanceLogger.h"
#import "RCTProfile.h"
#import "RCTTouchHandler.h"
#import "RCTUIManager.h"
#import "RCTUIManagerUtils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#import "RCTBridge.h"
#import "RCTLog.h"
#import "RCTPerformanceLogger.h"
#import "RCTProfile.h"
#import "RCTRootViewDelegate.h"
#import "RCTSurface.h"
#import "UIView+React.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,6 @@ void RCTAccessibilityManagerSetIsVoiceOverEnabled(

@end

@implementation RCTBridge (RCTAccessibilityManager)

- (RCTAccessibilityManager *)accessibilityManager
{
return [self moduleForClass:[RCTAccessibilityManager class]];
}

@end

@implementation RCTBridgeProxy (RCTAccessibilityManager)

- (RCTAccessibilityManager *)accessibilityManager
Expand Down
13 changes: 0 additions & 13 deletions packages/react-native/React/CoreModules/RCTDevMenu.mm
Original file line number Diff line number Diff line change
Expand Up @@ -616,19 +616,6 @@ + (instancetype)buttonItemWithTitleBlock:(NSString * (^)(void))titleBlock handle

#endif

@implementation RCTBridge (RCTDevMenu)

- (RCTDevMenu *)devMenu
{
#if RCT_DEV_MENU
return [self moduleForClass:[RCTDevMenu class]];
#else
return nil;
#endif
}

@end

@implementation RCTBridgeProxy (RCTDevMenu)

- (RCTDevMenu *)devMenu
Expand Down
15 changes: 0 additions & 15 deletions packages/react-native/React/CoreModules/RCTDevSettings.mm
Original file line number Diff line number Diff line change
Expand Up @@ -552,21 +552,6 @@ - (void)addHandler:(id<RCTPackagerClientMethod>)handler forPackagerMethod:(NSStr

#endif // #if RCT_DEV_MENU

@implementation RCTBridge (RCTDevSettings)

- (RCTDevSettings *)devSettings
{
#if RCT_REMOTE_PROFILE
return [self moduleForClass:[RCTDevSettings class]];
#elif RCT_DEV_MENU
return devSettingsMenuEnabled ? [self moduleForClass:[RCTDevSettings class]] : nil;
#else
return nil;
#endif
}

@end

@implementation RCTBridgeProxy (RCTDevSettings)

- (RCTDevSettings *)devSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#import <React/RCTBridge+Private.h>
#import <React/RCTBridge.h>
#import <React/RCTComponentEvent.h>
#import <React/RCTProfile.h>
#import <React/RCTUtils.h>
#import <ReactCommon/RCTTurboModule.h>

Expand Down
9 changes: 0 additions & 9 deletions packages/react-native/React/CoreModules/RCTWebSocketModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,6 @@ - (void)webSocket:(SRWebSocket *)webSocket

@end

@implementation RCTBridge (RCTWebSocketModule)

- (RCTWebSocketModule *)webSocketModule
{
return [self moduleForClass:[RCTWebSocketModule class]];
}

@end

@implementation RCTBridgeProxy (RCTWebSocketModule)

- (RCTWebSocketModule *)webSocketModule
Expand Down
Loading
Loading