react 0.14.7 → 0.15.0-alpha.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 (177) hide show
  1. package/LICENSE +1 -1
  2. package/dist/react-with-addons.js +2937 -3414
  3. package/dist/react-with-addons.min.js +7 -7
  4. package/dist/react.js +2762 -3034
  5. package/dist/react.min.js +7 -7
  6. package/lib/AutoFocusUtils.js +3 -15
  7. package/lib/BeforeInputEventPlugin.js +8 -25
  8. package/lib/CSSProperty.js +3 -1
  9. package/lib/CSSPropertyOperations.js +20 -6
  10. package/lib/CallbackQueue.js +12 -1
  11. package/lib/ChangeEventPlugin.js +58 -54
  12. package/lib/DOMChildrenOperations.js +21 -60
  13. package/lib/DOMLazyTree.js +95 -0
  14. package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
  15. package/lib/DOMProperty.js +7 -2
  16. package/lib/DOMPropertyOperations.js +66 -36
  17. package/lib/Danger.js +6 -7
  18. package/lib/DefaultEventPluginOrder.js +1 -1
  19. package/lib/EnterLeaveEventPlugin.js +24 -43
  20. package/lib/EventConstants.js +2 -1
  21. package/lib/EventPluginHub.js +15 -59
  22. package/lib/EventPluginRegistry.js +23 -2
  23. package/lib/EventPluginUtils.js +60 -35
  24. package/lib/EventPropagators.js +19 -17
  25. package/lib/FallbackCompositionState.js +1 -2
  26. package/lib/HTMLDOMPropertyConfig.js +21 -23
  27. package/lib/LinkedInput.js +49 -0
  28. package/lib/LinkedStateMixin.js +1 -2
  29. package/lib/LinkedValueUtils.js +1 -2
  30. package/lib/MetaMatchers.js +2 -2
  31. package/lib/Object.assign.js +1 -1
  32. package/lib/OrderedMap.js +1 -1
  33. package/lib/PooledClass.js +1 -1
  34. package/lib/React.js +1 -13
  35. package/lib/ReactBrowserEventEmitter.js +3 -23
  36. package/lib/ReactCSSTransitionGroup.js +1 -2
  37. package/lib/ReactCSSTransitionGroupChild.js +1 -6
  38. package/lib/ReactChildReconciler.js +12 -10
  39. package/lib/ReactChildren.js +3 -3
  40. package/lib/ReactClass.js +18 -67
  41. package/lib/ReactComponent.js +2 -5
  42. package/lib/ReactComponentBrowserEnvironment.js +9 -6
  43. package/lib/ReactComponentEnvironment.js +3 -3
  44. package/lib/ReactComponentWithPureRenderMixin.js +2 -2
  45. package/lib/ReactCompositeComponent.js +94 -29
  46. package/lib/ReactCurrentOwner.js +1 -1
  47. package/lib/ReactDOM.js +26 -14
  48. package/lib/ReactDOMButton.js +2 -2
  49. package/lib/ReactDOMComponent.js +156 -218
  50. package/lib/ReactDOMComponentFlags.js +18 -0
  51. package/lib/ReactDOMComponentTree.js +186 -0
  52. package/lib/ReactDOMContainerInfo.js +32 -0
  53. package/lib/ReactDOMDebugTool.js +69 -0
  54. package/lib/ReactDOMEmptyComponent.js +61 -0
  55. package/lib/ReactDOMFactories.js +1 -2
  56. package/lib/ReactDOMFeatureFlags.js +2 -2
  57. package/lib/ReactDOMIDOperations.js +5 -60
  58. package/lib/ReactDOMInput.js +52 -23
  59. package/lib/ReactDOMInstrumentation.js +16 -0
  60. package/lib/ReactDOMOption.js +9 -8
  61. package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +57 -0
  62. package/lib/ReactDOMSelect.js +35 -14
  63. package/lib/ReactDOMSelection.js +2 -2
  64. package/lib/ReactDOMServer.js +1 -1
  65. package/lib/ReactDOMTextComponent.js +41 -21
  66. package/lib/ReactDOMTextarea.js +32 -5
  67. package/lib/ReactDOMTreeTraversal.js +134 -0
  68. package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
  69. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  70. package/lib/ReactDefaultInjection.js +11 -15
  71. package/lib/ReactDefaultPerf.js +49 -19
  72. package/lib/ReactDefaultPerfAnalysis.js +16 -9
  73. package/lib/ReactElement.js +9 -5
  74. package/lib/ReactElementValidator.js +1 -1
  75. package/lib/ReactEmptyComponent.js +8 -29
  76. package/lib/ReactErrorUtils.js +1 -2
  77. package/lib/ReactEventEmitterMixin.js +3 -8
  78. package/lib/ReactEventListener.js +20 -75
  79. package/lib/ReactFeatureFlags.js +21 -0
  80. package/lib/ReactFragment.js +2 -2
  81. package/lib/ReactInjection.js +3 -3
  82. package/lib/ReactInputSelection.js +3 -3
  83. package/lib/ReactInstanceHandles.js +4 -6
  84. package/lib/ReactInstanceMap.js +1 -1
  85. package/lib/ReactIsomorphic.js +1 -1
  86. package/lib/ReactLink.js +1 -2
  87. package/lib/ReactMarkupChecksum.js +1 -1
  88. package/lib/ReactMount.js +67 -445
  89. package/lib/ReactMultiChild.js +104 -198
  90. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  91. package/lib/ReactNativeComponent.js +1 -1
  92. package/lib/ReactNodeTypes.js +37 -0
  93. package/lib/ReactNoopUpdateQueue.js +1 -24
  94. package/lib/ReactOwner.js +1 -1
  95. package/lib/ReactPerf.js +1 -2
  96. package/lib/ReactPropTransferer.js +1 -1
  97. package/lib/ReactPropTypeLocationNames.js +1 -1
  98. package/lib/ReactPropTypeLocations.js +1 -1
  99. package/lib/ReactPropTypes.js +8 -2
  100. package/lib/ReactReconcileTransaction.js +17 -6
  101. package/lib/ReactReconciler.js +14 -5
  102. package/lib/ReactRef.js +1 -1
  103. package/lib/ReactServerBatchingStrategy.js +1 -2
  104. package/lib/ReactServerRendering.js +15 -33
  105. package/lib/ReactServerRenderingTransaction.js +8 -26
  106. package/lib/ReactSimpleEmptyComponent.js +37 -0
  107. package/lib/ReactStateSetters.js +1 -1
  108. package/lib/ReactTestUtils.js +25 -15
  109. package/lib/ReactTransitionChildMapping.js +1 -2
  110. package/lib/ReactTransitionEvents.js +1 -1
  111. package/lib/ReactTransitionGroup.js +1 -1
  112. package/lib/ReactUpdateQueue.js +4 -4
  113. package/lib/ReactUpdates.js +19 -2
  114. package/lib/ReactVersion.js +2 -2
  115. package/lib/ReactWithAddons.js +1 -3
  116. package/lib/ResponderEventPlugin.js +53 -65
  117. package/lib/ResponderSyntheticEvent.js +1 -2
  118. package/lib/ResponderTouchHistoryStore.js +1 -1
  119. package/lib/SVGDOMPropertyConfig.js +2 -39
  120. package/lib/SelectEventPlugin.js +13 -18
  121. package/lib/SimpleEventPlugin.js +18 -16
  122. package/lib/SyntheticClipboardEvent.js +1 -2
  123. package/lib/SyntheticCompositionEvent.js +1 -2
  124. package/lib/SyntheticDragEvent.js +1 -2
  125. package/lib/SyntheticEvent.js +10 -7
  126. package/lib/SyntheticFocusEvent.js +1 -2
  127. package/lib/SyntheticInputEvent.js +1 -2
  128. package/lib/SyntheticKeyboardEvent.js +1 -2
  129. package/lib/SyntheticMouseEvent.js +1 -2
  130. package/lib/SyntheticTouchEvent.js +1 -2
  131. package/lib/SyntheticUIEvent.js +1 -2
  132. package/lib/SyntheticWheelEvent.js +1 -2
  133. package/lib/TapEventPlugin.js +3 -12
  134. package/lib/Transaction.js +1 -1
  135. package/lib/ViewportMetrics.js +1 -1
  136. package/lib/accumulate.js +1 -1
  137. package/lib/accumulateInto.js +1 -1
  138. package/lib/adler32.js +3 -2
  139. package/lib/canDefineProperty.js +1 -1
  140. package/lib/createHierarchyRenderer.js +1 -1
  141. package/lib/dangerousStyleValue.js +25 -3
  142. package/lib/deprecated.js +1 -1
  143. package/lib/escapeTextContentForBrowser.js +1 -1
  144. package/lib/findDOMNode.js +15 -8
  145. package/lib/flattenChildren.js +1 -1
  146. package/lib/forEachAccumulated.js +1 -1
  147. package/lib/getEventCharCode.js +1 -2
  148. package/lib/getEventKey.js +1 -2
  149. package/lib/getEventModifierState.js +1 -2
  150. package/lib/getEventTarget.js +1 -2
  151. package/lib/getIteratorFn.js +1 -2
  152. package/lib/getNativeComponentFromComposite.js +30 -0
  153. package/lib/getNodeForCharacterOffset.js +1 -1
  154. package/lib/getTestDocument.js +1 -1
  155. package/lib/getTextContentAccessor.js +1 -1
  156. package/lib/instantiateReactComponent.js +3 -4
  157. package/lib/isEventSupported.js +1 -1
  158. package/lib/isTextInputElement.js +1 -1
  159. package/lib/onlyChild.js +1 -1
  160. package/lib/quoteAttributeValueForBrowser.js +1 -1
  161. package/lib/reactComponentExpect.js +1 -1
  162. package/lib/renderSubtreeIntoContainer.js +1 -1
  163. package/lib/setInnerHTML.js +1 -1
  164. package/lib/setTextContent.js +1 -1
  165. package/lib/shallowCompare.js +1 -1
  166. package/lib/shouldUpdateReactComponent.js +1 -3
  167. package/lib/sliceChildren.js +1 -1
  168. package/lib/traverseAllChildren.js +6 -6
  169. package/lib/update.js +1 -1
  170. package/lib/validateDOMNesting.js +8 -9
  171. package/package.json +2 -2
  172. package/lib/ReactBrowserComponentMixin.js +0 -36
  173. package/lib/ReactEmptyComponentRegistry.js +0 -48
  174. package/lib/ReactRootIndex.js +0 -29
  175. package/lib/ServerReactRootIndex.js +0 -29
  176. package/lib/cloneWithProps.js +0 -54
  177. package/lib/webcomponents.js +0 -6379
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
package/lib/ReactDOM.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -13,10 +13,8 @@
13
13
 
14
14
  'use strict';
15
15
 
16
- var ReactCurrentOwner = require('./ReactCurrentOwner');
17
- var ReactDOMTextComponent = require('./ReactDOMTextComponent');
16
+ var ReactDOMComponentTree = require('./ReactDOMComponentTree');
18
17
  var ReactDefaultInjection = require('./ReactDefaultInjection');
19
- var ReactInstanceHandles = require('./ReactInstanceHandles');
20
18
  var ReactMount = require('./ReactMount');
21
19
  var ReactPerf = require('./ReactPerf');
22
20
  var ReactReconciler = require('./ReactReconciler');
@@ -24,6 +22,7 @@ var ReactUpdates = require('./ReactUpdates');
24
22
  var ReactVersion = require('./ReactVersion');
25
23
 
26
24
  var findDOMNode = require('./findDOMNode');
25
+ var getNativeComponentFromComposite = require('./getNativeComponentFromComposite');
27
26
  var renderSubtreeIntoContainer = require('./renderSubtreeIntoContainer');
28
27
  var warning = require('fbjs/lib/warning');
29
28
 
@@ -47,11 +46,22 @@ var React = {
47
46
  /* eslint-enable camelcase */
48
47
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
49
48
  __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
50
- CurrentOwner: ReactCurrentOwner,
51
- InstanceHandles: ReactInstanceHandles,
49
+ ComponentTree: {
50
+ getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
51
+ getNodeFromInstance: function (inst) {
52
+ // inst is an internal instance (but could be a composite)
53
+ if (inst._renderedComponent) {
54
+ inst = getNativeComponentFromComposite(inst);
55
+ }
56
+ if (inst) {
57
+ return ReactDOMComponentTree.getNodeFromInstance(inst);
58
+ } else {
59
+ return null;
60
+ }
61
+ }
62
+ },
52
63
  Mount: ReactMount,
53
- Reconciler: ReactReconciler,
54
- TextComponent: ReactDOMTextComponent
64
+ Reconciler: ReactReconciler
55
65
  });
56
66
  }
57
67
 
@@ -63,10 +73,15 @@ if (process.env.NODE_ENV !== 'production') {
63
73
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
64
74
  // If we're in Chrome or Firefox, provide a download link if not installed.
65
75
  if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
66
- console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
76
+ // Firefox does not have the issue with devtools loaded over file://
77
+ var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
78
+ console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
67
79
  }
68
80
  }
69
81
 
82
+ var testFunc = function testFn() {};
83
+ process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : undefined;
84
+
70
85
  // If we're in IE8, check to see if we are in compatibility mode and provide
71
86
  // information on preventing compatibility mode
72
87
  var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
@@ -75,14 +90,11 @@ if (process.env.NODE_ENV !== 'production') {
75
90
 
76
91
  var expectedFeatures = [
77
92
  // shims
78
- Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
79
-
80
- // shams
81
- Object.create, Object.freeze];
93
+ Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];
82
94
 
83
95
  for (var i = 0; i < expectedFeatures.length; i++) {
84
96
  if (!expectedFeatures[i]) {
85
- console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
97
+ process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : undefined;
86
98
  break;
87
99
  }
88
100
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -30,7 +30,7 @@ var mouseListenerNames = {
30
30
  * when `disabled` is set.
31
31
  */
32
32
  var ReactDOMButton = {
33
- getNativeProps: function (inst, props, context) {
33
+ getNativeProps: function (inst, props) {
34
34
  if (!props.disabled) {
35
35
  return props;
36
36
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -7,7 +7,6 @@
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
9
  * @providesModule ReactDOMComponent
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  /* global hasOwnProperty:true */
@@ -16,36 +15,39 @@
16
15
 
17
16
  var AutoFocusUtils = require('./AutoFocusUtils');
18
17
  var CSSPropertyOperations = require('./CSSPropertyOperations');
18
+ var DOMLazyTree = require('./DOMLazyTree');
19
+ var DOMNamespaces = require('./DOMNamespaces');
19
20
  var DOMProperty = require('./DOMProperty');
20
21
  var DOMPropertyOperations = require('./DOMPropertyOperations');
21
22
  var EventConstants = require('./EventConstants');
23
+ var EventPluginHub = require('./EventPluginHub');
24
+ var EventPluginRegistry = require('./EventPluginRegistry');
22
25
  var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
23
26
  var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');
24
27
  var ReactDOMButton = require('./ReactDOMButton');
28
+ var ReactDOMComponentFlags = require('./ReactDOMComponentFlags');
29
+ var ReactDOMComponentTree = require('./ReactDOMComponentTree');
25
30
  var ReactDOMInput = require('./ReactDOMInput');
26
31
  var ReactDOMOption = require('./ReactDOMOption');
27
32
  var ReactDOMSelect = require('./ReactDOMSelect');
28
33
  var ReactDOMTextarea = require('./ReactDOMTextarea');
29
- var ReactMount = require('./ReactMount');
30
34
  var ReactMultiChild = require('./ReactMultiChild');
31
35
  var ReactPerf = require('./ReactPerf');
32
- var ReactUpdateQueue = require('./ReactUpdateQueue');
33
36
 
34
37
  var assign = require('./Object.assign');
35
- var canDefineProperty = require('./canDefineProperty');
36
38
  var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
37
39
  var invariant = require('fbjs/lib/invariant');
38
40
  var isEventSupported = require('./isEventSupported');
39
41
  var keyOf = require('fbjs/lib/keyOf');
40
- var setInnerHTML = require('./setInnerHTML');
41
- var setTextContent = require('./setTextContent');
42
42
  var shallowEqual = require('fbjs/lib/shallowEqual');
43
43
  var validateDOMNesting = require('./validateDOMNesting');
44
44
  var warning = require('fbjs/lib/warning');
45
45
 
46
- var deleteListener = ReactBrowserEventEmitter.deleteListener;
46
+ var Flags = ReactDOMComponentFlags;
47
+ var deleteListener = EventPluginHub.deleteListener;
48
+ var getNode = ReactDOMComponentTree.getNodeFromInstance;
47
49
  var listenTo = ReactBrowserEventEmitter.listenTo;
48
- var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
50
+ var registrationNameModules = EventPluginRegistry.registrationNameModules;
49
51
 
50
52
  // For quickly matching children type, to test if can be treated as content.
51
53
  var CONTENT_TYPES = { 'string': true, 'number': true };
@@ -54,8 +56,6 @@ var CHILDREN = keyOf({ children: null });
54
56
  var STYLE = keyOf({ style: null });
55
57
  var HTML = keyOf({ __html: null });
56
58
 
57
- var ELEMENT_NODE_TYPE = 1;
58
-
59
59
  function getDeclarationErrorAddendum(internalInstance) {
60
60
  if (internalInstance) {
61
61
  var owner = internalInstance._currentElement._owner || null;
@@ -69,71 +69,6 @@ function getDeclarationErrorAddendum(internalInstance) {
69
69
  return '';
70
70
  }
71
71
 
72
- var legacyPropsDescriptor;
73
- if (process.env.NODE_ENV !== 'production') {
74
- legacyPropsDescriptor = {
75
- props: {
76
- enumerable: false,
77
- get: function () {
78
- var component = this._reactInternalComponent;
79
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined;
80
- return component._currentElement.props;
81
- }
82
- }
83
- };
84
- }
85
-
86
- function legacyGetDOMNode() {
87
- if (process.env.NODE_ENV !== 'production') {
88
- var component = this._reactInternalComponent;
89
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined;
90
- }
91
- return this;
92
- }
93
-
94
- function legacyIsMounted() {
95
- var component = this._reactInternalComponent;
96
- if (process.env.NODE_ENV !== 'production') {
97
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined;
98
- }
99
- return !!component;
100
- }
101
-
102
- function legacySetStateEtc() {
103
- if (process.env.NODE_ENV !== 'production') {
104
- var component = this._reactInternalComponent;
105
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined;
106
- }
107
- }
108
-
109
- function legacySetProps(partialProps, callback) {
110
- var component = this._reactInternalComponent;
111
- if (process.env.NODE_ENV !== 'production') {
112
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
113
- }
114
- if (!component) {
115
- return;
116
- }
117
- ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps);
118
- if (callback) {
119
- ReactUpdateQueue.enqueueCallbackInternal(component, callback);
120
- }
121
- }
122
-
123
- function legacyReplaceProps(partialProps, callback) {
124
- var component = this._reactInternalComponent;
125
- if (process.env.NODE_ENV !== 'production') {
126
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
127
- }
128
- if (!component) {
129
- return;
130
- }
131
- ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps);
132
- if (callback) {
133
- ReactUpdateQueue.enqueueCallbackInternal(component, callback);
134
- }
135
- }
136
-
137
72
  function friendlyStringify(obj) {
138
73
  if (typeof obj === 'object') {
139
74
  if (Array.isArray(obj)) {
@@ -153,7 +88,7 @@ function friendlyStringify(obj) {
153
88
  } else if (typeof obj === 'function') {
154
89
  return '[function object]';
155
90
  }
156
- // Differs from JSON.stringify in that undefined becauses undefined and that
91
+ // Differs from JSON.stringify in that undefined because undefined and that
157
92
  // inf and nan don't become null
158
93
  return String(obj);
159
94
  }
@@ -211,19 +146,21 @@ function assertValidProps(component, props) {
211
146
  !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : undefined;
212
147
  }
213
148
 
214
- function enqueuePutListener(id, registrationName, listener, transaction) {
149
+ function enqueuePutListener(inst, registrationName, listener, transaction) {
215
150
  if (process.env.NODE_ENV !== 'production') {
216
151
  // IE8 has no API for event capturing and the `onScroll` event doesn't
217
152
  // bubble.
218
153
  process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined;
219
154
  }
220
- var container = ReactMount.findReactContainerForID(id);
221
- if (container) {
222
- var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container;
223
- listenTo(registrationName, doc);
155
+ var containerInfo = inst._nativeContainerInfo;
156
+ var doc = containerInfo._ownerDocument;
157
+ if (!doc) {
158
+ // Server rendering.
159
+ return;
224
160
  }
161
+ listenTo(registrationName, doc);
225
162
  transaction.getReactMountReady().enqueue(putListener, {
226
- id: id,
163
+ inst: inst,
227
164
  registrationName: registrationName,
228
165
  listener: listener
229
166
  });
@@ -231,7 +168,7 @@ function enqueuePutListener(id, registrationName, listener, transaction) {
231
168
 
232
169
  function putListener() {
233
170
  var listenerToPut = this;
234
- ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener);
171
+ EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
235
172
  }
236
173
 
237
174
  // There are so many media events, it makes sense to just
@@ -267,7 +204,7 @@ function trapBubbledEventsLocal() {
267
204
  // If a component renders to null or if another component fatals and causes
268
205
  // the state of the tree to be corrupted, `node` here can be null.
269
206
  !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
270
- var node = ReactMount.getNode(inst._rootNodeID);
207
+ var node = getNode(inst);
271
208
  !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
272
209
 
273
210
  switch (inst._tag) {
@@ -278,7 +215,7 @@ function trapBubbledEventsLocal() {
278
215
  case 'audio':
279
216
 
280
217
  inst._wrapperState.listeners = [];
281
- // create listener for each media event
218
+ // Create listener for each media event
282
219
  for (var event in mediaEvents) {
283
220
  if (mediaEvents.hasOwnProperty(event)) {
284
221
  inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
@@ -292,19 +229,20 @@ function trapBubbledEventsLocal() {
292
229
  case 'form':
293
230
  inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
294
231
  break;
232
+ case 'input':
233
+ case 'select':
234
+ case 'textarea':
235
+ inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
236
+ break;
295
237
  }
296
238
  }
297
239
 
298
- function mountReadyInputWrapper() {
299
- ReactDOMInput.mountReadyWrapper(this);
300
- }
301
-
302
240
  function postUpdateSelectWrapper() {
303
241
  ReactDOMSelect.postUpdateWrapper(this);
304
242
  }
305
243
 
306
244
  // For HTML, certain tags should omit their close tag. We keep a whitelist for
307
- // those special cased tags.
245
+ // those special-case tags.
308
246
 
309
247
  var omittedCloseTags = {
310
248
  'area': true,
@@ -353,18 +291,12 @@ function validateDangerousTag(tag) {
353
291
  }
354
292
  }
355
293
 
356
- function processChildContextDev(context, inst) {
357
- // Pass down our tag name to child components for validation purposes
358
- context = assign({}, context);
359
- var info = context[validateDOMNesting.ancestorInfoContextKey];
360
- context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst);
361
- return context;
362
- }
363
-
364
294
  function isCustomComponent(tagName, props) {
365
295
  return tagName.indexOf('-') >= 0 || props.is != null;
366
296
  }
367
297
 
298
+ var globalIdCounter = 1;
299
+
368
300
  /**
369
301
  * Creates a new React class that is idempotent and capable of containing other
370
302
  * React components. It accepts event listeners and DOM properties that are
@@ -382,16 +314,20 @@ function isCustomComponent(tagName, props) {
382
314
  function ReactDOMComponent(tag) {
383
315
  validateDangerousTag(tag);
384
316
  this._tag = tag.toLowerCase();
317
+ this._namespaceURI = null;
385
318
  this._renderedChildren = null;
386
319
  this._previousStyle = null;
387
320
  this._previousStyleCopy = null;
321
+ this._nativeNode = null;
322
+ this._nativeParent = null;
388
323
  this._rootNodeID = null;
324
+ this._domID = null;
325
+ this._nativeContainerInfo = null;
389
326
  this._wrapperState = null;
390
327
  this._topLevelWrapper = null;
391
- this._nodeWithLegacyProperties = null;
328
+ this._flags = 0;
392
329
  if (process.env.NODE_ENV !== 'production') {
393
- this._unprocessedContextDev = null;
394
- this._processedContextDev = null;
330
+ this._ancestorInfo = null;
395
331
  }
396
332
  }
397
333
 
@@ -408,13 +344,17 @@ ReactDOMComponent.Mixin = {
408
344
  * is not idempotent.
409
345
  *
410
346
  * @internal
411
- * @param {string} rootID The root DOM ID for this node.
412
347
  * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
348
+ * @param {?ReactDOMComponent} the containing DOM component instance
349
+ * @param {?object} info about the native container
413
350
  * @param {object} context
414
351
  * @return {string} The computed markup.
415
352
  */
416
- mountComponent: function (rootID, transaction, context) {
417
- this._rootNodeID = rootID;
353
+ mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
354
+ this._rootNodeID = globalIdCounter++;
355
+ this._domID = nativeContainerInfo._idCounter++;
356
+ this._nativeParent = nativeParent;
357
+ this._nativeContainerInfo = nativeContainerInfo;
418
358
 
419
359
  var props = this._currentElement.props;
420
360
 
@@ -430,50 +370,96 @@ ReactDOMComponent.Mixin = {
430
370
  transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
431
371
  break;
432
372
  case 'button':
433
- props = ReactDOMButton.getNativeProps(this, props, context);
373
+ props = ReactDOMButton.getNativeProps(this, props, nativeParent);
434
374
  break;
435
375
  case 'input':
436
- ReactDOMInput.mountWrapper(this, props, context);
437
- props = ReactDOMInput.getNativeProps(this, props, context);
376
+ ReactDOMInput.mountWrapper(this, props, nativeParent);
377
+ props = ReactDOMInput.getNativeProps(this, props);
378
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
438
379
  break;
439
380
  case 'option':
440
- ReactDOMOption.mountWrapper(this, props, context);
441
- props = ReactDOMOption.getNativeProps(this, props, context);
381
+ ReactDOMOption.mountWrapper(this, props, nativeParent);
382
+ props = ReactDOMOption.getNativeProps(this, props);
442
383
  break;
443
384
  case 'select':
444
- ReactDOMSelect.mountWrapper(this, props, context);
445
- props = ReactDOMSelect.getNativeProps(this, props, context);
446
- context = ReactDOMSelect.processChildContext(this, props, context);
385
+ ReactDOMSelect.mountWrapper(this, props, nativeParent);
386
+ props = ReactDOMSelect.getNativeProps(this, props);
387
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
447
388
  break;
448
389
  case 'textarea':
449
- ReactDOMTextarea.mountWrapper(this, props, context);
450
- props = ReactDOMTextarea.getNativeProps(this, props, context);
390
+ ReactDOMTextarea.mountWrapper(this, props, nativeParent);
391
+ props = ReactDOMTextarea.getNativeProps(this, props);
392
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
451
393
  break;
452
394
  }
453
395
 
454
396
  assertValidProps(this, props);
455
- if (process.env.NODE_ENV !== 'production') {
456
- if (context[validateDOMNesting.ancestorInfoContextKey]) {
457
- validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]);
397
+
398
+ // We create tags in the namespace of their parent container, except HTML
399
+ // tags get no namespace.
400
+ var namespaceURI;
401
+ var parentTag;
402
+ if (nativeParent != null) {
403
+ namespaceURI = nativeParent._namespaceURI;
404
+ parentTag = nativeParent._tag;
405
+ } else if (nativeContainerInfo._tag) {
406
+ namespaceURI = nativeContainerInfo._namespaceURI;
407
+ parentTag = nativeContainerInfo._tag;
408
+ }
409
+ if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
410
+ namespaceURI = DOMNamespaces.html;
411
+ }
412
+ if (namespaceURI === DOMNamespaces.html) {
413
+ if (this._tag === 'svg') {
414
+ namespaceURI = DOMNamespaces.svg;
415
+ } else if (this._tag === 'math') {
416
+ namespaceURI = DOMNamespaces.mathml;
458
417
  }
459
418
  }
419
+ this._namespaceURI = namespaceURI;
460
420
 
461
421
  if (process.env.NODE_ENV !== 'production') {
462
- this._unprocessedContextDev = context;
463
- this._processedContextDev = processChildContextDev(context, this);
464
- context = this._processedContextDev;
422
+ var parentInfo;
423
+ if (nativeParent != null) {
424
+ parentInfo = nativeParent._ancestorInfo;
425
+ } else if (nativeContainerInfo._tag) {
426
+ parentInfo = nativeContainerInfo._ancestorInfo;
427
+ }
428
+ if (parentInfo) {
429
+ // parentInfo should always be present except for the top-level
430
+ // component when server rendering
431
+ validateDOMNesting(this._tag, this, parentInfo);
432
+ }
433
+ this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
465
434
  }
466
435
 
467
436
  var mountImage;
468
437
  if (transaction.useCreateElement) {
469
- var ownerDocument = context[ReactMount.ownerDocumentContextKey];
470
- var el = ownerDocument.createElement(this._currentElement.type);
471
- DOMPropertyOperations.setAttributeForID(el, this._rootNodeID);
472
- // Populate node cache
473
- ReactMount.getID(el);
474
- this._updateDOMProperties({}, props, transaction, el);
475
- this._createInitialChildren(transaction, props, context, el);
476
- mountImage = el;
438
+ var ownerDocument = nativeContainerInfo._ownerDocument;
439
+ var el;
440
+ if (namespaceURI === DOMNamespaces.html) {
441
+ if (this._tag === 'script') {
442
+ // Create the script via .innerHTML so its "parser-inserted" flag is
443
+ // set to true and it does not execute
444
+ var div = ownerDocument.createElement('div');
445
+ var type = this._currentElement.type;
446
+ div.innerHTML = '<' + type + '></' + type + '>';
447
+ el = div.removeChild(div.firstChild);
448
+ } else {
449
+ el = ownerDocument.createElement(this._currentElement.type);
450
+ }
451
+ } else {
452
+ el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
453
+ }
454
+ ReactDOMComponentTree.precacheNode(this, el);
455
+ this._flags |= Flags.hasCachedChildNodes;
456
+ if (!this._nativeParent) {
457
+ DOMPropertyOperations.setAttributeForRoot(el);
458
+ }
459
+ this._updateDOMProperties(null, props, transaction);
460
+ var lazyTree = DOMLazyTree(el);
461
+ this._createInitialChildren(transaction, props, context, lazyTree);
462
+ mountImage = lazyTree;
477
463
  } else {
478
464
  var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
479
465
  var tagContent = this._createContentMarkup(transaction, props, context);
@@ -485,10 +471,8 @@ ReactDOMComponent.Mixin = {
485
471
  }
486
472
 
487
473
  switch (this._tag) {
488
- case 'input':
489
- transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this);
490
- // falls through
491
474
  case 'button':
475
+ case 'input':
492
476
  case 'select':
493
477
  case 'textarea':
494
478
  if (props.autoFocus) {
@@ -526,7 +510,7 @@ ReactDOMComponent.Mixin = {
526
510
  }
527
511
  if (registrationNameModules.hasOwnProperty(propKey)) {
528
512
  if (propValue) {
529
- enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
513
+ enqueuePutListener(this, propKey, propValue, transaction);
530
514
  }
531
515
  } else {
532
516
  if (propKey === STYLE) {
@@ -537,13 +521,15 @@ ReactDOMComponent.Mixin = {
537
521
  }
538
522
  propValue = this._previousStyleCopy = assign({}, props.style);
539
523
  }
540
- propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
524
+ propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
541
525
  }
542
526
  var markup = null;
543
527
  if (this._tag != null && isCustomComponent(this._tag, props)) {
544
528
  if (propKey !== CHILDREN) {
545
529
  markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
546
530
  }
531
+ } else if (this._namespaceURI === DOMNamespaces.svg) {
532
+ markup = DOMPropertyOperations.createMarkupForSVGAttribute(propKey, propValue);
547
533
  } else {
548
534
  markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
549
535
  }
@@ -559,8 +545,11 @@ ReactDOMComponent.Mixin = {
559
545
  return ret;
560
546
  }
561
547
 
562
- var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
563
- return ret + ' ' + markupForID;
548
+ if (!this._nativeParent) {
549
+ ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
550
+ }
551
+ ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
552
+ return ret;
564
553
  },
565
554
 
566
555
  /**
@@ -609,23 +598,23 @@ ReactDOMComponent.Mixin = {
609
598
  }
610
599
  },
611
600
 
612
- _createInitialChildren: function (transaction, props, context, el) {
601
+ _createInitialChildren: function (transaction, props, context, lazyTree) {
613
602
  // Intentional use of != to avoid catching zero/false.
614
603
  var innerHTML = props.dangerouslySetInnerHTML;
615
604
  if (innerHTML != null) {
616
605
  if (innerHTML.__html != null) {
617
- setInnerHTML(el, innerHTML.__html);
606
+ DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
618
607
  }
619
608
  } else {
620
609
  var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
621
610
  var childrenToUse = contentToUse != null ? null : props.children;
622
611
  if (contentToUse != null) {
623
612
  // TODO: Validate that text is allowed as a child of this node
624
- setTextContent(el, contentToUse);
613
+ DOMLazyTree.queueText(lazyTree, contentToUse);
625
614
  } else if (childrenToUse != null) {
626
615
  var mountImages = this.mountChildren(childrenToUse, transaction, context);
627
616
  for (var i = 0; i < mountImages.length; i++) {
628
- el.appendChild(mountImages[i]);
617
+ DOMLazyTree.queueChild(lazyTree, mountImages[i]);
629
618
  }
630
619
  }
631
620
  }
@@ -684,25 +673,10 @@ ReactDOMComponent.Mixin = {
684
673
  break;
685
674
  }
686
675
 
687
- if (process.env.NODE_ENV !== 'production') {
688
- // If the context is reference-equal to the old one, pass down the same
689
- // processed object so the update bailout in ReactReconciler behaves
690
- // correctly (and identically in dev and prod). See #5005.
691
- if (this._unprocessedContextDev !== context) {
692
- this._unprocessedContextDev = context;
693
- this._processedContextDev = processChildContextDev(context, this);
694
- }
695
- context = this._processedContextDev;
696
- }
697
-
698
676
  assertValidProps(this, nextProps);
699
- this._updateDOMProperties(lastProps, nextProps, transaction, null);
677
+ this._updateDOMProperties(lastProps, nextProps, transaction);
700
678
  this._updateDOMChildren(lastProps, nextProps, transaction, context);
701
679
 
702
- if (!canDefineProperty && this._nodeWithLegacyProperties) {
703
- this._nodeWithLegacyProperties.props = nextProps;
704
- }
705
-
706
680
  if (this._tag === 'select') {
707
681
  // <select> value update needs to occur after <option> children
708
682
  // reconciliation
@@ -724,15 +698,14 @@ ReactDOMComponent.Mixin = {
724
698
  * @private
725
699
  * @param {object} lastProps
726
700
  * @param {object} nextProps
727
- * @param {ReactReconcileTransaction} transaction
728
701
  * @param {?DOMElement} node
729
702
  */
730
- _updateDOMProperties: function (lastProps, nextProps, transaction, node) {
703
+ _updateDOMProperties: function (lastProps, nextProps, transaction) {
731
704
  var propKey;
732
705
  var styleName;
733
706
  var styleUpdates;
734
707
  for (propKey in lastProps) {
735
- if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) {
708
+ if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
736
709
  continue;
737
710
  }
738
711
  if (propKey === STYLE) {
@@ -749,19 +722,18 @@ ReactDOMComponent.Mixin = {
749
722
  // Only call deleteListener if there was a listener previously or
750
723
  // else willDeleteListener gets called when there wasn't actually a
751
724
  // listener (e.g., onClick={null})
752
- deleteListener(this._rootNodeID, propKey);
725
+ deleteListener(this, propKey);
753
726
  }
727
+ } else if (this._namespaceURI === DOMNamespaces.svg) {
728
+ DOMPropertyOperations.deleteValueForSVGAttribute(getNode(this), propKey);
754
729
  } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
755
- if (!node) {
756
- node = ReactMount.getNode(this._rootNodeID);
757
- }
758
- DOMPropertyOperations.deleteValueForProperty(node, propKey);
730
+ DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
759
731
  }
760
732
  }
761
733
  for (propKey in nextProps) {
762
734
  var nextProp = nextProps[propKey];
763
- var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey];
764
- if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
735
+ var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
736
+ if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
765
737
  continue;
766
738
  }
767
739
  if (propKey === STYLE) {
@@ -795,24 +767,21 @@ ReactDOMComponent.Mixin = {
795
767
  }
796
768
  } else if (registrationNameModules.hasOwnProperty(propKey)) {
797
769
  if (nextProp) {
798
- enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction);
770
+ enqueuePutListener(this, propKey, nextProp, transaction);
799
771
  } else if (lastProp) {
800
- deleteListener(this._rootNodeID, propKey);
772
+ deleteListener(this, propKey);
801
773
  }
802
774
  } else if (isCustomComponent(this._tag, nextProps)) {
803
- if (!node) {
804
- node = ReactMount.getNode(this._rootNodeID);
805
- }
806
775
  if (propKey === CHILDREN) {
807
776
  nextProp = null;
808
777
  }
809
- DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp);
778
+ DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
779
+ } else if (this._namespaceURI === DOMNamespaces.svg) {
780
+ DOMPropertyOperations.setValueForSVGAttribute(getNode(this), propKey, nextProp);
810
781
  } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
811
- if (!node) {
812
- node = ReactMount.getNode(this._rootNodeID);
813
- }
782
+ var node = getNode(this);
814
783
  // If we're updating to null or undefined, we should remove the property
815
- // from the DOM node instead of inadvertantly setting to a string. This
784
+ // from the DOM node instead of inadvertently setting to a string. This
816
785
  // brings us in line with the same behavior we have on initial render.
817
786
  if (nextProp != null) {
818
787
  DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
@@ -822,10 +791,7 @@ ReactDOMComponent.Mixin = {
822
791
  }
823
792
  }
824
793
  if (styleUpdates) {
825
- if (!node) {
826
- node = ReactMount.getNode(this._rootNodeID);
827
- }
828
- CSSPropertyOperations.setValueForStyles(node, styleUpdates);
794
+ CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
829
795
  }
830
796
  },
831
797
 
@@ -872,6 +838,10 @@ ReactDOMComponent.Mixin = {
872
838
  }
873
839
  },
874
840
 
841
+ getNativeNode: function () {
842
+ return getNode(this);
843
+ },
844
+
875
845
  /**
876
846
  * Destroys all event registrations for this instance. Does not remove from
877
847
  * the DOM. That must be done by the parent.
@@ -892,9 +862,6 @@ ReactDOMComponent.Mixin = {
892
862
  }
893
863
  }
894
864
  break;
895
- case 'input':
896
- ReactDOMInput.unmountWrapper(this);
897
- break;
898
865
  case 'html':
899
866
  case 'head':
900
867
  case 'body':
@@ -909,52 +876,23 @@ ReactDOMComponent.Mixin = {
909
876
  }
910
877
 
911
878
  this.unmountChildren();
912
- ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
879
+ ReactDOMComponentTree.uncacheNode(this);
880
+ EventPluginHub.deleteAllListeners(this);
913
881
  ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
914
882
  this._rootNodeID = null;
883
+ this._domID = null;
915
884
  this._wrapperState = null;
916
- if (this._nodeWithLegacyProperties) {
917
- var node = this._nodeWithLegacyProperties;
918
- node._reactInternalComponent = null;
919
- this._nodeWithLegacyProperties = null;
920
- }
921
885
  },
922
886
 
923
887
  getPublicInstance: function () {
924
- if (!this._nodeWithLegacyProperties) {
925
- var node = ReactMount.getNode(this._rootNodeID);
926
-
927
- node._reactInternalComponent = this;
928
- node.getDOMNode = legacyGetDOMNode;
929
- node.isMounted = legacyIsMounted;
930
- node.setState = legacySetStateEtc;
931
- node.replaceState = legacySetStateEtc;
932
- node.forceUpdate = legacySetStateEtc;
933
- node.setProps = legacySetProps;
934
- node.replaceProps = legacyReplaceProps;
935
-
936
- if (process.env.NODE_ENV !== 'production') {
937
- if (canDefineProperty) {
938
- Object.defineProperties(node, legacyPropsDescriptor);
939
- } else {
940
- // updateComponent will update this property on subsequent renders
941
- node.props = this._currentElement.props;
942
- }
943
- } else {
944
- // updateComponent will update this property on subsequent renders
945
- node.props = this._currentElement.props;
946
- }
947
-
948
- this._nodeWithLegacyProperties = node;
949
- }
950
- return this._nodeWithLegacyProperties;
888
+ return getNode(this);
951
889
  }
952
890
 
953
891
  };
954
892
 
955
- ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', {
893
+ ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
956
894
  mountComponent: 'mountComponent',
957
- updateComponent: 'updateComponent'
895
+ receiveComponent: 'receiveComponent'
958
896
  });
959
897
 
960
898
  assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);