react 0.14.0-alpha2 → 0.14.0-beta3

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 (196) hide show
  1. package/README.md +5 -2
  2. package/addons.js +6 -3
  3. package/dist/JSXTransformer.js +634 -274
  4. package/dist/react-with-addons.js +5350 -4954
  5. package/dist/react-with-addons.min.js +6 -6
  6. package/dist/react.js +4777 -4408
  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 -117
  16. package/lib/DOMPropertyOperations.js +78 -33
  17. package/lib/Danger.js +14 -14
  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 +13 -3
  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 +6 -6
  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 +9 -9
  39. package/lib/ReactClass.js +65 -83
  40. package/lib/ReactComponent.js +22 -17
  41. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  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 +378 -56
  48. package/lib/ReactDOMFactories.js +177 -0
  49. package/lib/ReactDOMIDOperations.js +23 -23
  50. package/lib/ReactDOMInput.js +83 -99
  51. package/lib/ReactDOMOption.js +25 -45
  52. package/lib/ReactDOMSelect.js +88 -98
  53. package/lib/ReactDOMSelection.js +3 -3
  54. package/lib/ReactDOMServer.js +2 -2
  55. package/lib/ReactDOMTextComponent.js +11 -11
  56. package/lib/ReactDOMTextarea.js +48 -61
  57. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  58. package/lib/ReactDefaultInjection.js +24 -71
  59. package/lib/ReactDefaultPerf.js +7 -7
  60. package/lib/ReactDefaultPerfAnalysis.js +6 -9
  61. package/lib/ReactElement.js +22 -83
  62. package/lib/ReactElementValidator.js +48 -117
  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 +11 -11
  72. package/lib/ReactLink.js +1 -1
  73. package/lib/ReactMarkupChecksum.js +6 -2
  74. package/lib/ReactMount.js +88 -88
  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 +49 -11
  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 -1
  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 -7
  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 +15 -14
  145. package/lib/update.js +13 -13
  146. package/lib/validateDOMNesting.js +14 -6
  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/ReactDOMClient.js +0 -85
  168. package/lib/ReactDOMForm.js +0 -47
  169. package/lib/ReactDOMIframe.js +0 -43
  170. package/lib/ReactDOMImg.js +0 -44
  171. package/lib/ReactLifeCycle.js +0 -35
  172. package/lib/camelize.js +0 -32
  173. package/lib/camelizeStyleName.js +0 -40
  174. package/lib/containsNode.js +0 -55
  175. package/lib/createArrayFromMixed.js +0 -85
  176. package/lib/createFullPageComponent.js +0 -51
  177. package/lib/createNodesFromMarkup.js +0 -84
  178. package/lib/emptyFunction.js +0 -38
  179. package/lib/emptyObject.js +0 -20
  180. package/lib/focusNode.js +0 -26
  181. package/lib/getActiveElement.js +0 -29
  182. package/lib/getMarkupWrap.js +0 -115
  183. package/lib/getUnboundedScrollPosition.js +0 -38
  184. package/lib/hyphenate.js +0 -33
  185. package/lib/hyphenateStyleName.js +0 -39
  186. package/lib/invariant.js +0 -49
  187. package/lib/isNode.js +0 -23
  188. package/lib/isTextNode.js +0 -25
  189. package/lib/keyMirror.js +0 -48
  190. package/lib/keyOf.js +0 -35
  191. package/lib/mapObject.js +0 -51
  192. package/lib/performance.js +0 -23
  193. package/lib/performanceNow.js +0 -28
  194. package/lib/shallowEqual.js +0 -48
  195. package/lib/toArray.js +0 -57
  196. package/lib/warning.js +0 -61
@@ -12,16 +12,37 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var DOMProperty = require("./DOMProperty");
15
+ var DOMProperty = require('./DOMProperty');
16
16
 
17
- var quoteAttributeValueForBrowser = require("./quoteAttributeValueForBrowser");
18
- var warning = require("./warning");
17
+ var quoteAttributeValueForBrowser = require('./quoteAttributeValueForBrowser');
18
+ var warning = require('fbjs/lib/warning');
19
19
 
20
- function shouldIgnoreValue(name, value) {
21
- return value == null || DOMProperty.hasBooleanValue[name] && !value || DOMProperty.hasNumericValue[name] && isNaN(value) || DOMProperty.hasPositiveNumericValue[name] && value < 1 || DOMProperty.hasOverloadedBooleanValue[name] && value === false;
20
+ // Simplified subset
21
+ var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][a-zA-Z_\.\-\d]*$/;
22
+ var illegalAttributeNameCache = {};
23
+ var validatedAttributeNameCache = {};
24
+
25
+ function isAttributeNameSafe(attributeName) {
26
+ if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
27
+ return true;
28
+ }
29
+ if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
30
+ return false;
31
+ }
32
+ if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
33
+ validatedAttributeNameCache[attributeName] = true;
34
+ return true;
35
+ }
36
+ illegalAttributeNameCache[attributeName] = true;
37
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined;
38
+ return false;
39
+ }
40
+
41
+ function shouldIgnoreValue(propertyInfo, value) {
42
+ return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
22
43
  }
23
44
 
24
- if ('production' !== process.env.NODE_ENV) {
45
+ if (process.env.NODE_ENV !== 'production') {
25
46
  var reactProps = {
26
47
  children: true,
27
48
  dangerouslySetInnerHTML: true,
@@ -43,7 +64,7 @@ if ('production' !== process.env.NODE_ENV) {
43
64
 
44
65
  // For now, only warn when we have a suggested correction. This prevents
45
66
  // logging too much when using transferPropsTo.
46
- 'production' !== process.env.NODE_ENV ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : null;
67
+ process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined;
47
68
  };
48
69
  }
49
70
 
@@ -70,12 +91,13 @@ var DOMPropertyOperations = {
70
91
  * @return {?string} Markup string, or null if the property was invalid.
71
92
  */
72
93
  createMarkupForProperty: function (name, value) {
73
- if (DOMProperty.isStandardName.hasOwnProperty(name) && DOMProperty.isStandardName[name]) {
74
- if (shouldIgnoreValue(name, value)) {
94
+ var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
95
+ if (propertyInfo) {
96
+ if (shouldIgnoreValue(propertyInfo, value)) {
75
97
  return '';
76
98
  }
77
- var attributeName = DOMProperty.getAttributeName[name];
78
- if (DOMProperty.hasBooleanValue[name] || DOMProperty.hasOverloadedBooleanValue[name] && value === true) {
99
+ var attributeName = propertyInfo.attributeName;
100
+ if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
79
101
  return attributeName + '=""';
80
102
  }
81
103
  return attributeName + '=' + quoteAttributeValueForBrowser(value);
@@ -84,12 +106,26 @@ var DOMPropertyOperations = {
84
106
  return '';
85
107
  }
86
108
  return name + '=' + quoteAttributeValueForBrowser(value);
87
- } else if ('production' !== process.env.NODE_ENV) {
109
+ } else if (process.env.NODE_ENV !== 'production') {
88
110
  warnUnknownProperty(name);
89
111
  }
90
112
  return null;
91
113
  },
92
114
 
115
+ /**
116
+ * Creates markup for a custom property.
117
+ *
118
+ * @param {string} name
119
+ * @param {*} value
120
+ * @return {string} Markup string, or empty string if the property was invalid.
121
+ */
122
+ createMarkupForCustomAttribute: function (name, value) {
123
+ if (!isAttributeNameSafe(name) || value == null) {
124
+ return '';
125
+ }
126
+ return name + '=' + quoteAttributeValueForBrowser(value);
127
+ },
128
+
93
129
  /**
94
130
  * Sets the value for a property on a node.
95
131
  *
@@ -98,15 +134,16 @@ var DOMPropertyOperations = {
98
134
  * @param {*} value
99
135
  */
100
136
  setValueForProperty: function (node, name, value) {
101
- if (DOMProperty.isStandardName.hasOwnProperty(name) && DOMProperty.isStandardName[name]) {
102
- var mutationMethod = DOMProperty.getMutationMethod[name];
137
+ var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
138
+ if (propertyInfo) {
139
+ var mutationMethod = propertyInfo.mutationMethod;
103
140
  if (mutationMethod) {
104
141
  mutationMethod(node, value);
105
- } else if (shouldIgnoreValue(name, value)) {
142
+ } else if (shouldIgnoreValue(propertyInfo, value)) {
106
143
  this.deleteValueForProperty(node, name);
107
- } else if (DOMProperty.mustUseAttribute[name]) {
108
- var attributeName = DOMProperty.getAttributeName[name];
109
- var namespace = DOMProperty.getAttributeNamespace[name];
144
+ } else if (propertyInfo.mustUseAttribute) {
145
+ var attributeName = propertyInfo.attributeName;
146
+ var namespace = propertyInfo.attributeNamespace;
110
147
  // `setAttribute` with objects becomes only `[object]` in IE8/9,
111
148
  // ('' + value) makes it output the correct toString()-value.
112
149
  if (namespace) {
@@ -115,26 +152,33 @@ var DOMPropertyOperations = {
115
152
  node.setAttribute(attributeName, '' + value);
116
153
  }
117
154
  } else {
118
- var propName = DOMProperty.getPropertyName[name];
155
+ var propName = propertyInfo.propertyName;
119
156
  // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
120
157
  // property type before comparing; only `value` does and is string.
121
- if (!DOMProperty.hasSideEffects[name] || '' + node[propName] !== '' + value) {
158
+ if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
122
159
  // Contrary to `setAttribute`, object properties are properly
123
160
  // `toString`ed by IE8/9.
124
161
  node[propName] = value;
125
162
  }
126
163
  }
127
164
  } else if (DOMProperty.isCustomAttribute(name)) {
128
- if (value == null) {
129
- node.removeAttribute(name);
130
- } else {
131
- node.setAttribute(name, '' + value);
132
- }
133
- } else if ('production' !== process.env.NODE_ENV) {
165
+ DOMPropertyOperations.setValueForAttribute(node, name, value);
166
+ } else if (process.env.NODE_ENV !== 'production') {
134
167
  warnUnknownProperty(name);
135
168
  }
136
169
  },
137
170
 
171
+ setValueForAttribute: function (node, name, value) {
172
+ if (!isAttributeNameSafe(name)) {
173
+ return;
174
+ }
175
+ if (value == null) {
176
+ node.removeAttribute(name);
177
+ } else {
178
+ node.setAttribute(name, '' + value);
179
+ }
180
+ },
181
+
138
182
  /**
139
183
  * Deletes the value for a property on a node.
140
184
  *
@@ -142,22 +186,23 @@ var DOMPropertyOperations = {
142
186
  * @param {string} name
143
187
  */
144
188
  deleteValueForProperty: function (node, name) {
145
- if (DOMProperty.isStandardName.hasOwnProperty(name) && DOMProperty.isStandardName[name]) {
146
- var mutationMethod = DOMProperty.getMutationMethod[name];
189
+ var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
190
+ if (propertyInfo) {
191
+ var mutationMethod = propertyInfo.mutationMethod;
147
192
  if (mutationMethod) {
148
193
  mutationMethod(node, undefined);
149
- } else if (DOMProperty.mustUseAttribute[name]) {
150
- node.removeAttribute(DOMProperty.getAttributeName[name]);
194
+ } else if (propertyInfo.mustUseAttribute) {
195
+ node.removeAttribute(propertyInfo.attributeName);
151
196
  } else {
152
- var propName = DOMProperty.getPropertyName[name];
197
+ var propName = propertyInfo.propertyName;
153
198
  var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName);
154
- if (!DOMProperty.hasSideEffects[name] || '' + node[propName] !== defaultValue) {
199
+ if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) {
155
200
  node[propName] = defaultValue;
156
201
  }
157
202
  }
158
203
  } else if (DOMProperty.isCustomAttribute(name)) {
159
204
  node.removeAttribute(name);
160
- } else if ('production' !== process.env.NODE_ENV) {
205
+ } else if (process.env.NODE_ENV !== 'production') {
161
206
  warnUnknownProperty(name);
162
207
  }
163
208
  }
package/lib/Danger.js CHANGED
@@ -12,12 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var ExecutionEnvironment = require("./ExecutionEnvironment");
15
+ var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
16
16
 
17
- var createNodesFromMarkup = require("./createNodesFromMarkup");
18
- var emptyFunction = require("./emptyFunction");
19
- var getMarkupWrap = require("./getMarkupWrap");
20
- var invariant = require("./invariant");
17
+ var createNodesFromMarkup = require('fbjs/lib/createNodesFromMarkup');
18
+ var emptyFunction = require('fbjs/lib/emptyFunction');
19
+ var getMarkupWrap = require('fbjs/lib/getMarkupWrap');
20
+ var invariant = require('fbjs/lib/invariant');
21
21
 
22
22
  var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
23
23
  var RESULT_INDEX_ATTR = 'data-danger-index';
@@ -49,12 +49,12 @@ var Danger = {
49
49
  * @internal
50
50
  */
51
51
  dangerouslyRenderMarkup: function (markupList) {
52
- 'production' !== process.env.NODE_ENV ? invariant(ExecutionEnvironment.canUseDOM, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'React.renderToString for server rendering.') : invariant(ExecutionEnvironment.canUseDOM);
52
+ !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'React.renderToString for server rendering.') : invariant(false) : undefined;
53
53
  var nodeName;
54
54
  var markupByNodeName = {};
55
55
  // Group markup by `nodeName` if a wrap is necessary, else by '*'.
56
56
  for (var i = 0; i < markupList.length; i++) {
57
- 'production' !== process.env.NODE_ENV ? invariant(markupList[i], 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(markupList[i]);
57
+ !markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined;
58
58
  nodeName = getNodeName(markupList[i]);
59
59
  nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
60
60
  markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
@@ -96,14 +96,14 @@ var Danger = {
96
96
  resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
97
97
  renderNode.removeAttribute(RESULT_INDEX_ATTR);
98
98
 
99
- 'production' !== process.env.NODE_ENV ? invariant(!resultList.hasOwnProperty(resultIndex), 'Danger: Assigning to an already-occupied result index.') : invariant(!resultList.hasOwnProperty(resultIndex));
99
+ !!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined;
100
100
 
101
101
  resultList[resultIndex] = renderNode;
102
102
 
103
103
  // This should match resultList.length and markupList.length when
104
104
  // we're done.
105
105
  resultListAssignmentCount += 1;
106
- } else if ('production' !== process.env.NODE_ENV) {
106
+ } else if (process.env.NODE_ENV !== 'production') {
107
107
  console.error('Danger: Discarding unexpected node:', renderNode);
108
108
  }
109
109
  }
@@ -111,9 +111,9 @@ var Danger = {
111
111
 
112
112
  // Although resultList was populated out of order, it should now be a dense
113
113
  // array.
114
- 'production' !== process.env.NODE_ENV ? invariant(resultListAssignmentCount === resultList.length, 'Danger: Did not assign to every index of resultList.') : invariant(resultListAssignmentCount === resultList.length);
114
+ !(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined;
115
115
 
116
- 'production' !== process.env.NODE_ENV ? invariant(resultList.length === markupList.length, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(resultList.length === markupList.length);
116
+ !(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined;
117
117
 
118
118
  return resultList;
119
119
  },
@@ -127,9 +127,9 @@ var Danger = {
127
127
  * @internal
128
128
  */
129
129
  dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
130
- 'production' !== process.env.NODE_ENV ? invariant(ExecutionEnvironment.canUseDOM, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'React.renderToString for server rendering.') : invariant(ExecutionEnvironment.canUseDOM);
131
- 'production' !== process.env.NODE_ENV ? invariant(markup, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(markup);
132
- 'production' !== process.env.NODE_ENV ? invariant(oldChild.tagName.toLowerCase() !== 'html', 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See React.renderToString().') : invariant(oldChild.tagName.toLowerCase() !== 'html');
130
+ !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'React.renderToString for server rendering.') : invariant(false) : undefined;
131
+ !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined;
132
+ !(oldChild.tagName.toLowerCase() !== 'html') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See React.renderToString().') : invariant(false) : undefined;
133
133
 
134
134
  var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
135
135
  oldChild.parentNode.replaceChild(newChild, oldChild);
@@ -11,7 +11,7 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var keyOf = require("./keyOf");
14
+ var keyOf = require('fbjs/lib/keyOf');
15
15
 
16
16
  /**
17
17
  * Module that is injectable into `EventPluginHub`, that specifies a
@@ -22,6 +22,6 @@ var keyOf = require("./keyOf");
22
22
  * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
23
23
  * preventing default on events is convenient in `SimpleEventPlugin` handlers.
24
24
  */
25
- var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null }), keyOf({ AnalyticsEventPlugin: null })];
25
+ var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
26
26
 
27
27
  module.exports = DefaultEventPluginOrder;
@@ -12,12 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var EventConstants = require("./EventConstants");
16
- var EventPropagators = require("./EventPropagators");
17
- var SyntheticMouseEvent = require("./SyntheticMouseEvent");
15
+ var EventConstants = require('./EventConstants');
16
+ var EventPropagators = require('./EventPropagators');
17
+ var SyntheticMouseEvent = require('./SyntheticMouseEvent');
18
18
 
19
- var ReactMount = require("./ReactMount");
20
- var keyOf = require("./keyOf");
19
+ var ReactMount = require('./ReactMount');
20
+ var keyOf = require('fbjs/lib/keyOf');
21
21
 
22
22
  var topLevelTypes = EventConstants.topLevelTypes;
23
23
  var getFirstReactDOM = ReactMount.getFirstReactDOM;
@@ -53,7 +53,7 @@ var EnterLeaveEventPlugin = {
53
53
  * @return {*} An accumulation of synthetic events.
54
54
  * @see {EventPluginHub.extractEvents}
55
55
  */
56
- extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) {
56
+ extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
57
57
  if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
58
58
  return null;
59
59
  }
@@ -93,12 +93,12 @@ var EnterLeaveEventPlugin = {
93
93
  var fromID = from ? ReactMount.getID(from) : '';
94
94
  var toID = to ? ReactMount.getID(to) : '';
95
95
 
96
- var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent);
96
+ var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget);
97
97
  leave.type = 'mouseleave';
98
98
  leave.target = from;
99
99
  leave.relatedTarget = to;
100
100
 
101
- var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent);
101
+ var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget);
102
102
  enter.type = 'mouseenter';
103
103
  enter.target = to;
104
104
  enter.relatedTarget = from;
@@ -11,7 +11,7 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var keyMirror = require("./keyMirror");
14
+ var keyMirror = require('fbjs/lib/keyMirror');
15
15
 
16
16
  var PropagationPhases = keyMirror({ bubbled: null, captured: null });
17
17
 
@@ -19,7 +19,10 @@ var PropagationPhases = keyMirror({ bubbled: null, captured: null });
19
19
  * Types of raw signals from the browser caught at the top level.
20
20
  */
21
21
  var topLevelTypes = keyMirror({
22
+ topAbort: null,
22
23
  topBlur: null,
24
+ topCanPlay: null,
25
+ topCanPlayThrough: null,
23
26
  topChange: null,
24
27
  topClick: null,
25
28
  topCompositionEnd: null,
@@ -37,6 +40,10 @@ var topLevelTypes = keyMirror({
37
40
  topDragOver: null,
38
41
  topDragStart: null,
39
42
  topDrop: null,
43
+ topDurationChange: null,
44
+ topEmptied: null,
45
+ topEncrypted: null,
46
+ topEnded: null,
40
47
  topError: null,
41
48
  topFocus: null,
42
49
  topInput: null,
@@ -44,21 +51,36 @@ var topLevelTypes = keyMirror({
44
51
  topKeyPress: null,
45
52
  topKeyUp: null,
46
53
  topLoad: null,
54
+ topLoadedData: null,
55
+ topLoadedMetadata: null,
56
+ topLoadStart: null,
47
57
  topMouseDown: null,
48
58
  topMouseMove: null,
49
59
  topMouseOut: null,
50
60
  topMouseOver: null,
51
61
  topMouseUp: null,
52
62
  topPaste: null,
63
+ topPause: null,
64
+ topPlay: null,
65
+ topPlaying: null,
66
+ topProgress: null,
67
+ topRateChange: null,
53
68
  topReset: null,
54
69
  topScroll: null,
70
+ topSeeked: null,
71
+ topSeeking: null,
55
72
  topSelectionChange: null,
73
+ topStalled: null,
74
+ topSuspend: null,
56
75
  topSubmit: null,
57
76
  topTextInput: null,
77
+ topTimeUpdate: null,
58
78
  topTouchCancel: null,
59
79
  topTouchEnd: null,
60
80
  topTouchMove: null,
61
81
  topTouchStart: null,
82
+ topVolumeChange: null,
83
+ topWaiting: null,
62
84
  topWheel: null
63
85
  });
64
86
 
@@ -11,13 +11,13 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var EventPluginRegistry = require("./EventPluginRegistry");
15
- var EventPluginUtils = require("./EventPluginUtils");
14
+ var EventPluginRegistry = require('./EventPluginRegistry');
15
+ var EventPluginUtils = require('./EventPluginUtils');
16
16
 
17
- var accumulateInto = require("./accumulateInto");
18
- var forEachAccumulated = require("./forEachAccumulated");
19
- var invariant = require("./invariant");
20
- var warning = require("./warning");
17
+ var accumulateInto = require('./accumulateInto');
18
+ var forEachAccumulated = require('./forEachAccumulated');
19
+ var invariant = require('fbjs/lib/invariant');
20
+ var warning = require('fbjs/lib/warning');
21
21
 
22
22
  /**
23
23
  * Internal store for event listeners
@@ -60,7 +60,7 @@ var InstanceHandle = null;
60
60
 
61
61
  function validateInstanceHandle() {
62
62
  var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
63
- 'production' !== process.env.NODE_ENV ? warning(valid, 'InstanceHandle not injected before use!') : null;
63
+ process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
64
64
  }
65
65
 
66
66
  /**
@@ -104,13 +104,13 @@ var EventPluginHub = {
104
104
  */
105
105
  injectInstanceHandle: function (InjectedInstanceHandle) {
106
106
  InstanceHandle = InjectedInstanceHandle;
107
- if ('production' !== process.env.NODE_ENV) {
107
+ if (process.env.NODE_ENV !== 'production') {
108
108
  validateInstanceHandle();
109
109
  }
110
110
  },
111
111
 
112
112
  getInstanceHandle: function () {
113
- if ('production' !== process.env.NODE_ENV) {
113
+ if (process.env.NODE_ENV !== 'production') {
114
114
  validateInstanceHandle();
115
115
  }
116
116
  return InstanceHandle;
@@ -141,7 +141,7 @@ var EventPluginHub = {
141
141
  * @param {?function} listener The callback to store.
142
142
  */
143
143
  putListener: function (id, registrationName, listener) {
144
- 'production' !== process.env.NODE_ENV ? invariant(typeof listener === 'function', 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(typeof listener === 'function');
144
+ !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
145
145
 
146
146
  var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
147
147
  bankForRegistrationName[id] = listener;
@@ -212,14 +212,14 @@ var EventPluginHub = {
212
212
  * @return {*} An accumulation of synthetic events.
213
213
  * @internal
214
214
  */
215
- extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) {
215
+ extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
216
216
  var events;
217
217
  var plugins = EventPluginRegistry.plugins;
218
218
  for (var i = 0; i < plugins.length; i++) {
219
219
  // Not every plugin in the ordering may be loaded at runtime.
220
220
  var possiblePlugin = plugins[i];
221
221
  if (possiblePlugin) {
222
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent);
222
+ var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
223
223
  if (extractedEvents) {
224
224
  events = accumulateInto(events, extractedEvents);
225
225
  }
@@ -252,7 +252,7 @@ var EventPluginHub = {
252
252
  var processingEventQueue = eventQueue;
253
253
  eventQueue = null;
254
254
  forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
255
- 'production' !== process.env.NODE_ENV ? invariant(!eventQueue, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(!eventQueue);
255
+ !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
256
256
  },
257
257
 
258
258
  /**