react 0.14.0-beta1 → 0.14.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 (173) hide show
  1. package/addons.js +8 -3
  2. package/dist/react-with-addons.js +5048 -4095
  3. package/dist/react-with-addons.min.js +6 -6
  4. package/dist/react.js +4555 -3729
  5. package/dist/react.min.js +6 -5
  6. package/lib/AutoFocusUtils.js +3 -3
  7. package/lib/BeforeInputEventPlugin.js +13 -13
  8. package/lib/CSSProperty.js +18 -3
  9. package/lib/CSSPropertyOperations.js +27 -14
  10. package/lib/CallbackQueue.js +4 -4
  11. package/lib/ChangeEventPlugin.js +15 -14
  12. package/lib/DOMChildrenOperations.js +22 -7
  13. package/lib/DOMProperty.js +8 -8
  14. package/lib/DOMPropertyOperations.js +23 -10
  15. package/lib/Danger.js +21 -16
  16. package/lib/DefaultEventPluginOrder.js +2 -2
  17. package/lib/EnterLeaveEventPlugin.js +18 -10
  18. package/lib/EventConstants.js +23 -1
  19. package/lib/EventPluginHub.js +29 -21
  20. package/lib/EventPluginRegistry.js +8 -8
  21. package/lib/EventPluginUtils.js +34 -38
  22. package/lib/EventPropagators.js +8 -8
  23. package/lib/FallbackCompositionState.js +9 -3
  24. package/lib/HTMLDOMPropertyConfig.js +24 -4
  25. package/lib/LinkedStateMixin.js +2 -2
  26. package/lib/LinkedValueUtils.js +8 -8
  27. package/lib/MetaMatchers.js +118 -0
  28. package/lib/OrderedMap.js +453 -0
  29. package/lib/PooledClass.js +3 -5
  30. package/lib/React.js +18 -7
  31. package/lib/ReactBrowserComponentMixin.js +4 -4
  32. package/lib/ReactBrowserEventEmitter.js +36 -7
  33. package/lib/ReactCSSTransitionGroup.js +35 -9
  34. package/lib/ReactCSSTransitionGroupChild.js +48 -30
  35. package/lib/ReactChildReconciler.js +24 -19
  36. package/lib/ReactChildren.js +72 -32
  37. package/lib/ReactClass.js +46 -46
  38. package/lib/ReactComponent.js +18 -16
  39. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  40. package/lib/ReactComponentEnvironment.js +2 -2
  41. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  42. package/lib/ReactCompositeComponent.js +95 -44
  43. package/lib/ReactDOM.js +74 -159
  44. package/lib/ReactDOMComponent.js +235 -93
  45. package/lib/ReactDOMFactories.js +177 -0
  46. package/lib/{emptyObject.js → ReactDOMFeatureFlags.js} +6 -8
  47. package/lib/ReactDOMIDOperations.js +8 -81
  48. package/lib/ReactDOMInput.js +18 -9
  49. package/lib/ReactDOMOption.js +7 -7
  50. package/lib/ReactDOMSelect.js +9 -9
  51. package/lib/ReactDOMSelection.js +19 -3
  52. package/lib/ReactDOMServer.js +5 -3
  53. package/lib/ReactDOMTextComponent.js +33 -20
  54. package/lib/ReactDOMTextarea.js +14 -12
  55. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  56. package/lib/ReactDefaultInjection.js +23 -25
  57. package/lib/ReactDefaultPerf.js +17 -11
  58. package/lib/ReactDefaultPerfAnalysis.js +13 -12
  59. package/lib/ReactElement.js +85 -39
  60. package/lib/ReactElementValidator.js +47 -90
  61. package/lib/ReactEmptyComponent.js +26 -62
  62. package/lib/ReactEmptyComponentRegistry.js +48 -0
  63. package/lib/ReactErrorUtils.js +53 -9
  64. package/lib/ReactEventEmitterMixin.js +2 -2
  65. package/lib/ReactEventListener.js +33 -21
  66. package/lib/ReactFragment.js +27 -118
  67. package/lib/ReactInjection.js +10 -12
  68. package/lib/ReactInputSelection.js +4 -4
  69. package/lib/ReactInstanceHandles.js +10 -11
  70. package/lib/ReactIsomorphic.js +15 -11
  71. package/lib/ReactLink.js +2 -2
  72. package/lib/ReactMarkupChecksum.js +6 -2
  73. package/lib/ReactMount.js +186 -85
  74. package/lib/ReactMultiChild.js +119 -25
  75. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  76. package/lib/ReactNativeComponent.js +3 -3
  77. package/lib/ReactNoopUpdateQueue.js +3 -3
  78. package/lib/ReactOwner.js +3 -3
  79. package/lib/ReactPerf.js +2 -2
  80. package/lib/ReactPropTransferer.js +3 -3
  81. package/lib/ReactPropTypeLocationNames.js +1 -1
  82. package/lib/ReactPropTypeLocations.js +1 -1
  83. package/lib/ReactPropTypes.js +38 -9
  84. package/lib/ReactReconcileTransaction.js +10 -8
  85. package/lib/ReactReconciler.js +5 -6
  86. package/lib/ReactRef.js +14 -2
  87. package/lib/ReactServerBatchingStrategy.js +5 -5
  88. package/lib/ReactServerRendering.js +12 -12
  89. package/lib/ReactServerRenderingTransaction.js +6 -5
  90. package/lib/ReactTestUtils.js +47 -39
  91. package/lib/ReactTransitionChildMapping.js +3 -6
  92. package/lib/ReactTransitionEvents.js +1 -1
  93. package/lib/ReactTransitionGroup.js +5 -6
  94. package/lib/ReactUpdateQueue.js +19 -19
  95. package/lib/ReactUpdates.js +15 -15
  96. package/lib/{performance.js → ReactVersion.js} +3 -12
  97. package/lib/ReactWithAddons.js +24 -15
  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 -1
  102. package/lib/SelectEventPlugin.js +19 -9
  103. package/lib/SimpleEventPlugin.js +198 -43
  104. package/lib/SyntheticClipboardEvent.js +1 -1
  105. package/lib/SyntheticCompositionEvent.js +1 -1
  106. package/lib/SyntheticDragEvent.js +1 -1
  107. package/lib/SyntheticEvent.js +18 -4
  108. package/lib/SyntheticFocusEvent.js +1 -1
  109. package/lib/SyntheticInputEvent.js +1 -1
  110. package/lib/SyntheticKeyboardEvent.js +4 -4
  111. package/lib/SyntheticMouseEvent.js +3 -3
  112. package/lib/SyntheticTouchEvent.js +2 -2
  113. package/lib/SyntheticUIEvent.js +2 -2
  114. package/lib/SyntheticWheelEvent.js +1 -1
  115. package/lib/TapEventPlugin.js +119 -0
  116. package/lib/Transaction.js +7 -7
  117. package/lib/accumulate.js +44 -0
  118. package/lib/accumulateInto.js +2 -2
  119. package/lib/adler32.js +19 -7
  120. package/lib/cloneWithProps.js +11 -6
  121. package/lib/createHierarchyRenderer.js +85 -0
  122. package/lib/dangerousStyleValue.js +1 -1
  123. package/lib/deprecated.js +7 -6
  124. package/lib/findDOMNode.js +9 -9
  125. package/lib/flattenChildren.js +4 -4
  126. package/lib/getEventKey.js +1 -1
  127. package/lib/{isTextNode.js → getTestDocument.js} +7 -11
  128. package/lib/getTextContentAccessor.js +1 -1
  129. package/lib/instantiateReactComponent.js +15 -17
  130. package/lib/isEventSupported.js +1 -1
  131. package/lib/onlyChild.js +3 -3
  132. package/lib/quoteAttributeValueForBrowser.js +1 -1
  133. package/lib/reactComponentExpect.js +216 -0
  134. package/lib/renderSubtreeIntoContainer.js +1 -1
  135. package/lib/setInnerHTML.js +1 -1
  136. package/lib/setTextContent.js +3 -3
  137. package/lib/shallowCompare.js +1 -1
  138. package/lib/shouldUpdateReactComponent.js +12 -8
  139. package/lib/sliceChildren.js +34 -0
  140. package/lib/traverseAllChildren.js +25 -18
  141. package/lib/update.js +13 -13
  142. package/lib/validateDOMNesting.js +6 -6
  143. package/lib/webcomponents.js +6379 -0
  144. package/package.json +4 -6
  145. package/react.js +1 -51
  146. package/dist/JSXTransformer.js +0 -17588
  147. package/lib/CSSCore.js +0 -97
  148. package/lib/EventListener.js +0 -84
  149. package/lib/ExecutionEnvironment.js +0 -38
  150. package/lib/ReactDOMClient.js +0 -90
  151. package/lib/camelize.js +0 -32
  152. package/lib/camelizeStyleName.js +0 -40
  153. package/lib/containsNode.js +0 -55
  154. package/lib/createArrayFromMixed.js +0 -85
  155. package/lib/createNodesFromMarkup.js +0 -84
  156. package/lib/emptyFunction.js +0 -38
  157. package/lib/focusNode.js +0 -26
  158. package/lib/getActiveElement.js +0 -29
  159. package/lib/getMarkupWrap.js +0 -93
  160. package/lib/getUnboundedScrollPosition.js +0 -38
  161. package/lib/hyphenate.js +0 -33
  162. package/lib/hyphenateStyleName.js +0 -39
  163. package/lib/invariant.js +0 -49
  164. package/lib/isNode.js +0 -23
  165. package/lib/joinClasses.js +0 -39
  166. package/lib/keyMirror.js +0 -48
  167. package/lib/keyOf.js +0 -35
  168. package/lib/mapObject.js +0 -51
  169. package/lib/memoizeStringOnly.js +0 -31
  170. package/lib/performanceNow.js +0 -28
  171. package/lib/shallowEqual.js +0 -48
  172. package/lib/toArray.js +0 -57
  173. package/lib/warning.js +0 -57
@@ -0,0 +1,177 @@
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 ReactDOMFactories
10
+ * @typechecks static-only
11
+ */
12
+
13
+ 'use strict';
14
+
15
+ var ReactElement = require('./ReactElement');
16
+ var ReactElementValidator = require('./ReactElementValidator');
17
+
18
+ var mapObject = require('fbjs/lib/mapObject');
19
+
20
+ /**
21
+ * Create a factory that creates HTML tag elements.
22
+ *
23
+ * @param {string} tag Tag name (e.g. `div`).
24
+ * @private
25
+ */
26
+ function createDOMFactory(tag) {
27
+ if (process.env.NODE_ENV !== 'production') {
28
+ return ReactElementValidator.createFactory(tag);
29
+ }
30
+ return ReactElement.createFactory(tag);
31
+ }
32
+
33
+ /**
34
+ * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
35
+ * This is also accessible via `React.DOM`.
36
+ *
37
+ * @public
38
+ */
39
+ var ReactDOMFactories = mapObject({
40
+ a: 'a',
41
+ abbr: 'abbr',
42
+ address: 'address',
43
+ area: 'area',
44
+ article: 'article',
45
+ aside: 'aside',
46
+ audio: 'audio',
47
+ b: 'b',
48
+ base: 'base',
49
+ bdi: 'bdi',
50
+ bdo: 'bdo',
51
+ big: 'big',
52
+ blockquote: 'blockquote',
53
+ body: 'body',
54
+ br: 'br',
55
+ button: 'button',
56
+ canvas: 'canvas',
57
+ caption: 'caption',
58
+ cite: 'cite',
59
+ code: 'code',
60
+ col: 'col',
61
+ colgroup: 'colgroup',
62
+ data: 'data',
63
+ datalist: 'datalist',
64
+ dd: 'dd',
65
+ del: 'del',
66
+ details: 'details',
67
+ dfn: 'dfn',
68
+ dialog: 'dialog',
69
+ div: 'div',
70
+ dl: 'dl',
71
+ dt: 'dt',
72
+ em: 'em',
73
+ embed: 'embed',
74
+ fieldset: 'fieldset',
75
+ figcaption: 'figcaption',
76
+ figure: 'figure',
77
+ footer: 'footer',
78
+ form: 'form',
79
+ h1: 'h1',
80
+ h2: 'h2',
81
+ h3: 'h3',
82
+ h4: 'h4',
83
+ h5: 'h5',
84
+ h6: 'h6',
85
+ head: 'head',
86
+ header: 'header',
87
+ hgroup: 'hgroup',
88
+ hr: 'hr',
89
+ html: 'html',
90
+ i: 'i',
91
+ iframe: 'iframe',
92
+ img: 'img',
93
+ input: 'input',
94
+ ins: 'ins',
95
+ kbd: 'kbd',
96
+ keygen: 'keygen',
97
+ label: 'label',
98
+ legend: 'legend',
99
+ li: 'li',
100
+ link: 'link',
101
+ main: 'main',
102
+ map: 'map',
103
+ mark: 'mark',
104
+ menu: 'menu',
105
+ menuitem: 'menuitem',
106
+ meta: 'meta',
107
+ meter: 'meter',
108
+ nav: 'nav',
109
+ noscript: 'noscript',
110
+ object: 'object',
111
+ ol: 'ol',
112
+ optgroup: 'optgroup',
113
+ option: 'option',
114
+ output: 'output',
115
+ p: 'p',
116
+ param: 'param',
117
+ picture: 'picture',
118
+ pre: 'pre',
119
+ progress: 'progress',
120
+ q: 'q',
121
+ rp: 'rp',
122
+ rt: 'rt',
123
+ ruby: 'ruby',
124
+ s: 's',
125
+ samp: 'samp',
126
+ script: 'script',
127
+ section: 'section',
128
+ select: 'select',
129
+ small: 'small',
130
+ source: 'source',
131
+ span: 'span',
132
+ strong: 'strong',
133
+ style: 'style',
134
+ sub: 'sub',
135
+ summary: 'summary',
136
+ sup: 'sup',
137
+ table: 'table',
138
+ tbody: 'tbody',
139
+ td: 'td',
140
+ textarea: 'textarea',
141
+ tfoot: 'tfoot',
142
+ th: 'th',
143
+ thead: 'thead',
144
+ time: 'time',
145
+ title: 'title',
146
+ tr: 'tr',
147
+ track: 'track',
148
+ u: 'u',
149
+ ul: 'ul',
150
+ 'var': 'var',
151
+ video: 'video',
152
+ wbr: 'wbr',
153
+
154
+ // SVG
155
+ circle: 'circle',
156
+ clipPath: 'clipPath',
157
+ defs: 'defs',
158
+ ellipse: 'ellipse',
159
+ g: 'g',
160
+ image: 'image',
161
+ line: 'line',
162
+ linearGradient: 'linearGradient',
163
+ mask: 'mask',
164
+ path: 'path',
165
+ pattern: 'pattern',
166
+ polygon: 'polygon',
167
+ polyline: 'polyline',
168
+ radialGradient: 'radialGradient',
169
+ rect: 'rect',
170
+ stop: 'stop',
171
+ svg: 'svg',
172
+ text: 'text',
173
+ tspan: 'tspan'
174
+
175
+ }, createDOMFactory);
176
+
177
+ module.exports = ReactDOMFactories;
@@ -6,15 +6,13 @@
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @providesModule emptyObject
9
+ * @providesModule ReactDOMFeatureFlags
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
- var emptyObject = {};
14
+ var ReactDOMFeatureFlags = {
15
+ useCreateElement: false
16
+ };
15
17
 
16
- if ("production" !== process.env.NODE_ENV) {
17
- Object.freeze(emptyObject);
18
- }
19
-
20
- module.exports = emptyObject;
18
+ module.exports = ReactDOMFeatureFlags;
@@ -12,17 +12,15 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var CSSPropertyOperations = require("./CSSPropertyOperations");
16
- var DOMChildrenOperations = require("./DOMChildrenOperations");
17
- var DOMPropertyOperations = require("./DOMPropertyOperations");
18
- var ReactMount = require("./ReactMount");
19
- var ReactPerf = require("./ReactPerf");
15
+ var DOMChildrenOperations = require('./DOMChildrenOperations');
16
+ var DOMPropertyOperations = require('./DOMPropertyOperations');
17
+ var ReactMount = require('./ReactMount');
18
+ var ReactPerf = require('./ReactPerf');
20
19
 
21
- var invariant = require("./invariant");
22
- var setInnerHTML = require("./setInnerHTML");
20
+ var invariant = require('fbjs/lib/invariant');
23
21
 
24
22
  /**
25
- * Errors for properties that should not be updated with `updatePropertyById()`.
23
+ * Errors for properties that should not be updated with `updatePropertyByID()`.
26
24
  *
27
25
  * @type {object}
28
26
  * @private
@@ -33,8 +31,7 @@ var INVALID_PROPERTY_ERRORS = {
33
31
  };
34
32
 
35
33
  /**
36
- * Operations used to process updates to DOM nodes. This is made injectable via
37
- * `ReactDOMComponent.BackendIDOperations`.
34
+ * Operations used to process updates to DOM nodes.
38
35
  */
39
36
  var ReactDOMIDOperations = {
40
37
 
@@ -49,7 +46,7 @@ var ReactDOMIDOperations = {
49
46
  */
50
47
  updatePropertyByID: function (id, name, value) {
51
48
  var node = ReactMount.getNode(id);
52
- !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
49
+ !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
53
50
 
54
51
  // If we're updating to null or undefined, we should remove the property
55
52
  // from the DOM node instead of inadvertantly setting to a string. This
@@ -61,71 +58,6 @@ var ReactDOMIDOperations = {
61
58
  }
62
59
  },
63
60
 
64
- /**
65
- * Updates a DOM node with new property values.
66
- *
67
- * @param {string} id ID of the node to update.
68
- * @param {string} name A valid property name.
69
- * @param {*} value New value of the property.
70
- * @internal
71
- */
72
- updateAttributeByID: function (id, name, value) {
73
- var node = ReactMount.getNode(id);
74
- !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
75
- DOMPropertyOperations.setValueForAttribute(node, name, value);
76
- },
77
-
78
- /**
79
- * Updates a DOM node to remove a property. This should only be used to remove
80
- * DOM properties in `DOMProperty`.
81
- *
82
- * @param {string} id ID of the node to update.
83
- * @param {string} name A property name to remove, see `DOMProperty`.
84
- * @internal
85
- */
86
- deletePropertyByID: function (id, name, value) {
87
- var node = ReactMount.getNode(id);
88
- !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
89
- DOMPropertyOperations.deleteValueForProperty(node, name, value);
90
- },
91
-
92
- /**
93
- * Updates a DOM node with new style values. If a value is specified as '',
94
- * the corresponding style property will be unset.
95
- *
96
- * @param {string} id ID of the node to update.
97
- * @param {object} styles Mapping from styles to values.
98
- * @internal
99
- */
100
- updateStylesByID: function (id, styles) {
101
- var node = ReactMount.getNode(id);
102
- CSSPropertyOperations.setValueForStyles(node, styles);
103
- },
104
-
105
- /**
106
- * Updates a DOM node's innerHTML.
107
- *
108
- * @param {string} id ID of the node to update.
109
- * @param {string} html An HTML string.
110
- * @internal
111
- */
112
- updateInnerHTMLByID: function (id, html) {
113
- var node = ReactMount.getNode(id);
114
- setInnerHTML(node, html);
115
- },
116
-
117
- /**
118
- * Updates a DOM node's text content set by `props.content`.
119
- *
120
- * @param {string} id ID of the node to update.
121
- * @param {string} content Text content.
122
- * @internal
123
- */
124
- updateTextContentByID: function (id, content) {
125
- var node = ReactMount.getNode(id);
126
- DOMChildrenOperations.updateTextContent(node, content);
127
- },
128
-
129
61
  /**
130
62
  * Replaces a DOM node that exists in the document with markup.
131
63
  *
@@ -155,11 +87,6 @@ var ReactDOMIDOperations = {
155
87
  };
156
88
 
157
89
  ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
158
- updatePropertyByID: 'updatePropertyByID',
159
- deletePropertyByID: 'deletePropertyByID',
160
- updateStylesByID: 'updateStylesByID',
161
- updateInnerHTMLByID: 'updateInnerHTMLByID',
162
- updateTextContentByID: 'updateTextContentByID',
163
90
  dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID',
164
91
  dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
165
92
  });
@@ -11,13 +11,13 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactDOMIDOperations = require("./ReactDOMIDOperations");
15
- var LinkedValueUtils = require("./LinkedValueUtils");
16
- var ReactMount = require("./ReactMount");
17
- var ReactUpdates = require("./ReactUpdates");
14
+ var ReactDOMIDOperations = require('./ReactDOMIDOperations');
15
+ var LinkedValueUtils = require('./LinkedValueUtils');
16
+ var ReactMount = require('./ReactMount');
17
+ var ReactUpdates = require('./ReactUpdates');
18
18
 
19
- var assign = require("./Object.assign");
20
- var invariant = require("./invariant");
19
+ var assign = require('./Object.assign');
20
+ var invariant = require('fbjs/lib/invariant');
21
21
 
22
22
  var instancesByReactID = {};
23
23
 
@@ -61,7 +61,9 @@ var ReactDOMInput = {
61
61
  },
62
62
 
63
63
  mountWrapper: function (inst, props) {
64
- LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
64
+ if (process.env.NODE_ENV !== 'production') {
65
+ LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
66
+ }
65
67
 
66
68
  var defaultValue = props.defaultValue;
67
69
  inst._wrapperState = {
@@ -69,7 +71,10 @@ var ReactDOMInput = {
69
71
  initialValue: defaultValue != null ? defaultValue : null,
70
72
  onChange: _handleChange.bind(inst)
71
73
  };
74
+ },
72
75
 
76
+ mountReadyWrapper: function (inst) {
77
+ // Can't be in mountWrapper or else server rendering leaks.
73
78
  instancesByReactID[inst._rootNodeID] = inst;
74
79
  },
75
80
 
@@ -127,10 +132,14 @@ function _handleChange(event) {
127
132
  if (otherNode === rootNode || otherNode.form !== rootNode.form) {
128
133
  continue;
129
134
  }
135
+ // This will throw if radio buttons rendered by different copies of React
136
+ // and the same name are rendered into the same form (same as #1939).
137
+ // That's probably okay; we don't support it just as we don't support
138
+ // mixing React with non-React.
130
139
  var otherID = ReactMount.getID(otherNode);
131
- !otherID ? 'production' !== process.env.NODE_ENV ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
140
+ !otherID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
132
141
  var otherInstance = instancesByReactID[otherID];
133
- !otherInstance ? 'production' !== process.env.NODE_ENV ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
142
+ !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
134
143
  // If this is a controlled radio button group, forcing the input that
135
144
  // was previously checked to update will cause it to be come re-checked
136
145
  // as appropriate.
@@ -11,11 +11,11 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactChildren = require("./ReactChildren");
15
- var ReactDOMSelect = require("./ReactDOMSelect");
14
+ var ReactChildren = require('./ReactChildren');
15
+ var ReactDOMSelect = require('./ReactDOMSelect');
16
16
 
17
- var assign = require("./Object.assign");
18
- var warning = require("./warning");
17
+ var assign = require('./Object.assign');
18
+ var warning = require('fbjs/lib/warning');
19
19
 
20
20
  var valueContextKey = ReactDOMSelect.valueContextKey;
21
21
 
@@ -25,8 +25,8 @@ var valueContextKey = ReactDOMSelect.valueContextKey;
25
25
  var ReactDOMOption = {
26
26
  mountWrapper: function (inst, props, context) {
27
27
  // TODO (yungsters): Remove support for `selected` in <option>.
28
- if ('production' !== process.env.NODE_ENV) {
29
- 'production' !== process.env.NODE_ENV ? warning(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;
30
30
  }
31
31
 
32
32
  // Look up whether this option is 'selected' via context
@@ -73,7 +73,7 @@ var ReactDOMOption = {
73
73
  if (typeof child === 'string' || typeof child === 'number') {
74
74
  content += child;
75
75
  } else {
76
- '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;
77
77
  }
78
78
  });
79
79
 
@@ -11,17 +11,17 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var LinkedValueUtils = require("./LinkedValueUtils");
15
- var ReactMount = require("./ReactMount");
16
- var ReactUpdates = require("./ReactUpdates");
14
+ var LinkedValueUtils = require('./LinkedValueUtils');
15
+ var ReactMount = require('./ReactMount');
16
+ var ReactUpdates = require('./ReactUpdates');
17
17
 
18
- var assign = require("./Object.assign");
19
- var warning = require("./warning");
18
+ var assign = require('./Object.assign');
19
+ var warning = require('fbjs/lib/warning');
20
20
 
21
21
  var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
22
22
 
23
23
  function updateOptionsIfPendingUpdateAndMounted() {
24
- if (this._wrapperState.pendingUpdate && this._rootNodeID) {
24
+ if (this._rootNodeID && this._wrapperState.pendingUpdate) {
25
25
  this._wrapperState.pendingUpdate = false;
26
26
 
27
27
  var props = this._currentElement.props;
@@ -59,9 +59,9 @@ function checkSelectPropTypes(inst, props) {
59
59
  continue;
60
60
  }
61
61
  if (props.multiple) {
62
- 'production' !== process.env.NODE_ENV ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
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
63
  } else {
64
- 'production' !== process.env.NODE_ENV ? 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;
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;
65
65
  }
66
66
  }
67
67
  }
@@ -129,7 +129,7 @@ var ReactDOMSelect = {
129
129
  },
130
130
 
131
131
  mountWrapper: function (inst, props) {
132
- if ('production' !== process.env.NODE_ENV) {
132
+ if (process.env.NODE_ENV !== 'production') {
133
133
  checkSelectPropTypes(inst, props);
134
134
  }
135
135