react-test-renderer 15.5.4 → 15.7.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 (250) hide show
  1. package/LICENSE +16 -26
  2. package/lib/CallbackQueue.js +3 -5
  3. package/lib/EventConstants.js +3 -5
  4. package/lib/EventPluginHub.js +3 -9
  5. package/lib/EventPluginRegistry.js +3 -7
  6. package/lib/EventPluginUtils.js +3 -5
  7. package/lib/EventPropagators.js +3 -5
  8. package/lib/KeyEscapeUtils.js +3 -5
  9. package/lib/PluginModuleType.js +3 -5
  10. package/lib/PooledClass.js +3 -5
  11. package/lib/ReactChildFiber.js +3 -6
  12. package/lib/ReactChildReconciler.js +7 -10
  13. package/lib/ReactComponentEnvironment.js +3 -7
  14. package/lib/ReactCompositeComponent.js +5 -9
  15. package/lib/ReactCoroutine.js +3 -5
  16. package/lib/ReactDebugTool.js +6 -6
  17. package/lib/ReactDefaultBatchingStrategy.js +3 -5
  18. package/lib/ReactElementSymbol.js +3 -5
  19. package/lib/ReactEmptyComponent.js +3 -5
  20. package/lib/ReactErrorUtils.js +6 -6
  21. package/lib/ReactEventEmitterMixin.js +3 -6
  22. package/lib/ReactFeatureFlags.js +3 -5
  23. package/lib/ReactFiber.js +3 -7
  24. package/lib/ReactFiberBeginWork.js +3 -6
  25. package/lib/ReactFiberCommitWork.js +3 -6
  26. package/lib/ReactFiberCompleteWork.js +3 -7
  27. package/lib/ReactFiberReconciler.js +3 -5
  28. package/lib/ReactFiberRoot.js +3 -5
  29. package/lib/ReactFiberScheduler.js +3 -5
  30. package/lib/ReactFiberUpdateQueue.js +3 -5
  31. package/lib/ReactHostComponent.js +3 -5
  32. package/lib/ReactHostOperationHistoryHook.js +3 -5
  33. package/lib/ReactInstanceMap.js +3 -7
  34. package/lib/ReactInstanceType.js +3 -5
  35. package/lib/ReactInstrumentation.js +3 -5
  36. package/lib/ReactInvalidSetStateWarningHook.js +3 -5
  37. package/lib/ReactMultiChild.js +3 -9
  38. package/lib/ReactMultiChildUpdateTypes.js +3 -5
  39. package/lib/ReactNodeTypes.js +3 -5
  40. package/lib/ReactOwner.js +3 -6
  41. package/lib/ReactPerf.js +9 -11
  42. package/lib/ReactPriorityLevel.js +5 -6
  43. package/lib/ReactPropTypeLocationNames.js +3 -5
  44. package/lib/ReactPropTypeLocations.js +3 -5
  45. package/lib/ReactPropTypesSecret.js +3 -5
  46. package/lib/ReactReconciler.js +5 -9
  47. package/lib/ReactRef.js +3 -5
  48. package/lib/ReactReifiedYield.js +3 -5
  49. package/lib/ReactShallowRenderer.js +3 -5
  50. package/lib/ReactSimpleEmptyComponent.js +5 -7
  51. package/lib/ReactSyntheticEventType.js +3 -5
  52. package/lib/ReactTestEmptyComponent.js +3 -5
  53. package/lib/ReactTestMount.js +8 -8
  54. package/lib/ReactTestReconcileTransaction.js +2 -4
  55. package/lib/ReactTestRenderer.js +4 -5
  56. package/lib/ReactTestTextComponent.js +3 -5
  57. package/lib/ReactTypeOfWork.js +3 -5
  58. package/lib/ReactTypes.js +3 -5
  59. package/lib/ReactUpdateQueue.js +4 -8
  60. package/lib/ReactUpdates.js +4 -6
  61. package/lib/ReactVersion.js +4 -6
  62. package/lib/ResponderEventPlugin.js +3 -7
  63. package/lib/ResponderSyntheticEvent.js +3 -5
  64. package/lib/ResponderTouchHistoryStore.js +3 -5
  65. package/lib/SyntheticEvent.js +34 -33
  66. package/lib/Transaction.js +6 -5
  67. package/lib/accumulate.js +3 -5
  68. package/lib/accumulateInto.js +3 -5
  69. package/lib/adler32.js +3 -5
  70. package/lib/canDefineProperty.js +3 -5
  71. package/lib/checkReactTypeSpec.js +3 -5
  72. package/lib/deprecated.js +6 -8
  73. package/lib/flattenChildren.js +3 -5
  74. package/lib/forEachAccumulated.js +3 -5
  75. package/lib/getHostComponentFromComposite.js +3 -5
  76. package/lib/getIteratorFn.js +3 -5
  77. package/lib/instantiateReactComponent.js +4 -6
  78. package/lib/isTextInputElement.js +17 -19
  79. package/lib/lowPriorityWarning.js +62 -0
  80. package/lib/reactProdInvariant.js +2 -4
  81. package/lib/shallow/ARIADOMPropertyConfig.js +3 -5
  82. package/lib/shallow/AutoFocusUtils.js +3 -5
  83. package/lib/shallow/BeforeInputEventPlugin.js +3 -6
  84. package/lib/shallow/CSSProperty.js +10 -5
  85. package/lib/shallow/CSSPropertyOperations.js +17 -13
  86. package/lib/shallow/CallbackQueue.js +3 -5
  87. package/lib/shallow/ChangeEventPlugin.js +52 -88
  88. package/lib/shallow/DOMChildrenOperations.js +7 -8
  89. package/lib/shallow/DOMLazyTree.js +3 -5
  90. package/lib/shallow/DOMNamespaces.js +3 -5
  91. package/lib/shallow/DOMProperty.js +3 -6
  92. package/lib/shallow/DOMPropertyOperations.js +3 -7
  93. package/lib/shallow/Danger.js +3 -7
  94. package/lib/shallow/DefaultEventPluginOrder.js +3 -5
  95. package/lib/shallow/EnterLeaveEventPlugin.js +3 -7
  96. package/lib/shallow/EventConstants.js +3 -5
  97. package/lib/shallow/EventPluginHub.js +3 -9
  98. package/lib/shallow/EventPluginRegistry.js +3 -7
  99. package/lib/shallow/EventPluginUtils.js +3 -5
  100. package/lib/shallow/EventPropagators.js +3 -5
  101. package/lib/shallow/FallbackCompositionState.js +3 -5
  102. package/lib/shallow/HTMLDOMPropertyConfig.js +4 -5
  103. package/lib/shallow/KeyEscapeUtils.js +3 -5
  104. package/lib/shallow/LinkedValueUtils.js +10 -12
  105. package/lib/shallow/PluginModuleType.js +3 -5
  106. package/lib/shallow/PooledClass.js +3 -5
  107. package/lib/shallow/ReactBrowserEventEmitter.js +3 -9
  108. package/lib/shallow/ReactChildFiber.js +3 -6
  109. package/lib/shallow/ReactChildReconciler.js +7 -10
  110. package/lib/shallow/ReactComponentBrowserEnvironment.js +3 -7
  111. package/lib/shallow/ReactComponentEnvironment.js +3 -7
  112. package/lib/shallow/ReactCompositeComponent.js +5 -9
  113. package/lib/shallow/ReactCoroutine.js +3 -5
  114. package/lib/shallow/ReactDOM.js +5 -7
  115. package/lib/shallow/ReactDOMComponent.js +40 -29
  116. package/lib/shallow/ReactDOMComponentFlags.js +3 -5
  117. package/lib/shallow/ReactDOMComponentTree.js +3 -5
  118. package/lib/shallow/ReactDOMContainerInfo.js +3 -5
  119. package/lib/shallow/ReactDOMEmptyComponent.js +3 -5
  120. package/lib/shallow/ReactDOMFeatureFlags.js +3 -5
  121. package/lib/shallow/ReactDOMFiber.js +3 -6
  122. package/lib/shallow/ReactDOMIDOperations.js +3 -6
  123. package/lib/shallow/ReactDOMInput.js +8 -8
  124. package/lib/shallow/ReactDOMInvalidARIAHook.js +3 -5
  125. package/lib/shallow/ReactDOMNullInputValuePropHook.js +3 -5
  126. package/lib/shallow/ReactDOMOption.js +3 -6
  127. package/lib/shallow/ReactDOMSelect.js +3 -5
  128. package/lib/shallow/ReactDOMSelection.js +3 -5
  129. package/lib/shallow/ReactDOMServer.js +3 -5
  130. package/lib/shallow/ReactDOMTextComponent.js +3 -7
  131. package/lib/shallow/ReactDOMTextarea.js +3 -5
  132. package/lib/shallow/ReactDOMTreeTraversal.js +3 -5
  133. package/lib/shallow/ReactDOMUnknownPropertyHook.js +3 -5
  134. package/lib/shallow/ReactDebugTool.js +6 -6
  135. package/lib/shallow/ReactDefaultBatchingStrategy.js +3 -5
  136. package/lib/shallow/ReactDefaultInjection.js +3 -5
  137. package/lib/shallow/ReactElementSymbol.js +3 -5
  138. package/lib/shallow/ReactEmptyComponent.js +3 -5
  139. package/lib/shallow/ReactErrorUtils.js +6 -6
  140. package/lib/shallow/ReactEventEmitterMixin.js +3 -6
  141. package/lib/shallow/ReactEventListener.js +3 -5
  142. package/lib/shallow/ReactFeatureFlags.js +3 -5
  143. package/lib/shallow/ReactFiber.js +3 -7
  144. package/lib/shallow/ReactFiberBeginWork.js +3 -6
  145. package/lib/shallow/ReactFiberCommitWork.js +3 -6
  146. package/lib/shallow/ReactFiberCompleteWork.js +3 -7
  147. package/lib/shallow/ReactFiberReconciler.js +3 -5
  148. package/lib/shallow/ReactFiberRoot.js +3 -5
  149. package/lib/shallow/ReactFiberScheduler.js +3 -5
  150. package/lib/shallow/ReactFiberUpdateQueue.js +3 -5
  151. package/lib/shallow/ReactHostComponent.js +3 -5
  152. package/lib/shallow/ReactHostOperationHistoryHook.js +3 -5
  153. package/lib/shallow/ReactInjection.js +3 -5
  154. package/lib/shallow/ReactInputSelection.js +3 -6
  155. package/lib/shallow/ReactInstanceMap.js +3 -7
  156. package/lib/shallow/ReactInstanceType.js +3 -5
  157. package/lib/shallow/ReactInstrumentation.js +3 -5
  158. package/lib/shallow/ReactInvalidSetStateWarningHook.js +3 -5
  159. package/lib/shallow/ReactMarkupChecksum.js +3 -5
  160. package/lib/shallow/ReactMount.js +10 -12
  161. package/lib/shallow/ReactMultiChild.js +3 -9
  162. package/lib/shallow/ReactMultiChildUpdateTypes.js +3 -5
  163. package/lib/shallow/ReactNodeTypes.js +3 -5
  164. package/lib/shallow/ReactOwner.js +3 -6
  165. package/lib/shallow/ReactPerf.js +9 -11
  166. package/lib/shallow/ReactPriorityLevel.js +5 -6
  167. package/lib/shallow/ReactPropTypeLocationNames.js +3 -5
  168. package/lib/shallow/ReactPropTypeLocations.js +3 -5
  169. package/lib/shallow/ReactPropTypesSecret.js +3 -5
  170. package/lib/shallow/ReactReconcileTransaction.js +3 -5
  171. package/lib/shallow/ReactReconciler.js +5 -9
  172. package/lib/shallow/ReactRef.js +3 -5
  173. package/lib/shallow/ReactReifiedYield.js +3 -5
  174. package/lib/shallow/ReactServerBatchingStrategy.js +3 -5
  175. package/lib/shallow/ReactServerRendering.js +3 -5
  176. package/lib/shallow/ReactServerRenderingTransaction.js +3 -5
  177. package/lib/shallow/ReactServerUpdateQueue.js +3 -5
  178. package/lib/shallow/ReactShallowRenderer.js +3 -5
  179. package/lib/shallow/ReactSimpleEmptyComponent.js +5 -7
  180. package/lib/shallow/ReactSyntheticEventType.js +3 -5
  181. package/lib/shallow/ReactTestEmptyComponent.js +3 -5
  182. package/lib/shallow/ReactTestMount.js +8 -8
  183. package/lib/shallow/ReactTestReconcileTransaction.js +2 -4
  184. package/lib/shallow/ReactTestRenderer.js +4 -5
  185. package/lib/shallow/ReactTestTextComponent.js +3 -5
  186. package/lib/shallow/ReactTypeOfWork.js +3 -5
  187. package/lib/shallow/ReactTypes.js +3 -5
  188. package/lib/shallow/ReactUpdateQueue.js +4 -8
  189. package/lib/shallow/ReactUpdates.js +4 -6
  190. package/lib/shallow/ReactVersion.js +4 -6
  191. package/lib/shallow/ResponderEventPlugin.js +3 -7
  192. package/lib/shallow/ResponderSyntheticEvent.js +3 -5
  193. package/lib/shallow/ResponderTouchHistoryStore.js +3 -5
  194. package/lib/shallow/SVGDOMPropertyConfig.js +3 -5
  195. package/lib/shallow/SelectEventPlugin.js +3 -8
  196. package/lib/shallow/SimpleEventPlugin.js +3 -7
  197. package/lib/shallow/SyntheticAnimationEvent.js +3 -5
  198. package/lib/shallow/SyntheticClipboardEvent.js +3 -5
  199. package/lib/shallow/SyntheticCompositionEvent.js +3 -5
  200. package/lib/shallow/SyntheticDragEvent.js +3 -5
  201. package/lib/shallow/SyntheticEvent.js +34 -33
  202. package/lib/shallow/SyntheticFocusEvent.js +3 -5
  203. package/lib/shallow/SyntheticInputEvent.js +3 -5
  204. package/lib/shallow/SyntheticKeyboardEvent.js +3 -5
  205. package/lib/shallow/SyntheticMouseEvent.js +3 -5
  206. package/lib/shallow/SyntheticTouchEvent.js +3 -5
  207. package/lib/shallow/SyntheticTransitionEvent.js +3 -5
  208. package/lib/shallow/SyntheticUIEvent.js +3 -5
  209. package/lib/shallow/SyntheticWheelEvent.js +6 -11
  210. package/lib/shallow/TapEventPlugin.js +3 -7
  211. package/lib/shallow/Transaction.js +6 -5
  212. package/lib/shallow/ViewportMetrics.js +3 -7
  213. package/lib/shallow/accumulate.js +3 -5
  214. package/lib/shallow/accumulateInto.js +3 -5
  215. package/lib/shallow/adler32.js +3 -5
  216. package/lib/shallow/canDefineProperty.js +3 -5
  217. package/lib/shallow/checkReactTypeSpec.js +3 -5
  218. package/lib/shallow/createMicrosoftUnsafeLocalFunction.js +3 -5
  219. package/lib/shallow/dangerousStyleValue.js +5 -7
  220. package/lib/shallow/deprecated.js +6 -8
  221. package/lib/shallow/escapeTextContentForBrowser.js +3 -6
  222. package/lib/shallow/findDOMNode.js +3 -5
  223. package/lib/shallow/flattenChildren.js +3 -5
  224. package/lib/shallow/forEachAccumulated.js +3 -5
  225. package/lib/shallow/getEventCharCode.js +3 -5
  226. package/lib/shallow/getEventKey.js +27 -19
  227. package/lib/shallow/getEventModifierState.js +7 -9
  228. package/lib/shallow/getEventTarget.js +3 -5
  229. package/lib/shallow/getHostComponentFromComposite.js +3 -5
  230. package/lib/shallow/getIteratorFn.js +3 -5
  231. package/lib/shallow/getNodeForCharacterOffset.js +3 -5
  232. package/lib/shallow/getTextContentAccessor.js +3 -5
  233. package/lib/shallow/getVendorPrefixedEventName.js +3 -5
  234. package/lib/shallow/inputValueTracking.js +120 -0
  235. package/lib/shallow/instantiateReactComponent.js +4 -6
  236. package/lib/shallow/isEventSupported.js +3 -5
  237. package/lib/shallow/isTextInputElement.js +17 -19
  238. package/lib/shallow/lowPriorityWarning.js +62 -0
  239. package/lib/shallow/quoteAttributeValueForBrowser.js +3 -5
  240. package/lib/shallow/reactProdInvariant.js +2 -4
  241. package/lib/shallow/renderSubtreeIntoContainer.js +3 -5
  242. package/lib/shallow/setInnerHTML.js +4 -6
  243. package/lib/shallow/setTextContent.js +3 -5
  244. package/lib/shallow/shouldUpdateReactComponent.js +3 -5
  245. package/lib/shallow/traverseAllChildren.js +4 -6
  246. package/lib/shallow/validateDOMNesting.js +4 -12
  247. package/lib/shouldUpdateReactComponent.js +3 -5
  248. package/lib/traverseAllChildren.js +4 -6
  249. package/package.json +21 -17
  250. package/PATENTS +0 -33
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Copyright (c) 2013-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ var ReactDOMComponentTree = require('./ReactDOMComponentTree');
12
+
13
+ function isCheckable(elem) {
14
+ var type = elem.type;
15
+ var nodeName = elem.nodeName;
16
+ return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
17
+ }
18
+
19
+ function getTracker(inst) {
20
+ return inst._wrapperState.valueTracker;
21
+ }
22
+
23
+ function attachTracker(inst, tracker) {
24
+ inst._wrapperState.valueTracker = tracker;
25
+ }
26
+
27
+ function detachTracker(inst) {
28
+ inst._wrapperState.valueTracker = null;
29
+ }
30
+
31
+ function getValueFromNode(node) {
32
+ var value;
33
+ if (node) {
34
+ value = isCheckable(node) ? '' + node.checked : node.value;
35
+ }
36
+ return value;
37
+ }
38
+
39
+ var inputValueTracking = {
40
+ // exposed for testing
41
+ _getTrackerFromNode: function (node) {
42
+ return getTracker(ReactDOMComponentTree.getInstanceFromNode(node));
43
+ },
44
+
45
+
46
+ track: function (inst) {
47
+ if (getTracker(inst)) {
48
+ return;
49
+ }
50
+
51
+ var node = ReactDOMComponentTree.getNodeFromInstance(inst);
52
+ var valueField = isCheckable(node) ? 'checked' : 'value';
53
+ var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
54
+
55
+ var currentValue = '' + node[valueField];
56
+
57
+ // if someone has already defined a value or Safari, then bail
58
+ // and don't track value will cause over reporting of changes,
59
+ // but it's better then a hard failure
60
+ // (needed for certain tests that spyOn input values and Safari)
61
+ if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
62
+ return;
63
+ }
64
+
65
+ Object.defineProperty(node, valueField, {
66
+ enumerable: descriptor.enumerable,
67
+ configurable: true,
68
+ get: function () {
69
+ return descriptor.get.call(this);
70
+ },
71
+ set: function (value) {
72
+ currentValue = '' + value;
73
+ descriptor.set.call(this, value);
74
+ }
75
+ });
76
+
77
+ attachTracker(inst, {
78
+ getValue: function () {
79
+ return currentValue;
80
+ },
81
+ setValue: function (value) {
82
+ currentValue = '' + value;
83
+ },
84
+ stopTracking: function () {
85
+ detachTracker(inst);
86
+ delete node[valueField];
87
+ }
88
+ });
89
+ },
90
+
91
+ updateValueIfChanged: function (inst) {
92
+ if (!inst) {
93
+ return false;
94
+ }
95
+ var tracker = getTracker(inst);
96
+
97
+ if (!tracker) {
98
+ inputValueTracking.track(inst);
99
+ return true;
100
+ }
101
+
102
+ var lastValue = tracker.getValue();
103
+ var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst));
104
+
105
+ if (nextValue !== lastValue) {
106
+ tracker.setValue(nextValue);
107
+ return true;
108
+ }
109
+
110
+ return false;
111
+ },
112
+ stopTracking: function (inst) {
113
+ var tracker = getTracker(inst);
114
+ if (tracker) {
115
+ tracker.stopTracking();
116
+ }
117
+ }
118
+ };
119
+
120
+ module.exports = inputValueTracking;
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -67,7 +65,7 @@ function instantiateReactComponent(node, shouldHaveDebugID) {
67
65
  var info = '';
68
66
  if (process.env.NODE_ENV !== 'production') {
69
67
  if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
70
- info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
68
+ info += ' You likely forgot to export your component from the file ' + "it's defined in.";
71
69
  }
72
70
  }
73
71
  info += getDeclarationErrorAddendum(element._owner);
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -16,21 +14,21 @@
16
14
  */
17
15
 
18
16
  var supportedInputTypes = {
19
- 'color': true,
20
- 'date': true,
21
- 'datetime': true,
17
+ color: true,
18
+ date: true,
19
+ datetime: true,
22
20
  'datetime-local': true,
23
- 'email': true,
24
- 'month': true,
25
- 'number': true,
26
- 'password': true,
27
- 'range': true,
28
- 'search': true,
29
- 'tel': true,
30
- 'text': true,
31
- 'time': true,
32
- 'url': true,
33
- 'week': true
21
+ email: true,
22
+ month: true,
23
+ number: true,
24
+ password: true,
25
+ range: true,
26
+ search: true,
27
+ tel: true,
28
+ text: true,
29
+ time: true,
30
+ url: true,
31
+ week: true
34
32
  };
35
33
 
36
34
  function isTextInputElement(elem) {
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright (c) 2014-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ /**
12
+ * Forked from fbjs/warning:
13
+ * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
14
+ *
15
+ * Only change is we use console.warn instead of console.error,
16
+ * and do nothing when 'console' is not supported.
17
+ * This really simplifies the code.
18
+ * ---
19
+ * Similar to invariant but only logs a warning if the condition is not met.
20
+ * This can be used to log issues in development environments in critical
21
+ * paths. Removing the logging code for production environments will keep the
22
+ * same logic and follow the same code paths.
23
+ */
24
+
25
+ var lowPriorityWarning = function () {};
26
+
27
+ if (process.env.NODE_ENV !== 'production') {
28
+ var printWarning = function (format) {
29
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
30
+ args[_key - 1] = arguments[_key];
31
+ }
32
+
33
+ var argIndex = 0;
34
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
35
+ return args[argIndex++];
36
+ });
37
+ if (typeof console !== 'undefined') {
38
+ console.warn(message);
39
+ }
40
+ try {
41
+ // --- Welcome to debugging React ---
42
+ // This error was thrown as a convenience so that you can use this stack
43
+ // to find the callsite that caused this warning to fire.
44
+ throw new Error(message);
45
+ } catch (x) {}
46
+ };
47
+
48
+ lowPriorityWarning = function (condition, format) {
49
+ if (format === undefined) {
50
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
51
+ }
52
+ if (!condition) {
53
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
54
+ args[_key2 - 2] = arguments[_key2];
55
+ }
56
+
57
+ printWarning.apply(undefined, [format].concat(args));
58
+ }
59
+ };
60
+ }
61
+
62
+ module.exports = lowPriorityWarning;
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
2
  * Copyright (c) 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -76,7 +74,7 @@ if (ExecutionEnvironment.canUseDOM) {
76
74
  // in hopes that this is preserved even if "\uFEFF" is transformed to
77
75
  // the actual Unicode character (by Babel, for example).
78
76
  // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
79
- node.innerHTML = String.fromCharCode(0xFEFF) + html;
77
+ node.innerHTML = String.fromCharCode(0xfeff) + html;
80
78
 
81
79
  // deleteData leaves an empty `TextNode` which offsets the index of all
82
80
  // children. Definitely want to avoid this.
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -131,7 +129,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
131
129
  if (process.env.NODE_ENV !== 'production') {
132
130
  addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
133
131
  if (children._isReactElement) {
134
- addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
132
+ addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
135
133
  }
136
134
  if (ReactCurrentOwner.current) {
137
135
  var name = ReactCurrentOwner.current.getName();
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2015-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2015-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -121,7 +119,6 @@ if (process.env.NODE_ENV !== 'production') {
121
119
  // but
122
120
  case 'option':
123
121
  return tag === '#text';
124
-
125
122
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
126
123
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
127
124
  // No special behavior since these rules fall back to "in body" mode for
@@ -130,25 +127,20 @@ if (process.env.NODE_ENV !== 'production') {
130
127
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
131
128
  case 'tr':
132
129
  return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
133
-
134
130
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
135
131
  case 'tbody':
136
132
  case 'thead':
137
133
  case 'tfoot':
138
134
  return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
139
-
140
135
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
141
136
  case 'colgroup':
142
137
  return tag === 'col' || tag === 'template';
143
-
144
138
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
145
139
  case 'table':
146
140
  return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
147
-
148
141
  // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
149
142
  case 'head':
150
143
  return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
151
-
152
144
  // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
153
145
  case 'html':
154
146
  return tag === 'head' || tag === 'body';
@@ -344,7 +336,7 @@ if (process.env.NODE_ENV !== 'production') {
344
336
  tagDisplayName = 'Text nodes';
345
337
  } else {
346
338
  tagDisplayName = 'Whitespace text nodes';
347
- whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
339
+ whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
348
340
  }
349
341
  } else {
350
342
  tagDisplayName = '<' + childTag + '>';
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -131,7 +129,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
131
129
  if (process.env.NODE_ENV !== 'production') {
132
130
  addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
133
131
  if (children._isReactElement) {
134
- addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
132
+ addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
135
133
  }
136
134
  if (ReactCurrentOwner.current) {
137
135
  var name = ReactCurrentOwner.current.getName();
package/package.json CHANGED
@@ -1,32 +1,36 @@
1
1
  {
2
- "name": "react-test-renderer",
3
- "version": "15.5.4",
4
- "description": "React package for snapshot testing.",
5
- "main": "index.js",
6
- "repository": "facebook/react",
7
- "keywords": [
8
- "react",
9
- "react-native",
10
- "react-testing"
11
- ],
12
- "license": "BSD-3-Clause",
13
2
  "bugs": {
14
3
  "url": "https://github.com/facebook/react/issues"
15
4
  },
16
- "homepage": "https://facebook.github.io/react/",
5
+ "bundleDependencies": false,
17
6
  "dependencies": {
18
7
  "fbjs": "^0.8.9",
19
8
  "object-assign": "^4.1.0"
20
9
  },
21
- "peerDependencies": {
22
- "react": "^15.5.0"
23
- },
10
+ "deprecated": false,
11
+ "description": "React package for snapshot testing.",
24
12
  "files": [
25
13
  "LICENSE",
26
- "PATENTS",
27
14
  "README.md",
28
15
  "index.js",
29
16
  "shallow.js",
30
17
  "lib/"
31
- ]
18
+ ],
19
+ "homepage": "https://facebook.github.io/react/",
20
+ "keywords": [
21
+ "react",
22
+ "react-native",
23
+ "react-testing"
24
+ ],
25
+ "license": "MIT",
26
+ "main": "index.js",
27
+ "name": "react-test-renderer",
28
+ "peerDependencies": {
29
+ "react": "^15.7.0"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/facebook/react.git"
34
+ },
35
+ "version": "15.7.0"
32
36
  }
package/PATENTS DELETED
@@ -1,33 +0,0 @@
1
- Additional Grant of Patent Rights Version 2
2
-
3
- "Software" means the React software distributed by Facebook, Inc.
4
-
5
- Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
6
- ("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
7
- (subject to the termination provision below) license under any Necessary
8
- Claims, to make, have made, use, sell, offer to sell, import, and otherwise
9
- transfer the Software. For avoidance of doubt, no license is granted under
10
- Facebook's rights in any patent claims that are infringed by (i) modifications
11
- to the Software made by you or any third party or (ii) the Software in
12
- combination with any software or other technology.
13
-
14
- The license granted hereunder will terminate, automatically and without notice,
15
- if you (or any of your subsidiaries, corporate affiliates or agents) initiate
16
- directly or indirectly, or take a direct financial interest in, any Patent
17
- Assertion: (i) against Facebook or any of its subsidiaries or corporate
18
- affiliates, (ii) against any party if such Patent Assertion arises in whole or
19
- in part from any software, technology, product or service of Facebook or any of
20
- its subsidiaries or corporate affiliates, or (iii) against any party relating
21
- to the Software. Notwithstanding the foregoing, if Facebook or any of its
22
- subsidiaries or corporate affiliates files a lawsuit alleging patent
23
- infringement against you in the first instance, and you respond by filing a
24
- patent infringement counterclaim in that lawsuit against that party that is
25
- unrelated to the Software, the license granted hereunder will not terminate
26
- under section (i) of this paragraph due to such counterclaim.
27
-
28
- A "Necessary Claim" is a claim of a patent owned by Facebook that is
29
- necessarily infringed by the Software standing alone.
30
-
31
- A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
32
- or contributory infringement or inducement to infringe any patent, including a
33
- cross-claim or counterclaim.