react 0.9.0-rc1 → 0.11.0-rc1

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 (168) hide show
  1. package/README.md +3 -0
  2. package/dist/JSXTransformer.js +13445 -0
  3. package/dist/react-with-addons.js +20226 -0
  4. package/dist/react-with-addons.min.js +22 -0
  5. package/dist/react.js +18434 -0
  6. package/dist/react.min.js +21 -0
  7. package/lib/AutoFocusMixin.js +4 -2
  8. package/lib/BeforeInputEventPlugin.js +222 -0
  9. package/lib/CSSCore.js +1 -1
  10. package/lib/CSSProperty.js +1 -1
  11. package/lib/CSSPropertyOperations.js +4 -4
  12. package/lib/{ReactMountReady.js → CallbackQueue.js} +33 -25
  13. package/lib/ChangeEventPlugin.js +2 -2
  14. package/lib/ClientReactRootIndex.js +1 -1
  15. package/lib/CompositionEventPlugin.js +6 -2
  16. package/lib/DOMChildrenOperations.js +34 -21
  17. package/lib/DOMProperty.js +52 -22
  18. package/lib/DOMPropertyOperations.js +29 -17
  19. package/lib/Danger.js +1 -1
  20. package/lib/DefaultEventPluginOrder.js +2 -1
  21. package/lib/EnterLeaveEventPlugin.js +1 -1
  22. package/lib/EventConstants.js +2 -1
  23. package/lib/EventListener.js +5 -2
  24. package/lib/EventPluginHub.js +5 -6
  25. package/lib/EventPluginRegistry.js +27 -4
  26. package/lib/EventPluginUtils.js +12 -2
  27. package/lib/EventPropagators.js +1 -1
  28. package/lib/ExecutionEnvironment.js +9 -3
  29. package/lib/{DefaultDOMPropertyConfig.js → HTMLDOMPropertyConfig.js} +47 -58
  30. package/lib/LinkedStateMixin.js +1 -1
  31. package/lib/LinkedValueUtils.js +27 -29
  32. package/lib/LocalEventTrapMixin.js +52 -0
  33. package/lib/MobileSafariClickEventPlugin.js +1 -1
  34. package/lib/PooledClass.js +1 -1
  35. package/lib/React.js +39 -4
  36. package/lib/ReactBrowserComponentMixin.js +46 -0
  37. package/lib/{ReactEventEmitter.js → ReactBrowserEventEmitter.js} +118 -95
  38. package/lib/ReactCSSTransitionGroup.js +13 -11
  39. package/lib/ReactCSSTransitionGroupChild.js +3 -6
  40. package/lib/ReactChildren.js +35 -14
  41. package/lib/ReactComponent.js +120 -224
  42. package/lib/ReactComponentBrowserEnvironment.js +4 -37
  43. package/lib/ReactComponentWithPureRenderMixin.js +54 -0
  44. package/lib/ReactCompositeComponent.js +250 -288
  45. package/lib/ReactContext.js +1 -1
  46. package/lib/ReactCurrentOwner.js +1 -1
  47. package/lib/ReactDOM.js +26 -24
  48. package/lib/ReactDOMButton.js +3 -2
  49. package/lib/ReactDOMComponent.js +43 -24
  50. package/lib/ReactDOMForm.js +8 -13
  51. package/lib/ReactDOMIDOperations.js +3 -32
  52. package/lib/ReactDOMImg.js +8 -14
  53. package/lib/ReactDOMInput.js +3 -2
  54. package/lib/ReactDOMOption.js +12 -8
  55. package/lib/ReactDOMSelect.js +19 -17
  56. package/lib/ReactDOMSelection.js +36 -11
  57. package/lib/ReactDOMTextarea.js +10 -8
  58. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  59. package/lib/ReactDefaultInjection.js +28 -15
  60. package/lib/ReactDefaultPerf.js +29 -12
  61. package/lib/ReactDefaultPerfAnalysis.js +5 -1
  62. package/lib/ReactDescriptor.js +243 -0
  63. package/lib/ReactDescriptorValidator.js +283 -0
  64. package/lib/ReactEmptyComponent.js +78 -0
  65. package/lib/ReactErrorUtils.js +1 -1
  66. package/lib/ReactEventEmitterMixin.js +2 -4
  67. package/lib/ReactEventListener.js +189 -0
  68. package/lib/ReactInjection.js +9 -3
  69. package/lib/ReactInputSelection.js +3 -2
  70. package/lib/ReactInstanceHandles.js +1 -1
  71. package/lib/ReactLink.js +25 -1
  72. package/lib/ReactMarkupChecksum.js +1 -1
  73. package/lib/ReactMount.js +62 -22
  74. package/lib/ReactMultiChild.js +19 -14
  75. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  76. package/lib/ReactOwner.js +7 -2
  77. package/lib/ReactPerf.js +1 -1
  78. package/lib/ReactPropTransferer.js +45 -30
  79. package/lib/ReactPropTypeLocationNames.js +1 -1
  80. package/lib/ReactPropTypeLocations.js +1 -1
  81. package/lib/ReactPropTypes.js +222 -238
  82. package/lib/ReactPutListenerQueue.js +3 -3
  83. package/lib/ReactReconcileTransaction.js +22 -21
  84. package/lib/ReactRootIndex.js +1 -1
  85. package/lib/ReactServerRendering.js +42 -12
  86. package/lib/ReactServerRenderingTransaction.js +115 -0
  87. package/lib/ReactStateSetters.js +1 -1
  88. package/lib/ReactTestUtils.js +412 -0
  89. package/lib/ReactTextComponent.js +22 -14
  90. package/lib/ReactTransitionChildMapping.js +3 -3
  91. package/lib/ReactTransitionEvents.js +20 -1
  92. package/lib/ReactTransitionGroup.js +10 -7
  93. package/lib/ReactUpdates.js +140 -23
  94. package/lib/ReactWithAddons.js +13 -3
  95. package/lib/SVGDOMPropertyConfig.js +97 -0
  96. package/lib/SelectEventPlugin.js +1 -1
  97. package/lib/ServerReactRootIndex.js +1 -1
  98. package/lib/SimpleEventPlugin.js +8 -2
  99. package/lib/SyntheticClipboardEvent.js +1 -1
  100. package/lib/SyntheticCompositionEvent.js +1 -1
  101. package/lib/SyntheticDragEvent.js +1 -1
  102. package/lib/SyntheticEvent.js +1 -1
  103. package/lib/SyntheticFocusEvent.js +1 -1
  104. package/lib/SyntheticInputEvent.js +52 -0
  105. package/lib/SyntheticKeyboardEvent.js +34 -5
  106. package/lib/SyntheticMouseEvent.js +4 -1
  107. package/lib/SyntheticTouchEvent.js +5 -2
  108. package/lib/SyntheticUIEvent.js +25 -3
  109. package/lib/SyntheticWheelEvent.js +1 -1
  110. package/lib/Transaction.js +1 -33
  111. package/lib/ViewportMetrics.js +1 -1
  112. package/lib/accumulate.js +1 -1
  113. package/lib/adler32.js +1 -1
  114. package/lib/cloneWithProps.js +11 -9
  115. package/lib/containsNode.js +1 -1
  116. package/lib/copyProperties.js +1 -1
  117. package/lib/createArrayFrom.js +1 -1
  118. package/lib/createFullPageComponent.js +2 -2
  119. package/lib/createNodesFromMarkup.js +1 -1
  120. package/lib/cx.js +1 -1
  121. package/lib/dangerousStyleValue.js +12 -6
  122. package/lib/emptyFunction.js +1 -1
  123. package/lib/{ReactComponentEnvironment.js → emptyObject.js} +7 -6
  124. package/lib/escapeTextForBrowser.js +3 -4
  125. package/lib/flattenChildren.js +10 -8
  126. package/lib/focusNode.js +33 -0
  127. package/lib/forEachAccumulated.js +1 -1
  128. package/lib/getActiveElement.js +1 -1
  129. package/lib/getEventKey.js +36 -6
  130. package/lib/getEventModifierState.js +52 -0
  131. package/lib/getEventTarget.js +1 -1
  132. package/lib/getMarkupWrap.js +3 -1
  133. package/lib/getNodeForCharacterOffset.js +1 -1
  134. package/lib/getReactRootElementInContainer.js +1 -1
  135. package/lib/getTextContentAccessor.js +2 -2
  136. package/lib/getUnboundedScrollPosition.js +1 -1
  137. package/lib/hyphenate.js +4 -1
  138. package/lib/hyphenateStyleName.js +46 -0
  139. package/lib/instantiateReactComponent.js +62 -0
  140. package/lib/invariant.js +21 -23
  141. package/lib/isEventSupported.js +1 -1
  142. package/lib/isNode.js +2 -2
  143. package/lib/isTextInputElement.js +1 -1
  144. package/lib/isTextNode.js +1 -1
  145. package/lib/joinClasses.js +1 -1
  146. package/lib/keyMirror.js +1 -1
  147. package/lib/keyOf.js +1 -1
  148. package/lib/{objMap.js → mapObject.js} +9 -4
  149. package/lib/memoizeStringOnly.js +1 -1
  150. package/lib/merge.js +1 -1
  151. package/lib/mergeHelpers.js +12 -1
  152. package/lib/mergeInto.js +4 -3
  153. package/lib/mixInto.js +1 -1
  154. package/lib/monitorCodeUse.js +37 -0
  155. package/lib/onlyChild.js +4 -4
  156. package/lib/performance.js +33 -0
  157. package/lib/performanceNow.js +6 -15
  158. package/lib/setInnerHTML.js +77 -0
  159. package/lib/shallowEqual.js +1 -1
  160. package/lib/shouldUpdateReactComponent.js +15 -29
  161. package/lib/toArray.js +1 -1
  162. package/lib/traverseAllChildren.js +10 -6
  163. package/lib/update.js +171 -0
  164. package/lib/warning.js +19 -11
  165. package/package.json +5 -3
  166. package/lib/ReactEventTopLevelCallback.js +0 -109
  167. package/lib/createObjectFrom.js +0 -61
  168. package/lib/objMapKeyVal.js +0 -47
@@ -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,10 +18,11 @@
18
18
 
19
19
  "use strict";
20
20
 
21
+ var EventConstants = require("./EventConstants");
22
+ var LocalEventTrapMixin = require("./LocalEventTrapMixin");
23
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
21
24
  var ReactCompositeComponent = require("./ReactCompositeComponent");
22
25
  var ReactDOM = require("./ReactDOM");
23
- var ReactEventEmitter = require("./ReactEventEmitter");
24
- var EventConstants = require("./EventConstants");
25
26
 
26
27
  // Store a reference to the <img> `ReactDOMComponent`.
27
28
  var img = ReactDOM.img;
@@ -36,22 +37,15 @@ var ReactDOMImg = ReactCompositeComponent.createClass({
36
37
  displayName: 'ReactDOMImg',
37
38
  tagName: 'IMG',
38
39
 
40
+ mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
41
+
39
42
  render: function() {
40
43
  return img(this.props);
41
44
  },
42
45
 
43
46
  componentDidMount: function() {
44
- var node = this.getDOMNode();
45
- ReactEventEmitter.trapBubbledEvent(
46
- EventConstants.topLevelTypes.topLoad,
47
- 'load',
48
- node
49
- );
50
- ReactEventEmitter.trapBubbledEvent(
51
- EventConstants.topLevelTypes.topError,
52
- 'error',
53
- node
54
- );
47
+ this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
48
+ this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error');
55
49
  }
56
50
  });
57
51
 
@@ -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.
@@ -21,6 +21,7 @@
21
21
  var AutoFocusMixin = require("./AutoFocusMixin");
22
22
  var DOMPropertyOperations = require("./DOMPropertyOperations");
23
23
  var LinkedValueUtils = require("./LinkedValueUtils");
24
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
24
25
  var ReactCompositeComponent = require("./ReactCompositeComponent");
25
26
  var ReactDOM = require("./ReactDOM");
26
27
  var ReactMount = require("./ReactMount");
@@ -52,7 +53,7 @@ var instancesByReactID = {};
52
53
  var ReactDOMInput = ReactCompositeComponent.createClass({
53
54
  displayName: 'ReactDOMInput',
54
55
 
55
- mixins: [AutoFocusMixin, LinkedValueUtils.Mixin],
56
+ mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
56
57
 
57
58
  getInitialState: function() {
58
59
  var defaultValue = this.props.defaultValue;
@@ -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,9 +18,12 @@
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
 
25
+ var warning = require("./warning");
26
+
24
27
  // Store a reference to the <option> `ReactDOMComponent`.
25
28
  var option = ReactDOM.option;
26
29
 
@@ -30,15 +33,16 @@ var option = ReactDOM.option;
30
33
  var ReactDOMOption = ReactCompositeComponent.createClass({
31
34
  displayName: 'ReactDOMOption',
32
35
 
36
+ mixins: [ReactBrowserComponentMixin],
37
+
33
38
  componentWillMount: function() {
34
39
  // TODO (yungsters): Remove support for `selected` in <option>.
35
- if (this.props.selected != null) {
36
- if ("production" !== process.env.NODE_ENV) {
37
- console.warn(
38
- 'Use the `defaultValue` or `value` props on <select> instead of ' +
39
- 'setting `selected` on <option>.'
40
- );
41
- }
40
+ if ("production" !== process.env.NODE_ENV) {
41
+ ("production" !== process.env.NODE_ENV ? warning(
42
+ this.props.selected == null,
43
+ 'Use the `defaultValue` or `value` props on <select> instead of ' +
44
+ 'setting `selected` on <option>.'
45
+ ) : null);
42
46
  }
43
47
  },
44
48
 
@@ -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.
@@ -20,10 +20,10 @@
20
20
 
21
21
  var AutoFocusMixin = require("./AutoFocusMixin");
22
22
  var LinkedValueUtils = require("./LinkedValueUtils");
23
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
23
24
  var ReactCompositeComponent = require("./ReactCompositeComponent");
24
25
  var ReactDOM = require("./ReactDOM");
25
26
 
26
- var invariant = require("./invariant");
27
27
  var merge = require("./merge");
28
28
 
29
29
  // Store a reference to the <select> `ReactDOMComponent`.
@@ -38,19 +38,19 @@ function selectValueType(props, propName, componentName) {
38
38
  return;
39
39
  }
40
40
  if (props.multiple) {
41
- ("production" !== process.env.NODE_ENV ? invariant(
42
- Array.isArray(props[propName]),
43
- 'The `%s` prop supplied to <select> must be an array if `multiple` is ' +
44
- 'true.',
45
- propName
46
- ) : invariant(Array.isArray(props[propName])));
41
+ if (!Array.isArray(props[propName])) {
42
+ return new Error(
43
+ ("The `" + propName + "` prop supplied to <select> must be an array if ") +
44
+ ("`multiple` is true.")
45
+ );
46
+ }
47
47
  } else {
48
- ("production" !== process.env.NODE_ENV ? invariant(
49
- !Array.isArray(props[propName]),
50
- 'The `%s` prop supplied to <select> must be a scalar value if ' +
51
- '`multiple` is false.',
52
- propName
53
- ) : invariant(!Array.isArray(props[propName])));
48
+ if (Array.isArray(props[propName])) {
49
+ return new Error(
50
+ ("The `" + propName + "` prop supplied to <select> must be a scalar ") +
51
+ ("value if `multiple` is false.")
52
+ );
53
+ }
54
54
  }
55
55
  }
56
56
 
@@ -103,7 +103,7 @@ function updateOptions(component, propValue) {
103
103
  var ReactDOMSelect = ReactCompositeComponent.createClass({
104
104
  displayName: 'ReactDOMSelect',
105
105
 
106
- mixins: [AutoFocusMixin, LinkedValueUtils.Mixin],
106
+ mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
107
107
 
108
108
  propTypes: {
109
109
  defaultValue: selectValueType,
@@ -141,9 +141,11 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
141
141
  updateOptions(this, LinkedValueUtils.getValue(this));
142
142
  },
143
143
 
144
- componentDidUpdate: function() {
144
+ componentDidUpdate: function(prevProps) {
145
145
  var value = LinkedValueUtils.getValue(this);
146
- if (value != null) {
146
+ var prevMultiple = !!prevProps.multiple;
147
+ var multiple = !!this.props.multiple;
148
+ if (value != null || prevMultiple !== multiple) {
147
149
  updateOptions(this, value);
148
150
  }
149
151
  },
@@ -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,9 +18,20 @@
18
18
 
19
19
  "use strict";
20
20
 
21
+ var ExecutionEnvironment = require("./ExecutionEnvironment");
22
+
21
23
  var getNodeForCharacterOffset = require("./getNodeForCharacterOffset");
22
24
  var getTextContentAccessor = require("./getTextContentAccessor");
23
25
 
26
+ /**
27
+ * While `isCollapsed` is available on the Selection object and `collapsed`
28
+ * is available on the Range object, IE11 sometimes gets them wrong.
29
+ * If the anchor/focus nodes and offsets are the same, the range is collapsed.
30
+ */
31
+ function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
32
+ return anchorNode === focusNode && anchorOffset === focusOffset;
33
+ }
34
+
24
35
  /**
25
36
  * Get the appropriate anchor and focus node/offset pairs for IE.
26
37
  *
@@ -71,13 +82,31 @@ function getModernOffsets(node) {
71
82
  var focusOffset = selection.focusOffset;
72
83
 
73
84
  var currentRange = selection.getRangeAt(0);
74
- var rangeLength = currentRange.toString().length;
85
+
86
+ // If the node and offset values are the same, the selection is collapsed.
87
+ // `Selection.isCollapsed` is available natively, but IE sometimes gets
88
+ // this value wrong.
89
+ var isSelectionCollapsed = isCollapsed(
90
+ selection.anchorNode,
91
+ selection.anchorOffset,
92
+ selection.focusNode,
93
+ selection.focusOffset
94
+ );
95
+
96
+ var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
75
97
 
76
98
  var tempRange = currentRange.cloneRange();
77
99
  tempRange.selectNodeContents(node);
78
100
  tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
79
101
 
80
- var start = tempRange.toString().length;
102
+ var isTempRangeCollapsed = isCollapsed(
103
+ tempRange.startContainer,
104
+ tempRange.startOffset,
105
+ tempRange.endContainer,
106
+ tempRange.endOffset
107
+ );
108
+
109
+ var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
81
110
  var end = start + rangeLength;
82
111
 
83
112
  // Detect whether the selection is backward.
@@ -167,23 +196,19 @@ function setModernOffsets(node, offsets) {
167
196
  }
168
197
  }
169
198
 
199
+ var useIEOffsets = ExecutionEnvironment.canUseDOM && document.selection;
200
+
170
201
  var ReactDOMSelection = {
171
202
  /**
172
203
  * @param {DOMElement} node
173
204
  */
174
- getOffsets: function(node) {
175
- var getOffsets = document.selection ? getIEOffsets : getModernOffsets;
176
- return getOffsets(node);
177
- },
205
+ getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
178
206
 
179
207
  /**
180
208
  * @param {DOMElement|DOMTextNode} node
181
209
  * @param {object} offsets
182
210
  */
183
- setOffsets: function(node, offsets) {
184
- var setOffsets = document.selection ? setIEOffsets : setModernOffsets;
185
- setOffsets(node, offsets);
186
- }
211
+ setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
187
212
  };
188
213
 
189
214
  module.exports = ReactDOMSelection;
@@ -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.
@@ -21,12 +21,15 @@
21
21
  var AutoFocusMixin = require("./AutoFocusMixin");
22
22
  var DOMPropertyOperations = require("./DOMPropertyOperations");
23
23
  var LinkedValueUtils = require("./LinkedValueUtils");
24
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
24
25
  var ReactCompositeComponent = require("./ReactCompositeComponent");
25
26
  var ReactDOM = require("./ReactDOM");
26
27
 
27
28
  var invariant = require("./invariant");
28
29
  var merge = require("./merge");
29
30
 
31
+ var warning = require("./warning");
32
+
30
33
  // Store a reference to the <textarea> `ReactDOMComponent`.
31
34
  var textarea = ReactDOM.textarea;
32
35
 
@@ -48,7 +51,7 @@ var textarea = ReactDOM.textarea;
48
51
  var ReactDOMTextarea = ReactCompositeComponent.createClass({
49
52
  displayName: 'ReactDOMTextarea',
50
53
 
51
- mixins: [AutoFocusMixin, LinkedValueUtils.Mixin],
54
+ mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
52
55
 
53
56
  getInitialState: function() {
54
57
  var defaultValue = this.props.defaultValue;
@@ -56,10 +59,11 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
56
59
  var children = this.props.children;
57
60
  if (children != null) {
58
61
  if ("production" !== process.env.NODE_ENV) {
59
- console.warn(
62
+ ("production" !== process.env.NODE_ENV ? warning(
63
+ false,
60
64
  'Use the `defaultValue` or `value` props instead of setting ' +
61
65
  'children on <textarea>.'
62
- );
66
+ ) : null);
63
67
  }
64
68
  ("production" !== process.env.NODE_ENV ? invariant(
65
69
  defaultValue == null,
@@ -84,8 +88,7 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
84
88
  // `textContent` (unnecessary since we update value).
85
89
  // The initial value can be a boolean or object so that's why it's
86
90
  // forced to be a string.
87
- initialValue: '' + (value != null ? value : defaultValue),
88
- value: defaultValue
91
+ initialValue: '' + (value != null ? value : defaultValue)
89
92
  };
90
93
  },
91
94
 
@@ -97,7 +100,6 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
97
100
  render: function() {
98
101
  // Clone `this.props` so we don't mutate the input.
99
102
  var props = merge(this.props);
100
- var value = LinkedValueUtils.getValue(this);
101
103
 
102
104
  ("production" !== process.env.NODE_ENV ? invariant(
103
105
  props.dangerouslySetInnerHTML == null,
@@ -105,7 +107,7 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
105
107
  ) : invariant(props.dangerouslySetInnerHTML == null));
106
108
 
107
109
  props.defaultValue = null;
108
- props.value = value != null ? value : this.state.value;
110
+ props.value = null;
109
111
  props.onChange = this._handleChange;
110
112
 
111
113
  // Always set children to the same thing. In IE9, the selection range will
@@ -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.
@@ -58,16 +58,16 @@ var ReactDefaultBatchingStrategy = {
58
58
  * Call the provided function in a context within which calls to `setState`
59
59
  * and friends are batched such that components aren't updated unnecessarily.
60
60
  */
61
- batchedUpdates: function(callback, param) {
61
+ batchedUpdates: function(callback, a, b) {
62
62
  var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
63
63
 
64
64
  ReactDefaultBatchingStrategy.isBatchingUpdates = true;
65
65
 
66
66
  // The code is written this way to avoid extra allocations
67
67
  if (alreadyBatchingUpdates) {
68
- callback(param);
68
+ callback(a, b);
69
69
  } else {
70
- transaction.perform(callback, null, param);
70
+ transaction.perform(callback, null, a, b);
71
71
  }
72
72
  }
73
73
  };
@@ -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,19 +18,19 @@
18
18
 
19
19
  "use strict";
20
20
 
21
- var ReactInjection = require("./ReactInjection");
22
-
23
- var ExecutionEnvironment = require("./ExecutionEnvironment");
24
-
25
- var DefaultDOMPropertyConfig = require("./DefaultDOMPropertyConfig");
26
-
21
+ var BeforeInputEventPlugin = require("./BeforeInputEventPlugin");
27
22
  var ChangeEventPlugin = require("./ChangeEventPlugin");
28
23
  var ClientReactRootIndex = require("./ClientReactRootIndex");
29
24
  var CompositionEventPlugin = require("./CompositionEventPlugin");
30
25
  var DefaultEventPluginOrder = require("./DefaultEventPluginOrder");
31
26
  var EnterLeaveEventPlugin = require("./EnterLeaveEventPlugin");
27
+ var ExecutionEnvironment = require("./ExecutionEnvironment");
28
+ var HTMLDOMPropertyConfig = require("./HTMLDOMPropertyConfig");
32
29
  var MobileSafariClickEventPlugin = require("./MobileSafariClickEventPlugin");
33
- var ReactEventTopLevelCallback = require("./ReactEventTopLevelCallback");
30
+ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
31
+ var ReactComponentBrowserEnvironment =
32
+ require("./ReactComponentBrowserEnvironment");
33
+ var ReactDefaultBatchingStrategy = require("./ReactDefaultBatchingStrategy");
34
34
  var ReactDOM = require("./ReactDOM");
35
35
  var ReactDOMButton = require("./ReactDOMButton");
36
36
  var ReactDOMForm = require("./ReactDOMForm");
@@ -39,19 +39,20 @@ var ReactDOMInput = require("./ReactDOMInput");
39
39
  var ReactDOMOption = require("./ReactDOMOption");
40
40
  var ReactDOMSelect = require("./ReactDOMSelect");
41
41
  var ReactDOMTextarea = require("./ReactDOMTextarea");
42
+ var ReactEventListener = require("./ReactEventListener");
43
+ var ReactInjection = require("./ReactInjection");
42
44
  var ReactInstanceHandles = require("./ReactInstanceHandles");
43
45
  var ReactMount = require("./ReactMount");
44
46
  var SelectEventPlugin = require("./SelectEventPlugin");
45
47
  var ServerReactRootIndex = require("./ServerReactRootIndex");
46
48
  var SimpleEventPlugin = require("./SimpleEventPlugin");
47
-
48
- var ReactDefaultBatchingStrategy = require("./ReactDefaultBatchingStrategy");
49
+ var SVGDOMPropertyConfig = require("./SVGDOMPropertyConfig");
49
50
 
50
51
  var createFullPageComponent = require("./createFullPageComponent");
51
52
 
52
53
  function inject() {
53
- ReactInjection.EventEmitter.injectTopLevelCallbackCreator(
54
- ReactEventTopLevelCallback
54
+ ReactInjection.EventEmitter.injectReactEventListener(
55
+ ReactEventListener
55
56
  );
56
57
 
57
58
  /**
@@ -71,7 +72,8 @@ function inject() {
71
72
  ChangeEventPlugin: ChangeEventPlugin,
72
73
  CompositionEventPlugin: CompositionEventPlugin,
73
74
  MobileSafariClickEventPlugin: MobileSafariClickEventPlugin,
74
- SelectEventPlugin: SelectEventPlugin
75
+ SelectEventPlugin: SelectEventPlugin,
76
+ BeforeInputEventPlugin: BeforeInputEventPlugin
75
77
  });
76
78
 
77
79
  ReactInjection.DOM.injectComponentClasses({
@@ -85,12 +87,21 @@ function inject() {
85
87
 
86
88
  html: createFullPageComponent(ReactDOM.html),
87
89
  head: createFullPageComponent(ReactDOM.head),
88
- title: createFullPageComponent(ReactDOM.title),
89
90
  body: createFullPageComponent(ReactDOM.body)
90
91
  });
91
92
 
92
- ReactInjection.DOMProperty.injectDOMPropertyConfig(DefaultDOMPropertyConfig);
93
+ // This needs to happen after createFullPageComponent() otherwise the mixin
94
+ // gets double injected.
95
+ ReactInjection.CompositeComponent.injectMixin(ReactBrowserComponentMixin);
96
+
97
+ ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
98
+ ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
93
99
 
100
+ ReactInjection.EmptyComponent.injectEmptyComponent(ReactDOM.noscript);
101
+
102
+ ReactInjection.Updates.injectReconcileTransaction(
103
+ ReactComponentBrowserEnvironment.ReactReconcileTransaction
104
+ );
94
105
  ReactInjection.Updates.injectBatchingStrategy(
95
106
  ReactDefaultBatchingStrategy
96
107
  );
@@ -101,6 +112,8 @@ function inject() {
101
112
  ServerReactRootIndex.createReactRootIndex
102
113
  );
103
114
 
115
+ ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
116
+
104
117
  if ("production" !== process.env.NODE_ENV) {
105
118
  var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
106
119
  if ((/[?&]react_perf\b/).test(url)) {