react 0.14.10 → 15.0.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 (193) hide show
  1. package/LICENSE +1 -1
  2. package/dist/react-with-addons.js +4900 -4627
  3. package/dist/react-with-addons.min.js +7 -7
  4. package/dist/react.js +4556 -4059
  5. package/dist/react.min.js +7 -7
  6. package/lib/AutoFocusUtils.js +3 -15
  7. package/lib/BeforeInputEventPlugin.js +8 -25
  8. package/lib/CSSProperty.js +10 -1
  9. package/lib/CSSPropertyOperations.js +49 -19
  10. package/lib/CallbackQueue.js +16 -4
  11. package/lib/ChangeEventPlugin.js +58 -54
  12. package/lib/DOMChildrenOperations.js +91 -61
  13. package/lib/DOMLazyTree.js +105 -0
  14. package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
  15. package/lib/DOMProperty.js +18 -39
  16. package/lib/DOMPropertyOperations.js +42 -53
  17. package/lib/Danger.js +13 -14
  18. package/lib/DefaultEventPluginOrder.js +1 -1
  19. package/lib/EnterLeaveEventPlugin.js +24 -43
  20. package/lib/EventConstants.js +6 -1
  21. package/lib/EventPluginHub.js +22 -66
  22. package/lib/EventPluginRegistry.js +30 -9
  23. package/lib/EventPluginUtils.js +61 -36
  24. package/lib/EventPropagators.js +19 -17
  25. package/lib/FallbackCompositionState.js +4 -4
  26. package/lib/HTMLDOMPropertyConfig.js +131 -152
  27. package/lib/LinkedStateMixin.js +1 -2
  28. package/lib/LinkedValueUtils.js +6 -7
  29. package/lib/MetaMatchers.js +2 -2
  30. package/lib/OrderedMap.js +17 -16
  31. package/lib/PooledClass.js +2 -2
  32. package/lib/React.js +50 -20
  33. package/lib/ReactBrowserEventEmitter.js +19 -26
  34. package/lib/ReactCSSTransitionGroup.js +4 -5
  35. package/lib/ReactCSSTransitionGroupChild.js +1 -6
  36. package/lib/ReactChildReconciler.js +15 -13
  37. package/lib/ReactChildren.js +5 -4
  38. package/lib/ReactClass.js +44 -92
  39. package/lib/ReactComponent.js +9 -10
  40. package/lib/ReactComponentBrowserEnvironment.js +9 -6
  41. package/lib/ReactComponentEnvironment.js +4 -4
  42. package/lib/ReactComponentWithPureRenderMixin.js +2 -2
  43. package/lib/ReactCompositeComponent.js +166 -74
  44. package/lib/ReactCurrentOwner.js +2 -1
  45. package/lib/ReactDOM.js +27 -15
  46. package/lib/ReactDOMButton.js +2 -2
  47. package/lib/ReactDOMComponent.js +186 -250
  48. package/lib/ReactDOMComponentFlags.js +18 -0
  49. package/lib/ReactDOMComponentTree.js +186 -0
  50. package/lib/ReactDOMContainerInfo.js +32 -0
  51. package/lib/ReactDOMDebugTool.js +61 -0
  52. package/lib/ReactDOMEmptyComponent.js +60 -0
  53. package/lib/ReactDOMFactories.js +1 -2
  54. package/lib/ReactDOMFeatureFlags.js +2 -2
  55. package/lib/ReactDOMIDOperations.js +5 -60
  56. package/lib/ReactDOMInput.js +73 -23
  57. package/lib/ReactDOMInstrumentation.js +16 -0
  58. package/lib/ReactDOMOption.js +14 -12
  59. package/lib/ReactDOMSelect.js +43 -19
  60. package/lib/ReactDOMSelection.js +4 -4
  61. package/lib/ReactDOMServer.js +1 -1
  62. package/lib/ReactDOMTextComponent.js +87 -45
  63. package/lib/ReactDOMTextarea.js +39 -11
  64. package/lib/ReactDOMTreeTraversal.js +134 -0
  65. package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
  66. package/lib/ReactDebugInstanceMap.js +102 -0
  67. package/lib/ReactDebugTool.js +72 -0
  68. package/lib/ReactDefaultBatchingStrategy.js +4 -3
  69. package/lib/ReactDefaultInjection.js +11 -15
  70. package/lib/ReactDefaultPerf.js +105 -26
  71. package/lib/ReactDefaultPerfAnalysis.js +23 -15
  72. package/lib/ReactElement.js +63 -23
  73. package/lib/ReactElementValidator.js +9 -9
  74. package/lib/ReactEmptyComponent.js +8 -33
  75. package/lib/ReactErrorUtils.js +1 -2
  76. package/lib/ReactEventEmitterMixin.js +3 -8
  77. package/lib/ReactEventListener.js +23 -77
  78. package/lib/ReactFeatureFlags.js +21 -0
  79. package/lib/ReactFragment.js +6 -6
  80. package/lib/ReactInjection.js +3 -3
  81. package/lib/ReactInputSelection.js +4 -4
  82. package/lib/ReactInstanceHandles.js +10 -12
  83. package/lib/ReactInstanceMap.js +2 -1
  84. package/lib/ReactInstrumentation.js +16 -0
  85. package/lib/ReactInvalidSetStateWarningDevTool.js +36 -0
  86. package/lib/ReactLink.js +2 -3
  87. package/lib/ReactMarkupChecksum.js +8 -3
  88. package/lib/ReactMount.js +88 -460
  89. package/lib/ReactMultiChild.js +106 -200
  90. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  91. package/lib/ReactNativeComponent.js +6 -5
  92. package/lib/ReactNodeTypes.js +37 -0
  93. package/lib/ReactNoopUpdateQueue.js +2 -25
  94. package/lib/ReactOwner.js +7 -6
  95. package/lib/ReactPerf.js +2 -2
  96. package/lib/ReactPropTransferer.js +5 -4
  97. package/lib/ReactPropTypeLocationNames.js +1 -1
  98. package/lib/ReactPropTypeLocations.js +1 -1
  99. package/lib/ReactPropTypes.js +31 -7
  100. package/lib/ReactReconcileTransaction.js +20 -9
  101. package/lib/ReactReconciler.js +29 -6
  102. package/lib/ReactRef.js +1 -1
  103. package/lib/ReactServerBatchingStrategy.js +1 -2
  104. package/lib/ReactServerRendering.js +17 -35
  105. package/lib/ReactServerRenderingTransaction.js +11 -29
  106. package/lib/ReactSimpleEmptyComponent.js +36 -0
  107. package/lib/ReactStateSetters.js +1 -1
  108. package/lib/ReactTestUtils.js +47 -28
  109. package/lib/ReactTransitionChildMapping.js +1 -2
  110. package/lib/ReactTransitionEvents.js +8 -44
  111. package/lib/ReactTransitionGroup.js +4 -3
  112. package/lib/ReactUMDEntry.js +26 -0
  113. package/lib/ReactUpdateQueue.js +24 -66
  114. package/lib/ReactUpdates.js +29 -11
  115. package/lib/ReactVersion.js +2 -2
  116. package/lib/ReactWithAddons.js +1 -21
  117. package/lib/ReactWithAddonsUMDEntry.js +26 -0
  118. package/lib/ResponderEventPlugin.js +54 -66
  119. package/lib/ResponderSyntheticEvent.js +2 -3
  120. package/lib/ResponderTouchHistoryStore.js +5 -5
  121. package/lib/SVGDOMPropertyConfig.js +267 -94
  122. package/lib/SelectEventPlugin.js +13 -18
  123. package/lib/SimpleEventPlugin.js +57 -17
  124. package/lib/SyntheticAnimationEvent.js +39 -0
  125. package/lib/SyntheticClipboardEvent.js +2 -3
  126. package/lib/SyntheticCompositionEvent.js +2 -3
  127. package/lib/SyntheticDragEvent.js +2 -3
  128. package/lib/SyntheticEvent.js +102 -21
  129. package/lib/SyntheticFocusEvent.js +2 -3
  130. package/lib/SyntheticInputEvent.js +2 -3
  131. package/lib/SyntheticKeyboardEvent.js +2 -3
  132. package/lib/SyntheticMouseEvent.js +2 -3
  133. package/lib/SyntheticTouchEvent.js +2 -3
  134. package/lib/SyntheticTransitionEvent.js +39 -0
  135. package/lib/SyntheticUIEvent.js +2 -3
  136. package/lib/SyntheticWheelEvent.js +2 -3
  137. package/lib/TapEventPlugin.js +3 -12
  138. package/lib/Transaction.js +3 -3
  139. package/lib/ViewportMetrics.js +1 -1
  140. package/lib/accumulate.js +2 -2
  141. package/lib/accumulateInto.js +2 -2
  142. package/lib/adler32.js +3 -2
  143. package/lib/canDefineProperty.js +1 -1
  144. package/lib/createHierarchyRenderer.js +1 -1
  145. package/lib/createMicrosoftUnsafeLocalFunction.js +32 -0
  146. package/lib/dangerousStyleValue.js +25 -3
  147. package/lib/deprecated.js +7 -4
  148. package/lib/escapeTextContentForBrowser.js +1 -1
  149. package/lib/findDOMNode.js +15 -8
  150. package/lib/flattenChildren.js +2 -2
  151. package/lib/forEachAccumulated.js +2 -1
  152. package/lib/getEventCharCode.js +2 -2
  153. package/lib/getEventKey.js +1 -2
  154. package/lib/getEventModifierState.js +1 -2
  155. package/lib/getEventTarget.js +8 -2
  156. package/lib/getIteratorFn.js +2 -2
  157. package/lib/getNativeComponentFromComposite.js +30 -0
  158. package/lib/getNodeForCharacterOffset.js +2 -1
  159. package/lib/getTestDocument.js +1 -1
  160. package/lib/getTextContentAccessor.js +1 -1
  161. package/lib/getVendorPrefixedEventName.js +101 -0
  162. package/lib/instantiateReactComponent.js +12 -13
  163. package/lib/isEventSupported.js +2 -2
  164. package/lib/isTextInputElement.js +2 -1
  165. package/lib/onlyChild.js +2 -2
  166. package/lib/quoteAttributeValueForBrowser.js +1 -1
  167. package/lib/reactComponentExpect.js +5 -4
  168. package/lib/renderSubtreeIntoContainer.js +1 -1
  169. package/lib/setInnerHTML.js +6 -14
  170. package/lib/setTextContent.js +1 -1
  171. package/lib/shallowCompare.js +1 -1
  172. package/lib/shouldUpdateReactComponent.js +2 -3
  173. package/lib/sliceChildren.js +1 -1
  174. package/lib/traverseAllChildren.js +8 -8
  175. package/lib/update.js +16 -15
  176. package/lib/validateDOMNesting.js +18 -13
  177. package/package.json +23 -32
  178. package/addons.js +0 -13
  179. package/cjs/react-jsx-dev-runtime.development.js +0 -861
  180. package/cjs/react-jsx-dev-runtime.production.min.js +0 -9
  181. package/cjs/react-jsx-runtime.development.js +0 -883
  182. package/cjs/react-jsx-runtime.production.min.js +0 -10
  183. package/jsx-dev-runtime.js +0 -7
  184. package/jsx-runtime.js +0 -7
  185. package/lib/Object.assign.js +0 -47
  186. package/lib/React.native.js +0 -5
  187. package/lib/ReactBrowserComponentMixin.js +0 -36
  188. package/lib/ReactEmptyComponentRegistry.js +0 -48
  189. package/lib/ReactIsomorphic.js +0 -74
  190. package/lib/ReactRootIndex.js +0 -29
  191. package/lib/ServerReactRootIndex.js +0 -29
  192. package/lib/cloneWithProps.js +0 -54
  193. package/lib/webcomponents.js +0 -6379
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -7,7 +7,6 @@
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
9
  * @providesModule LinkedStateMixin
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  'use strict';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -7,7 +7,6 @@
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
9
  * @providesModule LinkedValueUtils
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  'use strict';
@@ -29,16 +28,16 @@ var hasReadOnlyValue = {
29
28
  };
30
29
 
31
30
  function _assertSingleLink(inputProps) {
32
- !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
31
+ !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : void 0;
33
32
  }
34
33
  function _assertValueLink(inputProps) {
35
34
  _assertSingleLink(inputProps);
36
- !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
35
+ !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : void 0;
37
36
  }
38
37
 
39
38
  function _assertCheckedLink(inputProps) {
40
39
  _assertSingleLink(inputProps);
41
- !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
40
+ !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : void 0;
42
41
  }
43
42
 
44
43
  var propTypes = {
@@ -76,7 +75,7 @@ var LinkedValueUtils = {
76
75
  checkPropTypes: function (tagName, props, owner) {
77
76
  for (var propName in propTypes) {
78
77
  if (propTypes.hasOwnProperty(propName)) {
79
- var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
78
+ var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
80
79
  }
81
80
  if (error instanceof Error && !(error.message in loggedTypeFailures)) {
82
81
  // Only monitor this failure once because there tends to be a lot of the
@@ -84,7 +83,7 @@ var LinkedValueUtils = {
84
83
  loggedTypeFailures[error.message] = true;
85
84
 
86
85
  var addendum = getDeclarationErrorAddendum(owner);
87
- process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
86
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
88
87
  }
89
88
  }
90
89
  },
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2015, Facebook, Inc.
2
+ * Copyright 2015-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -20,7 +20,7 @@
20
20
  function getRunnerWithResults(describeFunction) {
21
21
  if (describeFunction._cachedRunner) {
22
22
  // Cached result of execution. This is a convenience way to test against
23
- // the same authorative function multiple times.
23
+ // the same authoritative function multiple times.
24
24
  return describeFunction._cachedRunner;
25
25
  }
26
26
  // Patch the current global environment.
package/lib/OrderedMap.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -11,7 +11,8 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var assign = require('./Object.assign');
14
+ var _assign = require('object-assign');
15
+
15
16
  var invariant = require('fbjs/lib/invariant');
16
17
 
17
18
  var PREFIX = 'key:';
@@ -34,7 +35,7 @@ function extractObjectFromArray(arr, keyExtractor) {
34
35
  var key = keyExtractor(item);
35
36
  assertValidPublicKey(key);
36
37
  var normalizedKey = PREFIX + key;
37
- !!(normalizedKey in normalizedObj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: IDs returned by the key extraction function must be unique.') : invariant(false) : undefined;
38
+ !!(normalizedKey in normalizedObj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: IDs returned by the key extraction function must be unique.') : invariant(false) : void 0;
38
39
  normalizedObj[normalizedKey] = item;
39
40
  }
40
41
  return normalizedObj;
@@ -81,7 +82,7 @@ function OrderedMapImpl(normalizedObj, computedLength) {
81
82
  * @throws Error if key is not appropriate for use in `OrderedMap`.
82
83
  */
83
84
  function assertValidPublicKey(key) {
84
- !(key !== '' && (typeof key === 'string' || typeof key === 'number')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Key must be non-empty, non-null string or number.') : invariant(false) : undefined;
85
+ !(key !== '' && (typeof key === 'string' || typeof key === 'number')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Key must be non-empty, non-null string or number.') : invariant(false) : void 0;
85
86
  }
86
87
 
87
88
  /**
@@ -94,7 +95,7 @@ function assertValidPublicKey(key) {
94
95
  * @throws Error if range arguments are out of bounds.
95
96
  */
96
97
  function assertValidRangeIndices(start, length, actualLen) {
97
- !(typeof start === 'number' && typeof length === 'number' && length >= 0 && start >= 0 && start + length <= actualLen) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: `mapRange` and `forEachRange` expect non-negative start and ' + 'length arguments within the bounds of the instance.') : invariant(false) : undefined;
98
+ !(typeof start === 'number' && typeof length === 'number' && length >= 0 && start >= 0 && start + length <= actualLen) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: `mapRange` and `forEachRange` expect non-negative start and ' + 'length arguments within the bounds of the instance.') : invariant(false) : void 0;
98
99
  }
99
100
 
100
101
  /**
@@ -107,7 +108,7 @@ function assertValidRangeIndices(start, length, actualLen) {
107
108
  */
108
109
  function _fromNormalizedObjects(a, b) {
109
110
  // Second optional, both must be plain JavaScript objects.
110
- !(a && a.constructor === Object && (!b || b.constructor === Object)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Corrupted instance of OrderedMap detected.') : invariant(false) : undefined;
111
+ !(a && a.constructor === Object && (!b || b.constructor === Object)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Corrupted instance of OrderedMap detected.') : invariant(false) : void 0;
111
112
 
112
113
  var newSet = {};
113
114
  var length = 0;
@@ -183,7 +184,7 @@ var OrderedMapMethods = {
183
184
  * merge.
184
185
  */
185
186
  merge: function (orderedMap) {
186
- !(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.merge(...): Expected an OrderedMap instance.') : invariant(false) : undefined;
187
+ !(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.merge(...): Expected an OrderedMap instance.') : invariant(false) : void 0;
187
188
  return _fromNormalizedObjects(this._normalizedObj, orderedMap._normalizedObj);
188
189
  },
189
190
 
@@ -295,16 +296,16 @@ var OrderedMapMethods = {
295
296
  mapKeyRange: function (cb, startKey, endKey, context) {
296
297
  var startIndex = this.indexOfKey(startKey);
297
298
  var endIndex = this.indexOfKey(endKey);
298
- !(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mapKeyRange must be given keys that are present.') : invariant(false) : undefined;
299
- !(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.mapKeyRange(...): `endKey` must not come before `startIndex`.') : invariant(false) : undefined;
299
+ !(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mapKeyRange must be given keys that are present.') : invariant(false) : void 0;
300
+ !(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.mapKeyRange(...): `endKey` must not come before `startIndex`.') : invariant(false) : void 0;
300
301
  return this.mapRange(cb, startIndex, endIndex - startIndex + 1, context);
301
302
  },
302
303
 
303
304
  forEachKeyRange: function (cb, startKey, endKey, context) {
304
305
  var startIndex = this.indexOfKey(startKey);
305
306
  var endIndex = this.indexOfKey(endKey);
306
- !(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'forEachKeyRange must be given keys that are present.') : invariant(false) : undefined;
307
- !(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.forEachKeyRange(...): `endKey` must not come before ' + '`startIndex`.') : invariant(false) : undefined;
307
+ !(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'forEachKeyRange must be given keys that are present.') : invariant(false) : void 0;
308
+ !(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.forEachKeyRange(...): `endKey` must not come before ' + '`startIndex`.') : invariant(false) : void 0;
308
309
  this.forEachRange(cb, startIndex, endIndex - startIndex + 1, context);
309
310
  },
310
311
 
@@ -348,7 +349,7 @@ var OrderedMapMethods = {
348
349
  */
349
350
  nthKeyAfter: function (key, n) {
350
351
  var curIndex = this.indexOfKey(key);
351
- !(curIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.nthKeyAfter: The key `%s` does not exist in this instance.', key) : invariant(false) : undefined;
352
+ !(curIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.nthKeyAfter: The key `%s` does not exist in this instance.', key) : invariant(false) : void 0;
352
353
  return this.keyAtIndex(curIndex + n);
353
354
  },
354
355
 
@@ -435,17 +436,17 @@ var OrderedMapMethods = {
435
436
  }
436
437
  };
437
438
 
438
- assign(OrderedMapImpl.prototype, OrderedMapMethods);
439
+ _assign(OrderedMapImpl.prototype, OrderedMapMethods);
439
440
 
440
441
  var OrderedMap = {
441
442
  from: function (orderedMap) {
442
- !(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.from(...): Expected an OrderedMap instance.') : invariant(false) : undefined;
443
+ !(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.from(...): Expected an OrderedMap instance.') : invariant(false) : void 0;
443
444
  return _fromNormalizedObjects(orderedMap._normalizedObj, null);
444
445
  },
445
446
 
446
447
  fromArray: function (arr, keyExtractor) {
447
- !Array.isArray(arr) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): First argument must be an array.') : invariant(false) : undefined;
448
- !(typeof keyExtractor === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): Second argument must be a function used ' + 'to determine the unique key for each entry.') : invariant(false) : undefined;
448
+ !Array.isArray(arr) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): First argument must be an array.') : invariant(false) : void 0;
449
+ !(typeof keyExtractor === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): Second argument must be a function used ' + 'to determine the unique key for each entry.') : invariant(false) : void 0;
449
450
  return new OrderedMapImpl(extractObjectFromArray(arr, keyExtractor), arr.length);
450
451
  }
451
452
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -77,7 +77,7 @@ var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
77
77
 
78
78
  var standardReleaser = function (instance) {
79
79
  var Klass = this;
80
- !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
80
+ !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;
81
81
  instance.destructor();
82
82
  if (Klass.instancePool.length < Klass.poolSize) {
83
83
  Klass.instancePool.push(instance);
package/lib/React.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -11,30 +11,60 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactDOM = require('./ReactDOM');
15
- var ReactDOMServer = require('./ReactDOMServer');
16
- var ReactIsomorphic = require('./ReactIsomorphic');
14
+ var ReactChildren = require('./ReactChildren');
15
+ var ReactComponent = require('./ReactComponent');
16
+ var ReactClass = require('./ReactClass');
17
+ var ReactDOMFactories = require('./ReactDOMFactories');
18
+ var ReactElement = require('./ReactElement');
19
+ var ReactElementValidator = require('./ReactElementValidator');
20
+ var ReactPropTypes = require('./ReactPropTypes');
21
+ var ReactVersion = require('./ReactVersion');
17
22
 
18
- var assign = require('./Object.assign');
19
- var deprecated = require('./deprecated');
23
+ var onlyChild = require('./onlyChild');
20
24
 
21
- // `version` will be added here by ReactIsomorphic.
22
- var React = {};
25
+ var createElement = ReactElement.createElement;
26
+ var createFactory = ReactElement.createFactory;
27
+ var cloneElement = ReactElement.cloneElement;
23
28
 
24
- assign(React, ReactIsomorphic);
29
+ if (process.env.NODE_ENV !== 'production') {
30
+ createElement = ReactElementValidator.createElement;
31
+ createFactory = ReactElementValidator.createFactory;
32
+ cloneElement = ReactElementValidator.cloneElement;
33
+ }
25
34
 
26
- assign(React, {
27
- // ReactDOM
28
- findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
29
- render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
30
- unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
35
+ var React = {
31
36
 
32
- // ReactDOMServer
33
- renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
34
- renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
35
- });
37
+ // Modern
36
38
 
37
- React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
38
- React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
39
+ Children: {
40
+ map: ReactChildren.map,
41
+ forEach: ReactChildren.forEach,
42
+ count: ReactChildren.count,
43
+ toArray: ReactChildren.toArray,
44
+ only: onlyChild
45
+ },
46
+
47
+ Component: ReactComponent,
48
+
49
+ createElement: createElement,
50
+ cloneElement: cloneElement,
51
+ isValidElement: ReactElement.isValidElement,
52
+
53
+ // Classic
54
+
55
+ PropTypes: ReactPropTypes,
56
+ createClass: ReactClass.createClass,
57
+ createFactory: createFactory,
58
+ createMixin: function (mixin) {
59
+ // Currently a noop. Will be used to validate and trace mixins.
60
+ return mixin;
61
+ },
62
+
63
+ // This looks DOM specific but these are actually isomorphic helpers
64
+ // since they are just generating DOM strings.
65
+ DOM: ReactDOMFactories,
66
+
67
+ version: ReactVersion
68
+ };
39
69
 
40
70
  module.exports = React;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -7,19 +7,18 @@
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
9
  * @providesModule ReactBrowserEventEmitter
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  'use strict';
14
13
 
14
+ var _assign = require('object-assign');
15
+
15
16
  var EventConstants = require('./EventConstants');
16
- var EventPluginHub = require('./EventPluginHub');
17
17
  var EventPluginRegistry = require('./EventPluginRegistry');
18
18
  var ReactEventEmitterMixin = require('./ReactEventEmitterMixin');
19
- var ReactPerf = require('./ReactPerf');
20
19
  var ViewportMetrics = require('./ViewportMetrics');
21
20
 
22
- var assign = require('./Object.assign');
21
+ var getVendorPrefixedEventName = require('./getVendorPrefixedEventName');
23
22
  var isEventSupported = require('./isEventSupported');
24
23
 
25
24
  /**
@@ -77,6 +76,7 @@ var isEventSupported = require('./isEventSupported');
77
76
  * React Core . General Purpose Event Plugin System
78
77
  */
79
78
 
79
+ var hasEventPageXY;
80
80
  var alreadyListeningTo = {};
81
81
  var isMonitoringScrollValue = false;
82
82
  var reactTopListenersCounter = 0;
@@ -86,6 +86,9 @@ var reactTopListenersCounter = 0;
86
86
  // events so we don't include them here
87
87
  var topEventMapping = {
88
88
  topAbort: 'abort',
89
+ topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
90
+ topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
91
+ topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
89
92
  topBlur: 'blur',
90
93
  topCanPlay: 'canplay',
91
94
  topCanPlayThrough: 'canplaythrough',
@@ -142,6 +145,7 @@ var topEventMapping = {
142
145
  topTouchEnd: 'touchend',
143
146
  topTouchMove: 'touchmove',
144
147
  topTouchStart: 'touchstart',
148
+ topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
145
149
  topVolumeChange: 'volumechange',
146
150
  topWaiting: 'waiting',
147
151
  topWheel: 'wheel'
@@ -166,13 +170,13 @@ function getListeningForDocument(mountAt) {
166
170
  * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
167
171
  * example:
168
172
  *
169
- * ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
173
+ * EventPluginHub.putListener('myID', 'onClick', myFunction);
170
174
  *
171
175
  * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
172
176
  *
173
177
  * @internal
174
178
  */
175
- var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
179
+ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
176
180
 
177
181
  /**
178
182
  * Injectable event backend
@@ -290,35 +294,24 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
290
294
  * Listens to window scroll and resize events. We cache scroll values so that
291
295
  * application code can access them without triggering reflows.
292
296
  *
297
+ * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
298
+ * pageX/pageY isn't supported (legacy browsers).
299
+ *
293
300
  * NOTE: Scroll events do not bubble.
294
301
  *
295
302
  * @see http://www.quirksmode.org/dom/events/scroll.html
296
303
  */
297
304
  ensureScrollValueMonitoring: function () {
298
- if (!isMonitoringScrollValue) {
305
+ if (hasEventPageXY === undefined) {
306
+ hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
307
+ }
308
+ if (!hasEventPageXY && !isMonitoringScrollValue) {
299
309
  var refresh = ViewportMetrics.refreshScrollValues;
300
310
  ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
301
311
  isMonitoringScrollValue = true;
302
312
  }
303
- },
304
-
305
- eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
306
-
307
- registrationNameModules: EventPluginHub.registrationNameModules,
308
-
309
- putListener: EventPluginHub.putListener,
310
-
311
- getListener: EventPluginHub.getListener,
312
-
313
- deleteListener: EventPluginHub.deleteListener,
314
-
315
- deleteAllListeners: EventPluginHub.deleteAllListeners
316
-
317
- });
313
+ }
318
314
 
319
- ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
320
- putListener: 'putListener',
321
- deleteListener: 'deleteListener'
322
315
  });
323
316
 
324
317
  module.exports = ReactBrowserEventEmitter;
@@ -1,20 +1,19 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
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
- * @typechecks
10
9
  * @providesModule ReactCSSTransitionGroup
11
10
  */
12
11
 
13
12
  'use strict';
14
13
 
15
- var React = require('./React');
14
+ var _assign = require('object-assign');
16
15
 
17
- var assign = require('./Object.assign');
16
+ var React = require('./React');
18
17
 
19
18
  var ReactTransitionGroup = require('./ReactTransitionGroup');
20
19
  var ReactCSSTransitionGroupChild = require('./ReactCSSTransitionGroupChild');
@@ -76,7 +75,7 @@ var ReactCSSTransitionGroup = React.createClass({
76
75
  },
77
76
 
78
77
  render: function () {
79
- return React.createElement(ReactTransitionGroup, assign({}, this.props, { childFactory: this._wrapChild }));
78
+ return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
80
79
  }
81
80
  });
82
81
 
@@ -1,12 +1,11 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
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
- * @typechecks
10
9
  * @providesModule ReactCSSTransitionGroupChild
11
10
  */
12
11
 
@@ -20,10 +19,6 @@ var ReactTransitionEvents = require('./ReactTransitionEvents');
20
19
 
21
20
  var onlyChild = require('./onlyChild');
22
21
 
23
- // We don't remove the element from the DOM until we receive an animationend or
24
- // transitionend event. If the user screws up and forgets to add an animation
25
- // their node will be stuck in the DOM forever, so we detect if an animation
26
- // does not start and if it doesn't, we just call the end listener immediately.
27
22
  var TICK = 17;
28
23
 
29
24
  var ReactCSSTransitionGroupChild = React.createClass({