diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index 858fc32c0..501d4c9cc 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -180,9 +180,11 @@ function setUpNumber() { function setUpDevTools() { // not when debugging in chrome - if (__DEV__ && !window.document && require('Platform').OS === 'ios') { - var setupDevtools = require('setupDevtools'); - setupDevtools(); + if (__DEV__) { // TODO(9123099) Strip `__DEV__ &&` + if (!window.document && require('Platform').OS === 'ios') { + var setupDevtools = require('setupDevtools'); + setupDevtools(); + } } } @@ -202,6 +204,8 @@ setUpDevTools(); // Just to make sure the JS gets packaged up. Wait until the JS environment has // been initialized before requiring them. -require('RCTDebugComponentOwnership'); +if (__DEV__) { + require('RCTDebugComponentOwnership'); +} require('RCTDeviceEventEmitter'); require('PerformanceLogger'); diff --git a/Libraries/ReactIOS/renderApplication.ios.js b/Libraries/ReactIOS/renderApplication.ios.js index aca645324..01eb1e5d5 100644 --- a/Libraries/ReactIOS/renderApplication.ios.js +++ b/Libraries/ReactIOS/renderApplication.ios.js @@ -10,16 +10,17 @@ */ 'use strict'; -var Inspector = require('Inspector'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var React = require('React'); var StyleSheet = require('StyleSheet'); var Subscribable = require('Subscribable'); var View = require('View'); -var WarningBox = require('WarningBox'); var invariant = require('invariant'); +var Inspector = __DEV__ ? require('Inspector') : null; +var WarningBox = __DEV__ ? require('WarningBox') : null; + var AppContainer = React.createClass({ mixins: [Subscribable.Mixin], @@ -28,7 +29,7 @@ var AppContainer = React.createClass({ }, toggleElementInspector: function() { - var inspector = this.state.inspector + var inspector = !__DEV__ || this.state.inspector ? null :