Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Exposing RCTDevMenuItem when not in DEV mode and adding a missing header
Reviewed By: javache

Differential Revision: D4189179

fbshipit-source-id: c9ad45b20bab884e5d0fcd17efc494fc37ab7d92
  • Loading branch information
dcaspi authored and Facebook Github Bot committed Nov 16, 2016
1 parent 13ae1a3 commit 3b4ac79
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 0 additions & 4 deletions React/Executors/RCTJSCExecutor.mm
Expand Up @@ -175,7 +175,6 @@ @implementation RCTJSCExecutor
RCT_EXPORT_MODULE()

#if RCT_DEV

static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
{
if (RCTJSCProfilerIsSupported()) {
Expand Down Expand Up @@ -419,8 +418,6 @@ - (void)setUp
}
};

#ifdef RCT_DEV

// Add toggles for JSC's sampling profiler, if the profiler is enabled
if (self->_jscWrapper->JSSamplingProfilerEnabled()) {
// Mark this thread as the main JS thread before starting profiling.
Expand Down Expand Up @@ -451,7 +448,6 @@ - (void)setUp
};
}
#endif
#endif

#if RCT_DEV
RCTInstallJSCProfiler(self->_bridge, context.JSGlobalContextRef);
Expand Down
9 changes: 9 additions & 0 deletions React/Modules/RCTDevMenu.m
Expand Up @@ -694,6 +694,15 @@ - (void)addItem:(RCTDevMenu *)item {}

@end

@implementation RCTDevMenuItem

+ (instancetype)buttonItemWithTitle:(NSString *)title handler:(void(^)(void))handler {return nil;}
+ (instancetype)toggleItemWithKey:(NSString *)key
title:(NSString *)title
selectedTitle:(NSString *)selectedTitle
handler:(void(^)(BOOL selected))handler {return nil;}
@end

#endif

@implementation RCTBridge (RCTDevMenu)
Expand Down
6 changes: 6 additions & 0 deletions React/React.xcodeproj/project.pbxproj
Expand Up @@ -168,6 +168,7 @@
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };
369123E11DDC75850095B341 /* JSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* JSCSamplingProfiler.m */; };
391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };
3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };
3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };
Expand Down Expand Up @@ -378,6 +379,8 @@
2D2A28131D9B038B00D4039D /* libReact-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libReact-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTI18nUtil.h; sourceTree = "<group>"; };
352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nUtil.m; sourceTree = "<group>"; };
369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSamplingProfiler.h; sourceTree = "<group>"; };
369123E01DDC75850095B341 /* JSCSamplingProfiler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCSamplingProfiler.m; sourceTree = "<group>"; };
391E86A21C623EC800009732 /* RCTTouchEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchEvent.m; sourceTree = "<group>"; };
391E86A31C623EC800009732 /* RCTTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTouchEvent.h; sourceTree = "<group>"; };
3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -490,6 +493,8 @@
13B07FE01A69315300A75B9A /* Modules */ = {
isa = PBXGroup;
children = (
369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */,
369123E01DDC75850095B341 /* JSCSamplingProfiler.m */,
13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */,
13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */,
E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */,
Expand Down Expand Up @@ -1031,6 +1036,7 @@
13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */,
14200DAA1AC179B3008EE6BA /* RCTJavaScriptLoader.m in Sources */,
137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */,
369123E11DDC75850095B341 /* JSCSamplingProfiler.m in Sources */,
13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */,
13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */,
E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */,
Expand Down

0 comments on commit 3b4ac79

Please sign in to comment.