Exposing RCTDevMenuItem when not in DEV mode and adding a missing header
Reviewed By: javache Differential Revision: D4189179 fbshipit-source-id: c9ad45b20bab884e5d0fcd17efc494fc37ab7d92
This commit is contained in:
parent
13ae1a3c03
commit
3b4ac79583
|
@ -175,7 +175,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||||
RCT_EXPORT_MODULE()
|
RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
#if RCT_DEV
|
#if RCT_DEV
|
||||||
|
|
||||||
static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
||||||
{
|
{
|
||||||
if (RCTJSCProfilerIsSupported()) {
|
if (RCTJSCProfilerIsSupported()) {
|
||||||
|
@ -419,8 +418,6 @@ static NSThread *newJavaScriptThread(void)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef RCT_DEV
|
|
||||||
|
|
||||||
// Add toggles for JSC's sampling profiler, if the profiler is enabled
|
// Add toggles for JSC's sampling profiler, if the profiler is enabled
|
||||||
if (self->_jscWrapper->JSSamplingProfilerEnabled()) {
|
if (self->_jscWrapper->JSSamplingProfilerEnabled()) {
|
||||||
// Mark this thread as the main JS thread before starting profiling.
|
// Mark this thread as the main JS thread before starting profiling.
|
||||||
|
@ -451,7 +448,6 @@ static NSThread *newJavaScriptThread(void)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if RCT_DEV
|
#if RCT_DEV
|
||||||
RCTInstallJSCProfiler(self->_bridge, context.JSGlobalContextRef);
|
RCTInstallJSCProfiler(self->_bridge, context.JSGlobalContextRef);
|
||||||
|
|
|
@ -694,6 +694,15 @@ RCT_EXPORT_METHOD(setHotLoadingEnabled:(BOOL)enabled)
|
||||||
|
|
||||||
@end
|
@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
|
#endif
|
||||||
|
|
||||||
@implementation RCTBridge (RCTDevMenu)
|
@implementation RCTBridge (RCTDevMenu)
|
||||||
|
|
|
@ -168,6 +168,7 @@
|
||||||
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };
|
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };
|
||||||
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };
|
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };
|
||||||
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.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 */; };
|
391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };
|
||||||
3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };
|
3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };
|
||||||
3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };
|
3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };
|
||||||
|
@ -378,6 +379,8 @@
|
||||||
2D2A28131D9B038B00D4039D /* libReact-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libReact-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = "<group>"; };
|
||||||
|
@ -490,6 +493,8 @@
|
||||||
13B07FE01A69315300A75B9A /* Modules */ = {
|
13B07FE01A69315300A75B9A /* Modules */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */,
|
||||||
|
369123E01DDC75850095B341 /* JSCSamplingProfiler.m */,
|
||||||
13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */,
|
13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */,
|
||||||
13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */,
|
13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */,
|
||||||
E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */,
|
E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */,
|
||||||
|
@ -1031,6 +1036,7 @@
|
||||||
13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */,
|
13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */,
|
||||||
14200DAA1AC179B3008EE6BA /* RCTJavaScriptLoader.m in Sources */,
|
14200DAA1AC179B3008EE6BA /* RCTJavaScriptLoader.m in Sources */,
|
||||||
137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */,
|
137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */,
|
||||||
|
369123E11DDC75850095B341 /* JSCSamplingProfiler.m in Sources */,
|
||||||
13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */,
|
13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */,
|
||||||
13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */,
|
13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */,
|
||||||
E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */,
|
E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */,
|
||||||
|
|
Loading…
Reference in New Issue