react 0.13.0-beta.1 → 0.13.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 (181) hide show
  1. package/dist/JSXTransformer.js +1919 -1295
  2. package/dist/react-with-addons.js +1690 -1090
  3. package/dist/react-with-addons.min.js +7 -6
  4. package/dist/react.js +1574 -1010
  5. package/dist/react.min.js +6 -6
  6. package/lib/AutoFocusMixin.js +1 -1
  7. package/lib/BeforeInputEventPlugin.js +1 -5
  8. package/lib/CSSCore.js +1 -1
  9. package/lib/CSSProperty.js +3 -1
  10. package/lib/CSSPropertyOperations.js +1 -1
  11. package/lib/CallbackQueue.js +1 -1
  12. package/lib/ChangeEventPlugin.js +1 -1
  13. package/lib/ClientReactRootIndex.js +1 -1
  14. package/lib/DOMChildrenOperations.js +4 -43
  15. package/lib/DOMProperty.js +1 -1
  16. package/lib/DOMPropertyOperations.js +7 -14
  17. package/lib/Danger.js +1 -1
  18. package/lib/DefaultEventPluginOrder.js +2 -2
  19. package/lib/EnterLeaveEventPlugin.js +1 -1
  20. package/lib/EventConstants.js +1 -1
  21. package/lib/EventListener.js +1 -1
  22. package/lib/EventPluginHub.js +1 -1
  23. package/lib/EventPluginRegistry.js +1 -1
  24. package/lib/EventPluginUtils.js +3 -3
  25. package/lib/EventPropagators.js +1 -1
  26. package/lib/ExecutionEnvironment.js +1 -1
  27. package/lib/FallbackCompositionState.js +1 -1
  28. package/lib/HTMLDOMPropertyConfig.js +12 -5
  29. package/lib/LinkedStateMixin.js +1 -1
  30. package/lib/LinkedValueUtils.js +1 -1
  31. package/lib/LocalEventTrapMixin.js +1 -1
  32. package/lib/MobileSafariClickEventPlugin.js +1 -1
  33. package/lib/Object.assign.js +1 -1
  34. package/lib/PooledClass.js +1 -1
  35. package/lib/React.js +7 -9
  36. package/lib/ReactBrowserComponentMixin.js +1 -1
  37. package/lib/ReactBrowserEventEmitter.js +2 -2
  38. package/lib/ReactCSSTransitionGroup.js +1 -1
  39. package/lib/ReactCSSTransitionGroupChild.js +8 -5
  40. package/lib/ReactChildReconciler.js +1 -1
  41. package/lib/ReactChildren.js +3 -2
  42. package/lib/ReactClass.js +49 -23
  43. package/lib/ReactComponent.js +35 -19
  44. package/lib/ReactComponentBrowserEnvironment.js +1 -1
  45. package/lib/ReactComponentEnvironment.js +1 -1
  46. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  47. package/lib/ReactCompositeComponent.js +89 -40
  48. package/lib/ReactContext.js +13 -3
  49. package/lib/ReactCurrentOwner.js +1 -1
  50. package/lib/ReactDOM.js +1 -1
  51. package/lib/ReactDOMButton.js +1 -1
  52. package/lib/ReactDOMComponent.js +19 -19
  53. package/lib/ReactDOMForm.js +1 -1
  54. package/lib/ReactDOMIDOperations.js +3 -3
  55. package/lib/ReactDOMIframe.js +43 -0
  56. package/lib/ReactDOMImg.js +1 -1
  57. package/lib/ReactDOMInput.js +1 -1
  58. package/lib/ReactDOMOption.js +1 -1
  59. package/lib/ReactDOMSelect.js +1 -1
  60. package/lib/ReactDOMSelection.js +1 -1
  61. package/lib/ReactDOMTextComponent.js +3 -5
  62. package/lib/ReactDOMTextarea.js +1 -1
  63. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  64. package/lib/ReactDefaultInjection.js +25 -1
  65. package/lib/ReactDefaultPerf.js +5 -10
  66. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  67. package/lib/ReactElement.js +56 -2
  68. package/lib/ReactElementValidator.js +122 -79
  69. package/lib/ReactEmptyComponent.js +5 -5
  70. package/lib/ReactErrorUtils.js +1 -1
  71. package/lib/ReactEventEmitterMixin.js +1 -1
  72. package/lib/ReactEventListener.js +1 -1
  73. package/lib/ReactFragment.js +181 -0
  74. package/lib/ReactInjection.js +1 -1
  75. package/lib/ReactInputSelection.js +1 -1
  76. package/lib/ReactInstanceHandles.js +1 -1
  77. package/lib/ReactInstanceMap.js +1 -1
  78. package/lib/ReactLifeCycle.js +1 -1
  79. package/lib/ReactLink.js +1 -1
  80. package/lib/ReactMarkupChecksum.js +1 -1
  81. package/lib/ReactMount.js +32 -10
  82. package/lib/ReactMultiChild.js +1 -1
  83. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  84. package/lib/ReactNativeComponent.js +7 -20
  85. package/lib/ReactOwner.js +1 -1
  86. package/lib/ReactPerf.js +1 -1
  87. package/lib/ReactPropTransferer.js +1 -1
  88. package/lib/ReactPropTypeLocationNames.js +1 -1
  89. package/lib/ReactPropTypeLocations.js +1 -1
  90. package/lib/ReactPropTypes.js +7 -4
  91. package/lib/ReactPutListenerQueue.js +1 -1
  92. package/lib/ReactReconcileTransaction.js +1 -1
  93. package/lib/ReactReconciler.js +15 -2
  94. package/lib/ReactRef.js +2 -3
  95. package/lib/ReactRootIndex.js +1 -1
  96. package/lib/ReactServerRendering.js +1 -1
  97. package/lib/ReactServerRenderingTransaction.js +1 -1
  98. package/lib/ReactStateSetters.js +1 -1
  99. package/lib/ReactTestUtils.js +19 -7
  100. package/lib/ReactTransitionChildMapping.js +7 -3
  101. package/lib/ReactTransitionEvents.js +1 -1
  102. package/lib/ReactTransitionGroup.js +5 -5
  103. package/lib/ReactUpdateQueue.js +63 -32
  104. package/lib/ReactUpdates.js +7 -2
  105. package/lib/ReactWithAddons.js +3 -1
  106. package/lib/SVGDOMPropertyConfig.js +1 -1
  107. package/lib/SelectEventPlugin.js +1 -1
  108. package/lib/ServerReactRootIndex.js +1 -1
  109. package/lib/SimpleEventPlugin.js +3 -3
  110. package/lib/SyntheticClipboardEvent.js +1 -1
  111. package/lib/SyntheticCompositionEvent.js +1 -1
  112. package/lib/SyntheticDragEvent.js +1 -1
  113. package/lib/SyntheticEvent.js +1 -1
  114. package/lib/SyntheticFocusEvent.js +1 -1
  115. package/lib/SyntheticInputEvent.js +1 -1
  116. package/lib/SyntheticKeyboardEvent.js +1 -1
  117. package/lib/SyntheticMouseEvent.js +1 -1
  118. package/lib/SyntheticTouchEvent.js +1 -1
  119. package/lib/SyntheticUIEvent.js +1 -1
  120. package/lib/SyntheticWheelEvent.js +1 -1
  121. package/lib/Transaction.js +2 -2
  122. package/lib/ViewportMetrics.js +1 -1
  123. package/lib/accumulateInto.js +1 -1
  124. package/lib/adler32.js +1 -1
  125. package/lib/camelize.js +1 -1
  126. package/lib/camelizeStyleName.js +1 -1
  127. package/lib/cloneWithProps.js +4 -4
  128. package/lib/containsNode.js +1 -1
  129. package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
  130. package/lib/createFullPageComponent.js +1 -1
  131. package/lib/createNodesFromMarkup.js +4 -4
  132. package/lib/cx.js +16 -1
  133. package/lib/dangerousStyleValue.js +1 -1
  134. package/lib/emptyFunction.js +1 -1
  135. package/lib/emptyObject.js +1 -1
  136. package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +4 -5
  137. package/lib/findDOMNode.js +19 -1
  138. package/lib/flattenChildren.js +1 -1
  139. package/lib/focusNode.js +1 -1
  140. package/lib/forEachAccumulated.js +1 -1
  141. package/lib/getActiveElement.js +1 -1
  142. package/lib/getEventCharCode.js +1 -1
  143. package/lib/getEventKey.js +1 -1
  144. package/lib/getEventModifierState.js +1 -1
  145. package/lib/getEventTarget.js +1 -1
  146. package/lib/getIteratorFn.js +1 -1
  147. package/lib/getMarkupWrap.js +1 -1
  148. package/lib/getNodeForCharacterOffset.js +1 -1
  149. package/lib/getReactRootElementInContainer.js +1 -1
  150. package/lib/getTextContentAccessor.js +1 -1
  151. package/lib/getUnboundedScrollPosition.js +1 -1
  152. package/lib/hyphenate.js +1 -1
  153. package/lib/hyphenateStyleName.js +1 -1
  154. package/lib/instantiateReactComponent.js +6 -1
  155. package/lib/invariant.js +1 -1
  156. package/lib/isEventSupported.js +1 -1
  157. package/lib/isNode.js +1 -1
  158. package/lib/isTextInputElement.js +1 -1
  159. package/lib/isTextNode.js +1 -1
  160. package/lib/joinClasses.js +1 -1
  161. package/lib/keyMirror.js +1 -1
  162. package/lib/keyOf.js +1 -1
  163. package/lib/mapObject.js +1 -1
  164. package/lib/memoizeStringOnly.js +1 -1
  165. package/lib/onlyChild.js +1 -1
  166. package/lib/performance.js +1 -1
  167. package/lib/performanceNow.js +1 -1
  168. package/lib/quoteAttributeValueForBrowser.js +26 -0
  169. package/lib/setInnerHTML.js +1 -1
  170. package/lib/setTextContent.js +40 -0
  171. package/lib/shallowEqual.js +1 -1
  172. package/lib/shouldUpdateReactComponent.js +32 -10
  173. package/lib/toArray.js +2 -2
  174. package/lib/traverseAllChildren.js +18 -4
  175. package/lib/update.js +1 -1
  176. package/lib/warning.js +9 -2
  177. package/package.json +1 -1
  178. package/lib/copyProperties.js +0 -56
  179. package/lib/merge.js +0 -34
  180. package/lib/mergeInto.js +0 -24
  181. package/lib/monitorCodeUse.js +0 -30
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, 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,7 +9,7 @@
9
9
  * @providesModule ReactLifeCycle
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  /**
15
15
  * This module manages the bookkeeping when a component is in the process
package/lib/ReactLink.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
package/lib/ReactMount.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -279,7 +279,7 @@ function batchedMountComponentIntoNode(
279
279
  }
280
280
 
281
281
  /**
282
- * Mounting is the process of initializing a React component by creatings its
282
+ * Mounting is the process of initializing a React component by creating its
283
283
  * representative DOM elements and inserting them into a supplied `container`.
284
284
  * Any prior content inside `container` is destroyed in the process.
285
285
  *
@@ -370,13 +370,13 @@ var ReactMount = {
370
370
 
371
371
  /**
372
372
  * Render a new component into the DOM.
373
- * @param {ReactComponent} nextComponent component instance to render
373
+ * @param {ReactElement} nextElement element to render
374
374
  * @param {DOMElement} container container to render into
375
375
  * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
376
376
  * @return {ReactComponent} nextComponent
377
377
  */
378
378
  _renderNewRootComponent: function(
379
- nextComponent,
379
+ nextElement,
380
380
  container,
381
381
  shouldReuseMarkup
382
382
  ) {
@@ -391,7 +391,7 @@ var ReactMount = {
391
391
  'componentDidUpdate.'
392
392
  ) : null);
393
393
 
394
- var componentInstance = instantiateReactComponent(nextComponent, null);
394
+ var componentInstance = instantiateReactComponent(nextElement, null);
395
395
  var reactRootID = ReactMount._registerComponent(
396
396
  componentInstance,
397
397
  container
@@ -469,6 +469,25 @@ var ReactMount = {
469
469
  var containerHasReactMarkup =
470
470
  reactRootElement && ReactMount.isRenderedByReact(reactRootElement);
471
471
 
472
+ if ("production" !== process.env.NODE_ENV) {
473
+ if (!containerHasReactMarkup || reactRootElement.nextSibling) {
474
+ var rootElementSibling = reactRootElement;
475
+ while (rootElementSibling) {
476
+ if (ReactMount.isRenderedByReact(rootElementSibling)) {
477
+ ("production" !== process.env.NODE_ENV ? warning(
478
+ false,
479
+ 'render(): Target node has markup rendered by React, but there ' +
480
+ 'are unrelated nodes as well. This is most commonly caused by ' +
481
+ 'white-space inserted around server-rendered markup.'
482
+ ) : null);
483
+ break;
484
+ }
485
+
486
+ rootElementSibling = rootElementSibling.nextSibling;
487
+ }
488
+ }
489
+ }
490
+
472
491
  var shouldReuseMarkup = containerHasReactMarkup && !prevComponent;
473
492
 
474
493
  var component = ReactMount._renderNewRootComponent(
@@ -634,10 +653,11 @@ var ReactMount = {
634
653
  // warning is when the container is empty.
635
654
  rootElementsByReactRootID[reactRootID] = containerChild;
636
655
  } else {
637
- console.warn(
656
+ ("production" !== process.env.NODE_ENV ? warning(
657
+ false,
638
658
  'ReactMount: Root element has been removed from its original ' +
639
659
  'container. New container:', rootElement.parentNode
640
- );
660
+ ) : null);
641
661
  }
642
662
  }
643
663
  }
@@ -815,7 +835,8 @@ var ReactMount = {
815
835
  ) : invariant(container.nodeType !== DOC_NODE_TYPE));
816
836
 
817
837
  if ("production" !== process.env.NODE_ENV) {
818
- console.warn(
838
+ ("production" !== process.env.NODE_ENV ? warning(
839
+ false,
819
840
  'React attempted to reuse markup in a container but the ' +
820
841
  'checksum was invalid. This generally means that you are ' +
821
842
  'using server rendering and the markup generated on the ' +
@@ -823,8 +844,9 @@ var ReactMount = {
823
844
  'new markup to compensate which works but you have lost many ' +
824
845
  'of the benefits of server rendering. Instead, figure out ' +
825
846
  'why the markup being generated is different on the client ' +
826
- 'or server:\n' + difference
827
- );
847
+ 'or server:\n%s',
848
+ difference
849
+ ) : null);
828
850
  }
829
851
  }
830
852
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014, Facebook, Inc.
2
+ * Copyright 2014-2015, 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,12 +11,10 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactClass = require("./ReactClass");
15
- var ReactElement = require("./ReactElement");
16
-
17
14
  var assign = require("./Object.assign");
18
15
  var invariant = require("./invariant");
19
16
 
17
+ var autoGenerateWrapperClass = null;
20
18
  var genericComponentClass = null;
21
19
  // This registry keeps track of wrapper classes around native tags
22
20
  var tagToComponentClass = {};
@@ -37,25 +35,14 @@ var ReactNativeComponentInjection = {
37
35
  // tag. That particular tag will use this class instead of the generic one.
38
36
  injectComponentClasses: function(componentClasses) {
39
37
  assign(tagToComponentClass, componentClasses);
38
+ },
39
+ // Temporary hack since we expect DOM refs to behave like composites,
40
+ // for this release.
41
+ injectAutoWrapper: function(wrapperFactory) {
42
+ autoGenerateWrapperClass = wrapperFactory;
40
43
  }
41
44
  };
42
45
 
43
- function autoGenerateWrapperClass(type) {
44
- return ReactClass.createClass({
45
- tagName: type.toUpperCase(),
46
- render: function() {
47
- return new ReactElement(
48
- type,
49
- null,
50
- null,
51
- null,
52
- null,
53
- this.props
54
- );
55
- }
56
- });
57
- }
58
-
59
46
  /**
60
47
  * Get a composite component wrapper class for a specific tag.
61
48
  *
package/lib/ReactOwner.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
package/lib/ReactPerf.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, 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,6 +12,7 @@
12
12
  'use strict';
13
13
 
14
14
  var ReactElement = require("./ReactElement");
15
+ var ReactFragment = require("./ReactFragment");
15
16
  var ReactPropTypeLocationNames = require("./ReactPropTypeLocationNames");
16
17
 
17
18
  var emptyFunction = require("./emptyFunction");
@@ -94,7 +95,7 @@ function createChainableTypeChecker(validate) {
94
95
  var locationName = ReactPropTypeLocationNames[location];
95
96
  if (isRequired) {
96
97
  return new Error(
97
- ("Required " + locationName + " `" + propName + "` was not specified in ")+
98
+ ("Required " + locationName + " `" + propName + "` was not specified in ") +
98
99
  ("`" + componentName + "`.")
99
100
  );
100
101
  }
@@ -284,13 +285,14 @@ function createShapeTypeChecker(shapeTypes) {
284
285
  }
285
286
  return null;
286
287
  }
287
- return createChainableTypeChecker(validate, 'expected `object`');
288
+ return createChainableTypeChecker(validate);
288
289
  }
289
290
 
290
291
  function isNode(propValue) {
291
292
  switch (typeof propValue) {
292
293
  case 'number':
293
294
  case 'string':
295
+ case 'undefined':
294
296
  return true;
295
297
  case 'boolean':
296
298
  return !propValue;
@@ -298,9 +300,10 @@ function isNode(propValue) {
298
300
  if (Array.isArray(propValue)) {
299
301
  return propValue.every(isNode);
300
302
  }
301
- if (ReactElement.isValidElement(propValue)) {
303
+ if (propValue === null || ReactElement.isValidElement(propValue)) {
302
304
  return true;
303
305
  }
306
+ propValue = ReactFragment.extractIfFragment(propValue);
304
307
  for (var k in propValue) {
305
308
  if (!isNode(propValue[k])) {
306
309
  return false;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -86,7 +86,6 @@ var ReactReconciler = {
86
86
  }
87
87
 
88
88
  var refsChanged = ReactRef.shouldUpdateRefs(
89
- this,
90
89
  prevElement,
91
90
  nextElement
92
91
  );
@@ -100,6 +99,20 @@ var ReactReconciler = {
100
99
  if (refsChanged) {
101
100
  transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
102
101
  }
102
+ },
103
+
104
+ /**
105
+ * Flush any dirty changes in a component.
106
+ *
107
+ * @param {ReactComponent} internalInstance
108
+ * @param {ReactReconcileTransaction} transaction
109
+ * @internal
110
+ */
111
+ performUpdateIfNecessary: function(
112
+ internalInstance,
113
+ transaction
114
+ ) {
115
+ internalInstance.performUpdateIfNecessary(transaction);
103
116
  }
104
117
 
105
118
  };
package/lib/ReactRef.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, 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,7 +12,6 @@
12
12
  'use strict';
13
13
 
14
14
  var ReactOwner = require("./ReactOwner");
15
- var ReactUpdates = require("./ReactUpdates");
16
15
 
17
16
  var ReactRef = {};
18
17
 
@@ -41,7 +40,7 @@ ReactRef.attachRefs = function(instance, element) {
41
40
  }
42
41
  };
43
42
 
44
- ReactRef.shouldUpdateRefs = function(instance, prevElement, nextElement) {
43
+ ReactRef.shouldUpdateRefs = function(prevElement, nextElement) {
45
44
  // If either the owner or a `ref` has changed, make sure the newest owner
46
45
  // has stored a reference to `this`, and the previous owner (if different)
47
46
  // has forgotten the reference to `this`. We use the element instead
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014, Facebook, Inc.
2
+ * Copyright 2014-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -16,6 +16,7 @@ var EventPluginHub = require("./EventPluginHub");
16
16
  var EventPropagators = require("./EventPropagators");
17
17
  var React = require("./React");
18
18
  var ReactElement = require("./ReactElement");
19
+ var ReactEmptyComponent = require("./ReactEmptyComponent");
19
20
  var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
20
21
  var ReactCompositeComponent = require("./ReactCompositeComponent");
21
22
  var ReactInstanceHandles = require("./ReactInstanceHandles");
@@ -169,7 +170,7 @@ var ReactTestUtils = {
169
170
  var all =
170
171
  ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
171
172
  if (all.length !== 1) {
172
- throw new Error('Did not find exactly one match '+
173
+ throw new Error('Did not find exactly one match ' +
173
174
  '(found: ' + all.length + ') for class:' + className
174
175
  );
175
176
  }
@@ -322,14 +323,17 @@ var ReactShallowRenderer = function() {
322
323
  ReactShallowRenderer.prototype.getRenderOutput = function() {
323
324
  return (
324
325
  (this._instance && this._instance._renderedComponent &&
325
- this._instance._renderedComponent._currentElement)
326
+ this._instance._renderedComponent._renderedOutput)
326
327
  || null
327
328
  );
328
329
  };
329
330
 
330
331
  var NoopInternalComponent = function(element) {
331
- this._currentElement = element;
332
- }
332
+ this._renderedOutput = element;
333
+ this._currentElement = element === null || element === false ?
334
+ ReactEmptyComponent.emptyElement :
335
+ element;
336
+ };
333
337
 
334
338
  NoopInternalComponent.prototype = {
335
339
 
@@ -337,11 +341,13 @@ NoopInternalComponent.prototype = {
337
341
  },
338
342
 
339
343
  receiveComponent: function(element) {
340
- this._currentElement = element;
344
+ this._renderedOutput = element;
345
+ this._currentElement = element === null || element === false ?
346
+ ReactEmptyComponent.emptyElement :
347
+ element;
341
348
  },
342
349
 
343
350
  unmountComponent: function() {
344
-
345
351
  }
346
352
 
347
353
  };
@@ -366,6 +372,12 @@ ReactShallowRenderer.prototype.render = function(element, context) {
366
372
  ReactUpdates.ReactReconcileTransaction.release(transaction);
367
373
  };
368
374
 
375
+ ReactShallowRenderer.prototype.unmount = function() {
376
+ if (this._instance) {
377
+ this._instance.unmountComponent();
378
+ }
379
+ };
380
+
369
381
  ReactShallowRenderer.prototype._render = function(element, transaction, context) {
370
382
  if (!this._instance) {
371
383
  var rootID = ReactInstanceHandles.createReactRootID();