react 0.13.0-alpha.2 → 0.13.0-rc2

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 (183) hide show
  1. package/dist/JSXTransformer.js +1798 -1194
  2. package/dist/react-with-addons.js +2640 -2046
  3. package/dist/react-with-addons.min.js +7 -6
  4. package/dist/react.js +2459 -1930
  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 +43 -16
  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 +10 -15
  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 +9 -2
  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 +11 -14
  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 +9 -5
  41. package/lib/ReactChildren.js +3 -2
  42. package/lib/ReactClass.js +144 -76
  43. package/lib/ReactComponent.js +99 -166
  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 +261 -480
  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 +23 -48
  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 -12
  62. package/lib/ReactDOMTextarea.js +1 -1
  63. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  64. package/lib/ReactDefaultInjection.js +25 -1
  65. package/lib/ReactDefaultPerf.js +11 -3
  66. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  67. package/lib/ReactElement.js +59 -4
  68. package/lib/ReactElementValidator.js +141 -85
  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 -2
  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 +35 -0
  79. package/lib/ReactLink.js +1 -1
  80. package/lib/ReactMarkupChecksum.js +1 -1
  81. package/lib/ReactMount.js +77 -20
  82. package/lib/ReactMultiChild.js +7 -4
  83. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  84. package/lib/ReactNativeComponent.js +33 -36
  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 +5 -3
  91. package/lib/ReactPutListenerQueue.js +1 -1
  92. package/lib/ReactReconcileTransaction.js +1 -1
  93. package/lib/ReactReconciler.js +120 -0
  94. package/lib/ReactRef.js +40 -67
  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 +48 -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 +295 -0
  104. package/lib/ReactUpdates.js +11 -20
  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 +20 -20
  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 +12 -1
  177. package/package.json +1 -1
  178. package/lib/ReactComponentBase.js +0 -126
  179. package/lib/accumulate.js +0 -47
  180. package/lib/copyProperties.js +0 -56
  181. package/lib/merge.js +0 -34
  182. package/lib/mergeInto.js +0 -24
  183. 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
@@ -15,6 +15,7 @@ var CallbackQueue = require("./CallbackQueue");
15
15
  var PooledClass = require("./PooledClass");
16
16
  var ReactCurrentOwner = require("./ReactCurrentOwner");
17
17
  var ReactPerf = require("./ReactPerf");
18
+ var ReactReconciler = require("./ReactReconciler");
18
19
  var Transaction = require("./Transaction");
19
20
 
20
21
  var assign = require("./Object.assign");
@@ -104,9 +105,9 @@ assign(
104
105
 
105
106
  PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
106
107
 
107
- function batchedUpdates(callback, a, b) {
108
+ function batchedUpdates(callback, a, b, c, d) {
108
109
  ensureInjected();
109
- batchingStrategy.batchedUpdates(callback, a, b);
110
+ batchingStrategy.batchedUpdates(callback, a, b, c, d);
110
111
  }
111
112
 
112
113
  /**
@@ -146,7 +147,11 @@ function runBatchedUpdates(transaction) {
146
147
  // stash the callbacks first
147
148
  var callbacks = component._pendingCallbacks;
148
149
  component._pendingCallbacks = null;
149
- component.performUpdateIfNecessary(transaction.reconcileTransaction);
150
+
151
+ ReactReconciler.performUpdateIfNecessary(
152
+ component,
153
+ transaction.reconcileTransaction
154
+ );
150
155
 
151
156
  if (callbacks) {
152
157
  for (var j = 0; j < callbacks.length; j++) {
@@ -190,13 +195,7 @@ flushBatchedUpdates = ReactPerf.measure(
190
195
  * Mark a component as needing a rerender, adding an optional callback to a
191
196
  * list of functions which will be executed once the rerender occurs.
192
197
  */
193
- function enqueueUpdate(component, callback) {
194
- ("production" !== process.env.NODE_ENV ? invariant(
195
- !callback || typeof callback === 'function',
196
- 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +
197
- '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +
198
- 'isn\'t callable.'
199
- ) : invariant(!callback || typeof callback === 'function'));
198
+ function enqueueUpdate(component) {
200
199
  ensureInjected();
201
200
 
202
201
  // Various parts of our code (such as ReactCompositeComponent's
@@ -213,19 +212,11 @@ function enqueueUpdate(component, callback) {
213
212
  ) : null);
214
213
 
215
214
  if (!batchingStrategy.isBatchingUpdates) {
216
- batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);
215
+ batchingStrategy.batchedUpdates(enqueueUpdate, component);
217
216
  return;
218
217
  }
219
218
 
220
219
  dirtyComponents.push(component);
221
-
222
- if (callback) {
223
- if (component._pendingCallbacks) {
224
- component._pendingCallbacks.push(callback);
225
- } else {
226
- component._pendingCallbacks = [callback];
227
- }
228
- }
229
220
  }
230
221
 
231
222
  /**
@@ -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
@@ -23,6 +23,7 @@ var React = require("./React");
23
23
  var ReactComponentWithPureRenderMixin =
24
24
  require("./ReactComponentWithPureRenderMixin");
25
25
  var ReactCSSTransitionGroup = require("./ReactCSSTransitionGroup");
26
+ var ReactFragment = require("./ReactFragment");
26
27
  var ReactTransitionGroup = require("./ReactTransitionGroup");
27
28
  var ReactUpdates = require("./ReactUpdates");
28
29
 
@@ -39,6 +40,7 @@ React.addons = {
39
40
  batchedUpdates: ReactUpdates.batchedUpdates,
40
41
  classSet: cx,
41
42
  cloneWithProps: cloneWithProps,
43
+ createFragment: ReactFragment.create,
42
44
  update: update
43
45
  };
44
46
 
@@ -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
@@ -285,8 +285,8 @@ var topLevelEventsToDispatchConfig = {
285
285
  topWheel: eventTypes.wheel
286
286
  };
287
287
 
288
- for (var topLevelType in topLevelEventsToDispatchConfig) {
289
- topLevelEventsToDispatchConfig[topLevelType].dependencies = [topLevelType];
288
+ for (var type in topLevelEventsToDispatchConfig) {
289
+ topLevelEventsToDispatchConfig[type].dependencies = [type];
290
290
  }
291
291
 
292
292
  var SimpleEventPlugin = {
@@ -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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 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
@@ -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
@@ -61,7 +61,7 @@ var invariant = require("./invariant");
61
61
  * content.
62
62
  * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
63
63
  * to preserve the `scrollTop` (an automatic scroll aware DOM).
64
- * - (Future use case): Layout calculations before and after DOM upates.
64
+ * - (Future use case): Layout calculations before and after DOM updates.
65
65
  *
66
66
  * Transactional plugin API:
67
67
  * - A module that has an `initialize` method that returns any precomputation.
@@ -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
package/lib/adler32.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/camelize.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 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,12 +1,12 @@
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
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @typechecks
9
+ * @typechecks static-only
10
10
  * @providesModule cloneWithProps
11
11
  */
12
12
 
@@ -24,10 +24,10 @@ var CHILDREN_PROP = keyOf({children: null});
24
24
  * Sometimes you want to change the props of a child passed to you. Usually
25
25
  * this is to add a CSS class.
26
26
  *
27
- * @param {object} child child component you'd like to clone
27
+ * @param {ReactElement} child child element you'd like to clone
28
28
  * @param {object} props props you'd like to modify. className and style will be
29
29
  * merged automatically.
30
- * @return {object} a clone of child with props merged in.
30
+ * @return {ReactElement} a clone of child with props merged in.
31
31
  */
32
32
  function cloneWithProps(child, props) {
33
33
  if ("production" !== process.env.NODE_ENV) {
@@ -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,12 +1,12 @@
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
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @providesModule createArrayFrom
9
+ * @providesModule createArrayFromMixed
10
10
  * @typechecks
11
11
  */
12
12
 
@@ -56,10 +56,10 @@ function hasArrayNature(obj) {
56
56
  *
57
57
  * This is mostly useful idiomatically:
58
58
  *
59
- * var createArrayFrom = require('createArrayFrom');
59
+ * var createArrayFromMixed = require('createArrayFromMixed');
60
60
  *
61
61
  * function takesOneOrMoreThings(things) {
62
- * things = createArrayFrom(things);
62
+ * things = createArrayFromMixed(things);
63
63
  * ...
64
64
  * }
65
65
  *
@@ -71,7 +71,7 @@ function hasArrayNature(obj) {
71
71
  * @param {*} obj
72
72
  * @return {array}
73
73
  */
74
- function createArrayFrom(obj) {
74
+ function createArrayFromMixed(obj) {
75
75
  if (!hasArrayNature(obj)) {
76
76
  return [obj];
77
77
  } else if (Array.isArray(obj)) {
@@ -81,4 +81,4 @@ function createArrayFrom(obj) {
81
81
  }
82
82
  }
83
83
 
84
- module.exports = createArrayFrom;
84
+ module.exports = createArrayFromMixed;
@@ -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
@@ -14,7 +14,7 @@
14
14
 
15
15
  var ExecutionEnvironment = require("./ExecutionEnvironment");
16
16
 
17
- var createArrayFrom = require("./createArrayFrom");
17
+ var createArrayFromMixed = require("./createArrayFromMixed");
18
18
  var getMarkupWrap = require("./getMarkupWrap");
19
19
  var invariant = require("./invariant");
20
20
 
@@ -73,10 +73,10 @@ function createNodesFromMarkup(markup, handleScript) {
73
73
  handleScript,
74
74
  'createNodesFromMarkup(...): Unexpected <script> element rendered.'
75
75
  ) : invariant(handleScript));
76
- createArrayFrom(scripts).forEach(handleScript);
76
+ createArrayFromMixed(scripts).forEach(handleScript);
77
77
  }
78
78
 
79
- var nodes = createArrayFrom(node.childNodes);
79
+ var nodes = createArrayFromMixed(node.childNodes);
80
80
  while (node.lastChild) {
81
81
  node.removeChild(node.lastChild);
82
82
  }
package/lib/cx.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
@@ -24,7 +24,22 @@
24
24
  * @param [string ...] Variable list of classNames in the string case.
25
25
  * @return string Renderable space-separated CSS className.
26
26
  */
27
+
28
+ 'use strict';
29
+ var warning = require("./warning");
30
+
31
+ var warned = false;
32
+
27
33
  function cx(classNames) {
34
+ if ("production" !== process.env.NODE_ENV) {
35
+ ("production" !== process.env.NODE_ENV ? warning(
36
+ warned,
37
+ 'React.addons.classSet will be deprecated in a future version. See ' +
38
+ 'http://fb.me/react-addons-classset'
39
+ ) : null);
40
+ warned = true;
41
+ }
42
+
28
43
  if (typeof classNames == 'object') {
29
44
  return Object.keys(classNames).filter(function(className) {
30
45
  return classNames[className];
@@ -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