react 0.8.0 → 0.10.0

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 (160) hide show
  1. package/README.md +0 -8
  2. package/addons.js +0 -3
  3. package/lib/AutoFocusMixin.js +32 -0
  4. package/lib/CSSCore.js +23 -22
  5. package/lib/CSSProperty.js +32 -1
  6. package/lib/CSSPropertyOperations.js +1 -1
  7. package/lib/ChangeEventPlugin.js +27 -5
  8. package/lib/ClientReactRootIndex.js +30 -0
  9. package/lib/CompositionEventPlugin.js +58 -10
  10. package/lib/DOMChildrenOperations.js +39 -3
  11. package/lib/DOMProperty.js +9 -5
  12. package/lib/DOMPropertyOperations.js +21 -8
  13. package/lib/Danger.js +9 -8
  14. package/lib/DefaultDOMPropertyConfig.js +23 -14
  15. package/lib/DefaultEventPluginOrder.js +1 -1
  16. package/lib/EnterLeaveEventPlugin.js +38 -5
  17. package/lib/EventConstants.js +4 -1
  18. package/lib/EventListener.js +42 -34
  19. package/lib/EventPluginHub.js +118 -13
  20. package/lib/EventPluginRegistry.js +62 -18
  21. package/lib/EventPluginUtils.js +33 -4
  22. package/lib/EventPropagators.js +7 -43
  23. package/lib/ExecutionEnvironment.js +4 -1
  24. package/lib/LinkedStateMixin.js +1 -1
  25. package/lib/LinkedValueUtils.js +160 -0
  26. package/lib/MobileSafariClickEventPlugin.js +1 -1
  27. package/lib/PooledClass.js +7 -1
  28. package/lib/React.js +30 -4
  29. package/lib/ReactBrowserComponentMixin.js +42 -0
  30. package/lib/ReactCSSTransitionGroup.js +65 -0
  31. package/lib/{ReactTransitionableChild.js → ReactCSSTransitionGroupChild.js} +22 -36
  32. package/lib/ReactChildren.js +4 -4
  33. package/lib/ReactComponent.js +163 -83
  34. package/lib/ReactComponentBrowserEnvironment.js +55 -71
  35. package/lib/ReactCompositeComponent.js +686 -119
  36. package/lib/ReactContext.js +67 -0
  37. package/lib/ReactCurrentOwner.js +1 -1
  38. package/lib/ReactDOM.js +19 -6
  39. package/lib/ReactDOMButton.js +6 -1
  40. package/lib/ReactDOMComponent.js +66 -24
  41. package/lib/ReactDOMForm.js +13 -3
  42. package/lib/ReactDOMIDOperations.js +106 -61
  43. package/lib/ReactDOMImg.js +61 -0
  44. package/lib/ReactDOMInput.js +28 -15
  45. package/lib/ReactDOMOption.js +13 -8
  46. package/lib/ReactDOMSelect.js +38 -18
  47. package/lib/ReactDOMSelection.js +1 -1
  48. package/lib/ReactDOMTextarea.js +19 -11
  49. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  50. package/lib/ReactDefaultInjection.js +60 -26
  51. package/lib/ReactDefaultPerf.js +208 -371
  52. package/lib/ReactDefaultPerfAnalysis.js +199 -0
  53. package/lib/ReactErrorUtils.js +6 -15
  54. package/lib/ReactEventEmitter.js +144 -146
  55. package/lib/ReactEventEmitterMixin.js +1 -33
  56. package/lib/ReactEventTopLevelCallback.js +75 -15
  57. package/lib/ReactInjection.js +43 -0
  58. package/lib/ReactInputSelection.js +3 -2
  59. package/lib/ReactInstanceHandles.js +36 -20
  60. package/lib/ReactLink.js +2 -2
  61. package/lib/ReactMarkupChecksum.js +1 -1
  62. package/lib/ReactMount.js +136 -104
  63. package/lib/ReactMountReady.js +2 -2
  64. package/lib/ReactMultiChild.js +40 -49
  65. package/lib/ReactMultiChildUpdateTypes.js +3 -1
  66. package/lib/ReactOwner.js +17 -4
  67. package/lib/ReactPerf.js +6 -9
  68. package/lib/ReactPropTransferer.js +41 -22
  69. package/lib/ReactPropTypeLocationNames.js +31 -0
  70. package/lib/{ReactComponentEnvironment.js → ReactPropTypeLocations.js} +11 -6
  71. package/lib/ReactPropTypes.js +249 -48
  72. package/lib/ReactPutListenerQueue.js +61 -0
  73. package/lib/ReactReconcileTransaction.js +28 -7
  74. package/lib/ReactRootIndex.js +36 -0
  75. package/lib/ReactServerRendering.js +46 -19
  76. package/lib/ReactServerRenderingTransaction.js +116 -0
  77. package/lib/ReactStateSetters.js +1 -1
  78. package/lib/ReactTestUtils.js +394 -0
  79. package/lib/ReactTextComponent.js +33 -6
  80. package/lib/{ReactTransitionKeySet.js → ReactTransitionChildMapping.js} +43 -48
  81. package/lib/ReactTransitionEvents.js +1 -1
  82. package/lib/ReactTransitionGroup.js +133 -58
  83. package/lib/ReactUpdates.js +15 -12
  84. package/lib/ReactWithAddons.js +15 -3
  85. package/lib/SelectEventPlugin.js +23 -40
  86. package/lib/ServerReactRootIndex.js +36 -0
  87. package/lib/SimpleEventPlugin.js +55 -7
  88. package/lib/SyntheticClipboardEvent.js +8 -2
  89. package/lib/SyntheticCompositionEvent.js +1 -1
  90. package/lib/SyntheticDragEvent.js +44 -0
  91. package/lib/SyntheticEvent.js +3 -2
  92. package/lib/SyntheticFocusEvent.js +1 -1
  93. package/lib/SyntheticKeyboardEvent.js +5 -3
  94. package/lib/SyntheticMouseEvent.js +1 -1
  95. package/lib/SyntheticTouchEvent.js +1 -1
  96. package/lib/SyntheticUIEvent.js +1 -1
  97. package/lib/SyntheticWheelEvent.js +11 -8
  98. package/lib/Transaction.js +62 -37
  99. package/lib/ViewportMetrics.js +1 -1
  100. package/lib/accumulate.js +1 -1
  101. package/lib/adler32.js +1 -1
  102. package/lib/cloneWithProps.js +59 -0
  103. package/lib/containsNode.js +1 -1
  104. package/lib/copyProperties.js +1 -1
  105. package/lib/createArrayFrom.js +11 -14
  106. package/lib/createFullPageComponent.js +63 -0
  107. package/lib/createNodesFromMarkup.js +1 -1
  108. package/lib/createObjectFrom.js +1 -1
  109. package/lib/cx.js +3 -3
  110. package/lib/dangerousStyleValue.js +1 -1
  111. package/lib/emptyFunction.js +1 -1
  112. package/lib/emptyObject.js +27 -0
  113. package/lib/escapeTextForBrowser.js +1 -1
  114. package/lib/flattenChildren.js +6 -3
  115. package/lib/focusNode.js +33 -0
  116. package/lib/forEachAccumulated.js +1 -1
  117. package/lib/getActiveElement.js +5 -4
  118. package/lib/getEventKey.js +85 -0
  119. package/lib/getEventTarget.js +1 -1
  120. package/lib/getMarkupWrap.js +11 -1
  121. package/lib/getNodeForCharacterOffset.js +1 -1
  122. package/lib/getReactRootElementInContainer.js +1 -1
  123. package/lib/getTextContentAccessor.js +6 -4
  124. package/lib/getUnboundedScrollPosition.js +3 -3
  125. package/lib/hyphenate.js +1 -1
  126. package/lib/instantiateReactComponent.js +70 -0
  127. package/lib/invariant.js +20 -12
  128. package/lib/isEventSupported.js +8 -12
  129. package/lib/isNode.js +2 -2
  130. package/lib/isTextInputElement.js +1 -1
  131. package/lib/isTextNode.js +1 -1
  132. package/lib/joinClasses.js +1 -1
  133. package/lib/keyMirror.js +1 -1
  134. package/lib/keyOf.js +1 -1
  135. package/lib/memoizeStringOnly.js +1 -1
  136. package/lib/merge.js +1 -1
  137. package/lib/mergeHelpers.js +6 -7
  138. package/lib/mergeInto.js +1 -1
  139. package/lib/mixInto.js +1 -1
  140. package/lib/monitorCodeUse.js +37 -0
  141. package/lib/objMap.js +1 -1
  142. package/lib/objMapKeyVal.js +1 -1
  143. package/lib/onlyChild.js +43 -0
  144. package/lib/performanceNow.js +1 -1
  145. package/lib/shallowEqual.js +1 -1
  146. package/lib/shouldUpdateReactComponent.js +61 -0
  147. package/lib/toArray.js +75 -0
  148. package/lib/traverseAllChildren.js +72 -9
  149. package/lib/update.js +159 -0
  150. package/lib/warning.js +48 -0
  151. package/package.json +3 -3
  152. package/react.js +0 -3
  153. package/ReactJSErrors.js +0 -40
  154. package/lib/$.js +0 -46
  155. package/lib/CallbackRegistry.js +0 -91
  156. package/lib/LinkedValueMixin.js +0 -68
  157. package/lib/ex.js +0 -49
  158. package/lib/filterAttributes.js +0 -45
  159. package/lib/ge.js +0 -76
  160. package/lib/mutateHTMLNodeWithMarkup.js +0 -100
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright 2013-2014 Facebook, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ * @providesModule ReactContext
17
+ */
18
+
19
+ "use strict";
20
+
21
+ var merge = require("./merge");
22
+
23
+ /**
24
+ * Keeps track of the current context.
25
+ *
26
+ * The context is automatically passed down the component ownership hierarchy
27
+ * and is accessible via `this.context` on ReactCompositeComponents.
28
+ */
29
+ var ReactContext = {
30
+
31
+ /**
32
+ * @internal
33
+ * @type {object}
34
+ */
35
+ current: {},
36
+
37
+ /**
38
+ * Temporarily extends the current context while executing scopedCallback.
39
+ *
40
+ * A typical use case might look like
41
+ *
42
+ * render: function() {
43
+ * var children = ReactContext.withContext({foo: 'foo'} () => (
44
+ *
45
+ * ));
46
+ * return <div>{children}</div>;
47
+ * }
48
+ *
49
+ * @param {object} newContext New context to merge into the existing context
50
+ * @param {function} scopedCallback Callback to run with the new context
51
+ * @return {ReactComponent|array<ReactComponent>}
52
+ */
53
+ withContext: function(newContext, scopedCallback) {
54
+ var result;
55
+ var previousContext = ReactContext.current;
56
+ ReactContext.current = merge(previousContext, newContext);
57
+ try {
58
+ result = scopedCallback();
59
+ } finally {
60
+ ReactContext.current = previousContext;
61
+ }
62
+ return result;
63
+ }
64
+
65
+ };
66
+
67
+ module.exports = ReactContext;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/ReactDOM.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -50,6 +50,14 @@ function createDOMComponentClass(tag, omitClose) {
50
50
  instance.construct.apply(instance, arguments);
51
51
  return instance;
52
52
  };
53
+
54
+ // Expose the constructor on the ConvenienceConstructor and prototype so that
55
+ // it can be easily easily accessed on descriptors.
56
+ // E.g. <div />.type === div.type
57
+ ConvenienceConstructor.type = Constructor;
58
+ Constructor.prototype.type = Constructor;
59
+
60
+ Constructor.ConvenienceConstructor = ConvenienceConstructor;
53
61
  ConvenienceConstructor.componentConstructor = Constructor;
54
62
  return ConvenienceConstructor;
55
63
  }
@@ -64,12 +72,12 @@ var ReactDOM = objMapKeyVal({
64
72
  a: false,
65
73
  abbr: false,
66
74
  address: false,
67
- area: false,
75
+ area: true,
68
76
  article: false,
69
77
  aside: false,
70
78
  audio: false,
71
79
  b: false,
72
- base: false,
80
+ base: true,
73
81
  bdi: false,
74
82
  bdo: false,
75
83
  big: false,
@@ -119,7 +127,7 @@ var ReactDOM = objMapKeyVal({
119
127
  label: false,
120
128
  legend: false,
121
129
  li: false,
122
- link: false,
130
+ link: true,
123
131
  main: false,
124
132
  map: false,
125
133
  mark: false,
@@ -148,7 +156,7 @@ var ReactDOM = objMapKeyVal({
148
156
  section: false,
149
157
  select: false,
150
158
  small: false,
151
- source: false,
159
+ source: true,
152
160
  span: false,
153
161
  strong: false,
154
162
  style: false,
@@ -170,15 +178,20 @@ var ReactDOM = objMapKeyVal({
170
178
  ul: false,
171
179
  'var': false,
172
180
  video: false,
173
- wbr: false,
181
+ wbr: true,
174
182
 
175
183
  // SVG
176
184
  circle: false,
185
+ defs: false,
177
186
  g: false,
178
187
  line: false,
188
+ linearGradient: false,
179
189
  path: false,
190
+ polygon: false,
180
191
  polyline: false,
192
+ radialGradient: false,
181
193
  rect: false,
194
+ stop: false,
182
195
  svg: false,
183
196
  text: false
184
197
  }, createDOMComponentClass);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,8 @@
18
18
 
19
19
  "use strict";
20
20
 
21
+ var AutoFocusMixin = require("./AutoFocusMixin");
22
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
21
23
  var ReactCompositeComponent = require("./ReactCompositeComponent");
22
24
  var ReactDOM = require("./ReactDOM");
23
25
 
@@ -44,6 +46,9 @@ var mouseListenerNames = keyMirror({
44
46
  * when `disabled` is set.
45
47
  */
46
48
  var ReactDOMButton = ReactCompositeComponent.createClass({
49
+ displayName: 'ReactDOMButton',
50
+
51
+ mixins: [AutoFocusMixin, ReactBrowserComponentMixin],
47
52
 
48
53
  render: function() {
49
54
  var props = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -22,10 +22,11 @@
22
22
  var CSSPropertyOperations = require("./CSSPropertyOperations");
23
23
  var DOMProperty = require("./DOMProperty");
24
24
  var DOMPropertyOperations = require("./DOMPropertyOperations");
25
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
25
26
  var ReactComponent = require("./ReactComponent");
26
27
  var ReactEventEmitter = require("./ReactEventEmitter");
27
- var ReactMultiChild = require("./ReactMultiChild");
28
28
  var ReactMount = require("./ReactMount");
29
+ var ReactMultiChild = require("./ReactMultiChild");
29
30
  var ReactPerf = require("./ReactPerf");
30
31
 
31
32
  var escapeTextForBrowser = require("./escapeTextForBrowser");
@@ -34,15 +35,17 @@ var keyOf = require("./keyOf");
34
35
  var merge = require("./merge");
35
36
  var mixInto = require("./mixInto");
36
37
 
37
- var putListener = ReactEventEmitter.putListener;
38
38
  var deleteListener = ReactEventEmitter.deleteListener;
39
- var registrationNames = ReactEventEmitter.registrationNames;
39
+ var listenTo = ReactEventEmitter.listenTo;
40
+ var registrationNameModules = ReactEventEmitter.registrationNameModules;
40
41
 
41
42
  // For quickly matching children type, to test if can be treated as content.
42
43
  var CONTENT_TYPES = {'string': true, 'number': true};
43
44
 
44
45
  var STYLE = keyOf({style: null});
45
46
 
47
+ var ELEMENT_NODE_TYPE = 1;
48
+
46
49
  /**
47
50
  * @param {?object} props
48
51
  */
@@ -62,6 +65,22 @@ function assertValidProps(props) {
62
65
  ) : invariant(props.style == null || typeof props.style === 'object'));
63
66
  }
64
67
 
68
+ function putListener(id, registrationName, listener, transaction) {
69
+ var container = ReactMount.findReactContainerForID(id);
70
+ if (container) {
71
+ var doc = container.nodeType === ELEMENT_NODE_TYPE ?
72
+ container.ownerDocument :
73
+ container;
74
+ listenTo(registrationName, doc);
75
+ }
76
+ transaction.getPutListenerQueue().enqueuePutListener(
77
+ id,
78
+ registrationName,
79
+ listener
80
+ );
81
+ }
82
+
83
+
65
84
  /**
66
85
  * @constructor ReactDOMComponent
67
86
  * @extends ReactComponent
@@ -81,7 +100,7 @@ ReactDOMComponent.Mixin = {
81
100
  *
82
101
  * @internal
83
102
  * @param {string} rootID The root DOM ID for this node.
84
- * @param {ReactReconcileTransaction} transaction
103
+ * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
85
104
  * @param {number} mountDepth number of components in the owner hierarchy
86
105
  * @return {string} The computed markup.
87
106
  */
@@ -97,7 +116,7 @@ ReactDOMComponent.Mixin = {
97
116
  );
98
117
  assertValidProps(this.props);
99
118
  return (
100
- this._createOpenTagMarkup() +
119
+ this._createOpenTagMarkupAndPutListeners(transaction) +
101
120
  this._createContentMarkup(transaction) +
102
121
  this._tagClose
103
122
  );
@@ -113,9 +132,10 @@ ReactDOMComponent.Mixin = {
113
132
  * @see http://jsperf.com/obj-vs-arr-iteration
114
133
  *
115
134
  * @private
135
+ * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
116
136
  * @return {string} Markup of opening tag.
117
137
  */
118
- _createOpenTagMarkup: function() {
138
+ _createOpenTagMarkupAndPutListeners: function(transaction) {
119
139
  var props = this.props;
120
140
  var ret = this._tagOpen;
121
141
 
@@ -127,8 +147,8 @@ ReactDOMComponent.Mixin = {
127
147
  if (propValue == null) {
128
148
  continue;
129
149
  }
130
- if (registrationNames[propKey]) {
131
- putListener(this._rootNodeID, propKey, propValue);
150
+ if (registrationNameModules[propKey]) {
151
+ putListener(this._rootNodeID, propKey, propValue, transaction);
132
152
  } else {
133
153
  if (propKey === STYLE) {
134
154
  if (propValue) {
@@ -144,15 +164,21 @@ ReactDOMComponent.Mixin = {
144
164
  }
145
165
  }
146
166
 
147
- var escapedID = escapeTextForBrowser(this._rootNodeID);
148
- return ret + ' ' + ReactMount.ATTR_NAME + '="' + escapedID + '">';
167
+ // For static pages, no need to put React ID and checksum. Saves lots of
168
+ // bytes.
169
+ if (transaction.renderToStaticMarkup) {
170
+ return ret + '>';
171
+ }
172
+
173
+ var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
174
+ return ret + ' ' + markupForID + '>';
149
175
  },
150
176
 
151
177
  /**
152
178
  * Creates markup for the content between the tags.
153
179
  *
154
180
  * @private
155
- * @param {ReactReconcileTransaction} transaction
181
+ * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
156
182
  * @return {string} Content markup.
157
183
  */
158
184
  _createContentMarkup: function(transaction) {
@@ -180,6 +206,15 @@ ReactDOMComponent.Mixin = {
180
206
  },
181
207
 
182
208
  receiveComponent: function(nextComponent, transaction) {
209
+ if (nextComponent === this) {
210
+ // Since props and context are immutable after the component is
211
+ // mounted, we can do a cheap identity compare here to determine
212
+ // if this is a superfluous reconcile.
213
+
214
+ // TODO: compare the descriptor
215
+ return;
216
+ }
217
+
183
218
  assertValidProps(nextComponent.props);
184
219
  ReactComponent.Mixin.receiveComponent.call(
185
220
  this,
@@ -200,9 +235,14 @@ ReactDOMComponent.Mixin = {
200
235
  updateComponent: ReactPerf.measure(
201
236
  'ReactDOMComponent',
202
237
  'updateComponent',
203
- function(transaction, prevProps) {
204
- ReactComponent.Mixin.updateComponent.call(this, transaction, prevProps);
205
- this._updateDOMProperties(prevProps);
238
+ function(transaction, prevProps, prevOwner) {
239
+ ReactComponent.Mixin.updateComponent.call(
240
+ this,
241
+ transaction,
242
+ prevProps,
243
+ prevOwner
244
+ );
245
+ this._updateDOMProperties(prevProps, transaction);
206
246
  this._updateDOMChildren(prevProps, transaction);
207
247
  }
208
248
  ),
@@ -220,8 +260,9 @@ ReactDOMComponent.Mixin = {
220
260
  *
221
261
  * @private
222
262
  * @param {object} lastProps
263
+ * @param {ReactReconcileTransaction} transaction
223
264
  */
224
- _updateDOMProperties: function(lastProps) {
265
+ _updateDOMProperties: function(lastProps, transaction) {
225
266
  var nextProps = this.props;
226
267
  var propKey;
227
268
  var styleName;
@@ -239,12 +280,12 @@ ReactDOMComponent.Mixin = {
239
280
  styleUpdates[styleName] = '';
240
281
  }
241
282
  }
242
- } else if (registrationNames[propKey]) {
283
+ } else if (registrationNameModules[propKey]) {
243
284
  deleteListener(this._rootNodeID, propKey);
244
285
  } else if (
245
286
  DOMProperty.isStandardName[propKey] ||
246
287
  DOMProperty.isCustomAttribute(propKey)) {
247
- ReactComponent.DOMIDOperations.deletePropertyByID(
288
+ ReactComponent.BackendIDOperations.deletePropertyByID(
248
289
  this._rootNodeID,
249
290
  propKey
250
291
  );
@@ -281,12 +322,12 @@ ReactDOMComponent.Mixin = {
281
322
  // Relies on `updateStylesByID` not mutating `styleUpdates`.
282
323
  styleUpdates = nextProp;
283
324
  }
284
- } else if (registrationNames[propKey]) {
285
- putListener(this._rootNodeID, propKey, nextProp);
325
+ } else if (registrationNameModules[propKey]) {
326
+ putListener(this._rootNodeID, propKey, nextProp, transaction);
286
327
  } else if (
287
328
  DOMProperty.isStandardName[propKey] ||
288
329
  DOMProperty.isCustomAttribute(propKey)) {
289
- ReactComponent.DOMIDOperations.updatePropertyByID(
330
+ ReactComponent.BackendIDOperations.updatePropertyByID(
290
331
  this._rootNodeID,
291
332
  propKey,
292
333
  nextProp
@@ -294,7 +335,7 @@ ReactDOMComponent.Mixin = {
294
335
  }
295
336
  }
296
337
  if (styleUpdates) {
297
- ReactComponent.DOMIDOperations.updateStylesByID(
338
+ ReactComponent.BackendIDOperations.updateStylesByID(
298
339
  this._rootNodeID,
299
340
  styleUpdates
300
341
  );
@@ -343,7 +384,7 @@ ReactDOMComponent.Mixin = {
343
384
  }
344
385
  } else if (nextHtml != null) {
345
386
  if (lastHtml !== nextHtml) {
346
- ReactComponent.DOMIDOperations.updateInnerHTMLByID(
387
+ ReactComponent.BackendIDOperations.updateInnerHTMLByID(
347
388
  this._rootNodeID,
348
389
  nextHtml
349
390
  );
@@ -360,9 +401,9 @@ ReactDOMComponent.Mixin = {
360
401
  * @internal
361
402
  */
362
403
  unmountComponent: function() {
404
+ this.unmountChildren();
363
405
  ReactEventEmitter.deleteAllListeners(this._rootNodeID);
364
406
  ReactComponent.Mixin.unmountComponent.call(this);
365
- this.unmountChildren();
366
407
  }
367
408
 
368
409
  };
@@ -370,5 +411,6 @@ ReactDOMComponent.Mixin = {
370
411
  mixInto(ReactDOMComponent, ReactComponent.Mixin);
371
412
  mixInto(ReactDOMComponent, ReactDOMComponent.Mixin);
372
413
  mixInto(ReactDOMComponent, ReactMultiChild.Mixin);
414
+ mixInto(ReactDOMComponent, ReactBrowserComponentMixin);
373
415
 
374
416
  module.exports = ReactDOMComponent;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
18
18
 
19
19
  "use strict";
20
20
 
21
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
21
22
  var ReactCompositeComponent = require("./ReactCompositeComponent");
22
23
  var ReactDOM = require("./ReactDOM");
23
24
  var ReactEventEmitter = require("./ReactEventEmitter");
@@ -33,6 +34,10 @@ var form = ReactDOM.form;
33
34
  * composite component and use `componentDidMount` to attach the event handlers.
34
35
  */
35
36
  var ReactDOMForm = ReactCompositeComponent.createClass({
37
+ displayName: 'ReactDOMForm',
38
+
39
+ mixins: [ReactBrowserComponentMixin],
40
+
36
41
  render: function() {
37
42
  // TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
38
43
  // `jshint` fails to parse JSX so in order for linting to work in the open
@@ -40,11 +45,16 @@ var ReactDOMForm = ReactCompositeComponent.createClass({
40
45
  return this.transferPropsTo(form(null, this.props.children));
41
46
  },
42
47
 
43
- componentDidMount: function(node) {
48
+ componentDidMount: function() {
49
+ ReactEventEmitter.trapBubbledEvent(
50
+ EventConstants.topLevelTypes.topReset,
51
+ 'reset',
52
+ this.getDOMNode()
53
+ );
44
54
  ReactEventEmitter.trapBubbledEvent(
45
55
  EventConstants.topLevelTypes.topSubmit,
46
56
  'submit',
47
- node
57
+ this.getDOMNode()
48
58
  );
49
59
  }
50
60
  });