make systrace look more like prod

Reviewed By: alexeylang

Differential Revision: D5023354

fbshipit-source-id: ed9d4b43d042c9aa12d7c74901b026a105b31d9c
This commit is contained in:
Aaron Chiu 2017-05-11 15:09:05 -07:00 committed by Facebook Github Bot
parent 9e6c44095b
commit 105d219935
1 changed files with 15 additions and 9 deletions

View File

@ -112,7 +112,9 @@ BatchedBridge.registerCallableModule('HeapCapture', require('HeapCapture'));
BatchedBridge.registerCallableModule('SamplingProfiler', require('SamplingProfiler'));
if (__DEV__) {
BatchedBridge.registerCallableModule('HMRClient', require('HMRClient'));
if (!global.__RCTProfileIsProfiling) {
BatchedBridge.registerCallableModule('HMRClient', require('HMRClient'));
}
}
// RCTLog needs to register with BatchedBridge
@ -203,19 +205,23 @@ defineProperty(global, 'Set', () => require('Set'), true);
// Set up devtools
if (__DEV__) {
// not when debugging in chrome
// TODO(t12832058) This check is broken
if (!window.document) {
require('setupDevtools');
}
if (!global.__RCTProfileIsProfiling) {
// not when debugging in chrome
// TODO(t12832058) This check is broken
if (!window.document) {
require('setupDevtools');
}
require('RCTDebugComponentOwnership');
require('RCTDebugComponentOwnership');
}
}
// Set up inspector
if (__DEV__) {
const JSInspector = require('JSInspector');
JSInspector.registerAgent(require('NetworkAgent'));
if (!global.__RCTProfileIsProfiling) {
const JSInspector = require('JSInspector');
JSInspector.registerAgent(require('NetworkAgent'));
}
}
// Just to make sure the JS gets packaged up. Wait until the JS environment has