react 15.0.0-rc.2 → 15.0.2-alpha.2

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 (116) hide show
  1. package/dist/react-with-addons.js +1250 -1105
  2. package/dist/react-with-addons.min.js +6 -6
  3. package/dist/react.js +1116 -1001
  4. package/dist/react.min.js +6 -6
  5. package/lib/CSSPropertyOperations.js +31 -15
  6. package/lib/CallbackQueue.js +4 -3
  7. package/lib/DOMChildrenOperations.js +0 -3
  8. package/lib/DOMProperty.js +3 -3
  9. package/lib/DOMPropertyOperations.js +1 -1
  10. package/lib/Danger.js +8 -8
  11. package/lib/EventPluginHub.js +2 -2
  12. package/lib/EventPluginRegistry.js +7 -7
  13. package/lib/EventPluginUtils.js +6 -6
  14. package/lib/EventPropagators.js +1 -1
  15. package/lib/FallbackCompositionState.js +3 -2
  16. package/lib/IOSDefaultEventPluginOrder.js +16 -0
  17. package/lib/IOSNativeBridgeEventPlugin.js +57 -0
  18. package/lib/LinkedValueUtils.js +4 -4
  19. package/lib/NativeMethodsMixin.js +165 -0
  20. package/lib/OrderedMap.js +16 -15
  21. package/lib/PanResponder.js +362 -0
  22. package/lib/PooledClass.js +1 -1
  23. package/lib/React.js +68 -9
  24. package/lib/ReactBrowserEventEmitter.js +3 -2
  25. package/lib/ReactCSSTransitionGroup.js +3 -3
  26. package/lib/ReactChildReconciler.js +1 -1
  27. package/lib/ReactClass.js +24 -23
  28. package/lib/ReactComponent.js +5 -5
  29. package/lib/ReactComponentEnvironment.js +1 -1
  30. package/lib/ReactCompositeComponent.js +26 -25
  31. package/lib/ReactDOM.js +3 -3
  32. package/lib/ReactDOMComponent.js +34 -22
  33. package/lib/ReactDOMComponentTree.js +3 -3
  34. package/lib/ReactDOMDebugTool.js +1 -1
  35. package/lib/ReactDOMEmptyComponent.js +3 -3
  36. package/lib/ReactDOMInput.js +11 -10
  37. package/lib/ReactDOMOption.js +15 -4
  38. package/lib/ReactDOMSelect.js +8 -7
  39. package/lib/ReactDOMTextComponent.js +4 -3
  40. package/lib/ReactDOMTextarea.js +10 -9
  41. package/lib/ReactDOMTreeTraversal.js +5 -5
  42. package/lib/ReactDOMUnknownPropertyDevtool.js +2 -2
  43. package/lib/ReactDebugInstanceMap.js +102 -0
  44. package/lib/ReactDebugTool.js +1 -1
  45. package/lib/ReactDefaultBatchingStrategy.js +3 -2
  46. package/lib/ReactDefaultPerf.js +46 -7
  47. package/lib/ReactDefaultPerfAnalysis.js +7 -7
  48. package/lib/ReactElement.js +5 -4
  49. package/lib/ReactElementValidator.js +7 -7
  50. package/lib/ReactEventListener.js +3 -2
  51. package/lib/ReactFragment.js +4 -4
  52. package/lib/ReactInstanceHandles.js +6 -6
  53. package/lib/ReactInvalidSetStateWarningDevTool.js +1 -1
  54. package/lib/ReactMount.js +15 -14
  55. package/lib/ReactMultiChild.js +2 -2
  56. package/lib/ReactNative.js +71 -0
  57. package/lib/ReactNativeAttributePayload.js +397 -0
  58. package/lib/ReactNativeBaseComponent.js +196 -0
  59. package/lib/ReactNativeComponent.js +4 -3
  60. package/lib/ReactNativeComponentEnvironment.js +38 -0
  61. package/lib/ReactNativeComponentTree.js +66 -0
  62. package/lib/ReactNativeContainerInfo.js +21 -0
  63. package/lib/ReactNativeDOMIDOperations.js +83 -0
  64. package/lib/ReactNativeDefaultInjection.js +99 -0
  65. package/lib/ReactNativeEventEmitter.js +183 -0
  66. package/lib/ReactNativeGlobalInteractionHandler.js +33 -0
  67. package/lib/ReactNativeGlobalResponderHandler.js +25 -0
  68. package/lib/ReactNativeMount.js +190 -0
  69. package/lib/ReactNativePropRegistry.js +52 -0
  70. package/lib/ReactNativeReconcileTransaction.js +100 -0
  71. package/lib/ReactNativeTagHandles.js +54 -0
  72. package/lib/ReactNativeTextComponent.js +70 -0
  73. package/lib/ReactNativeTreeTraversal.js +127 -0
  74. package/lib/ReactNodeTypes.js +1 -1
  75. package/lib/ReactNoopUpdateQueue.js +1 -1
  76. package/lib/ReactOwner.js +2 -2
  77. package/lib/ReactPropTransferer.js +4 -3
  78. package/lib/ReactReconcileTransaction.js +3 -3
  79. package/lib/ReactServerRendering.js +2 -2
  80. package/lib/ReactServerRenderingTransaction.js +3 -3
  81. package/lib/ReactSimpleEmptyComponent.js +3 -3
  82. package/lib/ReactTestUtils.js +18 -8
  83. package/lib/ReactTransitionGroup.js +3 -2
  84. package/lib/ReactUMDEntry.js +26 -0
  85. package/lib/ReactUpdateQueue.js +23 -6
  86. package/lib/ReactUpdates.js +10 -9
  87. package/lib/ReactVersion.js +1 -1
  88. package/lib/ReactWithAddons.js +0 -7
  89. package/lib/ReactWithAddonsUMDEntry.js +26 -0
  90. package/lib/ResponderEventPlugin.js +1 -1
  91. package/lib/ResponderTouchHistoryStore.js +4 -4
  92. package/lib/SimpleEventPlugin.js +1 -1
  93. package/lib/SyntheticEvent.js +7 -6
  94. package/lib/TouchHistoryMath.js +99 -0
  95. package/lib/Transaction.js +2 -2
  96. package/lib/accumulate.js +1 -1
  97. package/lib/accumulateInto.js +1 -1
  98. package/lib/createReactNativeComponentClass.js +42 -0
  99. package/lib/dangerousStyleValue.js +1 -1
  100. package/lib/deprecated.js +4 -3
  101. package/lib/findDOMNode.js +3 -3
  102. package/lib/findNodeHandle.js +89 -0
  103. package/lib/flattenChildren.js +1 -1
  104. package/lib/instantiateReactComponent.js +6 -5
  105. package/lib/onlyChild.js +1 -1
  106. package/lib/reactComponentExpect.js +4 -3
  107. package/lib/setInnerHTML.js +1 -0
  108. package/lib/traverseAllChildren.js +2 -2
  109. package/lib/update.js +14 -13
  110. package/lib/validateDOMNesting.js +5 -4
  111. package/package.json +5 -4
  112. package/addons.js +0 -15
  113. package/lib/Object.assign.js +0 -47
  114. package/lib/React.native.js +0 -5
  115. package/lib/ReactDOM.native.js +0 -12
  116. package/lib/ReactIsomorphic.js +0 -74
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @providesModule TouchHistoryMath
3
+ */
4
+
5
+ 'use strict';
6
+
7
+ var TouchHistoryMath = {
8
+ /**
9
+ * This code is optimized and not intended to look beautiful. This allows
10
+ * computing of touch centroids that have moved after `touchesChangedAfter`
11
+ * timeStamp. You can compute the current centroid involving all touches
12
+ * moves after `touchesChangedAfter`, or you can compute the previous
13
+ * centroid of all touches that were moved after `touchesChangedAfter`.
14
+ *
15
+ * @param {TouchHistoryMath} touchHistory Standard Responder touch track
16
+ * data.
17
+ * @param {number} touchesChangedAfter timeStamp after which moved touches
18
+ * are considered "actively moving" - not just "active".
19
+ * @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.
20
+ * @param {boolean} ofCurrent Compute current centroid for actively moving
21
+ * touches vs. previous centroid of now actively moving touches.
22
+ * @return {number} value of centroid in specified dimension.
23
+ */
24
+ centroidDimension: function (touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {
25
+ var touchBank = touchHistory.touchBank;
26
+ var total = 0;
27
+ var count = 0;
28
+
29
+ var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;
30
+
31
+ if (oneTouchData !== null) {
32
+ if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
33
+ total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
34
+ count = 1;
35
+ }
36
+ } else {
37
+ for (var i = 0; i < touchBank.length; i++) {
38
+ var touchTrack = touchBank[i];
39
+ if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {
40
+ var toAdd; // Yuck, program temporarily in invalid state.
41
+ if (ofCurrent && isXAxis) {
42
+ toAdd = touchTrack.currentPageX;
43
+ } else if (ofCurrent && !isXAxis) {
44
+ toAdd = touchTrack.currentPageY;
45
+ } else if (!ofCurrent && isXAxis) {
46
+ toAdd = touchTrack.previousPageX;
47
+ } else {
48
+ toAdd = touchTrack.previousPageY;
49
+ }
50
+ total += toAdd;
51
+ count++;
52
+ }
53
+ }
54
+ }
55
+ return count > 0 ? total / count : TouchHistoryMath.noCentroid;
56
+ },
57
+
58
+ currentCentroidXOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
59
+ return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis
60
+ true // ofCurrent
61
+ );
62
+ },
63
+
64
+ currentCentroidYOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
65
+ return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis
66
+ true // ofCurrent
67
+ );
68
+ },
69
+
70
+ previousCentroidXOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
71
+ return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis
72
+ false // ofCurrent
73
+ );
74
+ },
75
+
76
+ previousCentroidYOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
77
+ return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis
78
+ false // ofCurrent
79
+ );
80
+ },
81
+
82
+ currentCentroidX: function (touchHistory) {
83
+ return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter
84
+ true, // isXAxis
85
+ true // ofCurrent
86
+ );
87
+ },
88
+
89
+ currentCentroidY: function (touchHistory) {
90
+ return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter
91
+ false, // isXAxis
92
+ true // ofCurrent
93
+ );
94
+ },
95
+
96
+ noCentroid: -1
97
+ };
98
+
99
+ module.exports = TouchHistoryMath;
@@ -122,7 +122,7 @@ var Mixin = {
122
122
  * @return {*} Return value from `method`.
123
123
  */
124
124
  perform: function (method, scope, a, b, c, d, e, f) {
125
- !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined;
125
+ !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
126
126
  var errorThrown;
127
127
  var ret;
128
128
  try {
@@ -186,7 +186,7 @@ var Mixin = {
186
186
  * invoked).
187
187
  */
188
188
  closeAll: function (startIndex) {
189
- !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined;
189
+ !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;
190
190
  var transactionWrappers = this.transactionWrappers;
191
191
  for (var i = startIndex; i < transactionWrappers.length; i++) {
192
192
  var wrapper = transactionWrappers[i];
package/lib/accumulate.js CHANGED
@@ -21,7 +21,7 @@ var invariant = require('fbjs/lib/invariant');
21
21
  * @return {*|array<*>} An accumulation of items.
22
22
  */
23
23
  function accumulate(current, next) {
24
- !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulate(...): Accumulated items must be not be null or undefined.') : invariant(false) : undefined;
24
+ !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulate(...): Accumulated items must be not be null or undefined.') : invariant(false) : void 0;
25
25
  if (current == null) {
26
26
  return next;
27
27
  } else {
@@ -28,7 +28,7 @@ var invariant = require('fbjs/lib/invariant');
28
28
  */
29
29
 
30
30
  function accumulateInto(current, next) {
31
- !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined;
31
+ !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;
32
32
  if (current == null) {
33
33
  return next;
34
34
  }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) 2015-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 createReactNativeComponentClass
10
+ *
11
+ */
12
+
13
+ 'use strict';
14
+
15
+ var ReactNativeBaseComponent = require('./ReactNativeBaseComponent');
16
+
17
+ // See also ReactNativeBaseComponent
18
+
19
+
20
+ /**
21
+ * @param {string} config iOS View configuration.
22
+ * @private
23
+ */
24
+ var createReactNativeComponentClass = function (viewConfig) {
25
+ var Constructor = function (element) {
26
+ this._currentElement = element;
27
+ this._topLevelWrapper = null;
28
+ this._nativeParent = null;
29
+ this._nativeContainerInfo = null;
30
+ this._rootNodeID = null;
31
+ this._renderedChildren = null;
32
+ };
33
+ Constructor.displayName = viewConfig.uiViewClassName;
34
+ Constructor.viewConfig = viewConfig;
35
+ Constructor.propTypes = viewConfig.propTypes;
36
+ Constructor.prototype = new ReactNativeBaseComponent(viewConfig);
37
+ Constructor.prototype.constructor = Constructor;
38
+
39
+ return Constructor;
40
+ };
41
+
42
+ module.exports = createReactNativeComponentClass;
@@ -65,7 +65,7 @@ function dangerousStyleValue(name, value, component) {
65
65
  }
66
66
  }
67
67
  if (!warned) {
68
- process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : undefined;
68
+ process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
69
69
  }
70
70
  }
71
71
  }
package/lib/deprecated.js CHANGED
@@ -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 warning = require('fbjs/lib/warning');
16
17
 
17
18
  /**
@@ -34,14 +35,14 @@ function deprecated(fnName, newModule, newPackage, ctx, fn) {
34
35
  // Require examples in this string must be split to prevent React's
35
36
  // build tools from mistaking them for real requires.
36
37
  // Otherwise the build tools will attempt to build a '%s' module.
37
- 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
38
+ 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : void 0;
38
39
  /* eslint-enable no-useless-concat */
39
40
  warned = true;
40
41
  return fn.apply(ctx, arguments);
41
42
  };
42
43
  // We need to make sure all properties of the original fn are copied over.
43
44
  // In particular, this is needed to support PropTypes
44
- return assign(newFn, fn);
45
+ return _assign(newFn, fn);
45
46
  }
46
47
 
47
48
  return fn;
@@ -29,7 +29,7 @@ function findDOMNode(componentOrElement) {
29
29
  if (process.env.NODE_ENV !== 'production') {
30
30
  var owner = ReactCurrentOwner.current;
31
31
  if (owner !== null) {
32
- process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + '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;
32
+ process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + '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;
33
33
  owner._warnedAboutRefsInRender = true;
34
34
  }
35
35
  }
@@ -47,9 +47,9 @@ function findDOMNode(componentOrElement) {
47
47
  }
48
48
 
49
49
  if (typeof componentOrElement.render === 'function') {
50
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
50
+ !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;
51
51
  } else {
52
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
52
+ !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;
53
53
  }
54
54
  }
55
55
 
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright (c) 2015-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 findNodeHandle
10
+ *
11
+ */
12
+
13
+ 'use strict';
14
+
15
+ var ReactCurrentOwner = require('./ReactCurrentOwner');
16
+ var ReactInstanceMap = require('./ReactInstanceMap');
17
+
18
+ var invariant = require('fbjs/lib/invariant');
19
+ var warning = require('fbjs/lib/warning');
20
+
21
+ /**
22
+ * ReactNative vs ReactWeb
23
+ * -----------------------
24
+ * React treats some pieces of data opaquely. This means that the information
25
+ * is first class (it can be passed around), but cannot be inspected. This
26
+ * allows us to build infrastructure that reasons about resources, without
27
+ * making assumptions about the nature of those resources, and this allows that
28
+ * infra to be shared across multiple platforms, where the resources are very
29
+ * different. General infra (such as `ReactMultiChild`) reasons opaquely about
30
+ * the data, but platform specific code (such as `ReactNativeBaseComponent`) can
31
+ * make assumptions about the data.
32
+ *
33
+ *
34
+ * `rootNodeID`, uniquely identifies a position in the generated native view
35
+ * tree. Many layers of composite components (created with `React.createClass`)
36
+ * can all share the same `rootNodeID`.
37
+ *
38
+ * `nodeHandle`: A sufficiently unambiguous way to refer to a lower level
39
+ * resource (dom node, native view etc). The `rootNodeID` is sufficient for web
40
+ * `nodeHandle`s, because the position in a tree is always enough to uniquely
41
+ * identify a DOM node (we never have nodes in some bank outside of the
42
+ * document). The same would be true for `ReactNative`, but we must maintain a
43
+ * mapping that we can send efficiently serializable
44
+ * strings across native boundaries.
45
+ *
46
+ * Opaque name TodaysWebReact FutureWebWorkerReact ReactNative
47
+ * ----------------------------------------------------------------------------
48
+ * nodeHandle N/A rootNodeID tag
49
+ */
50
+
51
+ function findNodeHandle(componentOrHandle) {
52
+ if (process.env.NODE_ENV !== 'production') {
53
+ var owner = ReactCurrentOwner.current;
54
+ if (owner !== null) {
55
+ process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findNodeHandle inside its render(). ' + '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;
56
+ owner._warnedAboutRefsInRender = true;
57
+ }
58
+ }
59
+ if (componentOrHandle == null) {
60
+ return null;
61
+ }
62
+ if (typeof componentOrHandle === 'number') {
63
+ // Already a node handle
64
+ return componentOrHandle;
65
+ }
66
+
67
+ var component = componentOrHandle;
68
+
69
+ // TODO (balpert): Wrap iOS native components in a composite wrapper, then
70
+ // ReactInstanceMap.get here will always succeed for mounted components
71
+ var internalInstance = ReactInstanceMap.get(component);
72
+ if (internalInstance) {
73
+ return internalInstance.getNativeNode();
74
+ } else {
75
+ var rootNodeID = component._rootNodeID;
76
+ if (rootNodeID) {
77
+ return rootNodeID;
78
+ } else {
79
+ !(
80
+ // Native
81
+ typeof component === 'object' && '_rootNodeID' in component ||
82
+ // Composite
83
+ component.render != null && typeof component.render === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findNodeHandle(...): Argument is not a component ' + '(type: %s, keys: %s)', typeof component, Object.keys(component)) : invariant(false) : void 0;
84
+ !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findNodeHandle(...): Unable to find node handle for unmounted ' + 'component.') : invariant(false) : void 0;
85
+ }
86
+ }
87
+ }
88
+
89
+ module.exports = findNodeHandle;
@@ -24,7 +24,7 @@ function flattenSingleChildIntoContext(traverseContext, child, name) {
24
24
  var result = traverseContext;
25
25
  var keyUnique = result[name] === undefined;
26
26
  if (process.env.NODE_ENV !== 'production') {
27
- process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
27
+ process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : void 0;
28
28
  }
29
29
  if (keyUnique && child != null) {
30
30
  result[name] = child;
@@ -11,11 +11,12 @@
11
11
 
12
12
  'use strict';
13
13
 
14
+ var _assign = require('object-assign');
15
+
14
16
  var ReactCompositeComponent = require('./ReactCompositeComponent');
15
17
  var ReactEmptyComponent = require('./ReactEmptyComponent');
16
18
  var ReactNativeComponent = require('./ReactNativeComponent');
17
19
 
18
- var assign = require('./Object.assign');
19
20
  var invariant = require('fbjs/lib/invariant');
20
21
  var warning = require('fbjs/lib/warning');
21
22
 
@@ -23,7 +24,7 @@ var warning = require('fbjs/lib/warning');
23
24
  var ReactCompositeComponentWrapper = function (element) {
24
25
  this.construct(element);
25
26
  };
26
- assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
27
+ _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
27
28
  _instantiateReactComponent: instantiateReactComponent
28
29
  });
29
30
 
@@ -62,7 +63,7 @@ function instantiateReactComponent(node) {
62
63
  instance = ReactEmptyComponent.create(instantiateReactComponent);
63
64
  } else if (typeof node === 'object') {
64
65
  var element = node;
65
- !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
66
+ !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : void 0;
66
67
 
67
68
  // Special case string values
68
69
  if (typeof element.type === 'string') {
@@ -78,11 +79,11 @@ function instantiateReactComponent(node) {
78
79
  } else if (typeof node === 'string' || typeof node === 'number') {
79
80
  instance = ReactNativeComponent.createInstanceForText(node);
80
81
  } else {
81
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined;
82
+ !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : void 0;
82
83
  }
83
84
 
84
85
  if (process.env.NODE_ENV !== 'production') {
85
- process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
86
+ process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
86
87
  }
87
88
 
88
89
  // These two fields are used by the DOM and ART diffing algorithms
package/lib/onlyChild.js CHANGED
@@ -26,7 +26,7 @@ var invariant = require('fbjs/lib/invariant');
26
26
  * structure.
27
27
  */
28
28
  function onlyChild(children) {
29
- !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
29
+ !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0;
30
30
  return children;
31
31
  }
32
32
 
@@ -12,10 +12,11 @@
12
12
 
13
13
  'use strict';
14
14
 
15
+ var _assign = require('object-assign');
16
+
15
17
  var ReactInstanceMap = require('./ReactInstanceMap');
16
18
  var ReactTestUtils = require('./ReactTestUtils');
17
19
 
18
- var assign = require('./Object.assign');
19
20
  var invariant = require('fbjs/lib/invariant');
20
21
 
21
22
  function reactComponentExpect(instance) {
@@ -30,7 +31,7 @@ function reactComponentExpect(instance) {
30
31
  expect(instance).not.toBeNull();
31
32
  expect(instance).not.toBeUndefined();
32
33
 
33
- !ReactTestUtils.isCompositeComponent(instance) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'reactComponentExpect(...): instance must be a composite component') : invariant(false) : undefined;
34
+ !ReactTestUtils.isCompositeComponent(instance) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'reactComponentExpect(...): instance must be a composite component') : invariant(false) : void 0;
34
35
  var internalInstance = ReactInstanceMap.get(instance);
35
36
 
36
37
  expect(typeof internalInstance).toBe('object');
@@ -44,7 +45,7 @@ function reactComponentExpectInternal(internalInstance) {
44
45
  this._instance = internalInstance;
45
46
  }
46
47
 
47
- assign(reactComponentExpectInternal.prototype, {
48
+ _assign(reactComponentExpectInternal.prototype, {
48
49
  // Getters -------------------------------------------------------------------
49
50
 
50
51
  /**
@@ -76,6 +76,7 @@ if (ExecutionEnvironment.canUseDOM) {
76
76
  }
77
77
  };
78
78
  }
79
+ testElement = null;
79
80
  }
80
81
 
81
82
  module.exports = setInnerHTML;
@@ -127,7 +127,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
127
127
  }
128
128
  } else {
129
129
  if (process.env.NODE_ENV !== 'production') {
130
- process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
130
+ process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : void 0;
131
131
  didWarnAboutMaps = true;
132
132
  }
133
133
  // Iterator will provide entry [k,v] tuples rather than values.
@@ -155,7 +155,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
155
155
  }
156
156
  }
157
157
  var childrenString = String(children);
158
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
158
+ !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : void 0;
159
159
  }
160
160
  }
161
161