react 0.14.0-alpha1 → 0.14.0-beta2

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 (195) hide show
  1. package/README.md +5 -2
  2. package/addons.js +5 -2
  3. package/dist/JSXTransformer.js +634 -274
  4. package/dist/react-with-addons.js +5376 -4800
  5. package/dist/react-with-addons.min.js +6 -6
  6. package/dist/react.js +5175 -4626
  7. package/dist/react.min.js +6 -5
  8. package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +15 -5
  9. package/lib/BeforeInputEventPlugin.js +13 -13
  10. package/lib/CSSProperty.js +3 -0
  11. package/lib/CSSPropertyOperations.js +13 -13
  12. package/lib/CallbackQueue.js +4 -4
  13. package/lib/ChangeEventPlugin.js +16 -14
  14. package/lib/DOMChildrenOperations.js +10 -6
  15. package/lib/DOMProperty.js +82 -119
  16. package/lib/DOMPropertyOperations.js +78 -33
  17. package/lib/Danger.js +14 -16
  18. package/lib/DefaultEventPluginOrder.js +2 -2
  19. package/lib/EnterLeaveEventPlugin.js +8 -8
  20. package/lib/EventConstants.js +23 -1
  21. package/lib/EventPluginHub.js +13 -13
  22. package/lib/EventPluginRegistry.js +8 -8
  23. package/lib/EventPluginUtils.js +17 -17
  24. package/lib/EventPropagators.js +7 -7
  25. package/lib/FallbackCompositionState.js +3 -3
  26. package/lib/HTMLDOMPropertyConfig.js +14 -5
  27. package/lib/LinkedStateMixin.js +2 -2
  28. package/lib/LinkedValueUtils.js +50 -38
  29. package/lib/MetaMatchers.js +118 -0
  30. package/lib/OrderedMap.js +453 -0
  31. package/lib/PooledClass.js +14 -2
  32. package/lib/React.js +9 -111
  33. package/lib/ReactBrowserComponentMixin.js +4 -4
  34. package/lib/ReactBrowserEventEmitter.js +30 -7
  35. package/lib/ReactCSSTransitionGroup.js +16 -5
  36. package/lib/ReactCSSTransitionGroupChild.js +20 -11
  37. package/lib/ReactChildReconciler.js +25 -18
  38. package/lib/ReactChildren.js +24 -22
  39. package/lib/ReactClass.js +68 -86
  40. package/lib/ReactComponent.js +22 -17
  41. package/lib/ReactComponentBrowserEnvironment.js +2 -4
  42. package/lib/ReactComponentEnvironment.js +2 -2
  43. package/lib/ReactComponentWithPureRenderMixin.js +3 -3
  44. package/lib/ReactCompositeComponent.js +80 -111
  45. package/lib/ReactDOM.js +72 -158
  46. package/lib/ReactDOMButton.js +15 -26
  47. package/lib/ReactDOMComponent.js +384 -62
  48. package/lib/ReactDOMFactories.js +177 -0
  49. package/lib/ReactDOMIDOperations.js +23 -25
  50. package/lib/ReactDOMInput.js +83 -99
  51. package/lib/ReactDOMOption.js +38 -42
  52. package/lib/ReactDOMSelect.js +88 -98
  53. package/lib/ReactDOMSelection.js +3 -3
  54. package/lib/ReactDOMServer.js +24 -0
  55. package/lib/ReactDOMTextComponent.js +13 -13
  56. package/lib/ReactDOMTextarea.js +48 -61
  57. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  58. package/lib/ReactDefaultInjection.js +34 -71
  59. package/lib/ReactDefaultPerf.js +7 -7
  60. package/lib/ReactDefaultPerfAnalysis.js +6 -9
  61. package/lib/ReactElement.js +35 -92
  62. package/lib/ReactElementValidator.js +53 -130
  63. package/lib/ReactEmptyComponent.js +4 -4
  64. package/lib/ReactErrorUtils.js +1 -1
  65. package/lib/ReactEventEmitterMixin.js +3 -4
  66. package/lib/ReactEventListener.js +57 -12
  67. package/lib/ReactFragment.js +22 -17
  68. package/lib/ReactInjection.js +11 -11
  69. package/lib/ReactInputSelection.js +8 -7
  70. package/lib/ReactInstanceHandles.js +12 -12
  71. package/lib/ReactIsomorphic.js +70 -0
  72. package/lib/ReactLink.js +1 -1
  73. package/lib/ReactMarkupChecksum.js +6 -2
  74. package/lib/ReactMount.js +90 -89
  75. package/lib/ReactMultiChild.js +83 -22
  76. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  77. package/lib/ReactNativeComponent.js +3 -8
  78. package/lib/ReactNoopUpdateQueue.js +118 -0
  79. package/lib/ReactOwner.js +3 -3
  80. package/lib/ReactPerf.js +2 -2
  81. package/lib/ReactPropTransferer.js +3 -3
  82. package/lib/ReactPropTypeLocationNames.js +1 -1
  83. package/lib/ReactPropTypeLocations.js +1 -1
  84. package/lib/ReactPropTypes.js +72 -33
  85. package/lib/ReactReconcileTransaction.js +8 -8
  86. package/lib/ReactReconciler.js +18 -20
  87. package/lib/ReactRef.js +1 -1
  88. package/lib/ReactServerBatchingStrategy.js +23 -0
  89. package/lib/ReactServerRendering.js +22 -9
  90. package/lib/ReactServerRenderingTransaction.js +7 -7
  91. package/lib/ReactTestUtils.js +80 -58
  92. package/lib/ReactTransitionChildMapping.js +2 -2
  93. package/lib/ReactTransitionEvents.js +1 -1
  94. package/lib/ReactTransitionGroup.js +5 -6
  95. package/lib/ReactUpdateQueue.js +61 -36
  96. package/lib/ReactUpdates.js +14 -17
  97. package/lib/ReactWithAddons.js +14 -16
  98. package/lib/ResponderEventPlugin.js +514 -0
  99. package/lib/ResponderSyntheticEvent.js +40 -0
  100. package/lib/ResponderTouchHistoryStore.js +180 -0
  101. package/lib/SVGDOMPropertyConfig.js +1 -3
  102. package/lib/SelectEventPlugin.js +14 -15
  103. package/lib/SimpleEventPlugin.js +205 -29
  104. package/lib/SyntheticClipboardEvent.js +3 -3
  105. package/lib/SyntheticCompositionEvent.js +3 -3
  106. package/lib/SyntheticDragEvent.js +3 -3
  107. package/lib/SyntheticEvent.js +9 -8
  108. package/lib/SyntheticFocusEvent.js +3 -3
  109. package/lib/SyntheticInputEvent.js +3 -3
  110. package/lib/SyntheticKeyboardEvent.js +6 -6
  111. package/lib/SyntheticMouseEvent.js +5 -5
  112. package/lib/SyntheticTouchEvent.js +4 -4
  113. package/lib/SyntheticUIEvent.js +4 -4
  114. package/lib/SyntheticWheelEvent.js +3 -3
  115. package/lib/TapEventPlugin.js +119 -0
  116. package/lib/Transaction.js +16 -10
  117. package/lib/accumulate.js +44 -0
  118. package/lib/accumulateInto.js +2 -2
  119. package/lib/adler32.js +19 -9
  120. package/lib/cloneWithProps.js +12 -7
  121. package/lib/createHierarchyRenderer.js +85 -0
  122. package/lib/dangerousStyleValue.js +1 -1
  123. package/lib/deprecated.js +47 -0
  124. package/lib/findDOMNode.js +11 -12
  125. package/lib/flattenChildren.js +4 -4
  126. package/lib/forEachAccumulated.js +1 -1
  127. package/lib/getEventCharCode.js +1 -1
  128. package/lib/getEventKey.js +1 -1
  129. package/lib/getEventModifierState.js +0 -1
  130. package/lib/getTestDocument.js +28 -0
  131. package/lib/getTextContentAccessor.js +1 -1
  132. package/lib/instantiateReactComponent.js +24 -20
  133. package/lib/isEventSupported.js +1 -1
  134. package/lib/isTextInputElement.js +2 -1
  135. package/lib/joinClasses.js +1 -1
  136. package/lib/onlyChild.js +3 -3
  137. package/lib/quoteAttributeValueForBrowser.js +1 -1
  138. package/lib/reactComponentExpect.js +210 -0
  139. package/lib/renderSubtreeIntoContainer.js +1 -1
  140. package/lib/setInnerHTML.js +2 -2
  141. package/lib/setTextContent.js +3 -3
  142. package/lib/shallowCompare.js +1 -1
  143. package/lib/sliceChildren.js +51 -0
  144. package/lib/traverseAllChildren.js +24 -27
  145. package/lib/update.js +13 -13
  146. package/lib/validateDOMNesting.js +199 -100
  147. package/lib/webcomponents.js +6379 -0
  148. package/package.json +4 -6
  149. package/react.js +53 -1
  150. package/addons/CSSTransitionGroup.js +0 -1
  151. package/addons/LinkedStateMixin.js +0 -1
  152. package/addons/Perf.js +0 -1
  153. package/addons/PureRenderMixin.js +0 -1
  154. package/addons/TestUtils.js +0 -1
  155. package/addons/TransitionGroup.js +0 -1
  156. package/addons/batchedUpdates.js +0 -1
  157. package/addons/cloneWithProps.js +0 -1
  158. package/addons/createFragment.js +0 -1
  159. package/addons/renderSubtreeIntoContainer.js +0 -1
  160. package/addons/shallowCompare.js +0 -1
  161. package/addons/update.js +0 -1
  162. package/lib/CSSCore.js +0 -97
  163. package/lib/EventListener.js +0 -84
  164. package/lib/ExecutionEnvironment.js +0 -38
  165. package/lib/LocalEventTrapMixin.js +0 -46
  166. package/lib/ReactContext.js +0 -32
  167. package/lib/ReactDOMForm.js +0 -47
  168. package/lib/ReactDOMIframe.js +0 -43
  169. package/lib/ReactDOMImg.js +0 -44
  170. package/lib/ReactLifeCycle.js +0 -35
  171. package/lib/camelize.js +0 -32
  172. package/lib/camelizeStyleName.js +0 -40
  173. package/lib/containsNode.js +0 -55
  174. package/lib/createArrayFromMixed.js +0 -85
  175. package/lib/createFullPageComponent.js +0 -51
  176. package/lib/createNodesFromMarkup.js +0 -84
  177. package/lib/emptyFunction.js +0 -38
  178. package/lib/emptyObject.js +0 -20
  179. package/lib/focusNode.js +0 -26
  180. package/lib/getActiveElement.js +0 -29
  181. package/lib/getMarkupWrap.js +0 -115
  182. package/lib/getUnboundedScrollPosition.js +0 -38
  183. package/lib/hyphenate.js +0 -33
  184. package/lib/hyphenateStyleName.js +0 -39
  185. package/lib/invariant.js +0 -49
  186. package/lib/isNode.js +0 -23
  187. package/lib/isTextNode.js +0 -25
  188. package/lib/keyMirror.js +0 -48
  189. package/lib/keyOf.js +0 -35
  190. package/lib/mapObject.js +0 -51
  191. package/lib/performance.js +0 -23
  192. package/lib/performanceNow.js +0 -28
  193. package/lib/shallowEqual.js +0 -48
  194. package/lib/toArray.js +0 -57
  195. package/lib/warning.js +0 -61
@@ -11,80 +11,76 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
15
- var ReactClass = require("./ReactClass");
16
- var ReactDOMSelect = require("./ReactDOMSelect");
17
- var ReactElement = require("./ReactElement");
18
- var ReactInstanceMap = require("./ReactInstanceMap");
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>.') : null;
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 = ReactInstanceMap.get(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
- return option(props, this.props.children);
65
+ var content = '';
66
+
67
+ // Flatten children and warn if they aren't strings or numbers;
68
+ // invalid types are ignored.
69
+ ReactChildren.forEach(props.children, function (child) {
70
+ if (child == null) {
71
+ return;
72
+ }
73
+ if (typeof child === 'string' || typeof child === 'number') {
74
+ content += child;
75
+ } else {
76
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
77
+ }
78
+ });
79
+
80
+ nativeProps.children = content;
81
+ return nativeProps;
86
82
  }
87
83
 
88
- });
84
+ };
89
85
 
90
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._wrapperState.pendingUpdate && this._rootNodeID) {
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`
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright 2013-2015, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ *
9
+ * @providesModule ReactDOMServer
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var ReactDefaultInjection = require('./ReactDefaultInjection');
15
+ var ReactServerRendering = require('./ReactServerRendering');
16
+
17
+ ReactDefaultInjection.inject();
18
+
19
+ var ReactDOMServer = {
20
+ renderToString: ReactServerRendering.renderToString,
21
+ renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup
22
+ };
23
+
24
+ module.exports = ReactDOMServer;
@@ -12,13 +12,13 @@
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 DOMPropertyOperations = require('./DOMPropertyOperations');
16
+ var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');
17
+ var ReactDOMComponent = require('./ReactDOMComponent');
18
18
 
19
- var assign = require("./Object.assign");
20
- var escapeTextContentForBrowser = require("./escapeTextContentForBrowser");
21
- var validateDOMNesting = require("./validateDOMNesting");
19
+ var assign = require('./Object.assign');
20
+ var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
21
+ var validateDOMNesting = require('./validateDOMNesting');
22
22
 
23
23
  /**
24
24
  * Text nodes violate a couple assumptions that React makes about components:
@@ -35,7 +35,9 @@ var validateDOMNesting = require("./validateDOMNesting");
35
35
  * @extends ReactComponent
36
36
  * @internal
37
37
  */
38
- var ReactDOMTextComponent = function (props) {};
38
+ var ReactDOMTextComponent = function (props) {
39
+ // This constructor and its argument is currently used by mocks.
40
+ };
39
41
 
40
42
  assign(ReactDOMTextComponent.prototype, {
41
43
 
@@ -63,9 +65,9 @@ assign(ReactDOMTextComponent.prototype, {
63
65
  * @internal
64
66
  */
65
67
  mountComponent: function (rootID, transaction, context) {
66
- if ('production' !== process.env.NODE_ENV) {
67
- if (context[validateDOMNesting.tagStackContextKey]) {
68
- validateDOMNesting(context[validateDOMNesting.tagStackContextKey], 'span', null);
68
+ if (process.env.NODE_ENV !== 'production') {
69
+ if (context[validateDOMNesting.ancestorInfoContextKey]) {
70
+ validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
69
71
  }
70
72
  }
71
73
 
@@ -109,6 +111,4 @@ assign(ReactDOMTextComponent.prototype, {
109
111
 
110
112
  });
111
113
 
112
- module.exports = ReactDOMTextComponent;
113
-
114
- // This constructor and its argument is currently used by mocks.
114
+ module.exports = ReactDOMTextComponent;