Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/isomorphic/devtools/ReactDebugToolEventForwarderDevTool.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactDebugToolEventForwarderDevTool
*/

'use strict';

var ReactDOMDebugTool = require('ReactDOMDebugTool');

var ReactDebugToolEventForwarderDevTool = {
onBeginProcessingChildContext() {
ReactDOMDebugTool.onBeginProcessingChildContext();
},
onEndProcessingChildContext() {
ReactDOMDebugTool.onEndProcessingChildContext();
},
onNativeOperation(debugID, type, payload) {
ReactDOMDebugTool.onNativeOperation(debugID, type, payload);
},
onSetState() {
ReactDOMDebugTool.onSetState();
},
onSetDisplayName(debugID, displayName) {
ReactDOMDebugTool.onSetDisplayName(debugID, displayName);
},
onSetChildren(debugID, childDebugIDs) {
ReactDOMDebugTool.onSetChildren(debugID, childDebugIDs);
},
onSetOwner(debugID, ownerDebugID) {
ReactDOMDebugTool.onSetOwner(debugID, ownerDebugID);
},
onSetText(debugID, text) {
ReactDOMDebugTool.onSetText(debugID, text);
},
onMountRootComponent(debugID) {
ReactDOMDebugTool.onMountRootComponent(debugID);
},
onMountComponent(debugID) {
ReactDOMDebugTool.onMountComponent(debugID);
},
onUpdateComponent(debugID) {
ReactDOMDebugTool.onUpdateComponent(debugID);
},
onUnmountComponent(debugID) {
ReactDOMDebugTool.onUnmountComponent(debugID);
},
};

module.exports = ReactDebugToolEventForwarderDevTool;
5 changes: 5 additions & 0 deletions src/renderers/dom/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
'use strict';

var ReactDOMComponentTree = require('ReactDOMComponentTree');
var ReactDebugToolEventForwarderDevTool = require('ReactDebugToolEventForwarderDevTool');
var ReactDefaultInjection = require('ReactDefaultInjection');
var ReactInstrumentation = require('ReactInstrumentation');
var ReactMount = require('ReactMount');
var ReactReconciler = require('ReactReconciler');
var ReactUpdates = require('ReactUpdates');
Expand Down Expand Up @@ -133,6 +135,9 @@ if (__DEV__) {
}
}
}

ReactInstrumentation.debugTool.addDevtool(ReactDebugToolEventForwarderDevTool);

}

module.exports = React;
40 changes: 40 additions & 0 deletions src/renderers/dom/shared/ReactDOMDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,46 @@ var ReactDOMDebugTool = {
onUpdateDOMComponent(debugID, element) {
emitEvent('onMountDOMComponent', debugID, element);
},

//Events forwarded from ReactDebugTool

onBeginProcessingChildContext() {
emitEvent('onBeginProcessingChildContext');
},
onEndProcessingChildContext() {
emitEvent('onEndProcessingChildContext');
},
onNativeOperation(debugID, type, payload) {
emitEvent('onNativeOperation', debugID, type, payload);
},
onSetState() {
emitEvent('onSetState');
},
onSetDisplayName(debugID, displayName) {
emitEvent('onSetDisplayName', debugID, displayName);
},
onSetChildren(debugID, childDebugIDs) {
emitEvent('onSetChildren', debugID, childDebugIDs);
},
onSetOwner(debugID, ownerDebugID) {
emitEvent('onSetOwner', debugID, ownerDebugID);
},
onSetText(debugID, text) {
emitEvent('onSetText', debugID, text);
},
onMountRootComponent(debugID) {
emitEvent('onMountRootComponent', debugID);
},
onMountComponent(debugID) {
emitEvent('onMountComponent', debugID);
},
onUpdateComponent(debugID) {
emitEvent('onUpdateComponent', debugID);
},
onUnmountComponent(debugID) {
emitEvent('onUnmountComponent', debugID);
},

};

ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
Expand Down