react 0.14.7 → 0.15.0-alpha.1

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 (177) hide show
  1. package/LICENSE +1 -1
  2. package/dist/react-with-addons.js +2937 -3414
  3. package/dist/react-with-addons.min.js +7 -7
  4. package/dist/react.js +2762 -3034
  5. package/dist/react.min.js +7 -7
  6. package/lib/AutoFocusUtils.js +3 -15
  7. package/lib/BeforeInputEventPlugin.js +8 -25
  8. package/lib/CSSProperty.js +3 -1
  9. package/lib/CSSPropertyOperations.js +20 -6
  10. package/lib/CallbackQueue.js +12 -1
  11. package/lib/ChangeEventPlugin.js +58 -54
  12. package/lib/DOMChildrenOperations.js +21 -60
  13. package/lib/DOMLazyTree.js +95 -0
  14. package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
  15. package/lib/DOMProperty.js +7 -2
  16. package/lib/DOMPropertyOperations.js +66 -36
  17. package/lib/Danger.js +6 -7
  18. package/lib/DefaultEventPluginOrder.js +1 -1
  19. package/lib/EnterLeaveEventPlugin.js +24 -43
  20. package/lib/EventConstants.js +2 -1
  21. package/lib/EventPluginHub.js +15 -59
  22. package/lib/EventPluginRegistry.js +23 -2
  23. package/lib/EventPluginUtils.js +60 -35
  24. package/lib/EventPropagators.js +19 -17
  25. package/lib/FallbackCompositionState.js +1 -2
  26. package/lib/HTMLDOMPropertyConfig.js +21 -23
  27. package/lib/LinkedInput.js +49 -0
  28. package/lib/LinkedStateMixin.js +1 -2
  29. package/lib/LinkedValueUtils.js +1 -2
  30. package/lib/MetaMatchers.js +2 -2
  31. package/lib/Object.assign.js +1 -1
  32. package/lib/OrderedMap.js +1 -1
  33. package/lib/PooledClass.js +1 -1
  34. package/lib/React.js +1 -13
  35. package/lib/ReactBrowserEventEmitter.js +3 -23
  36. package/lib/ReactCSSTransitionGroup.js +1 -2
  37. package/lib/ReactCSSTransitionGroupChild.js +1 -6
  38. package/lib/ReactChildReconciler.js +12 -10
  39. package/lib/ReactChildren.js +3 -3
  40. package/lib/ReactClass.js +18 -67
  41. package/lib/ReactComponent.js +2 -5
  42. package/lib/ReactComponentBrowserEnvironment.js +9 -6
  43. package/lib/ReactComponentEnvironment.js +3 -3
  44. package/lib/ReactComponentWithPureRenderMixin.js +2 -2
  45. package/lib/ReactCompositeComponent.js +94 -29
  46. package/lib/ReactCurrentOwner.js +1 -1
  47. package/lib/ReactDOM.js +26 -14
  48. package/lib/ReactDOMButton.js +2 -2
  49. package/lib/ReactDOMComponent.js +156 -218
  50. package/lib/ReactDOMComponentFlags.js +18 -0
  51. package/lib/ReactDOMComponentTree.js +186 -0
  52. package/lib/ReactDOMContainerInfo.js +32 -0
  53. package/lib/ReactDOMDebugTool.js +69 -0
  54. package/lib/ReactDOMEmptyComponent.js +61 -0
  55. package/lib/ReactDOMFactories.js +1 -2
  56. package/lib/ReactDOMFeatureFlags.js +2 -2
  57. package/lib/ReactDOMIDOperations.js +5 -60
  58. package/lib/ReactDOMInput.js +52 -23
  59. package/lib/ReactDOMInstrumentation.js +16 -0
  60. package/lib/ReactDOMOption.js +9 -8
  61. package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +57 -0
  62. package/lib/ReactDOMSelect.js +35 -14
  63. package/lib/ReactDOMSelection.js +2 -2
  64. package/lib/ReactDOMServer.js +1 -1
  65. package/lib/ReactDOMTextComponent.js +41 -21
  66. package/lib/ReactDOMTextarea.js +32 -5
  67. package/lib/ReactDOMTreeTraversal.js +134 -0
  68. package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
  69. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  70. package/lib/ReactDefaultInjection.js +11 -15
  71. package/lib/ReactDefaultPerf.js +49 -19
  72. package/lib/ReactDefaultPerfAnalysis.js +16 -9
  73. package/lib/ReactElement.js +9 -5
  74. package/lib/ReactElementValidator.js +1 -1
  75. package/lib/ReactEmptyComponent.js +8 -29
  76. package/lib/ReactErrorUtils.js +1 -2
  77. package/lib/ReactEventEmitterMixin.js +3 -8
  78. package/lib/ReactEventListener.js +20 -75
  79. package/lib/ReactFeatureFlags.js +21 -0
  80. package/lib/ReactFragment.js +2 -2
  81. package/lib/ReactInjection.js +3 -3
  82. package/lib/ReactInputSelection.js +3 -3
  83. package/lib/ReactInstanceHandles.js +4 -6
  84. package/lib/ReactInstanceMap.js +1 -1
  85. package/lib/ReactIsomorphic.js +1 -1
  86. package/lib/ReactLink.js +1 -2
  87. package/lib/ReactMarkupChecksum.js +1 -1
  88. package/lib/ReactMount.js +67 -445
  89. package/lib/ReactMultiChild.js +104 -198
  90. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  91. package/lib/ReactNativeComponent.js +1 -1
  92. package/lib/ReactNodeTypes.js +37 -0
  93. package/lib/ReactNoopUpdateQueue.js +1 -24
  94. package/lib/ReactOwner.js +1 -1
  95. package/lib/ReactPerf.js +1 -2
  96. package/lib/ReactPropTransferer.js +1 -1
  97. package/lib/ReactPropTypeLocationNames.js +1 -1
  98. package/lib/ReactPropTypeLocations.js +1 -1
  99. package/lib/ReactPropTypes.js +8 -2
  100. package/lib/ReactReconcileTransaction.js +17 -6
  101. package/lib/ReactReconciler.js +14 -5
  102. package/lib/ReactRef.js +1 -1
  103. package/lib/ReactServerBatchingStrategy.js +1 -2
  104. package/lib/ReactServerRendering.js +15 -33
  105. package/lib/ReactServerRenderingTransaction.js +8 -26
  106. package/lib/ReactSimpleEmptyComponent.js +37 -0
  107. package/lib/ReactStateSetters.js +1 -1
  108. package/lib/ReactTestUtils.js +25 -15
  109. package/lib/ReactTransitionChildMapping.js +1 -2
  110. package/lib/ReactTransitionEvents.js +1 -1
  111. package/lib/ReactTransitionGroup.js +1 -1
  112. package/lib/ReactUpdateQueue.js +4 -4
  113. package/lib/ReactUpdates.js +19 -2
  114. package/lib/ReactVersion.js +2 -2
  115. package/lib/ReactWithAddons.js +1 -3
  116. package/lib/ResponderEventPlugin.js +53 -65
  117. package/lib/ResponderSyntheticEvent.js +1 -2
  118. package/lib/ResponderTouchHistoryStore.js +1 -1
  119. package/lib/SVGDOMPropertyConfig.js +2 -39
  120. package/lib/SelectEventPlugin.js +13 -18
  121. package/lib/SimpleEventPlugin.js +18 -16
  122. package/lib/SyntheticClipboardEvent.js +1 -2
  123. package/lib/SyntheticCompositionEvent.js +1 -2
  124. package/lib/SyntheticDragEvent.js +1 -2
  125. package/lib/SyntheticEvent.js +10 -7
  126. package/lib/SyntheticFocusEvent.js +1 -2
  127. package/lib/SyntheticInputEvent.js +1 -2
  128. package/lib/SyntheticKeyboardEvent.js +1 -2
  129. package/lib/SyntheticMouseEvent.js +1 -2
  130. package/lib/SyntheticTouchEvent.js +1 -2
  131. package/lib/SyntheticUIEvent.js +1 -2
  132. package/lib/SyntheticWheelEvent.js +1 -2
  133. package/lib/TapEventPlugin.js +3 -12
  134. package/lib/Transaction.js +1 -1
  135. package/lib/ViewportMetrics.js +1 -1
  136. package/lib/accumulate.js +1 -1
  137. package/lib/accumulateInto.js +1 -1
  138. package/lib/adler32.js +3 -2
  139. package/lib/canDefineProperty.js +1 -1
  140. package/lib/createHierarchyRenderer.js +1 -1
  141. package/lib/dangerousStyleValue.js +25 -3
  142. package/lib/deprecated.js +1 -1
  143. package/lib/escapeTextContentForBrowser.js +1 -1
  144. package/lib/findDOMNode.js +15 -8
  145. package/lib/flattenChildren.js +1 -1
  146. package/lib/forEachAccumulated.js +1 -1
  147. package/lib/getEventCharCode.js +1 -2
  148. package/lib/getEventKey.js +1 -2
  149. package/lib/getEventModifierState.js +1 -2
  150. package/lib/getEventTarget.js +1 -2
  151. package/lib/getIteratorFn.js +1 -2
  152. package/lib/getNativeComponentFromComposite.js +30 -0
  153. package/lib/getNodeForCharacterOffset.js +1 -1
  154. package/lib/getTestDocument.js +1 -1
  155. package/lib/getTextContentAccessor.js +1 -1
  156. package/lib/instantiateReactComponent.js +3 -4
  157. package/lib/isEventSupported.js +1 -1
  158. package/lib/isTextInputElement.js +1 -1
  159. package/lib/onlyChild.js +1 -1
  160. package/lib/quoteAttributeValueForBrowser.js +1 -1
  161. package/lib/reactComponentExpect.js +1 -1
  162. package/lib/renderSubtreeIntoContainer.js +1 -1
  163. package/lib/setInnerHTML.js +1 -1
  164. package/lib/setTextContent.js +1 -1
  165. package/lib/shallowCompare.js +1 -1
  166. package/lib/shouldUpdateReactComponent.js +1 -3
  167. package/lib/sliceChildren.js +1 -1
  168. package/lib/traverseAllChildren.js +6 -6
  169. package/lib/update.js +1 -1
  170. package/lib/validateDOMNesting.js +8 -9
  171. package/package.json +2 -2
  172. package/lib/ReactBrowserComponentMixin.js +0 -36
  173. package/lib/ReactEmptyComponentRegistry.js +0 -48
  174. package/lib/ReactRootIndex.js +0 -29
  175. package/lib/ServerReactRootIndex.js +0 -29
  176. package/lib/cloneWithProps.js +0 -54
  177. package/lib/webcomponents.js +0 -6379
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -7,7 +7,6 @@
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
9
  * @providesModule shouldUpdateReactComponent
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  'use strict';
@@ -37,7 +36,6 @@ function shouldUpdateReactComponent(prevElement, nextElement) {
37
36
  } else {
38
37
  return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
39
38
  }
40
- return false;
41
39
  }
42
40
 
43
41
  module.exports = shouldUpdateReactComponent;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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-2015, Facebook, Inc.
2
+ * Copyright 2013-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -13,13 +13,12 @@
13
13
 
14
14
  var ReactCurrentOwner = require('./ReactCurrentOwner');
15
15
  var ReactElement = require('./ReactElement');
16
- var ReactInstanceHandles = require('./ReactInstanceHandles');
17
16
 
18
17
  var getIteratorFn = require('./getIteratorFn');
19
18
  var invariant = require('fbjs/lib/invariant');
20
19
  var warning = require('fbjs/lib/warning');
21
20
 
22
- var SEPARATOR = ReactInstanceHandles.SEPARATOR;
21
+ var SEPARATOR = '.';
23
22
  var SUBSEPARATOR = ':';
24
23
 
25
24
  /**
@@ -29,11 +28,10 @@ var SUBSEPARATOR = ':';
29
28
 
30
29
  var userProvidedKeyEscaperLookup = {
31
30
  '=': '=0',
32
- '.': '=1',
33
31
  ':': '=2'
34
32
  };
35
33
 
36
- var userProvidedKeyEscapeRegex = /[=.:]/g;
34
+ var userProvidedKeyEscapeRegex = /[=:]/g;
37
35
 
38
36
  var didWarnAboutMaps = false;
39
37
 
@@ -49,7 +47,9 @@ function userProvidedKeyEscaper(match) {
49
47
  * @return {string}
50
48
  */
51
49
  function getComponentKey(component, index) {
52
- if (component && component.key != null) {
50
+ // Do some typechecking here since we call this blindly. We want to ensure
51
+ // that we don't block potential future ES APIs.
52
+ if (component && typeof component === 'object' && component.key != null) {
53
53
  // Explicit key
54
54
  return wrapUserProvidedKey(component.key);
55
55
  }
package/lib/update.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2015, Facebook, Inc.
2
+ * Copyright 2013-present, 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 2015, Facebook, Inc.
2
+ * Copyright 2015-present, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -47,7 +47,7 @@ if (process.env.NODE_ENV !== 'production') {
47
47
  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
48
48
 
49
49
  var emptyAncestorInfo = {
50
- parentTag: null,
50
+ current: null,
51
51
 
52
52
  formTag: null,
53
53
  aTagInScope: null,
@@ -79,7 +79,7 @@ if (process.env.NODE_ENV !== 'production') {
79
79
  ancestorInfo.dlItemTagAutoclosing = null;
80
80
  }
81
81
 
82
- ancestorInfo.parentTag = info;
82
+ ancestorInfo.current = info;
83
83
 
84
84
  if (tag === 'form') {
85
85
  ancestorInfo.formTag = info;
@@ -152,6 +152,8 @@ if (process.env.NODE_ENV !== 'production') {
152
152
  // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
153
153
  case 'html':
154
154
  return tag === 'head' || tag === 'body';
155
+ case '#document':
156
+ return tag === 'html';
155
157
  }
156
158
 
157
159
  // Probably in the "in body" parsing mode, so we outlaw only tag combos
@@ -175,6 +177,7 @@ if (process.env.NODE_ENV !== 'production') {
175
177
  case 'colgroup':
176
178
  case 'frame':
177
179
  case 'head':
180
+ case 'html':
178
181
  case 'tbody':
179
182
  case 'td':
180
183
  case 'tfoot':
@@ -273,9 +276,7 @@ if (process.env.NODE_ENV !== 'production') {
273
276
  }
274
277
 
275
278
  var stack = [];
276
- /*eslint-disable space-after-keywords */
277
279
  do {
278
- /*eslint-enable space-after-keywords */
279
280
  stack.push(instance);
280
281
  } while (instance = instance._currentElement._owner);
281
282
  stack.reverse();
@@ -286,7 +287,7 @@ if (process.env.NODE_ENV !== 'production') {
286
287
 
287
288
  validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
288
289
  ancestorInfo = ancestorInfo || emptyAncestorInfo;
289
- var parentInfo = ancestorInfo.parentTag;
290
+ var parentInfo = ancestorInfo.current;
290
291
  var parentTag = parentInfo && parentInfo.tag;
291
292
 
292
293
  var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
@@ -347,14 +348,12 @@ if (process.env.NODE_ENV !== 'production') {
347
348
  }
348
349
  };
349
350
 
350
- validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
351
-
352
351
  validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
353
352
 
354
353
  // For testing
355
354
  validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
356
355
  ancestorInfo = ancestorInfo || emptyAncestorInfo;
357
- var parentInfo = ancestorInfo.parentTag;
356
+ var parentInfo = ancestorInfo.current;
358
357
  var parentTag = parentInfo && parentInfo.tag;
359
358
  return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
360
359
  };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "0.14.7",
4
+ "version": "0.15.0-alpha.1",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
8
- "homepage": "https://facebook.github.io/react/",
8
+ "homepage": "https://github.com/facebook/react/tree/master/npm-react",
9
9
  "bugs": "https://github.com/facebook/react/issues",
10
10
  "license": "BSD-3-Clause",
11
11
  "files": [
@@ -1,36 +0,0 @@
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 ReactBrowserComponentMixin
10
- */
11
-
12
- 'use strict';
13
-
14
- var ReactInstanceMap = require('./ReactInstanceMap');
15
-
16
- var findDOMNode = require('./findDOMNode');
17
- var warning = require('fbjs/lib/warning');
18
-
19
- var didWarnKey = '_getDOMNodeDidWarn';
20
-
21
- var ReactBrowserComponentMixin = {
22
- /**
23
- * Returns the DOM node rendered by this component.
24
- *
25
- * @return {DOMElement} The root node of this component.
26
- * @final
27
- * @protected
28
- */
29
- getDOMNode: function () {
30
- process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
31
- this.constructor[didWarnKey] = true;
32
- return findDOMNode(this);
33
- }
34
- };
35
-
36
- module.exports = ReactBrowserComponentMixin;
@@ -1,48 +0,0 @@
1
- /**
2
- * Copyright 2014-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 ReactEmptyComponentRegistry
10
- */
11
-
12
- 'use strict';
13
-
14
- // This registry keeps track of the React IDs of the components that rendered to
15
- // `null` (in reality a placeholder such as `noscript`)
16
- var nullComponentIDsRegistry = {};
17
-
18
- /**
19
- * @param {string} id Component's `_rootNodeID`.
20
- * @return {boolean} True if the component is rendered to null.
21
- */
22
- function isNullComponentID(id) {
23
- return !!nullComponentIDsRegistry[id];
24
- }
25
-
26
- /**
27
- * Mark the component as having rendered to null.
28
- * @param {string} id Component's `_rootNodeID`.
29
- */
30
- function registerNullComponentID(id) {
31
- nullComponentIDsRegistry[id] = true;
32
- }
33
-
34
- /**
35
- * Unmark the component as having rendered to null: it renders to something now.
36
- * @param {string} id Component's `_rootNodeID`.
37
- */
38
- function deregisterNullComponentID(id) {
39
- delete nullComponentIDsRegistry[id];
40
- }
41
-
42
- var ReactEmptyComponentRegistry = {
43
- isNullComponentID: isNullComponentID,
44
- registerNullComponentID: registerNullComponentID,
45
- deregisterNullComponentID: deregisterNullComponentID
46
- };
47
-
48
- module.exports = ReactEmptyComponentRegistry;
@@ -1,29 +0,0 @@
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 ReactRootIndex
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var ReactRootIndexInjection = {
16
- /**
17
- * @param {function} _createReactRootIndex
18
- */
19
- injectCreateReactRootIndex: function (_createReactRootIndex) {
20
- ReactRootIndex.createReactRootIndex = _createReactRootIndex;
21
- }
22
- };
23
-
24
- var ReactRootIndex = {
25
- createReactRootIndex: null,
26
- injection: ReactRootIndexInjection
27
- };
28
-
29
- module.exports = ReactRootIndex;
@@ -1,29 +0,0 @@
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 ServerReactRootIndex
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- /**
16
- * Size of the reactRoot ID space. We generate random numbers for React root
17
- * IDs and if there's a collision the events and DOM update system will
18
- * get confused. In the future we need a way to generate GUIDs but for
19
- * now this will work on a smaller scale.
20
- */
21
- var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
22
-
23
- var ServerReactRootIndex = {
24
- createReactRootIndex: function () {
25
- return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
26
- }
27
- };
28
-
29
- module.exports = ServerReactRootIndex;
@@ -1,54 +0,0 @@
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
- * @typechecks static-only
10
- * @providesModule cloneWithProps
11
- */
12
-
13
- 'use strict';
14
-
15
- var ReactElement = require('./ReactElement');
16
- var ReactPropTransferer = require('./ReactPropTransferer');
17
-
18
- var keyOf = require('fbjs/lib/keyOf');
19
- var warning = require('fbjs/lib/warning');
20
-
21
- var CHILDREN_PROP = keyOf({ children: null });
22
-
23
- var didDeprecatedWarn = false;
24
-
25
- /**
26
- * Sometimes you want to change the props of a child passed to you. Usually
27
- * this is to add a CSS class.
28
- *
29
- * @param {ReactElement} child child element you'd like to clone
30
- * @param {object} props props you'd like to modify. className and style will be
31
- * merged automatically.
32
- * @return {ReactElement} a clone of child with props merged in.
33
- * @deprecated
34
- */
35
- function cloneWithProps(child, props) {
36
- if (process.env.NODE_ENV !== 'production') {
37
- process.env.NODE_ENV !== 'production' ? warning(didDeprecatedWarn, 'cloneWithProps(...) is deprecated. ' + 'Please use React.cloneElement instead.') : undefined;
38
- didDeprecatedWarn = true;
39
- process.env.NODE_ENV !== 'production' ? warning(!child.ref, 'You are calling cloneWithProps() on a child with a ref. This is ' + 'dangerous because you\'re creating a new child which will not be ' + 'added as a ref to its parent.') : undefined;
40
- }
41
-
42
- var newProps = ReactPropTransferer.mergeProps(props, child.props);
43
-
44
- // Use `child.props.children` if it is provided.
45
- if (!newProps.hasOwnProperty(CHILDREN_PROP) && child.props.hasOwnProperty(CHILDREN_PROP)) {
46
- newProps.children = child.props.children;
47
- }
48
-
49
- // The current API doesn't retain _owner, which is why this
50
- // doesn't use ReactElement.cloneAndReplaceProps.
51
- return ReactElement.createElement(child.type, newProps);
52
- }
53
-
54
- module.exports = cloneWithProps;