react 0.14.0-alpha3 → 0.14.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 (200) hide show
  1. package/README.md +5 -2
  2. package/addons.js +8 -3
  3. package/dist/react-dom.js +42 -0
  4. package/dist/react-dom.min.js +12 -0
  5. package/dist/react-with-addons.js +6076 -5337
  6. package/dist/react-with-addons.min.js +6 -6
  7. package/dist/react.js +5445 -4839
  8. package/dist/react.min.js +6 -5
  9. package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +15 -5
  10. package/lib/BeforeInputEventPlugin.js +13 -13
  11. package/lib/CSSProperty.js +18 -3
  12. package/lib/CSSPropertyOperations.js +22 -14
  13. package/lib/CallbackQueue.js +4 -4
  14. package/lib/ChangeEventPlugin.js +18 -15
  15. package/lib/DOMChildrenOperations.js +17 -7
  16. package/lib/DOMProperty.js +82 -117
  17. package/lib/DOMPropertyOperations.js +84 -33
  18. package/lib/Danger.js +21 -16
  19. package/lib/DefaultEventPluginOrder.js +2 -2
  20. package/lib/EnterLeaveEventPlugin.js +21 -13
  21. package/lib/EventConstants.js +23 -1
  22. package/lib/EventPluginHub.js +17 -20
  23. package/lib/EventPluginRegistry.js +8 -8
  24. package/lib/EventPluginUtils.js +33 -42
  25. package/lib/EventPropagators.js +8 -8
  26. package/lib/FallbackCompositionState.js +9 -3
  27. package/lib/HTMLDOMPropertyConfig.js +19 -3
  28. package/lib/LinkedStateMixin.js +2 -2
  29. package/lib/LinkedValueUtils.js +50 -38
  30. package/lib/MetaMatchers.js +118 -0
  31. package/lib/OrderedMap.js +453 -0
  32. package/lib/PooledClass.js +15 -5
  33. package/lib/React.js +18 -7
  34. package/lib/ReactBrowserComponentMixin.js +4 -4
  35. package/lib/ReactBrowserEventEmitter.js +30 -7
  36. package/lib/ReactCSSTransitionGroup.js +35 -9
  37. package/lib/ReactCSSTransitionGroupChild.js +56 -30
  38. package/lib/ReactChildReconciler.js +24 -19
  39. package/lib/ReactChildren.js +75 -35
  40. package/lib/ReactClass.js +70 -87
  41. package/lib/ReactComponent.js +27 -20
  42. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  43. package/lib/ReactComponentEnvironment.js +2 -2
  44. package/lib/ReactComponentWithPureRenderMixin.js +3 -3
  45. package/lib/ReactCompositeComponent.js +117 -106
  46. package/lib/ReactDOM.js +74 -158
  47. package/lib/ReactDOMButton.js +15 -26
  48. package/lib/ReactDOMComponent.js +441 -72
  49. package/lib/ReactDOMFactories.js +177 -0
  50. package/lib/{emptyObject.js → ReactDOMFeatureFlags.js} +6 -8
  51. package/lib/ReactDOMIDOperations.js +8 -66
  52. package/lib/ReactDOMInput.js +87 -99
  53. package/lib/ReactDOMOption.js +25 -44
  54. package/lib/ReactDOMSelect.js +88 -98
  55. package/lib/ReactDOMSelection.js +3 -3
  56. package/lib/ReactDOMServer.js +5 -3
  57. package/lib/ReactDOMTextComponent.js +33 -20
  58. package/lib/ReactDOMTextarea.js +48 -61
  59. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  60. package/lib/ReactDefaultInjection.js +23 -72
  61. package/lib/ReactDefaultPerf.js +7 -7
  62. package/lib/ReactDefaultPerfAnalysis.js +6 -11
  63. package/lib/ReactElement.js +92 -107
  64. package/lib/ReactElementValidator.js +53 -173
  65. package/lib/ReactEmptyComponent.js +26 -62
  66. package/lib/ReactEmptyComponentRegistry.js +48 -0
  67. package/lib/ReactErrorUtils.js +45 -9
  68. package/lib/ReactEventEmitterMixin.js +3 -4
  69. package/lib/ReactEventListener.js +64 -12
  70. package/lib/ReactFragment.js +29 -115
  71. package/lib/ReactInjection.js +10 -12
  72. package/lib/ReactInputSelection.js +8 -7
  73. package/lib/ReactInstanceHandles.js +12 -12
  74. package/lib/ReactIsomorphic.js +15 -11
  75. package/lib/ReactLink.js +1 -1
  76. package/lib/ReactMarkupChecksum.js +6 -2
  77. package/lib/ReactMount.js +196 -122
  78. package/lib/ReactMultiChild.js +119 -25
  79. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  80. package/lib/ReactNativeComponent.js +3 -8
  81. package/lib/ReactNoopUpdateQueue.js +118 -0
  82. package/lib/ReactOwner.js +3 -3
  83. package/lib/ReactPerf.js +2 -2
  84. package/lib/ReactPropTransferer.js +3 -3
  85. package/lib/ReactPropTypeLocationNames.js +1 -1
  86. package/lib/ReactPropTypeLocations.js +1 -1
  87. package/lib/ReactPropTypes.js +41 -12
  88. package/lib/ReactReconcileTransaction.js +12 -10
  89. package/lib/ReactReconciler.js +8 -11
  90. package/lib/ReactRef.js +15 -2
  91. package/lib/ReactServerBatchingStrategy.js +23 -0
  92. package/lib/ReactServerRendering.js +22 -9
  93. package/lib/ReactServerRenderingTransaction.js +8 -7
  94. package/lib/ReactTestUtils.js +89 -64
  95. package/lib/ReactTransitionChildMapping.js +3 -6
  96. package/lib/ReactTransitionEvents.js +1 -1
  97. package/lib/ReactTransitionGroup.js +5 -6
  98. package/lib/ReactUpdateQueue.js +60 -35
  99. package/lib/ReactUpdates.js +15 -18
  100. package/lib/{isTextNode.js → ReactVersion.js} +2 -13
  101. package/lib/ReactWithAddons.js +24 -17
  102. package/lib/ResponderEventPlugin.js +514 -0
  103. package/lib/ResponderSyntheticEvent.js +40 -0
  104. package/lib/ResponderTouchHistoryStore.js +180 -0
  105. package/lib/SVGDOMPropertyConfig.js +1 -1
  106. package/lib/SelectEventPlugin.js +25 -16
  107. package/lib/SimpleEventPlugin.js +200 -45
  108. package/lib/SyntheticClipboardEvent.js +3 -3
  109. package/lib/SyntheticCompositionEvent.js +3 -3
  110. package/lib/SyntheticDragEvent.js +3 -3
  111. package/lib/SyntheticEvent.js +24 -8
  112. package/lib/SyntheticFocusEvent.js +3 -3
  113. package/lib/SyntheticInputEvent.js +3 -3
  114. package/lib/SyntheticKeyboardEvent.js +6 -6
  115. package/lib/SyntheticMouseEvent.js +5 -5
  116. package/lib/SyntheticTouchEvent.js +4 -4
  117. package/lib/SyntheticUIEvent.js +4 -4
  118. package/lib/SyntheticWheelEvent.js +3 -3
  119. package/lib/TapEventPlugin.js +119 -0
  120. package/lib/Transaction.js +17 -11
  121. package/lib/accumulate.js +44 -0
  122. package/lib/accumulateInto.js +2 -2
  123. package/lib/adler32.js +19 -7
  124. package/lib/cloneWithProps.js +12 -7
  125. package/lib/createHierarchyRenderer.js +85 -0
  126. package/lib/dangerousStyleValue.js +1 -1
  127. package/lib/deprecated.js +48 -0
  128. package/lib/findDOMNode.js +11 -12
  129. package/lib/flattenChildren.js +4 -4
  130. package/lib/forEachAccumulated.js +1 -1
  131. package/lib/getEventCharCode.js +1 -1
  132. package/lib/getEventKey.js +1 -1
  133. package/lib/getEventModifierState.js +0 -1
  134. package/lib/getTestDocument.js +28 -0
  135. package/lib/getTextContentAccessor.js +1 -1
  136. package/lib/instantiateReactComponent.js +27 -25
  137. package/lib/isEventSupported.js +1 -1
  138. package/lib/isTextInputElement.js +2 -1
  139. package/lib/joinClasses.js +1 -1
  140. package/lib/onlyChild.js +3 -3
  141. package/lib/quoteAttributeValueForBrowser.js +1 -1
  142. package/lib/reactComponentExpect.js +216 -0
  143. package/lib/renderSubtreeIntoContainer.js +1 -1
  144. package/lib/setInnerHTML.js +2 -2
  145. package/lib/setTextContent.js +3 -3
  146. package/lib/shallowCompare.js +1 -1
  147. package/lib/shouldUpdateReactComponent.js +12 -8
  148. package/lib/sliceChildren.js +34 -0
  149. package/lib/traverseAllChildren.js +21 -19
  150. package/lib/update.js +13 -13
  151. package/lib/validateDOMNesting.js +6 -6
  152. package/lib/webcomponents.js +6379 -0
  153. package/package.json +4 -6
  154. package/react.js +2 -0
  155. package/addons/CSSTransitionGroup.js +0 -1
  156. package/addons/LinkedStateMixin.js +0 -1
  157. package/addons/Perf.js +0 -1
  158. package/addons/PureRenderMixin.js +0 -1
  159. package/addons/TestUtils.js +0 -1
  160. package/addons/TransitionGroup.js +0 -1
  161. package/addons/batchedUpdates.js +0 -1
  162. package/addons/cloneWithProps.js +0 -1
  163. package/addons/createFragment.js +0 -1
  164. package/addons/renderSubtreeIntoContainer.js +0 -1
  165. package/addons/shallowCompare.js +0 -1
  166. package/addons/update.js +0 -1
  167. package/dist/JSXTransformer.js +0 -17589
  168. package/lib/CSSCore.js +0 -97
  169. package/lib/EventListener.js +0 -84
  170. package/lib/ExecutionEnvironment.js +0 -38
  171. package/lib/LocalEventTrapMixin.js +0 -46
  172. package/lib/ReactContext.js +0 -32
  173. package/lib/ReactDOMClient.js +0 -85
  174. package/lib/ReactDOMForm.js +0 -47
  175. package/lib/ReactDOMIframe.js +0 -43
  176. package/lib/ReactDOMImg.js +0 -44
  177. package/lib/ReactLifeCycle.js +0 -35
  178. package/lib/camelize.js +0 -32
  179. package/lib/camelizeStyleName.js +0 -40
  180. package/lib/containsNode.js +0 -55
  181. package/lib/createArrayFromMixed.js +0 -85
  182. package/lib/createFullPageComponent.js +0 -51
  183. package/lib/createNodesFromMarkup.js +0 -84
  184. package/lib/emptyFunction.js +0 -38
  185. package/lib/focusNode.js +0 -26
  186. package/lib/getActiveElement.js +0 -29
  187. package/lib/getMarkupWrap.js +0 -115
  188. package/lib/getUnboundedScrollPosition.js +0 -38
  189. package/lib/hyphenate.js +0 -33
  190. package/lib/hyphenateStyleName.js +0 -39
  191. package/lib/invariant.js +0 -49
  192. package/lib/isNode.js +0 -23
  193. package/lib/keyMirror.js +0 -48
  194. package/lib/keyOf.js +0 -35
  195. package/lib/mapObject.js +0 -51
  196. package/lib/performance.js +0 -23
  197. package/lib/performanceNow.js +0 -28
  198. package/lib/shallowEqual.js +0 -48
  199. package/lib/toArray.js +0 -57
  200. package/lib/warning.js +0 -61
@@ -11,95 +11,76 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
15
- var ReactChildren = require("./ReactChildren");
16
- var ReactClass = require("./ReactClass");
17
- var ReactDOMSelect = require("./ReactDOMSelect");
18
- var ReactElement = require("./ReactElement");
19
- var ReactPropTypes = require("./ReactPropTypes");
14
+ var ReactChildren = require('./ReactChildren');
15
+ var ReactDOMSelect = require('./ReactDOMSelect');
20
16
 
21
- var assign = require("./Object.assign");
22
- var warning = require("./warning");
23
-
24
- var option = ReactElement.createFactory('option');
17
+ var assign = require('./Object.assign');
18
+ var warning = require('fbjs/lib/warning');
25
19
 
26
20
  var valueContextKey = ReactDOMSelect.valueContextKey;
27
21
 
28
22
  /**
29
23
  * Implements an <option> native component that warns when `selected` is set.
30
24
  */
31
- var ReactDOMOption = ReactClass.createClass({
32
- displayName: 'ReactDOMOption',
33
- tagName: 'OPTION',
34
-
35
- mixins: [ReactBrowserComponentMixin],
36
-
37
- getInitialState: function () {
38
- return { selected: null };
39
- },
40
-
41
- contextTypes: (function () {
42
- var obj = {};
43
- obj[valueContextKey] = ReactPropTypes.any;
44
- return obj;
45
- })(),
46
-
47
- componentWillMount: function () {
25
+ var ReactDOMOption = {
26
+ mountWrapper: function (inst, props, context) {
48
27
  // TODO (yungsters): Remove support for `selected` in <option>.
49
- if ('production' !== process.env.NODE_ENV) {
50
- 'production' !== process.env.NODE_ENV ? warning(this.props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
28
+ if (process.env.NODE_ENV !== 'production') {
29
+ process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
51
30
  }
52
31
 
53
- // Look up whether this option is 'selected' via parent-based context
54
- var context = this.context;
32
+ // Look up whether this option is 'selected' via context
55
33
  var selectValue = context[valueContextKey];
56
34
 
57
35
  // If context key is null (e.g., no specified value or after initial mount)
58
- // or missing (e.g., for <datalist>) skip props
36
+ // or missing (e.g., for <datalist>), we don't change props.selected
37
+ var selected = null;
59
38
  if (selectValue != null) {
60
- var selected = false;
39
+ selected = false;
61
40
  if (Array.isArray(selectValue)) {
62
41
  // multiple
63
42
  for (var i = 0; i < selectValue.length; i++) {
64
- if ('' + selectValue[i] === '' + this.props.value) {
43
+ if ('' + selectValue[i] === '' + props.value) {
65
44
  selected = true;
66
45
  break;
67
46
  }
68
47
  }
69
48
  } else {
70
- selected = '' + selectValue === '' + this.props.value;
49
+ selected = '' + selectValue === '' + props.value;
71
50
  }
72
- this.setState({ selected: selected });
73
51
  }
52
+
53
+ inst._wrapperState = { selected: selected };
74
54
  },
75
55
 
76
- render: function () {
77
- var props = this.props;
56
+ getNativeProps: function (inst, props, context) {
57
+ var nativeProps = assign({ selected: undefined, children: undefined }, props);
78
58
 
79
59
  // Read state only from initial mount because <select> updates value
80
60
  // manually; we need the initial state only for server rendering
81
- if (this.state.selected != null) {
82
- props = assign({}, props, { selected: this.state.selected });
61
+ if (inst._wrapperState.selected != null) {
62
+ nativeProps.selected = inst._wrapperState.selected;
83
63
  }
84
64
 
85
65
  var content = '';
86
66
 
87
67
  // Flatten children and warn if they aren't strings or numbers;
88
68
  // invalid types are ignored.
89
- ReactChildren.forEach(this.props.children, function (child) {
69
+ ReactChildren.forEach(props.children, function (child) {
90
70
  if (child == null) {
91
71
  return;
92
72
  }
93
73
  if (typeof child === 'string' || typeof child === 'number') {
94
74
  content += child;
95
75
  } else {
96
- 'production' !== process.env.NODE_ENV ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
76
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
97
77
  }
98
78
  });
99
79
 
100
- return option(props, content);
80
+ nativeProps.children = content;
81
+ return nativeProps;
101
82
  }
102
83
 
103
- });
84
+ };
104
85
 
105
86
  module.exports = ReactDOMOption;
@@ -11,61 +11,72 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var AutoFocusMixin = require("./AutoFocusMixin");
15
- var LinkedValueUtils = require("./LinkedValueUtils");
16
- var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
17
- var ReactClass = require("./ReactClass");
18
- var ReactElement = require("./ReactElement");
19
- var ReactUpdates = require("./ReactUpdates");
20
- var ReactPropTypes = require("./ReactPropTypes");
14
+ var LinkedValueUtils = require('./LinkedValueUtils');
15
+ var ReactMount = require('./ReactMount');
16
+ var ReactUpdates = require('./ReactUpdates');
21
17
 
22
- var assign = require("./Object.assign");
23
- var findDOMNode = require("./findDOMNode");
24
-
25
- var select = ReactElement.createFactory('select');
18
+ var assign = require('./Object.assign');
19
+ var warning = require('fbjs/lib/warning');
26
20
 
27
21
  var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
28
22
 
29
23
  function updateOptionsIfPendingUpdateAndMounted() {
30
- /*jshint validthis:true */
31
- if (this._pendingUpdate) {
32
- this._pendingUpdate = false;
33
- var value = LinkedValueUtils.getValue(this.props);
34
- if (value != null && this.isMounted()) {
35
- updateOptions(this, value);
24
+ if (this._rootNodeID && this._wrapperState.pendingUpdate) {
25
+ this._wrapperState.pendingUpdate = false;
26
+
27
+ var props = this._currentElement.props;
28
+ var value = LinkedValueUtils.getValue(props);
29
+
30
+ if (value != null) {
31
+ updateOptions(this, props, value);
36
32
  }
37
33
  }
38
34
  }
39
35
 
36
+ function getDeclarationErrorAddendum(owner) {
37
+ if (owner) {
38
+ var name = owner.getName();
39
+ if (name) {
40
+ return ' Check the render method of `' + name + '`.';
41
+ }
42
+ }
43
+ return '';
44
+ }
45
+
46
+ var valuePropNames = ['value', 'defaultValue'];
47
+
40
48
  /**
41
49
  * Validation function for `value` and `defaultValue`.
42
50
  * @private
43
51
  */
44
- function selectValueType(props, propName, componentName) {
45
- if (props[propName] == null) {
46
- return null;
47
- }
48
- if (props.multiple) {
49
- if (!Array.isArray(props[propName])) {
50
- return new Error('The `' + propName + '` prop supplied to <select> must be an array if ' + '`multiple` is true.');
52
+ function checkSelectPropTypes(inst, props) {
53
+ var owner = inst._currentElement._owner;
54
+ LinkedValueUtils.checkPropTypes('select', props, owner);
55
+
56
+ for (var i = 0; i < valuePropNames.length; i++) {
57
+ var propName = valuePropNames[i];
58
+ if (props[propName] == null) {
59
+ continue;
51
60
  }
52
- } else {
53
- if (Array.isArray(props[propName])) {
54
- return new Error('The `' + propName + '` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.');
61
+ if (props.multiple) {
62
+ process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
63
+ } else {
64
+ process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
55
65
  }
56
66
  }
57
67
  }
58
68
 
59
69
  /**
60
- * @param {ReactComponent} component Instance of ReactDOMSelect
70
+ * @param {ReactDOMComponent} inst
71
+ * @param {boolean} multiple
61
72
  * @param {*} propValue A stringable (with `multiple`, a list of stringables).
62
73
  * @private
63
74
  */
64
- function updateOptions(component, propValue) {
75
+ function updateOptions(inst, multiple, propValue) {
65
76
  var selectedValue, i;
66
- var options = findDOMNode(component).options;
77
+ var options = ReactMount.getNode(inst._rootNodeID).options;
67
78
 
68
- if (component.props.multiple) {
79
+ if (multiple) {
69
80
  selectedValue = {};
70
81
  for (i = 0; i < propValue.length; i++) {
71
82
  selectedValue['' + propValue[i]] = true;
@@ -107,92 +118,71 @@ function updateOptions(component, propValue) {
107
118
  * If `defaultValue` is provided, any options with the supplied values will be
108
119
  * selected.
109
120
  */
110
- var ReactDOMSelect = ReactClass.createClass({
111
- displayName: 'ReactDOMSelect',
112
- tagName: 'SELECT',
113
-
114
- mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
115
-
116
- statics: {
117
- valueContextKey: valueContextKey
121
+ var ReactDOMSelect = {
122
+ valueContextKey: valueContextKey,
123
+
124
+ getNativeProps: function (inst, props, context) {
125
+ return assign({}, props, {
126
+ onChange: inst._wrapperState.onChange,
127
+ value: undefined
128
+ });
118
129
  },
119
130
 
120
- propTypes: {
121
- defaultValue: selectValueType,
122
- value: selectValueType
123
- },
124
-
125
- getInitialState: function () {
126
- // Pass down initial value so initial generated markup has correct
127
- // `selected` attributes
128
- var value = LinkedValueUtils.getValue(this.props);
129
- if (value != null) {
130
- return { initialValue: value };
131
- } else {
132
- return { initialValue: this.props.defaultValue };
131
+ mountWrapper: function (inst, props) {
132
+ if (process.env.NODE_ENV !== 'production') {
133
+ checkSelectPropTypes(inst, props);
133
134
  }
134
- },
135
135
 
136
- childContextTypes: (function () {
137
- var obj = {};
138
- obj[valueContextKey] = ReactPropTypes.any;
139
- return obj;
140
- })(),
141
-
142
- getChildContext: function () {
143
- var obj = {};
144
- obj[valueContextKey] = this.state.initialValue;
145
- return obj;
136
+ var value = LinkedValueUtils.getValue(props);
137
+ inst._wrapperState = {
138
+ pendingUpdate: false,
139
+ initialValue: value != null ? value : props.defaultValue,
140
+ onChange: _handleChange.bind(inst),
141
+ wasMultiple: Boolean(props.multiple)
142
+ };
146
143
  },
147
144
 
148
- render: function () {
149
- // Clone `this.props` so we don't mutate the input.
150
- var props = assign({}, this.props);
151
-
152
- props.onChange = this._handleChange;
153
- props.value = null;
154
-
155
- return select(props, this.props.children);
145
+ processChildContext: function (inst, props, context) {
146
+ // Pass down initial value so initial generated markup has correct
147
+ // `selected` attributes
148
+ var childContext = assign({}, context);
149
+ childContext[valueContextKey] = inst._wrapperState.initialValue;
150
+ return childContext;
156
151
  },
157
152
 
158
- componentWillMount: function () {
159
- this._pendingUpdate = false;
160
- },
153
+ postUpdateWrapper: function (inst) {
154
+ var props = inst._currentElement.props;
161
155
 
162
- componentWillReceiveProps: function (nextProps) {
163
156
  // After the initial mount, we control selected-ness manually so don't pass
164
157
  // the context value down
165
- this.setState({ initialValue: null });
166
- },
158
+ inst._wrapperState.initialValue = undefined;
159
+
160
+ var wasMultiple = inst._wrapperState.wasMultiple;
161
+ inst._wrapperState.wasMultiple = Boolean(props.multiple);
167
162
 
168
- componentDidUpdate: function (prevProps) {
169
- var value = LinkedValueUtils.getValue(this.props);
163
+ var value = LinkedValueUtils.getValue(props);
170
164
  if (value != null) {
171
- this._pendingUpdate = false;
172
- updateOptions(this, value);
173
- } else if (!prevProps.multiple !== !this.props.multiple) {
165
+ inst._wrapperState.pendingUpdate = false;
166
+ updateOptions(inst, Boolean(props.multiple), value);
167
+ } else if (wasMultiple !== Boolean(props.multiple)) {
174
168
  // For simplicity, reapply `defaultValue` if `multiple` is toggled.
175
- if (this.props.defaultValue != null) {
176
- updateOptions(this, this.props.defaultValue);
169
+ if (props.defaultValue != null) {
170
+ updateOptions(inst, Boolean(props.multiple), props.defaultValue);
177
171
  } else {
178
172
  // Revert the select back to its default unselected state.
179
- updateOptions(this, this.props.multiple ? [] : '');
173
+ updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
180
174
  }
181
175
  }
182
- },
183
-
184
- _handleChange: function (event) {
185
- var returnValue;
186
- var onChange = LinkedValueUtils.getOnChange(this.props);
187
- if (onChange) {
188
- returnValue = onChange.call(this, event);
189
- }
190
-
191
- this._pendingUpdate = true;
192
- ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
193
- return returnValue;
194
176
  }
177
+ };
195
178
 
196
- });
179
+ function _handleChange(event) {
180
+ var props = this._currentElement.props;
181
+ var returnValue = LinkedValueUtils.executeOnChange(props, event);
182
+
183
+ this._wrapperState.pendingUpdate = true;
184
+ ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
185
+ return returnValue;
186
+ }
197
187
 
198
188
  module.exports = ReactDOMSelect;
@@ -11,10 +11,10 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ExecutionEnvironment = require("./ExecutionEnvironment");
14
+ var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
15
15
 
16
- var getNodeForCharacterOffset = require("./getNodeForCharacterOffset");
17
- var getTextContentAccessor = require("./getTextContentAccessor");
16
+ var getNodeForCharacterOffset = require('./getNodeForCharacterOffset');
17
+ var getTextContentAccessor = require('./getTextContentAccessor');
18
18
 
19
19
  /**
20
20
  * While `isCollapsed` is available on the Selection object and `collapsed`
@@ -11,14 +11,16 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactDefaultInjection = require("./ReactDefaultInjection");
15
- var ReactServerRendering = require("./ReactServerRendering");
14
+ var ReactDefaultInjection = require('./ReactDefaultInjection');
15
+ var ReactServerRendering = require('./ReactServerRendering');
16
+ var ReactVersion = require('./ReactVersion');
16
17
 
17
18
  ReactDefaultInjection.inject();
18
19
 
19
20
  var ReactDOMServer = {
20
21
  renderToString: ReactServerRendering.renderToString,
21
- renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup
22
+ renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
23
+ version: ReactVersion
22
24
  };
23
25
 
24
26
  module.exports = ReactDOMServer;
@@ -12,13 +12,15 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var DOMPropertyOperations = require("./DOMPropertyOperations");
16
- var ReactComponentBrowserEnvironment = require("./ReactComponentBrowserEnvironment");
17
- var ReactDOMComponent = require("./ReactDOMComponent");
15
+ var DOMChildrenOperations = require('./DOMChildrenOperations');
16
+ var DOMPropertyOperations = require('./DOMPropertyOperations');
17
+ var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');
18
+ var ReactMount = require('./ReactMount');
18
19
 
19
- var assign = require("./Object.assign");
20
- var escapeTextContentForBrowser = require("./escapeTextContentForBrowser");
21
- var validateDOMNesting = require("./validateDOMNesting");
20
+ var assign = require('./Object.assign');
21
+ var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
22
+ var setTextContent = require('./setTextContent');
23
+ var validateDOMNesting = require('./validateDOMNesting');
22
24
 
23
25
  /**
24
26
  * Text nodes violate a couple assumptions that React makes about components:
@@ -35,7 +37,9 @@ var validateDOMNesting = require("./validateDOMNesting");
35
37
  * @extends ReactComponent
36
38
  * @internal
37
39
  */
38
- var ReactDOMTextComponent = function (props) {};
40
+ var ReactDOMTextComponent = function (props) {
41
+ // This constructor and its argument is currently used by mocks.
42
+ };
39
43
 
40
44
  assign(ReactDOMTextComponent.prototype, {
41
45
 
@@ -63,23 +67,33 @@ assign(ReactDOMTextComponent.prototype, {
63
67
  * @internal
64
68
  */
65
69
  mountComponent: function (rootID, transaction, context) {
66
- if ('production' !== process.env.NODE_ENV) {
70
+ if (process.env.NODE_ENV !== 'production') {
67
71
  if (context[validateDOMNesting.ancestorInfoContextKey]) {
68
72
  validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
69
73
  }
70
74
  }
71
75
 
72
76
  this._rootNodeID = rootID;
73
- var escapedText = escapeTextContentForBrowser(this._stringText);
77
+ if (transaction.useCreateElement) {
78
+ var ownerDocument = context[ReactMount.ownerDocumentContextKey];
79
+ var el = ownerDocument.createElement('span');
80
+ DOMPropertyOperations.setAttributeForID(el, rootID);
81
+ // Populate node cache
82
+ ReactMount.getID(el);
83
+ setTextContent(el, this._stringText);
84
+ return el;
85
+ } else {
86
+ var escapedText = escapeTextContentForBrowser(this._stringText);
87
+
88
+ if (transaction.renderToStaticMarkup) {
89
+ // Normally we'd wrap this in a `span` for the reasons stated above, but
90
+ // since this is a situation where React won't take over (static pages),
91
+ // we can simply return the text as it is.
92
+ return escapedText;
93
+ }
74
94
 
75
- if (transaction.renderToStaticMarkup) {
76
- // Normally we'd wrap this in a `span` for the reasons stated above, but
77
- // since this is a situation where React won't take over (static pages),
78
- // we can simply return the text as it is.
79
- return escapedText;
95
+ return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
80
96
  }
81
-
82
- return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
83
97
  },
84
98
 
85
99
  /**
@@ -98,7 +112,8 @@ assign(ReactDOMTextComponent.prototype, {
98
112
  // and/or updateComponent to do the actual update for consistency with
99
113
  // other component types?
100
114
  this._stringText = nextStringText;
101
- ReactDOMComponent.BackendIDOperations.updateTextContentByID(this._rootNodeID, nextStringText);
115
+ var node = ReactMount.getNode(this._rootNodeID);
116
+ DOMChildrenOperations.updateTextContent(node, nextStringText);
102
117
  }
103
118
  }
104
119
  },
@@ -109,6 +124,4 @@ assign(ReactDOMTextComponent.prototype, {
109
124
 
110
125
  });
111
126
 
112
- module.exports = ReactDOMTextComponent;
113
-
114
- // This constructor and its argument is currently used by mocks.
127
+ module.exports = ReactDOMTextComponent;