mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove hacks from RNTester (#24924)
Summary: Removes the hacks we had in place to help Fabric run in RNTester. Runs fine without them now, so let's remove em! ## Changelog [Internal] [Removed] - RNTester Fabric hax Pull Request resolved: https://github.com/facebook/react-native/pull/24924 Differential Revision: D15391418 Pulled By: cpojer fbshipit-source-id: d800f4c2f68f5e68a20a03c65fdf0317072d2c5e
This commit is contained in:
committed by
Facebook Github Bot
parent
7abfd23b90
commit
cf9babf082
@@ -50,13 +50,6 @@
|
||||
}
|
||||
@end
|
||||
|
||||
#ifdef RN_FABRIC_ENABLED
|
||||
// FIXME: remove when resolved https://github.com/facebook/react-native/issues/23910
|
||||
@interface RCTSurfacePresenter ()
|
||||
-(void)_startAllSurfaces;
|
||||
@end
|
||||
#endif
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
@@ -76,12 +69,6 @@
|
||||
}
|
||||
|
||||
#ifdef RN_FABRIC_ENABLED
|
||||
// FIXME: remove when resolved https://github.com/facebook/react-native/issues/23910
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(handleJavaScriptDidLoadNotification:)
|
||||
name:RCTJavaScriptDidLoadNotification
|
||||
object:_bridge];
|
||||
|
||||
_surfacePresenter = [[RCTSurfacePresenter alloc] initWithBridge:_bridge config:nil];
|
||||
_bridge.surfacePresenter = _surfacePresenter;
|
||||
|
||||
@@ -98,15 +85,6 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
#ifdef RN_FABRIC_ENABLED
|
||||
// FIXME: remove when resolved https://github.com/facebook/react-native/issues/23910
|
||||
- (void)handleJavaScriptDidLoadNotification:(__unused NSNotification*)notification {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self->_surfacePresenter _startAllSurfaces];
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge
|
||||
{
|
||||
NSString *bundlePrefix = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"RN_BUNDLE_PREFIX"];
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
3D56F9F11D6F6E9B00F53A06 /* RNTesterBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */; };
|
||||
5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; };
|
||||
5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; };
|
||||
68D134442238528800D0B233 /* Swizzle_RCTFabricSurface.m in Sources */ = {isa = PBXBuildFile; fileRef = 68D134432238528800D0B233 /* Swizzle_RCTFabricSurface.m */; };
|
||||
68E1E4BC2230DF2F00570185 /* ComponentRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 68E1E4BB2230DF2F00570185 /* ComponentRegistry.cpp */; };
|
||||
B9C5BB1881F54450DBCA70F5 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8508AD3C1DC3509924E63948 /* libPods-RNTester.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
@@ -53,7 +52,6 @@
|
||||
5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = "<group>"; };
|
||||
5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RNTesterTurboModuleProvider.mm; path = RNTester/RNTesterTurboModuleProvider.mm; sourceTree = "<group>"; };
|
||||
5CB07C9A226467E60039471C /* RNTesterTurboModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNTesterTurboModuleProvider.h; path = RNTester/RNTesterTurboModuleProvider.h; sourceTree = "<group>"; };
|
||||
68D134432238528800D0B233 /* Swizzle_RCTFabricSurface.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Swizzle_RCTFabricSurface.m; sourceTree = "<group>"; };
|
||||
68E1E4BB2230DF2F00570185 /* ComponentRegistry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ComponentRegistry.cpp; sourceTree = "<group>"; };
|
||||
8508AD3C1DC3509924E63948 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
98233960D1D6A1977D1C7EAF /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
@@ -147,7 +145,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
68E1E4BB2230DF2F00570185 /* ComponentRegistry.cpp */,
|
||||
68D134432238528800D0B233 /* Swizzle_RCTFabricSurface.m */,
|
||||
);
|
||||
name = Fabric;
|
||||
sourceTree = "<group>";
|
||||
@@ -333,7 +330,6 @@
|
||||
files = (
|
||||
68E1E4BC2230DF2F00570185 /* ComponentRegistry.cpp in Sources */,
|
||||
272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */,
|
||||
68D134442238528800D0B233 /* Swizzle_RCTFabricSurface.m in Sources */,
|
||||
5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */,
|
||||
27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */,
|
||||
5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */,
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#ifdef RN_FABRIC_ENABLED
|
||||
#import <objc/runtime.h>
|
||||
#import <React/RCTFabricSurface.h>
|
||||
|
||||
// FIXME: remove when resolved https://github.com/facebook/react-native/issues/23910
|
||||
@implementation RCTFabricSurface (SwizzleMeTimbers)
|
||||
|
||||
+ (void)load {
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
Class class = [self class];
|
||||
|
||||
SEL originalSelector = @selector((start));
|
||||
SEL swizzledSelector = @selector(xxx_start);
|
||||
|
||||
Method originalMethod = class_getInstanceMethod(class, originalSelector);
|
||||
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
|
||||
|
||||
BOOL didAddMethod =
|
||||
class_addMethod(class,
|
||||
originalSelector,
|
||||
method_getImplementation(swizzledMethod),
|
||||
method_getTypeEncoding(swizzledMethod));
|
||||
|
||||
if (didAddMethod) {
|
||||
class_replaceMethod(class,
|
||||
swizzledSelector,
|
||||
method_getImplementation(originalMethod),
|
||||
method_getTypeEncoding(originalMethod));
|
||||
} else {
|
||||
method_exchangeImplementations(originalMethod, swizzledMethod);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - Method Swizzling
|
||||
|
||||
- (void)xxx_start {
|
||||
NSLog(@"RCTSurface start: %@", self);
|
||||
}
|
||||
|
||||
@end
|
||||
#endif
|
||||
Reference in New Issue
Block a user