Skip to content

Commit

Permalink
revert "Disable DebugTools in production (facebook#7189)"
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyan Zhang committed Jul 25, 2016
1 parent 85dcbf8 commit e0595bb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
8 changes: 5 additions & 3 deletions src/renderers/dom/shared/ReactDOMDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

'use strict';

var ReactDebugTool = require('ReactDebugTool');
var ReactDOMNullInputValuePropDevtool = require('ReactDOMNullInputValuePropDevtool');
var ReactDOMUnknownPropertyDevtool = require('ReactDOMUnknownPropertyDevtool');
var ReactDebugTool = require('ReactDebugTool');

var warning = require('warning');

Expand Down Expand Up @@ -66,7 +66,9 @@ var ReactDOMDebugTool = {
},
};

ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
ReactDOMDebugTool.addDevtool(ReactDOMNullInputValuePropDevtool);
if (__DEV__) {
ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
ReactDOMDebugTool.addDevtool(ReactDOMNullInputValuePropDevtool);
}

module.exports = ReactDOMDebugTool;
9 changes: 2 additions & 7 deletions src/renderers/dom/shared/ReactDOMInstrumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@

'use strict';

var debugTool = null;
var ReactDOMDebugTool = require('ReactDOMDebugTool');

if (__DEV__) {
var ReactDOMDebugTool = require('ReactDOMDebugTool');
debugTool = ReactDOMDebugTool;
}

module.exports = {debugTool};
module.exports = {debugTool: ReactDOMDebugTool};
22 changes: 12 additions & 10 deletions src/renderers/shared/ReactDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

'use strict';

var ReactInvalidSetStateWarningDevTool = require('ReactInvalidSetStateWarningDevTool');
var ReactHostOperationHistoryDevtool = require('ReactHostOperationHistoryDevtool');
var ReactComponentTreeDevtool = require('ReactComponentTreeDevtool');
var ReactChildrenMutationWarningDevtool = require('ReactChildrenMutationWarningDevtool');
var ExecutionEnvironment = require('ExecutionEnvironment');
var ReactChildrenMutationWarningDevtool = require('ReactChildrenMutationWarningDevtool');
var ReactComponentTreeDevtool = require('ReactComponentTreeDevtool');
var ReactHostOperationHistoryDevtool = require('ReactHostOperationHistoryDevtool');
var ReactInvalidSetStateWarningDevTool = require('ReactInvalidSetStateWarningDevTool');

var performanceNow = require('performanceNow');
var warning = require('warning');
Expand Down Expand Up @@ -325,12 +325,14 @@ var ReactDebugTool = {
},
};

ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
ReactDebugTool.addDevtool(ReactChildrenMutationWarningDevtool);
var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
if ((/[?&]react_perf\b/).test(url)) {
ReactDebugTool.beginProfiling();
if (__DEV__) {
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
ReactDebugTool.addDevtool(ReactChildrenMutationWarningDevtool);
var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
if ((/[?&]react_perf\b/).test(url)) {
ReactDebugTool.beginProfiling();
}
}

module.exports = ReactDebugTool;
9 changes: 2 additions & 7 deletions src/renderers/shared/ReactInstrumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@

'use strict';

var debugTool = null;
var ReactDebugTool = require('ReactDebugTool');

if (__DEV__) {
var ReactDebugTool = require('ReactDebugTool');
debugTool = ReactDebugTool;
}

module.exports = {debugTool};
module.exports = {debugTool: ReactDebugTool};

0 comments on commit e0595bb

Please sign in to comment.