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
package/lib/isTextNode.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/keyMirror.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/keyOf.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/mapObject.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/onlyChild.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
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2013-2015, 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 quoteAttributeValueForBrowser
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var escapeTextContentForBrowser = require("./escapeTextContentForBrowser");
15
+
16
+ /**
17
+ * Escapes attribute value to prevent scripting attacks.
18
+ *
19
+ * @param {*} value Value to escape.
20
+ * @return {string} An escaped string.
21
+ */
22
+ function quoteAttributeValueForBrowser(value) {
23
+ return '"' + escapeTextContentForBrowser(value) + '"';
24
+ }
25
+
26
+ module.exports = quoteAttributeValueForBrowser;
@@ -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
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright 2013-2015, 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 setTextContent
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var ExecutionEnvironment = require("./ExecutionEnvironment");
15
+ var escapeTextContentForBrowser = require("./escapeTextContentForBrowser");
16
+ var setInnerHTML = require("./setInnerHTML");
17
+
18
+ /**
19
+ * Set the textContent property of a node, ensuring that whitespace is preserved
20
+ * even in IE8. innerText is a poor substitute for textContent and, among many
21
+ * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
22
+ * as it should.
23
+ *
24
+ * @param {DOMElement} node
25
+ * @param {string} text
26
+ * @internal
27
+ */
28
+ var setTextContent = function(node, text) {
29
+ node.textContent = text;
30
+ };
31
+
32
+ if (ExecutionEnvironment.canUseDOM) {
33
+ if (!('textContent' in document.documentElement)) {
34
+ setTextContent = function(node, text) {
35
+ setInnerHTML(node, escapeTextContentForBrowser(text));
36
+ };
37
+ }
38
+ }
39
+
40
+ module.exports = setTextContent;
@@ -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,7 +12,7 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var monitorCodeUse = require("./monitorCodeUse");
15
+ var warning = require("./warning");
16
16
 
17
17
  /**
18
18
  * Given a `prevElement` and `nextElement`, determines if the existing
@@ -57,15 +57,37 @@ function shouldUpdateReactComponent(prevElement, nextElement) {
57
57
  nextElement.type.displayName != null) {
58
58
  nextDisplayName = nextElement.type.displayName;
59
59
  }
60
- monitorCodeUse(
61
- 'react_should_update_owner_is_useful',
62
- {
63
- key: prevElement.key,
64
- prevOwner: prevName,
65
- nextOwner: nextName,
66
- nextDisplayName: nextDisplayName
60
+ if (nextElement.type != null && typeof nextElement.type === 'string') {
61
+ nextDisplayName = nextElement.type;
62
+ }
63
+ if (typeof nextElement.type !== 'string' ||
64
+ nextElement.type === 'input' ||
65
+ nextElement.type === 'textarea') {
66
+ if ((prevElement._owner != null &&
67
+ prevElement._owner._isOwnerNecessary === false) ||
68
+ (nextElement._owner != null &&
69
+ nextElement._owner._isOwnerNecessary === false)) {
70
+ if (prevElement._owner != null) {
71
+ prevElement._owner._isOwnerNecessary = true;
72
+ }
73
+ if (nextElement._owner != null) {
74
+ nextElement._owner._isOwnerNecessary = true;
75
+ }
76
+ ("production" !== process.env.NODE_ENV ? warning(
77
+ false,
78
+ '<%s /> is being rendered by both %s and %s using the same ' +
79
+ 'key (%s) in the same place. Currently, this means that ' +
80
+ 'they don\'t preserve state. This behavior should be very ' +
81
+ 'rare so we\'re considering deprecating it. Please contact ' +
82
+ 'the React team and explain your use case so that we can ' +
83
+ 'take that into consideration.',
84
+ nextDisplayName || 'Unknown Component',
85
+ prevName || '[Unknown]',
86
+ nextName || '[Unknown]',
87
+ prevElement.key
88
+ ) : null);
67
89
  }
68
- );
90
+ }
69
91
  }
70
92
  }
71
93
  return ownersMatch;
package/lib/toArray.js CHANGED
@@ -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
@@ -16,7 +16,7 @@ var invariant = require("./invariant");
16
16
  * Convert array-like objects to arrays.
17
17
  *
18
18
  * This API assumes the caller knows the contents of the data type. For less
19
- * well defined inputs use createArrayFrom.
19
+ * well defined inputs use createArrayFromMixed.
20
20
  *
21
21
  * @param {object|function|filelist} obj
22
22
  * @return {array}
@@ -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,10 +12,12 @@
12
12
  'use strict';
13
13
 
14
14
  var ReactElement = require("./ReactElement");
15
+ var ReactFragment = require("./ReactFragment");
15
16
  var ReactInstanceHandles = require("./ReactInstanceHandles");
16
17
 
17
18
  var getIteratorFn = require("./getIteratorFn");
18
19
  var invariant = require("./invariant");
20
+ var warning = require("./warning");
19
21
 
20
22
  var SEPARATOR = ReactInstanceHandles.SEPARATOR;
21
23
  var SUBSEPARATOR = ':';
@@ -33,6 +35,8 @@ var userProvidedKeyEscaperLookup = {
33
35
 
34
36
  var userProvidedKeyEscapeRegex = /[=.:]/g;
35
37
 
38
+ var didWarnAboutMaps = false;
39
+
36
40
  function userProvidedKeyEscaper(match) {
37
41
  return userProvidedKeyEscaperLookup[match];
38
42
  }
@@ -157,6 +161,15 @@ function traverseAllChildrenImpl(
157
161
  );
158
162
  }
159
163
  } else {
164
+ if ("production" !== process.env.NODE_ENV) {
165
+ ("production" !== process.env.NODE_ENV ? warning(
166
+ didWarnAboutMaps,
167
+ 'Using Maps as children is not yet fully supported. It is an ' +
168
+ 'experimental feature that might be removed. Convert it to a ' +
169
+ 'sequence / iterable of keyed ReactElements instead.'
170
+ ) : null);
171
+ didWarnAboutMaps = true;
172
+ }
160
173
  // Iterator will provide entry [k,v] tuples rather than values.
161
174
  while (!(step = iterator.next()).done) {
162
175
  var entry = step.value;
@@ -184,9 +197,10 @@ function traverseAllChildrenImpl(
184
197
  'traverseAllChildren(...): Encountered an invalid child; DOM ' +
185
198
  'elements are not valid children of React components.'
186
199
  ) : invariant(children.nodeType !== 1));
187
- for (var key in children) {
188
- if (children.hasOwnProperty(key)) {
189
- child = children[key];
200
+ var fragment = ReactFragment.extract(children);
201
+ for (var key in fragment) {
202
+ if (fragment.hasOwnProperty(key)) {
203
+ child = fragment[key];
190
204
  nextName = (
191
205
  (nameSoFar !== '' ? nameSoFar + SUBSEPARATOR : SEPARATOR) +
192
206
  wrapUserProvidedKey(key) + SUBSEPARATOR +
package/lib/update.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/warning.js CHANGED
@@ -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
@@ -31,7 +31,14 @@ if ("production" !== process.env.NODE_ENV) {
31
31
  );
32
32
  }
33
33
 
34
- if (format.indexOf('Failed CompositeComponent proptype check. ') === 0) {
34
+ if (format.length < 10 || /^[s\W]*$/.test(format)) {
35
+ throw new Error(
36
+ 'The warning format should be able to uniquely identify this ' +
37
+ 'warning. Please, use a more descriptive format than: ' + format
38
+ );
39
+ }
40
+
41
+ if (format.indexOf('Failed Composite propType: ') === 0) {
35
42
  return; // Ignore CompositeComponent proptype check.
36
43
  }
37
44
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "0.13.0-beta.1",
4
+ "version": "0.13.0",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -1,56 +0,0 @@
1
- /**
2
- * Copyright 2013-2014, 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 copyProperties
10
- */
11
-
12
- "use strict";
13
-
14
- /**
15
- * Copy properties from one or more objects (up to 5) into the first object.
16
- * This is a shallow copy. It mutates the first object and also returns it.
17
- *
18
- * NOTE: `arguments` has a very significant performance penalty, which is why
19
- * we don't support unlimited arguments.
20
- */
21
- function copyProperties(obj, a, b, c, d, e, f) {
22
- obj = obj || {};
23
-
24
- if ("production" !== process.env.NODE_ENV) {
25
- if (f) {
26
- throw new Error('Too many arguments passed to copyProperties');
27
- }
28
- }
29
-
30
- var args = [a, b, c, d, e];
31
- var ii = 0, v;
32
- while (args[ii]) {
33
- v = args[ii++];
34
- for (var k in v) {
35
- obj[k] = v[k];
36
- }
37
-
38
- // IE ignores toString in object iteration.. See:
39
- // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html
40
- if (v.hasOwnProperty && v.hasOwnProperty('toString') &&
41
- (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {
42
- obj.toString = v.toString;
43
- }
44
- }
45
-
46
- return obj;
47
- }
48
-
49
- module.exports = copyProperties;
50
-
51
- // deprecation notice
52
- console.warn(
53
- 'react/lib/copyProperties has been deprecated and will be removed in the ' +
54
- 'next version of React. All uses can be replaced with ' +
55
- 'Object.assign(obj, a, b, ...) or _.extend(obj, a, b, ...).'
56
- );
package/lib/merge.js DELETED
@@ -1,34 +0,0 @@
1
- /**
2
- * Copyright 2013-2014, 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 merge
10
- */
11
-
12
- "use strict";
13
-
14
- var assign = require("./Object.assign");
15
-
16
- /**
17
- * Shallow merges two structures into a return value, without mutating either.
18
- *
19
- * @param {?object} one Optional object with properties to merge from.
20
- * @param {?object} two Optional object with properties to merge from.
21
- * @return {object} The shallow extension of one by two.
22
- */
23
- var merge = function(one, two) {
24
- return assign({}, one, two);
25
- };
26
-
27
- module.exports = merge;
28
-
29
- // deprecation notice
30
- console.warn(
31
- 'react/lib/merge has been deprecated and will be removed in the ' +
32
- 'next version of React. All uses can be replaced with ' +
33
- 'Object.assign({}, a, b) or _.extend({}, a, b).'
34
- );
package/lib/mergeInto.js DELETED
@@ -1,24 +0,0 @@
1
- /**
2
- * Copyright 2013-2014, 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 mergeInto
10
- * @typechecks static-only
11
- */
12
-
13
- "use strict";
14
-
15
- var assign = require("./Object.assign");
16
-
17
- module.exports = assign;
18
-
19
- // deprecation notice
20
- console.warn(
21
- 'react/lib/mergeInto has been deprecated and will be removed in the ' +
22
- 'next version of React. All uses can be replaced with ' +
23
- 'Object.assign(a, b, c, ...) or _.extend(a, b, c, ...).'
24
- );