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
@@ -13,56 +13,20 @@
13
13
 
14
14
  var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
15
15
 
16
- /**
17
- * EVENT_NAME_MAP is used to determine which event fired when a
18
- * transition/animation ends, based on the style property used to
19
- * define that event.
20
- */
21
- var EVENT_NAME_MAP = {
22
- transitionend: {
23
- 'transition': 'transitionend',
24
- 'WebkitTransition': 'webkitTransitionEnd',
25
- 'MozTransition': 'mozTransitionEnd',
26
- 'OTransition': 'oTransitionEnd',
27
- 'msTransition': 'MSTransitionEnd'
28
- },
29
-
30
- animationend: {
31
- 'animation': 'animationend',
32
- 'WebkitAnimation': 'webkitAnimationEnd',
33
- 'MozAnimation': 'mozAnimationEnd',
34
- 'OAnimation': 'oAnimationEnd',
35
- 'msAnimation': 'MSAnimationEnd'
36
- }
37
- };
16
+ var getVendorPrefixedEventName = require('./getVendorPrefixedEventName');
38
17
 
39
18
  var endEvents = [];
40
19
 
41
20
  function detectEvents() {
42
- var testEl = document.createElement('div');
43
- var style = testEl.style;
44
-
45
- // On some platforms, in particular some releases of Android 4.x,
46
- // the un-prefixed "animation" and "transition" properties are defined on the
47
- // style object but the events that fire will still be prefixed, so we need
48
- // to check if the un-prefixed events are useable, and if not remove them
49
- // from the map
50
- if (!('AnimationEvent' in window)) {
51
- delete EVENT_NAME_MAP.animationend.animation;
52
- }
21
+ var animEnd = getVendorPrefixedEventName('animationend');
22
+ var transEnd = getVendorPrefixedEventName('transitionend');
53
23
 
54
- if (!('TransitionEvent' in window)) {
55
- delete EVENT_NAME_MAP.transitionend.transition;
24
+ if (animEnd) {
25
+ endEvents.push(animEnd);
56
26
  }
57
27
 
58
- for (var baseEventName in EVENT_NAME_MAP) {
59
- var baseEvents = EVENT_NAME_MAP[baseEventName];
60
- for (var styleName in baseEvents) {
61
- if (styleName in style) {
62
- endEvents.push(baseEvents[styleName]);
63
- break;
64
- }
65
- }
28
+ if (transEnd) {
29
+ endEvents.push(transEnd);
66
30
  }
67
31
  }
68
32
 
@@ -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,10 +11,11 @@
11
11
 
12
12
  'use strict';
13
13
 
14
+ var _assign = require('object-assign');
15
+
14
16
  var React = require('./React');
15
17
  var ReactTransitionChildMapping = require('./ReactTransitionChildMapping');
16
18
 
17
- var assign = require('./Object.assign');
18
19
  var emptyFunction = require('fbjs/lib/emptyFunction');
19
20
 
20
21
  var ReactTransitionGroup = React.createClass({
@@ -176,7 +177,7 @@ var ReactTransitionGroup = React.createClass({
176
177
  this.performEnter(key);
177
178
  } else {
178
179
  this.setState(function (state) {
179
- var newChildren = assign({}, state.children);
180
+ var newChildren = _assign({}, state.children);
180
181
  delete newChildren[key];
181
182
  return { children: newChildren };
182
183
  });
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2013-present, 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 ReactUMDEntry
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var _assign = require('object-assign');
15
+
16
+ var ReactDOM = require('./ReactDOM');
17
+ var ReactDOMServer = require('./ReactDOMServer');
18
+ var React = require('./React');
19
+
20
+ // `version` will be added here by ReactIsomorphic.
21
+ var ReactUMDEntry = _assign({
22
+ __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
23
+ __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
24
+ }, React);
25
+
26
+ module.exports = ReactUMDEntry;
@@ -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
@@ -12,11 +12,9 @@
12
12
  'use strict';
13
13
 
14
14
  var ReactCurrentOwner = require('./ReactCurrentOwner');
15
- var ReactElement = require('./ReactElement');
16
15
  var ReactInstanceMap = require('./ReactInstanceMap');
17
16
  var ReactUpdates = require('./ReactUpdates');
18
17
 
19
- var assign = require('./Object.assign');
20
18
  var invariant = require('fbjs/lib/invariant');
21
19
  var warning = require('fbjs/lib/warning');
22
20
 
@@ -24,6 +22,19 @@ function enqueueUpdate(internalInstance) {
24
22
  ReactUpdates.enqueueUpdate(internalInstance);
25
23
  }
26
24
 
25
+ function formatUnexpectedArgument(arg) {
26
+ var type = typeof arg;
27
+ if (type !== 'object') {
28
+ return type;
29
+ }
30
+ var displayName = arg.constructor && arg.constructor.name || type;
31
+ var keys = Object.keys(arg);
32
+ if (keys.length > 0 && keys.length < 20) {
33
+ return displayName + ' (keys: ' + keys.join(', ') + ')';
34
+ }
35
+ return displayName;
36
+ }
37
+
27
38
  function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
28
39
  var internalInstance = ReactInstanceMap.get(publicInstance);
29
40
  if (!internalInstance) {
@@ -31,13 +42,13 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
31
42
  // Only warn when we have a callerName. Otherwise we should be silent.
32
43
  // We're probably calling from enqueueCallback. We don't want to warn
33
44
  // there because we already warned for the corresponding lifecycle method.
34
- process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : undefined;
45
+ process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : void 0;
35
46
  }
36
47
  return null;
37
48
  }
38
49
 
39
50
  if (process.env.NODE_ENV !== 'production') {
40
- process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined;
51
+ process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
41
52
  }
42
53
 
43
54
  return internalInstance;
@@ -60,7 +71,7 @@ var ReactUpdateQueue = {
60
71
  if (process.env.NODE_ENV !== 'production') {
61
72
  var owner = ReactCurrentOwner.current;
62
73
  if (owner !== null) {
63
- process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
74
+ process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
64
75
  owner._warnedAboutRefsInRender = true;
65
76
  }
66
77
  }
@@ -81,10 +92,11 @@ var ReactUpdateQueue = {
81
92
  *
82
93
  * @param {ReactClass} publicInstance The instance to use as `this` context.
83
94
  * @param {?function} callback Called after state is updated.
95
+ * @param {string} callerName Name of the calling function in the public API.
84
96
  * @internal
85
97
  */
86
- enqueueCallback: function (publicInstance, callback) {
87
- !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
98
+ enqueueCallback: function (publicInstance, callback, callerName) {
99
+ ReactUpdateQueue.validateCallback(callback, callerName);
88
100
  var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
89
101
 
90
102
  // Previously we would throw an error if we didn't have an internal
@@ -109,7 +121,6 @@ var ReactUpdateQueue = {
109
121
  },
110
122
 
111
123
  enqueueCallbackInternal: function (internalInstance, callback) {
112
- !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
113
124
  if (internalInstance._pendingCallbacks) {
114
125
  internalInstance._pendingCallbacks.push(callback);
115
126
  } else {
@@ -190,66 +201,13 @@ var ReactUpdateQueue = {
190
201
  enqueueUpdate(internalInstance);
191
202
  },
192
203
 
193
- /**
194
- * Sets a subset of the props.
195
- *
196
- * @param {ReactClass} publicInstance The instance that should rerender.
197
- * @param {object} partialProps Subset of the next props.
198
- * @internal
199
- */
200
- enqueueSetProps: function (publicInstance, partialProps) {
201
- var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps');
202
- if (!internalInstance) {
203
- return;
204
- }
205
- ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
206
- },
207
-
208
- enqueueSetPropsInternal: function (internalInstance, partialProps) {
209
- var topLevelWrapper = internalInstance._topLevelWrapper;
210
- !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
211
-
212
- // Merge with the pending element if it exists, otherwise with existing
213
- // element props.
214
- var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
215
- var element = wrapElement.props;
216
- var props = assign({}, element.props, partialProps);
217
- topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
218
-
219
- enqueueUpdate(topLevelWrapper);
220
- },
221
-
222
- /**
223
- * Replaces all of the props.
224
- *
225
- * @param {ReactClass} publicInstance The instance that should rerender.
226
- * @param {object} props New props.
227
- * @internal
228
- */
229
- enqueueReplaceProps: function (publicInstance, props) {
230
- var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps');
231
- if (!internalInstance) {
232
- return;
233
- }
234
- ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
235
- },
236
-
237
- enqueueReplacePropsInternal: function (internalInstance, props) {
238
- var topLevelWrapper = internalInstance._topLevelWrapper;
239
- !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
240
-
241
- // Merge with the pending element if it exists, otherwise with existing
242
- // element props.
243
- var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
244
- var element = wrapElement.props;
245
- topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
246
-
247
- enqueueUpdate(topLevelWrapper);
248
- },
249
-
250
204
  enqueueElementInternal: function (internalInstance, newElement) {
251
205
  internalInstance._pendingElement = newElement;
252
206
  enqueueUpdate(internalInstance);
207
+ },
208
+
209
+ validateCallback: function (callback, callerName) {
210
+ !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;
253
211
  }
254
212
 
255
213
  };
@@ -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,13 +11,15 @@
11
11
 
12
12
  'use strict';
13
13
 
14
+ var _assign = require('object-assign');
15
+
14
16
  var CallbackQueue = require('./CallbackQueue');
15
17
  var PooledClass = require('./PooledClass');
18
+ var ReactFeatureFlags = require('./ReactFeatureFlags');
16
19
  var ReactPerf = require('./ReactPerf');
17
20
  var ReactReconciler = require('./ReactReconciler');
18
21
  var Transaction = require('./Transaction');
19
22
 
20
- var assign = require('./Object.assign');
21
23
  var invariant = require('fbjs/lib/invariant');
22
24
 
23
25
  var dirtyComponents = [];
@@ -27,7 +29,7 @@ var asapEnqueued = false;
27
29
  var batchingStrategy = null;
28
30
 
29
31
  function ensureInjected() {
30
- !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined;
32
+ !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;
31
33
  }
32
34
 
33
35
  var NESTED_UPDATES = {
@@ -64,10 +66,11 @@ function ReactUpdatesFlushTransaction() {
64
66
  this.reinitializeTransaction();
65
67
  this.dirtyComponentsLength = null;
66
68
  this.callbackQueue = CallbackQueue.getPooled();
67
- this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false);
69
+ this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
70
+ /* useCreateElement */true);
68
71
  }
69
72
 
70
- assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
73
+ _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
71
74
  getTransactionWrappers: function () {
72
75
  return TRANSACTION_WRAPPERS;
73
76
  },
@@ -107,7 +110,7 @@ function mountOrderComparator(c1, c2) {
107
110
 
108
111
  function runBatchedUpdates(transaction) {
109
112
  var len = transaction.dirtyComponentsLength;
110
- !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined;
113
+ !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;
111
114
 
112
115
  // Since reconciling a component higher in the owner hierarchy usually (not
113
116
  // always -- see shouldComponentUpdate()) will reconcile children, reconcile
@@ -126,8 +129,23 @@ function runBatchedUpdates(transaction) {
126
129
  var callbacks = component._pendingCallbacks;
127
130
  component._pendingCallbacks = null;
128
131
 
132
+ var markerName;
133
+ if (ReactFeatureFlags.logTopLevelRenders) {
134
+ var namedComponent = component;
135
+ // Duck type TopLevelWrapper. This is probably always true.
136
+ if (component._currentElement.props === component._renderedComponent._currentElement) {
137
+ namedComponent = component._renderedComponent;
138
+ }
139
+ markerName = 'React update: ' + namedComponent.getName();
140
+ console.time(markerName);
141
+ }
142
+
129
143
  ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
130
144
 
145
+ if (markerName) {
146
+ console.timeEnd(markerName);
147
+ }
148
+
131
149
  if (callbacks) {
132
150
  for (var j = 0; j < callbacks.length; j++) {
133
151
  transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
@@ -185,21 +203,21 @@ function enqueueUpdate(component) {
185
203
  * if no updates are currently being performed.
186
204
  */
187
205
  function asap(callback, context) {
188
- !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;
206
+ !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;
189
207
  asapCallbackQueue.enqueue(callback, context);
190
208
  asapEnqueued = true;
191
209
  }
192
210
 
193
211
  var ReactUpdatesInjection = {
194
212
  injectReconcileTransaction: function (ReconcileTransaction) {
195
- !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined;
213
+ !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;
196
214
  ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
197
215
  },
198
216
 
199
217
  injectBatchingStrategy: function (_batchingStrategy) {
200
- !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined;
201
- !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined;
202
- !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined;
218
+ !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;
219
+ !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;
220
+ !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;
203
221
  batchingStrategy = _batchingStrategy;
204
222
  }
205
223
  };
@@ -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,4 +11,4 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- module.exports = '0.14.10';
14
+ module.exports = '15.0.0';
@@ -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
@@ -9,13 +9,6 @@
9
9
  * @providesModule ReactWithAddons
10
10
  */
11
11
 
12
- /**
13
- * This module exists purely in the open source project, and is meant as a way
14
- * to create a separate standalone build of React. This build has "addons", or
15
- * functionality we've built and think might be useful but doesn't have a good
16
- * place to live inside React core.
17
- */
18
-
19
12
  'use strict';
20
13
 
21
14
  var LinkedStateMixin = require('./LinkedStateMixin');
@@ -24,14 +17,9 @@ var ReactComponentWithPureRenderMixin = require('./ReactComponentWithPureRenderM
24
17
  var ReactCSSTransitionGroup = require('./ReactCSSTransitionGroup');
25
18
  var ReactFragment = require('./ReactFragment');
26
19
  var ReactTransitionGroup = require('./ReactTransitionGroup');
27
- var ReactUpdates = require('./ReactUpdates');
28
20
 
29
- var cloneWithProps = require('./cloneWithProps');
30
21
  var shallowCompare = require('./shallowCompare');
31
22
  var update = require('./update');
32
- var warning = require('fbjs/lib/warning');
33
-
34
- var warnedAboutBatchedUpdates = false;
35
23
 
36
24
  React.addons = {
37
25
  CSSTransitionGroup: ReactCSSTransitionGroup,
@@ -39,14 +27,6 @@ React.addons = {
39
27
  PureRenderMixin: ReactComponentWithPureRenderMixin,
40
28
  TransitionGroup: ReactTransitionGroup,
41
29
 
42
- batchedUpdates: function () {
43
- if (process.env.NODE_ENV !== 'production') {
44
- process.env.NODE_ENV !== 'production' ? warning(warnedAboutBatchedUpdates, 'React.addons.batchedUpdates is deprecated. Use ' + 'ReactDOM.unstable_batchedUpdates instead.') : undefined;
45
- warnedAboutBatchedUpdates = true;
46
- }
47
- return ReactUpdates.batchedUpdates.apply(this, arguments);
48
- },
49
- cloneWithProps: cloneWithProps,
50
30
  createFragment: ReactFragment.create,
51
31
  shallowCompare: shallowCompare,
52
32
  update: update