Skip to content

Commit 3b4ac79

Browse files
dcaspiFacebook Github Bot
authored and
Facebook Github Bot
committed
Exposing RCTDevMenuItem when not in DEV mode and adding a missing header
Reviewed By: javache Differential Revision: D4189179 fbshipit-source-id: c9ad45b20bab884e5d0fcd17efc494fc37ab7d92
1 parent 13ae1a3 commit 3b4ac79

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

React/Executors/RCTJSCExecutor.mm

-4
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ @implementation RCTJSCExecutor
175175
RCT_EXPORT_MODULE()
176176

177177
#if RCT_DEV
178-
179178
static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
180179
{
181180
if (RCTJSCProfilerIsSupported()) {
@@ -419,8 +418,6 @@ - (void)setUp
419418
}
420419
};
421420

422-
#ifdef RCT_DEV
423-
424421
// Add toggles for JSC's sampling profiler, if the profiler is enabled
425422
if (self->_jscWrapper->JSSamplingProfilerEnabled()) {
426423
// Mark this thread as the main JS thread before starting profiling.
@@ -451,7 +448,6 @@ - (void)setUp
451448
};
452449
}
453450
#endif
454-
#endif
455451

456452
#if RCT_DEV
457453
RCTInstallJSCProfiler(self->_bridge, context.JSGlobalContextRef);

React/Modules/RCTDevMenu.m

+9
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,15 @@ - (void)addItem:(RCTDevMenu *)item {}
694694

695695
@end
696696

697+
@implementation RCTDevMenuItem
698+
699+
+ (instancetype)buttonItemWithTitle:(NSString *)title handler:(void(^)(void))handler {return nil;}
700+
+ (instancetype)toggleItemWithKey:(NSString *)key
701+
title:(NSString *)title
702+
selectedTitle:(NSString *)selectedTitle
703+
handler:(void(^)(BOOL selected))handler {return nil;}
704+
@end
705+
697706
#endif
698707

699708
@implementation RCTBridge (RCTDevMenu)

React/React.xcodeproj/project.pbxproj

+6
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };
169169
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };
170170
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };
171+
369123E11DDC75850095B341 /* JSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* JSCSamplingProfiler.m */; };
171172
391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };
172173
3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };
173174
3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };
@@ -378,6 +379,8 @@
378379
2D2A28131D9B038B00D4039D /* libReact-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libReact-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
379380
352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTI18nUtil.h; sourceTree = "<group>"; };
380381
352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nUtil.m; sourceTree = "<group>"; };
382+
369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSamplingProfiler.h; sourceTree = "<group>"; };
383+
369123E01DDC75850095B341 /* JSCSamplingProfiler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCSamplingProfiler.m; sourceTree = "<group>"; };
381384
391E86A21C623EC800009732 /* RCTTouchEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchEvent.m; sourceTree = "<group>"; };
382385
391E86A31C623EC800009732 /* RCTTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTouchEvent.h; sourceTree = "<group>"; };
383386
3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = "<group>"; };
@@ -490,6 +493,8 @@
490493
13B07FE01A69315300A75B9A /* Modules */ = {
491494
isa = PBXGroup;
492495
children = (
496+
369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */,
497+
369123E01DDC75850095B341 /* JSCSamplingProfiler.m */,
493498
13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */,
494499
13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */,
495500
E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */,
@@ -1031,6 +1036,7 @@
10311036
13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */,
10321037
14200DAA1AC179B3008EE6BA /* RCTJavaScriptLoader.m in Sources */,
10331038
137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */,
1039+
369123E11DDC75850095B341 /* JSCSamplingProfiler.m in Sources */,
10341040
13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */,
10351041
13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */,
10361042
E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */,

0 commit comments

Comments
 (0)