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
@@ -167,18 +167,25 @@ function getUnchangedComponents(measurement) {
167
167
  // render anything to the DOM and return a mapping of their ID to
168
168
  // the amount of time it took to render the entire subtree.
169
169
  var cleanComponents = {};
170
- var dirtyLeafIDs = Object.keys(measurement.writes);
170
+ var writes = measurement.writes;
171
+ var dirtyComposites = {};
172
+ Object.keys(writes).forEach(function (id) {
173
+ writes[id].forEach(function (write) {
174
+ // Root mounting (innerHTML set) is recorded with an ID of ''
175
+ if (id !== '') {
176
+ measurement.hierarchy[id].forEach(function (c) {
177
+ return dirtyComposites[c] = true;
178
+ });
179
+ }
180
+ });
181
+ });
171
182
  var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
172
183
 
173
184
  for (var id in allIDs) {
174
185
  var isDirty = false;
175
- // For each component that rendered, see if a component that triggered
176
- // a DOM op is in its subtree.
177
- for (var i = 0; i < dirtyLeafIDs.length; i++) {
178
- if (dirtyLeafIDs[i].indexOf(id) === 0) {
179
- isDirty = true;
180
- break;
181
- }
186
+ // See if any of the DOM operations applied to this component's subtree.
187
+ if (dirtyComposites[id]) {
188
+ isDirty = true;
182
189
  }
183
190
  // check if component newly created
184
191
  if (measurement.created[id]) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014-2015, Facebook, Inc.
2
+ * Copyright 2014-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
@@ -28,8 +28,10 @@ var RESERVED_PROPS = {
28
28
  };
29
29
 
30
30
  /**
31
- * Base constructor for all React elements. This is only used to make this
32
- * work with a dynamic instanceof check. Nothing should live on this prototype.
31
+ * Factory method to create a new React element. This no longer adheres to
32
+ * the class pattern, so do not use new to call it. Also, no instanceof check
33
+ * will work. Instead test $$typeof field against Symbol.for('react.element') to check
34
+ * if something is a React Element.
33
35
  *
34
36
  * @param {*} type
35
37
  * @param {*} key
@@ -98,8 +100,10 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
98
100
  element._self = self;
99
101
  element._source = source;
100
102
  }
101
- Object.freeze(element.props);
102
- Object.freeze(element);
103
+ if (Object.freeze) {
104
+ Object.freeze(element.props);
105
+ Object.freeze(element);
106
+ }
103
107
  }
104
108
 
105
109
  return element;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014-2015, Facebook, Inc.
2
+ * Copyright 2014-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 2014-2015, Facebook, Inc.
2
+ * Copyright 2014-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
@@ -11,40 +11,19 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactElement = require('./ReactElement');
15
- var ReactEmptyComponentRegistry = require('./ReactEmptyComponentRegistry');
16
- var ReactReconciler = require('./ReactReconciler');
17
-
18
- var assign = require('./Object.assign');
19
-
20
- var placeholderElement;
14
+ var emptyComponentFactory;
21
15
 
22
16
  var ReactEmptyComponentInjection = {
23
- injectEmptyComponent: function (component) {
24
- placeholderElement = ReactElement.createElement(component);
17
+ injectEmptyComponentFactory: function (factory) {
18
+ emptyComponentFactory = factory;
25
19
  }
26
20
  };
27
21
 
28
- var ReactEmptyComponent = function (instantiate) {
29
- this._currentElement = null;
30
- this._rootNodeID = null;
31
- this._renderedComponent = instantiate(placeholderElement);
32
- };
33
- assign(ReactEmptyComponent.prototype, {
34
- construct: function (element) {},
35
- mountComponent: function (rootID, transaction, context) {
36
- ReactEmptyComponentRegistry.registerNullComponentID(rootID);
37
- this._rootNodeID = rootID;
38
- return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context);
39
- },
40
- receiveComponent: function () {},
41
- unmountComponent: function (rootID, transaction, context) {
42
- ReactReconciler.unmountComponent(this._renderedComponent);
43
- ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID);
44
- this._rootNodeID = null;
45
- this._renderedComponent = null;
22
+ var ReactEmptyComponent = {
23
+ create: function (instantiate) {
24
+ return emptyComponentFactory(instantiate);
46
25
  }
47
- });
26
+ };
48
27
 
49
28
  ReactEmptyComponent.injection = ReactEmptyComponentInjection;
50
29
 
@@ -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 ReactErrorUtils
10
- * @typechecks
11
10
  */
12
11
 
13
12
  'use strict';
@@ -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
@@ -23,14 +23,9 @@ var ReactEventEmitterMixin = {
23
23
  /**
24
24
  * Streams a fired top-level event to `EventPluginHub` where plugins have the
25
25
  * opportunity to create `ReactEvent`s to be dispatched.
26
- *
27
- * @param {string} topLevelType Record from `EventConstants`.
28
- * @param {object} topLevelTarget The listening component root node.
29
- * @param {string} topLevelTargetID ID of `topLevelTarget`.
30
- * @param {object} nativeEvent Native environment event.
31
26
  */
32
- handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
33
- var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
27
+ handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
28
+ var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
34
29
  runEventQueueInBatch(events);
35
30
  }
36
31
  };
@@ -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 ReactEventListener
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  'use strict';
@@ -15,32 +14,28 @@
15
14
  var EventListener = require('fbjs/lib/EventListener');
16
15
  var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
17
16
  var PooledClass = require('./PooledClass');
18
- var ReactInstanceHandles = require('./ReactInstanceHandles');
19
- var ReactMount = require('./ReactMount');
17
+ var ReactDOMComponentTree = require('./ReactDOMComponentTree');
20
18
  var ReactUpdates = require('./ReactUpdates');
21
19
 
22
20
  var assign = require('./Object.assign');
23
21
  var getEventTarget = require('./getEventTarget');
24
22
  var getUnboundedScrollPosition = require('fbjs/lib/getUnboundedScrollPosition');
25
23
 
26
- var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
27
-
28
24
  /**
29
- * Finds the parent React component of `node`.
30
- *
31
- * @param {*} node
32
- * @return {?DOMEventTarget} Parent container, or `null` if the specified node
33
- * is not nested.
25
+ * Find the deepest React component completely containing the root of the
26
+ * passed-in instance (for use when entire React trees are nested within each
27
+ * other). If React trees are not nested, returns null.
34
28
  */
35
- function findParent(node) {
29
+ function findParent(inst) {
36
30
  // TODO: It may be a good idea to cache this to prevent unnecessary DOM
37
31
  // traversal, but caching is difficult to do correctly without using a
38
32
  // mutation observer to listen for all DOM changes.
39
- var nodeID = ReactMount.getID(node);
40
- var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
41
- var container = ReactMount.findReactContainerForID(rootID);
42
- var parent = ReactMount.getFirstReactDOM(container);
43
- return parent;
33
+ while (inst._nativeParent) {
34
+ inst = inst._nativeParent;
35
+ }
36
+ var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
37
+ var container = rootNode.parentNode;
38
+ return ReactDOMComponentTree.getClosestInstanceFromNode(container);
44
39
  }
45
40
 
46
41
  // Used to store ancestor hierarchy in top level callback
@@ -59,72 +54,22 @@ assign(TopLevelCallbackBookKeeping.prototype, {
59
54
  PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
60
55
 
61
56
  function handleTopLevelImpl(bookKeeping) {
62
- // TODO: Re-enable event.path handling
63
- //
64
- // if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
65
- // // New browsers have a path attribute on native events
66
- // handleTopLevelWithPath(bookKeeping);
67
- // } else {
68
- // // Legacy browsers don't have a path attribute on native events
69
- // handleTopLevelWithoutPath(bookKeeping);
70
- // }
71
-
72
- void handleTopLevelWithPath; // temporarily unused
73
- handleTopLevelWithoutPath(bookKeeping);
74
- }
75
-
76
- // Legacy browsers don't have a path attribute on native events
77
- function handleTopLevelWithoutPath(bookKeeping) {
78
- var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window;
57
+ var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
58
+ var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
79
59
 
80
60
  // Loop through the hierarchy, in case there's any nested components.
81
61
  // It's important that we build the array of ancestors before calling any
82
62
  // event handlers, because event handlers can modify the DOM, leading to
83
63
  // inconsistencies with ReactMount's node cache. See #1105.
84
- var ancestor = topLevelTarget;
85
- while (ancestor) {
64
+ var ancestor = targetInst;
65
+ do {
86
66
  bookKeeping.ancestors.push(ancestor);
87
- ancestor = findParent(ancestor);
88
- }
67
+ ancestor = ancestor && findParent(ancestor);
68
+ } while (ancestor);
89
69
 
90
70
  for (var i = 0; i < bookKeeping.ancestors.length; i++) {
91
- topLevelTarget = bookKeeping.ancestors[i];
92
- var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
93
- ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
94
- }
95
- }
96
-
97
- // New browsers have a path attribute on native events
98
- function handleTopLevelWithPath(bookKeeping) {
99
- var path = bookKeeping.nativeEvent.path;
100
- var currentNativeTarget = path[0];
101
- var eventsFired = 0;
102
- for (var i = 0; i < path.length; i++) {
103
- var currentPathElement = path[i];
104
- if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
105
- currentNativeTarget = path[i + 1];
106
- }
107
- // TODO: slow
108
- var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
109
- if (reactParent === currentPathElement) {
110
- var currentPathElementID = ReactMount.getID(currentPathElement);
111
- var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
112
- bookKeeping.ancestors.push(currentPathElement);
113
-
114
- var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
115
- eventsFired++;
116
- ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
117
-
118
- // Jump to the root of this React render tree
119
- while (currentPathElementID !== newRootID) {
120
- i++;
121
- currentPathElement = path[i];
122
- currentPathElementID = ReactMount.getID(currentPathElement);
123
- }
124
- }
125
- }
126
- if (eventsFired === 0) {
127
- ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
71
+ targetInst = bookKeeping.ancestors[i];
72
+ ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
128
73
  }
129
74
  }
130
75
 
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright 2013-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ *
9
+ * @providesModule ReactFeatureFlags
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var ReactFeatureFlags = {
15
+ // When true, call console.time() before and .timeEnd() after each top-level
16
+ // render (both initial renders and updates). Useful when looking at prod-mode
17
+ // timeline profiles in Chrome, for example.
18
+ logTopLevelRenders: false
19
+ };
20
+
21
+ module.exports = ReactFeatureFlags;
@@ -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
@@ -20,7 +20,7 @@ var warning = require('fbjs/lib/warning');
20
20
 
21
21
  /**
22
22
  * We used to allow keyed objects to serve as a collection of ReactElements,
23
- * or nested sets. This allowed us a way to explicitly key a set a fragment of
23
+ * or nested sets. This allowed us a way to explicitly key a set or fragment of
24
24
  * components. This is now being replaced with an opaque data structure.
25
25
  * The upgrade path is to call React.addons.createFragment({ key: value }) to
26
26
  * create a keyed fragment. The resulting data structure is an array.
@@ -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,13 @@
13
13
 
14
14
  var DOMProperty = require('./DOMProperty');
15
15
  var EventPluginHub = require('./EventPluginHub');
16
+ var EventPluginUtils = require('./EventPluginUtils');
16
17
  var ReactComponentEnvironment = require('./ReactComponentEnvironment');
17
18
  var ReactClass = require('./ReactClass');
18
19
  var ReactEmptyComponent = require('./ReactEmptyComponent');
19
20
  var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
20
21
  var ReactNativeComponent = require('./ReactNativeComponent');
21
22
  var ReactPerf = require('./ReactPerf');
22
- var ReactRootIndex = require('./ReactRootIndex');
23
23
  var ReactUpdates = require('./ReactUpdates');
24
24
 
25
25
  var ReactInjection = {
@@ -28,10 +28,10 @@ var ReactInjection = {
28
28
  DOMProperty: DOMProperty.injection,
29
29
  EmptyComponent: ReactEmptyComponent.injection,
30
30
  EventPluginHub: EventPluginHub.injection,
31
+ EventPluginUtils: EventPluginUtils.injection,
31
32
  EventEmitter: ReactBrowserEventEmitter.injection,
32
33
  NativeComponent: ReactNativeComponent.injection,
33
34
  Perf: ReactPerf.injection,
34
- RootIndex: ReactRootIndex.injection,
35
35
  Updates: ReactUpdates.injection
36
36
  };
37
37
 
@@ -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
@@ -74,7 +74,7 @@ var ReactInputSelection = {
74
74
  start: input.selectionStart,
75
75
  end: input.selectionEnd
76
76
  };
77
- } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
77
+ } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
78
78
  // IE8 input.
79
79
  var range = document.selection.createRange();
80
80
  // There can only be one selection per document in IE, so it must
@@ -109,7 +109,7 @@ var ReactInputSelection = {
109
109
  if ('selectionStart' in input) {
110
110
  input.selectionStart = start;
111
111
  input.selectionEnd = Math.min(end, input.value.length);
112
- } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
112
+ } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
113
113
  var range = input.createTextRange();
114
114
  range.collapse(true);
115
115
  range.moveStart('character', start);
@@ -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,13 +7,10 @@
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
9
  * @providesModule ReactInstanceHandles
10
- * @typechecks static-only
11
10
  */
12
11
 
13
12
  'use strict';
14
13
 
15
- var ReactRootIndex = require('./ReactRootIndex');
16
-
17
14
  var invariant = require('fbjs/lib/invariant');
18
15
 
19
16
  var SEPARATOR = '.';
@@ -184,10 +181,11 @@ var ReactInstanceHandles = {
184
181
 
185
182
  /**
186
183
  * Constructs a React root ID
184
+ * @param {number} index A unique integer
187
185
  * @return {string} A React root ID.
188
186
  */
189
- createReactRootID: function () {
190
- return getReactRootIDString(ReactRootIndex.createReactRootIndex());
187
+ createReactRootID: function (index) {
188
+ return getReactRootIDString(index);
191
189
  },
192
190
 
193
191
  /**