react 15.3.0 → 15.3.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/react-with-addons.js +1581 -1626
  2. package/dist/react-with-addons.min.js +6 -6
  3. package/dist/react.js +1515 -1560
  4. package/dist/react.min.js +6 -6
  5. package/lib/BeforeInputEventPlugin.js +3 -1
  6. package/lib/ChangeEventPlugin.js +2 -2
  7. package/lib/DOMPropertyOperations.js +0 -7
  8. package/lib/EventPluginHub.js +2 -0
  9. package/lib/HTMLDOMPropertyConfig.js +3 -0
  10. package/lib/ReactBrowserEventEmitter.js +14 -1
  11. package/lib/ReactChildReconciler.js +11 -8
  12. package/lib/{ReactChildrenMutationWarningDevtool.js → ReactChildrenMutationWarningHook.js} +11 -19
  13. package/lib/ReactComponentBrowserEnvironment.js +1 -10
  14. package/lib/ReactComponentEnvironment.js +0 -8
  15. package/lib/ReactComponentTreeDevtool.js +2 -205
  16. package/lib/ReactComponentTreeHook.js +342 -0
  17. package/lib/ReactComponentTreeTestUtils.js +11 -11
  18. package/lib/ReactCompositeComponent.js +111 -151
  19. package/lib/ReactDOM.js +9 -0
  20. package/lib/ReactDOMComponent.js +33 -52
  21. package/lib/ReactDOMComponentTree.js +1 -1
  22. package/lib/ReactDOMEmptyComponent.js +1 -1
  23. package/lib/ReactDOMFactories.js +138 -144
  24. package/lib/ReactDOMFiber.js +0 -2
  25. package/lib/ReactDOMInput.js +26 -4
  26. package/lib/{ReactDOMNullInputValuePropDevtool.js → ReactDOMNullInputValuePropHook.js} +5 -5
  27. package/lib/ReactDOMSelect.js +5 -4
  28. package/lib/ReactDOMTextComponent.js +2 -9
  29. package/lib/{ReactDOMUnknownPropertyDevtool.js → ReactDOMUnknownPropertyHook.js} +8 -8
  30. package/lib/ReactDebugTool.js +63 -83
  31. package/lib/ReactElement.js +37 -49
  32. package/lib/ReactElementValidator.js +5 -3
  33. package/lib/{ReactHostOperationHistoryDevtool.js → ReactHostOperationHistoryHook.js} +4 -4
  34. package/lib/{ReactInvalidSetStateWarningDevTool.js → ReactInvalidSetStateWarningHook.js} +3 -3
  35. package/lib/ReactMount.js +45 -10
  36. package/lib/ReactMultiChild.js +11 -13
  37. package/lib/ReactNativeBaseComponent.js +5 -3
  38. package/lib/ReactNativeComponentEnvironment.js +0 -7
  39. package/lib/ReactNativeMount.js +2 -5
  40. package/lib/ReactNativeReconcileTransaction.js +13 -0
  41. package/lib/ReactNativeTextComponent.js +2 -10
  42. package/lib/ReactPropTypes.js +26 -12
  43. package/lib/ReactReconciler.js +5 -11
  44. package/lib/ReactRef.js +1 -1
  45. package/lib/ReactServerRendering.js +2 -1
  46. package/lib/ReactSimpleEmptyComponent.js +3 -2
  47. package/lib/ReactTestMount.js +3 -5
  48. package/lib/ReactTestReconcileTransaction.js +13 -0
  49. package/lib/ReactTestUtils.js +5 -5
  50. package/lib/ReactVersion.js +1 -1
  51. package/lib/ResponderEventPlugin.js +6 -5
  52. package/lib/SelectEventPlugin.js +1 -1
  53. package/lib/SimpleEventPlugin.js +2 -0
  54. package/lib/SyntheticEvent.js +10 -2
  55. package/lib/checkReactTypeSpec.js +6 -6
  56. package/lib/createReactNativeComponentClass.js +1 -1
  57. package/lib/escapeTextContentForBrowser.js +1 -0
  58. package/lib/flattenChildren.js +7 -5
  59. package/lib/instantiateReactComponent.js +1 -28
  60. package/lib/onlyChild.js +1 -1
  61. package/lib/setInnerHTML.js +3 -3
  62. package/lib/validateDOMNesting.js +16 -3
  63. package/package.json +2 -2
  64. package/lib/ReactDOMDebugTool.js +0 -67
  65. package/lib/ReactDOMInstrumentation.js +0 -21
  66. package/lib/createHierarchyRenderer.js +0 -85
@@ -57,8 +57,6 @@ var DOMRenderer = ReactFiberReconciler({
57
57
  deleteInstance: function (instance) {
58
58
  // Noop
59
59
  },
60
-
61
-
62
60
  scheduleHighPriCallback: window.requestAnimationFrame,
63
61
 
64
62
  scheduleLowPriCallback: window.requestIdleCallback
@@ -39,7 +39,7 @@ function forceUpdateIfMounted() {
39
39
 
40
40
  function isControlled(props) {
41
41
  var usesChecked = props.type === 'checkbox' || props.type === 'radio';
42
- return usesChecked ? props.checked !== undefined : props.value !== undefined;
42
+ return usesChecked ? props.checked != null : props.value != null;
43
43
  }
44
44
 
45
45
  /**
@@ -69,7 +69,11 @@ var ReactDOMInput = {
69
69
  type: undefined,
70
70
  // Make sure we set .step before .value (setting .value before .step
71
71
  // means .value is rounded on mount, based upon step precision)
72
- step: undefined
72
+ step: undefined,
73
+ // Make sure we set .min & .max before .value (to ensure proper order
74
+ // in corner cases such as min or max deriving from value, e.g. Issue #7170)
75
+ min: undefined,
76
+ max: undefined
73
77
  }, DisabledInputUtils.getHostProps(inst, props), {
74
78
  defaultChecked: undefined,
75
79
  defaultValue: undefined,
@@ -175,8 +179,26 @@ var ReactDOMInput = {
175
179
  // are not resetable nodes so this operation doesn't matter and actually
176
180
  // removes browser-default values (eg "Submit Query") when no value is
177
181
  // provided.
178
- if (props.type !== 'submit' && props.type !== 'reset') {
179
- node.value = node.value;
182
+
183
+ switch (props.type) {
184
+ case 'submit':
185
+ case 'reset':
186
+ break;
187
+ case 'color':
188
+ case 'date':
189
+ case 'datetime':
190
+ case 'datetime-local':
191
+ case 'month':
192
+ case 'time':
193
+ case 'week':
194
+ // This fixes the no-show issue on iOS Safari and Android Chrome:
195
+ // https://github.com/facebook/react/issues/7233
196
+ node.value = '';
197
+ node.value = node.defaultValue;
198
+ break;
199
+ default:
200
+ node.value = node.value;
201
+ break;
180
202
  }
181
203
 
182
204
  // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
@@ -6,12 +6,12 @@
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @providesModule ReactDOMNullInputValuePropDevtool
9
+ * @providesModule ReactDOMNullInputValuePropHook
10
10
  */
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
14
+ var ReactComponentTreeHook = require('./ReactComponentTreeHook');
15
15
 
16
16
  var warning = require('fbjs/lib/warning');
17
17
 
@@ -25,13 +25,13 @@ function handleElement(debugID, element) {
25
25
  return;
26
26
  }
27
27
  if (element.props != null && element.props.value === null && !didWarnValueNull) {
28
- process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
28
+ process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
29
29
 
30
30
  didWarnValueNull = true;
31
31
  }
32
32
  }
33
33
 
34
- var ReactDOMUnknownPropertyDevtool = {
34
+ var ReactDOMNullInputValuePropHook = {
35
35
  onBeforeMountComponent: function (debugID, element) {
36
36
  handleElement(debugID, element);
37
37
  },
@@ -40,4 +40,4 @@ var ReactDOMUnknownPropertyDevtool = {
40
40
  }
41
41
  };
42
42
 
43
- module.exports = ReactDOMUnknownPropertyDevtool;
43
+ module.exports = ReactDOMNullInputValuePropHook;
@@ -66,10 +66,11 @@ function checkSelectPropTypes(inst, props) {
66
66
  if (props[propName] == null) {
67
67
  continue;
68
68
  }
69
- if (props.multiple) {
70
- process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
71
- } else {
72
- process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
69
+ var isArray = Array.isArray(props[propName]);
70
+ if (props.multiple && !isArray) {
71
+ process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
72
+ } else if (!props.multiple && isArray) {
73
+ process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
73
74
  }
74
75
  }
75
76
  }
@@ -17,7 +17,6 @@ var _prodInvariant = require('./reactProdInvariant'),
17
17
  var DOMChildrenOperations = require('./DOMChildrenOperations');
18
18
  var DOMLazyTree = require('./DOMLazyTree');
19
19
  var ReactDOMComponentTree = require('./ReactDOMComponentTree');
20
- var ReactInstrumentation = require('./ReactInstrumentation');
21
20
 
22
21
  var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
23
22
  var invariant = require('fbjs/lib/invariant');
@@ -47,7 +46,7 @@ var ReactDOMTextComponent = function (text) {
47
46
  this._hostParent = null;
48
47
 
49
48
  // Properties
50
- this._domID = null;
49
+ this._domID = 0;
51
50
  this._mountIndex = 0;
52
51
  this._closingComment = null;
53
52
  this._commentNodes = null;
@@ -65,8 +64,6 @@ _assign(ReactDOMTextComponent.prototype, {
65
64
  */
66
65
  mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
67
66
  if (process.env.NODE_ENV !== 'production') {
68
- ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
69
-
70
67
  var parentInfo;
71
68
  if (hostParent != null) {
72
69
  parentInfo = hostParent._ancestorInfo;
@@ -76,7 +73,7 @@ _assign(ReactDOMTextComponent.prototype, {
76
73
  if (parentInfo) {
77
74
  // parentInfo should always be present except for the top-level
78
75
  // component when server rendering
79
- validateDOMNesting('#text', this, parentInfo);
76
+ validateDOMNesting(null, this._stringText, this, parentInfo);
80
77
  }
81
78
  }
82
79
 
@@ -130,10 +127,6 @@ _assign(ReactDOMTextComponent.prototype, {
130
127
  this._stringText = nextStringText;
131
128
  var commentNodes = this.getHostNode();
132
129
  DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
133
-
134
- if (process.env.NODE_ENV !== 'production') {
135
- ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
136
- }
137
130
  }
138
131
  }
139
132
  },
@@ -6,14 +6,14 @@
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @providesModule ReactDOMUnknownPropertyDevtool
9
+ * @providesModule ReactDOMUnknownPropertyHook
10
10
  */
11
11
 
12
12
  'use strict';
13
13
 
14
14
  var DOMProperty = require('./DOMProperty');
15
15
  var EventPluginRegistry = require('./EventPluginRegistry');
16
- var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
16
+ var ReactComponentTreeHook = require('./ReactComponentTreeHook');
17
17
 
18
18
  var warning = require('fbjs/lib/warning');
19
19
 
@@ -55,10 +55,10 @@ if (process.env.NODE_ENV !== 'production') {
55
55
  var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
56
56
 
57
57
  if (standardName != null) {
58
- process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
58
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
59
59
  return true;
60
60
  } else if (registrationName != null) {
61
- process.env.NODE_ENV !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
61
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
62
62
  return true;
63
63
  } else {
64
64
  // We were unable to guess which prop the user intended.
@@ -84,9 +84,9 @@ var warnUnknownProperties = function (debugID, element) {
84
84
  }).join(', ');
85
85
 
86
86
  if (unknownProps.length === 1) {
87
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
87
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
88
88
  } else if (unknownProps.length > 1) {
89
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
89
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
90
90
  }
91
91
  };
92
92
 
@@ -100,7 +100,7 @@ function handleElement(debugID, element) {
100
100
  warnUnknownProperties(debugID, element);
101
101
  }
102
102
 
103
- var ReactDOMUnknownPropertyDevtool = {
103
+ var ReactDOMUnknownPropertyHook = {
104
104
  onBeforeMountComponent: function (debugID, element) {
105
105
  handleElement(debugID, element);
106
106
  },
@@ -109,4 +109,4 @@ var ReactDOMUnknownPropertyDevtool = {
109
109
  }
110
110
  };
111
111
 
112
- module.exports = ReactDOMUnknownPropertyDevtool;
112
+ module.exports = ReactDOMUnknownPropertyHook;
@@ -11,29 +11,35 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool');
15
- var ReactHostOperationHistoryDevtool = require('./ReactHostOperationHistoryDevtool');
16
- var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
17
- var ReactChildrenMutationWarningDevtool = require('./ReactChildrenMutationWarningDevtool');
14
+ var ReactInvalidSetStateWarningHook = require('./ReactInvalidSetStateWarningHook');
15
+ var ReactHostOperationHistoryHook = require('./ReactHostOperationHistoryHook');
16
+ var ReactComponentTreeHook = require('./ReactComponentTreeHook');
17
+ var ReactChildrenMutationWarningHook = require('./ReactChildrenMutationWarningHook');
18
18
  var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
19
19
 
20
20
  var performanceNow = require('fbjs/lib/performanceNow');
21
21
  var warning = require('fbjs/lib/warning');
22
22
 
23
- var eventHandlers = [];
24
- var handlerDoesThrowForEvent = {};
23
+ var hooks = [];
24
+ var didHookThrowForEvent = {};
25
25
 
26
- function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
27
- eventHandlers.forEach(function (handler) {
28
- try {
29
- if (handler[handlerFunctionName]) {
30
- handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
31
- }
32
- } catch (e) {
33
- process.env.NODE_ENV !== 'production' ? warning(handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e + '\n' + e.stack) : void 0;
34
- handlerDoesThrowForEvent[handlerFunctionName] = true;
26
+ function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
27
+ try {
28
+ fn.call(context, arg1, arg2, arg3, arg4, arg5);
29
+ } catch (e) {
30
+ process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
31
+ didHookThrowForEvent[event] = true;
32
+ }
33
+ }
34
+
35
+ function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
36
+ for (var i = 0; i < hooks.length; i++) {
37
+ var hook = hooks[i];
38
+ var fn = hook[event];
39
+ if (fn) {
40
+ callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
35
41
  }
36
- });
42
+ }
37
43
  }
38
44
 
39
45
  var isProfiling = false;
@@ -50,21 +56,21 @@ var currentTimerType = null;
50
56
  var lifeCycleTimerHasWarned = false;
51
57
 
52
58
  function clearHistory() {
53
- ReactComponentTreeDevtool.purgeUnmountedComponents();
54
- ReactHostOperationHistoryDevtool.clearHistory();
59
+ ReactComponentTreeHook.purgeUnmountedComponents();
60
+ ReactHostOperationHistoryHook.clearHistory();
55
61
  }
56
62
 
57
63
  function getTreeSnapshot(registeredIDs) {
58
64
  return registeredIDs.reduce(function (tree, id) {
59
- var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
60
- var parentID = ReactComponentTreeDevtool.getParentID(id);
65
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
66
+ var parentID = ReactComponentTreeHook.getParentID(id);
61
67
  tree[id] = {
62
- displayName: ReactComponentTreeDevtool.getDisplayName(id),
63
- text: ReactComponentTreeDevtool.getText(id),
64
- updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
65
- childIDs: ReactComponentTreeDevtool.getChildIDs(id),
68
+ displayName: ReactComponentTreeHook.getDisplayName(id),
69
+ text: ReactComponentTreeHook.getText(id),
70
+ updateCount: ReactComponentTreeHook.getUpdateCount(id),
71
+ childIDs: ReactComponentTreeHook.getChildIDs(id),
66
72
  // Text nodes don't have owners but this is close enough.
67
- ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
73
+ ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID),
68
74
  parentID: parentID
69
75
  };
70
76
  return tree;
@@ -74,7 +80,7 @@ function getTreeSnapshot(registeredIDs) {
74
80
  function resetMeasurements() {
75
81
  var previousStartTime = currentFlushStartTime;
76
82
  var previousMeasurements = currentFlushMeasurements || [];
77
- var previousOperations = ReactHostOperationHistoryDevtool.getHistory();
83
+ var previousOperations = ReactHostOperationHistoryHook.getHistory();
78
84
 
79
85
  if (currentFlushNesting === 0) {
80
86
  currentFlushStartTime = null;
@@ -84,7 +90,7 @@ function resetMeasurements() {
84
90
  }
85
91
 
86
92
  if (previousMeasurements.length || previousOperations.length) {
87
- var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
93
+ var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
88
94
  flushHistory.push({
89
95
  duration: performanceNow() - previousStartTime,
90
96
  measurements: previousMeasurements || [],
@@ -99,7 +105,14 @@ function resetMeasurements() {
99
105
  }
100
106
 
101
107
  function checkDebugID(debugID) {
102
- process.env.NODE_ENV !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;
108
+ var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
109
+
110
+ if (allowRoot && debugID === 0) {
111
+ return;
112
+ }
113
+ if (!debugID) {
114
+ process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
115
+ }
103
116
  }
104
117
 
105
118
  function beginLifeCycleTimer(debugID, timerType) {
@@ -167,13 +180,13 @@ function resumeCurrentLifeCycleTimer() {
167
180
  }
168
181
 
169
182
  var ReactDebugTool = {
170
- addDevtool: function (devtool) {
171
- eventHandlers.push(devtool);
183
+ addHook: function (hook) {
184
+ hooks.push(hook);
172
185
  },
173
- removeDevtool: function (devtool) {
174
- for (var i = 0; i < eventHandlers.length; i++) {
175
- if (eventHandlers[i] === devtool) {
176
- eventHandlers.splice(i, 1);
186
+ removeHook: function (hook) {
187
+ for (var i = 0; i < hooks.length; i++) {
188
+ if (hooks[i] === hook) {
189
+ hooks.splice(i, 1);
177
190
  i--;
178
191
  }
179
192
  }
@@ -189,7 +202,7 @@ var ReactDebugTool = {
189
202
  isProfiling = true;
190
203
  flushHistory.length = 0;
191
204
  resetMeasurements();
192
- ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool);
205
+ ReactDebugTool.addHook(ReactHostOperationHistoryHook);
193
206
  },
194
207
  endProfiling: function () {
195
208
  if (!isProfiling) {
@@ -198,7 +211,7 @@ var ReactDebugTool = {
198
211
 
199
212
  isProfiling = false;
200
213
  resetMeasurements();
201
- ReactDebugTool.removeDevtool(ReactHostOperationHistoryDevtool);
214
+ ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
202
215
  },
203
216
  getFlushHistory: function () {
204
217
  return flushHistory;
@@ -225,20 +238,6 @@ var ReactDebugTool = {
225
238
  endLifeCycleTimer(debugID, timerType);
226
239
  emitEvent('onEndLifeCycleTimer', debugID, timerType);
227
240
  },
228
- onBeginReconcilerTimer: function (debugID, timerType) {
229
- checkDebugID(debugID);
230
- emitEvent('onBeginReconcilerTimer', debugID, timerType);
231
- },
232
- onEndReconcilerTimer: function (debugID, timerType) {
233
- checkDebugID(debugID);
234
- emitEvent('onEndReconcilerTimer', debugID, timerType);
235
- },
236
- onError: function (debugID) {
237
- if (currentTimerDebugID != null) {
238
- endLifeCycleTimer(currentTimerDebugID, currentTimerType);
239
- }
240
- emitEvent('onError', debugID);
241
- },
242
241
  onBeginProcessingChildContext: function () {
243
242
  emitEvent('onBeginProcessingChildContext');
244
243
  },
@@ -249,45 +248,18 @@ var ReactDebugTool = {
249
248
  checkDebugID(debugID);
250
249
  emitEvent('onHostOperation', debugID, type, payload);
251
250
  },
252
- onComponentHasMounted: function (debugID) {
253
- checkDebugID(debugID);
254
- emitEvent('onComponentHasMounted', debugID);
255
- },
256
- onComponentHasUpdated: function (debugID) {
257
- checkDebugID(debugID);
258
- emitEvent('onComponentHasUpdated', debugID);
259
- },
260
251
  onSetState: function () {
261
252
  emitEvent('onSetState');
262
253
  },
263
- onSetDisplayName: function (debugID, displayName) {
264
- checkDebugID(debugID);
265
- emitEvent('onSetDisplayName', debugID, displayName);
266
- },
267
254
  onSetChildren: function (debugID, childDebugIDs) {
268
255
  checkDebugID(debugID);
269
256
  childDebugIDs.forEach(checkDebugID);
270
257
  emitEvent('onSetChildren', debugID, childDebugIDs);
271
258
  },
272
- onSetOwner: function (debugID, ownerDebugID) {
273
- checkDebugID(debugID);
274
- emitEvent('onSetOwner', debugID, ownerDebugID);
275
- },
276
- onSetParent: function (debugID, parentDebugID) {
277
- checkDebugID(debugID);
278
- emitEvent('onSetParent', debugID, parentDebugID);
279
- },
280
- onSetText: function (debugID, text) {
281
- checkDebugID(debugID);
282
- emitEvent('onSetText', debugID, text);
283
- },
284
- onMountRootComponent: function (debugID) {
285
- checkDebugID(debugID);
286
- emitEvent('onMountRootComponent', debugID);
287
- },
288
- onBeforeMountComponent: function (debugID, element) {
259
+ onBeforeMountComponent: function (debugID, element, parentDebugID) {
289
260
  checkDebugID(debugID);
290
- emitEvent('onBeforeMountComponent', debugID, element);
261
+ checkDebugID(parentDebugID, true);
262
+ emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
291
263
  },
292
264
  onMountComponent: function (debugID) {
293
265
  checkDebugID(debugID);
@@ -301,6 +273,10 @@ var ReactDebugTool = {
301
273
  checkDebugID(debugID);
302
274
  emitEvent('onUpdateComponent', debugID);
303
275
  },
276
+ onBeforeUnmountComponent: function (debugID) {
277
+ checkDebugID(debugID);
278
+ emitEvent('onBeforeUnmountComponent', debugID);
279
+ },
304
280
  onUnmountComponent: function (debugID) {
305
281
  checkDebugID(debugID);
306
282
  emitEvent('onUnmountComponent', debugID);
@@ -310,9 +286,13 @@ var ReactDebugTool = {
310
286
  }
311
287
  };
312
288
 
313
- ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
314
- ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
315
- ReactDebugTool.addDevtool(ReactChildrenMutationWarningDevtool);
289
+ // TODO remove these when RN/www gets updated
290
+ ReactDebugTool.addDevtool = ReactDebugTool.addHook;
291
+ ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
292
+
293
+ ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
294
+ ReactDebugTool.addHook(ReactComponentTreeHook);
295
+ ReactDebugTool.addHook(ReactChildrenMutationWarningHook);
316
296
  var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
317
297
  if (/[?&]react_perf\b/.test(url)) {
318
298
  ReactDebugTool.beginProfiling();