react 15.3.2 → 15.4.0-rc.4

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 (210) hide show
  1. package/dist/react-with-addons.js +3864 -21390
  2. package/dist/react-with-addons.min.js +3 -6
  3. package/dist/react.js +2639 -19486
  4. package/dist/react.min.js +2 -6
  5. package/lib/KeyEscapeUtils.js +0 -1
  6. package/lib/LinkedStateMixin.js +1 -3
  7. package/lib/PooledClass.js +3 -1
  8. package/lib/React.js +0 -1
  9. package/lib/ReactAddonsDOMDependencies.js +35 -0
  10. package/lib/ReactAddonsDOMDependenciesUMDShim.js +31 -0
  11. package/lib/ReactCSSTransitionGroup.js +60 -43
  12. package/lib/ReactCSSTransitionGroupChild.js +2 -3
  13. package/lib/ReactChildren.js +0 -1
  14. package/lib/ReactClass.js +38 -54
  15. package/lib/ReactComponent.js +0 -1
  16. package/lib/ReactComponentTreeDevtool.js +0 -1
  17. package/lib/ReactComponentTreeHook.js +84 -101
  18. package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +4 -7
  19. package/lib/ReactComponentWithPureRenderMixin.js +0 -1
  20. package/lib/ReactCurrentOwner.js +1 -2
  21. package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +5 -4
  22. package/lib/ReactDOMFactories.js +0 -1
  23. package/lib/ReactElement.js +6 -14
  24. package/lib/ReactElementSymbol.js +19 -0
  25. package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +3 -9
  26. package/lib/ReactElementValidator.js +1 -3
  27. package/lib/ReactFragment.js +0 -1
  28. package/lib/ReactLink.js +0 -1
  29. package/lib/ReactNoopUpdateQueue.js +0 -1
  30. package/lib/ReactPropTypeLocationNames.js +1 -1
  31. package/lib/ReactPropTypeLocations.js +2 -12
  32. package/lib/ReactPropTypes.js +5 -3
  33. package/lib/ReactPropTypesSecret.js +1 -1
  34. package/lib/ReactPureComponent.js +0 -1
  35. package/lib/ReactStateSetters.js +0 -1
  36. package/lib/ReactTransitionChildMapping.js +0 -1
  37. package/lib/ReactTransitionEvents.js +1 -2
  38. package/lib/ReactTransitionGroup.js +145 -142
  39. package/lib/ReactUMDEntry.js +11 -6
  40. package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +3 -6
  41. package/lib/ReactVersion.js +1 -2
  42. package/lib/ReactWithAddons.js +15 -3
  43. package/lib/ReactWithAddonsUMDEntry.js +11 -6
  44. package/lib/canDefineProperty.js +2 -1
  45. package/lib/checkReactTypeSpec.js +0 -1
  46. package/lib/deprecated.js +0 -1
  47. package/lib/flattenChildren.js +0 -1
  48. package/lib/getIteratorFn.js +0 -1
  49. package/lib/onlyChild.js +0 -1
  50. package/lib/reactProdInvariant.js +0 -1
  51. package/lib/shallowCompare.js +1 -2
  52. package/lib/sliceChildren.js +0 -1
  53. package/lib/traverseAllChildren.js +11 -3
  54. package/lib/update.js +6 -8
  55. package/package.json +1 -1
  56. package/lib/AutoFocusUtils.js +0 -24
  57. package/lib/BeforeInputEventPlugin.js +0 -390
  58. package/lib/CSSProperty.js +0 -148
  59. package/lib/CSSPropertyOperations.js +0 -205
  60. package/lib/CallbackQueue.js +0 -106
  61. package/lib/ChangeEventPlugin.js +0 -325
  62. package/lib/DOMChildrenOperations.js +0 -194
  63. package/lib/DOMLazyTree.js +0 -118
  64. package/lib/DOMProperty.js +0 -206
  65. package/lib/DOMPropertyOperations.js +0 -221
  66. package/lib/Danger.js +0 -48
  67. package/lib/DefaultEventPluginOrder.js +0 -27
  68. package/lib/DisabledInputUtils.js +0 -50
  69. package/lib/EnterLeaveEventPlugin.js +0 -105
  70. package/lib/EventConstants.js +0 -97
  71. package/lib/EventPluginHub.js +0 -251
  72. package/lib/EventPluginRegistry.js +0 -247
  73. package/lib/EventPluginUtils.js +0 -229
  74. package/lib/EventPropagators.js +0 -137
  75. package/lib/FallbackCompositionState.js +0 -95
  76. package/lib/HTMLDOMPropertyConfig.js +0 -212
  77. package/lib/LinkedValueUtils.js +0 -136
  78. package/lib/NativeMethodsMixin.js +0 -167
  79. package/lib/ReactBrowserEventEmitter.js +0 -330
  80. package/lib/ReactChildReconciler.js +0 -154
  81. package/lib/ReactChildrenMutationWarningHook.js +0 -54
  82. package/lib/ReactComponentBrowserEnvironment.js +0 -30
  83. package/lib/ReactComponentEnvironment.js +0 -45
  84. package/lib/ReactComponentTreeTestUtils.js +0 -87
  85. package/lib/ReactCompositeComponent.js +0 -904
  86. package/lib/ReactDOM.js +0 -110
  87. package/lib/ReactDOMButton.js +0 -24
  88. package/lib/ReactDOMComponent.js +0 -1006
  89. package/lib/ReactDOMComponentTree.js +0 -188
  90. package/lib/ReactDOMContainerInfo.js +0 -33
  91. package/lib/ReactDOMEmptyComponent.js +0 -60
  92. package/lib/ReactDOMFiber.js +0 -76
  93. package/lib/ReactDOMIDOperations.js +0 -34
  94. package/lib/ReactDOMInput.js +0 -269
  95. package/lib/ReactDOMNullInputValuePropHook.js +0 -43
  96. package/lib/ReactDOMOption.js +0 -123
  97. package/lib/ReactDOMSelect.js +0 -201
  98. package/lib/ReactDOMSelection.js +0 -212
  99. package/lib/ReactDOMServer.js +0 -26
  100. package/lib/ReactDOMTextComponent.js +0 -164
  101. package/lib/ReactDOMTextarea.js +0 -155
  102. package/lib/ReactDOMTreeTraversal.js +0 -136
  103. package/lib/ReactDOMUnknownPropertyHook.js +0 -112
  104. package/lib/ReactDebugTool.js +0 -301
  105. package/lib/ReactDefaultBatchingStrategy.js +0 -68
  106. package/lib/ReactDefaultInjection.js +0 -84
  107. package/lib/ReactEmptyComponent.js +0 -30
  108. package/lib/ReactErrorUtils.js +0 -76
  109. package/lib/ReactEventEmitterMixin.js +0 -33
  110. package/lib/ReactEventListener.js +0 -157
  111. package/lib/ReactFeatureFlags.js +0 -22
  112. package/lib/ReactHostComponent.js +0 -76
  113. package/lib/ReactHostOperationHistoryHook.js +0 -37
  114. package/lib/ReactInjection.js +0 -36
  115. package/lib/ReactInputSelection.js +0 -124
  116. package/lib/ReactInstanceHandles.js +0 -302
  117. package/lib/ReactInstanceMap.js +0 -48
  118. package/lib/ReactInstrumentation.js +0 -21
  119. package/lib/ReactInvalidSetStateWarningHook.js +0 -36
  120. package/lib/ReactMarkupChecksum.js +0 -50
  121. package/lib/ReactMount.js +0 -534
  122. package/lib/ReactMultiChild.js +0 -451
  123. package/lib/ReactMultiChildUpdateTypes.js +0 -32
  124. package/lib/ReactNative.js +0 -71
  125. package/lib/ReactNativeAttributePayload.js +0 -371
  126. package/lib/ReactNativeBaseComponent.js +0 -198
  127. package/lib/ReactNativeBridgeEventPlugin.js +0 -60
  128. package/lib/ReactNativeComponentEnvironment.js +0 -31
  129. package/lib/ReactNativeComponentTree.js +0 -68
  130. package/lib/ReactNativeContainerInfo.js +0 -21
  131. package/lib/ReactNativeDOMIDOperations.js +0 -79
  132. package/lib/ReactNativeDefaultInjection.js +0 -101
  133. package/lib/ReactNativeEventEmitter.js +0 -191
  134. package/lib/ReactNativeEventPluginOrder.js +0 -16
  135. package/lib/ReactNativeGlobalResponderHandler.js +0 -25
  136. package/lib/ReactNativeMount.js +0 -193
  137. package/lib/ReactNativePropRegistry.js +0 -52
  138. package/lib/ReactNativeReconcileTransaction.js +0 -129
  139. package/lib/ReactNativeTagHandles.js +0 -56
  140. package/lib/ReactNativeTextComponent.js +0 -71
  141. package/lib/ReactNativeTreeTraversal.js +0 -127
  142. package/lib/ReactNodeTypes.js +0 -40
  143. package/lib/ReactNoop.js +0 -173
  144. package/lib/ReactOwner.js +0 -94
  145. package/lib/ReactPerf.js +0 -494
  146. package/lib/ReactReconcileTransaction.js +0 -178
  147. package/lib/ReactReconciler.js +0 -168
  148. package/lib/ReactRef.js +0 -80
  149. package/lib/ReactServerBatchingStrategy.js +0 -22
  150. package/lib/ReactServerRendering.js +0 -90
  151. package/lib/ReactServerRenderingTransaction.js +0 -90
  152. package/lib/ReactServerUpdateQueue.js +0 -141
  153. package/lib/ReactSimpleEmptyComponent.js +0 -37
  154. package/lib/ReactTestMount.js +0 -126
  155. package/lib/ReactTestReconcileTransaction.js +0 -121
  156. package/lib/ReactTestRenderer.js +0 -144
  157. package/lib/ReactTestUtils.js +0 -518
  158. package/lib/ReactUpdateQueue.js +0 -226
  159. package/lib/ReactUpdates.js +0 -251
  160. package/lib/ResponderEventPlugin.js +0 -510
  161. package/lib/ResponderSyntheticEvent.js +0 -39
  162. package/lib/ResponderTouchHistoryStore.js +0 -184
  163. package/lib/SVGDOMPropertyConfig.js +0 -302
  164. package/lib/SelectEventPlugin.js +0 -196
  165. package/lib/SimpleEventPlugin.js +0 -635
  166. package/lib/SyntheticAnimationEvent.js +0 -39
  167. package/lib/SyntheticClipboardEvent.js +0 -38
  168. package/lib/SyntheticCompositionEvent.js +0 -36
  169. package/lib/SyntheticDragEvent.js +0 -36
  170. package/lib/SyntheticEvent.js +0 -268
  171. package/lib/SyntheticFocusEvent.js +0 -36
  172. package/lib/SyntheticInputEvent.js +0 -37
  173. package/lib/SyntheticKeyboardEvent.js +0 -84
  174. package/lib/SyntheticMouseEvent.js +0 -72
  175. package/lib/SyntheticTouchEvent.js +0 -45
  176. package/lib/SyntheticTransitionEvent.js +0 -39
  177. package/lib/SyntheticUIEvent.js +0 -59
  178. package/lib/SyntheticWheelEvent.js +0 -54
  179. package/lib/TapEventPlugin.js +0 -110
  180. package/lib/TouchHistoryMath.js +0 -99
  181. package/lib/Transaction.js +0 -233
  182. package/lib/ViewportMetrics.js +0 -27
  183. package/lib/accumulate.js +0 -46
  184. package/lib/accumulateInto.js +0 -58
  185. package/lib/adler32.js +0 -44
  186. package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
  187. package/lib/createReactNativeComponentClass.js +0 -42
  188. package/lib/dangerousStyleValue.js +0 -79
  189. package/lib/escapeTextContentForBrowser.js +0 -123
  190. package/lib/findDOMNode.js +0 -60
  191. package/lib/findNodeHandle.js +0 -91
  192. package/lib/forEachAccumulated.js +0 -31
  193. package/lib/getEventCharCode.js +0 -50
  194. package/lib/getEventKey.js +0 -102
  195. package/lib/getEventModifierState.js +0 -43
  196. package/lib/getEventTarget.js +0 -35
  197. package/lib/getHostComponentFromComposite.js +0 -30
  198. package/lib/getNodeForCharacterOffset.js +0 -74
  199. package/lib/getTestDocument.js +0 -21
  200. package/lib/getTextContentAccessor.js +0 -33
  201. package/lib/getVendorPrefixedEventName.js +0 -101
  202. package/lib/instantiateReactComponent.js +0 -119
  203. package/lib/isEventSupported.js +0 -60
  204. package/lib/isTextInputElement.js +0 -51
  205. package/lib/quoteAttributeValueForBrowser.js +0 -26
  206. package/lib/reactComponentExpect.js +0 -217
  207. package/lib/setInnerHTML.js +0 -98
  208. package/lib/setTextContent.js +0 -48
  209. package/lib/shouldUpdateReactComponent.js +0 -42
  210. package/lib/validateDOMNesting.js +0 -382
@@ -1,178 +0,0 @@
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 ReactReconcileTransaction
10
- */
11
-
12
- 'use strict';
13
-
14
- var _assign = require('object-assign');
15
-
16
- var CallbackQueue = require('./CallbackQueue');
17
- var PooledClass = require('./PooledClass');
18
- var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
19
- var ReactInputSelection = require('./ReactInputSelection');
20
- var ReactInstrumentation = require('./ReactInstrumentation');
21
- var Transaction = require('./Transaction');
22
- var ReactUpdateQueue = require('./ReactUpdateQueue');
23
-
24
- /**
25
- * Ensures that, when possible, the selection range (currently selected text
26
- * input) is not disturbed by performing the transaction.
27
- */
28
- var SELECTION_RESTORATION = {
29
- /**
30
- * @return {Selection} Selection information.
31
- */
32
- initialize: ReactInputSelection.getSelectionInformation,
33
- /**
34
- * @param {Selection} sel Selection information returned from `initialize`.
35
- */
36
- close: ReactInputSelection.restoreSelection
37
- };
38
-
39
- /**
40
- * Suppresses events (blur/focus) that could be inadvertently dispatched due to
41
- * high level DOM manipulations (like temporarily removing a text input from the
42
- * DOM).
43
- */
44
- var EVENT_SUPPRESSION = {
45
- /**
46
- * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
47
- * the reconciliation.
48
- */
49
- initialize: function () {
50
- var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
51
- ReactBrowserEventEmitter.setEnabled(false);
52
- return currentlyEnabled;
53
- },
54
-
55
- /**
56
- * @param {boolean} previouslyEnabled Enabled status of
57
- * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
58
- * restores the previous value.
59
- */
60
- close: function (previouslyEnabled) {
61
- ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
62
- }
63
- };
64
-
65
- /**
66
- * Provides a queue for collecting `componentDidMount` and
67
- * `componentDidUpdate` callbacks during the transaction.
68
- */
69
- var ON_DOM_READY_QUEUEING = {
70
- /**
71
- * Initializes the internal `onDOMReady` queue.
72
- */
73
- initialize: function () {
74
- this.reactMountReady.reset();
75
- },
76
-
77
- /**
78
- * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
79
- */
80
- close: function () {
81
- this.reactMountReady.notifyAll();
82
- }
83
- };
84
-
85
- /**
86
- * Executed within the scope of the `Transaction` instance. Consider these as
87
- * being member methods, but with an implied ordering while being isolated from
88
- * each other.
89
- */
90
- var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
91
-
92
- if (process.env.NODE_ENV !== 'production') {
93
- TRANSACTION_WRAPPERS.push({
94
- initialize: ReactInstrumentation.debugTool.onBeginFlush,
95
- close: ReactInstrumentation.debugTool.onEndFlush
96
- });
97
- }
98
-
99
- /**
100
- * Currently:
101
- * - The order that these are listed in the transaction is critical:
102
- * - Suppresses events.
103
- * - Restores selection range.
104
- *
105
- * Future:
106
- * - Restore document/overflow scroll positions that were unintentionally
107
- * modified via DOM insertions above the top viewport boundary.
108
- * - Implement/integrate with customized constraint based layout system and keep
109
- * track of which dimensions must be remeasured.
110
- *
111
- * @class ReactReconcileTransaction
112
- */
113
- function ReactReconcileTransaction(useCreateElement) {
114
- this.reinitializeTransaction();
115
- // Only server-side rendering really needs this option (see
116
- // `ReactServerRendering`), but server-side uses
117
- // `ReactServerRenderingTransaction` instead. This option is here so that it's
118
- // accessible and defaults to false when `ReactDOMComponent` and
119
- // `ReactDOMTextComponent` checks it in `mountComponent`.`
120
- this.renderToStaticMarkup = false;
121
- this.reactMountReady = CallbackQueue.getPooled(null);
122
- this.useCreateElement = useCreateElement;
123
- }
124
-
125
- var Mixin = {
126
- /**
127
- * @see Transaction
128
- * @abstract
129
- * @final
130
- * @return {array<object>} List of operation wrap procedures.
131
- * TODO: convert to array<TransactionWrapper>
132
- */
133
- getTransactionWrappers: function () {
134
- return TRANSACTION_WRAPPERS;
135
- },
136
-
137
- /**
138
- * @return {object} The queue to collect `onDOMReady` callbacks with.
139
- */
140
- getReactMountReady: function () {
141
- return this.reactMountReady;
142
- },
143
-
144
- /**
145
- * @return {object} The queue to collect React async events.
146
- */
147
- getUpdateQueue: function () {
148
- return ReactUpdateQueue;
149
- },
150
-
151
- /**
152
- * Save current transaction state -- if the return value from this method is
153
- * passed to `rollback`, the transaction will be reset to that state.
154
- */
155
- checkpoint: function () {
156
- // reactMountReady is the our only stateful wrapper
157
- return this.reactMountReady.checkpoint();
158
- },
159
-
160
- rollback: function (checkpoint) {
161
- this.reactMountReady.rollback(checkpoint);
162
- },
163
-
164
- /**
165
- * `PooledClass` looks for this, and will invoke this before allowing this
166
- * instance to be reused.
167
- */
168
- destructor: function () {
169
- CallbackQueue.release(this.reactMountReady);
170
- this.reactMountReady = null;
171
- }
172
- };
173
-
174
- _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
175
-
176
- PooledClass.addPoolingTo(ReactReconcileTransaction);
177
-
178
- module.exports = ReactReconcileTransaction;
@@ -1,168 +0,0 @@
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 ReactReconciler
10
- */
11
-
12
- 'use strict';
13
-
14
- var ReactRef = require('./ReactRef');
15
- var ReactInstrumentation = require('./ReactInstrumentation');
16
-
17
- var warning = require('fbjs/lib/warning');
18
-
19
- /**
20
- * Helper to call ReactRef.attachRefs with this composite component, split out
21
- * to avoid allocations in the transaction mount-ready queue.
22
- */
23
- function attachRefs() {
24
- ReactRef.attachRefs(this, this._currentElement);
25
- }
26
-
27
- var ReactReconciler = {
28
-
29
- /**
30
- * Initializes the component, renders markup, and registers event listeners.
31
- *
32
- * @param {ReactComponent} internalInstance
33
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
34
- * @param {?object} the containing host component instance
35
- * @param {?object} info about the host container
36
- * @return {?string} Rendered markup to be inserted into the DOM.
37
- * @final
38
- * @internal
39
- */
40
- mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
41
- ) {
42
- if (process.env.NODE_ENV !== 'production') {
43
- if (internalInstance._debugID !== 0) {
44
- ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
45
- }
46
- }
47
- var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
48
- if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
49
- transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
50
- }
51
- if (process.env.NODE_ENV !== 'production') {
52
- if (internalInstance._debugID !== 0) {
53
- ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
54
- }
55
- }
56
- return markup;
57
- },
58
-
59
- /**
60
- * Returns a value that can be passed to
61
- * ReactComponentEnvironment.replaceNodeWithMarkup.
62
- */
63
- getHostNode: function (internalInstance) {
64
- return internalInstance.getHostNode();
65
- },
66
-
67
- /**
68
- * Releases any resources allocated by `mountComponent`.
69
- *
70
- * @final
71
- * @internal
72
- */
73
- unmountComponent: function (internalInstance, safely) {
74
- if (process.env.NODE_ENV !== 'production') {
75
- if (internalInstance._debugID !== 0) {
76
- ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
77
- }
78
- }
79
- ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
80
- internalInstance.unmountComponent(safely);
81
- if (process.env.NODE_ENV !== 'production') {
82
- if (internalInstance._debugID !== 0) {
83
- ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
84
- }
85
- }
86
- },
87
-
88
- /**
89
- * Update a component using a new element.
90
- *
91
- * @param {ReactComponent} internalInstance
92
- * @param {ReactElement} nextElement
93
- * @param {ReactReconcileTransaction} transaction
94
- * @param {object} context
95
- * @internal
96
- */
97
- receiveComponent: function (internalInstance, nextElement, transaction, context) {
98
- var prevElement = internalInstance._currentElement;
99
-
100
- if (nextElement === prevElement && context === internalInstance._context) {
101
- // Since elements are immutable after the owner is rendered,
102
- // we can do a cheap identity compare here to determine if this is a
103
- // superfluous reconcile. It's possible for state to be mutable but such
104
- // change should trigger an update of the owner which would recreate
105
- // the element. We explicitly check for the existence of an owner since
106
- // it's possible for an element created outside a composite to be
107
- // deeply mutated and reused.
108
-
109
- // TODO: Bailing out early is just a perf optimization right?
110
- // TODO: Removing the return statement should affect correctness?
111
- return;
112
- }
113
-
114
- if (process.env.NODE_ENV !== 'production') {
115
- if (internalInstance._debugID !== 0) {
116
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
117
- }
118
- }
119
-
120
- var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
121
-
122
- if (refsChanged) {
123
- ReactRef.detachRefs(internalInstance, prevElement);
124
- }
125
-
126
- internalInstance.receiveComponent(nextElement, transaction, context);
127
-
128
- if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
129
- transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
130
- }
131
-
132
- if (process.env.NODE_ENV !== 'production') {
133
- if (internalInstance._debugID !== 0) {
134
- ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
135
- }
136
- }
137
- },
138
-
139
- /**
140
- * Flush any dirty changes in a component.
141
- *
142
- * @param {ReactComponent} internalInstance
143
- * @param {ReactReconcileTransaction} transaction
144
- * @internal
145
- */
146
- performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
147
- if (internalInstance._updateBatchNumber !== updateBatchNumber) {
148
- // The component's enqueued batch number should always be the current
149
- // batch or the following one.
150
- process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
151
- return;
152
- }
153
- if (process.env.NODE_ENV !== 'production') {
154
- if (internalInstance._debugID !== 0) {
155
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
156
- }
157
- }
158
- internalInstance.performUpdateIfNecessary(transaction);
159
- if (process.env.NODE_ENV !== 'production') {
160
- if (internalInstance._debugID !== 0) {
161
- ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
162
- }
163
- }
164
- }
165
-
166
- };
167
-
168
- module.exports = ReactReconciler;
package/lib/ReactRef.js DELETED
@@ -1,80 +0,0 @@
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 ReactRef
10
- */
11
-
12
- 'use strict';
13
-
14
- var ReactOwner = require('./ReactOwner');
15
-
16
- var ReactRef = {};
17
-
18
- function attachRef(ref, component, owner) {
19
- if (typeof ref === 'function') {
20
- ref(component.getPublicInstance());
21
- } else {
22
- // Legacy ref
23
- ReactOwner.addComponentAsRefTo(component, ref, owner);
24
- }
25
- }
26
-
27
- function detachRef(ref, component, owner) {
28
- if (typeof ref === 'function') {
29
- ref(null);
30
- } else {
31
- // Legacy ref
32
- ReactOwner.removeComponentAsRefFrom(component, ref, owner);
33
- }
34
- }
35
-
36
- ReactRef.attachRefs = function (instance, element) {
37
- if (element === null || element === false) {
38
- return;
39
- }
40
- var ref = element.ref;
41
- if (ref != null) {
42
- attachRef(ref, instance, element._owner);
43
- }
44
- };
45
-
46
- ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
47
- // If either the owner or a `ref` has changed, make sure the newest owner
48
- // has stored a reference to `this`, and the previous owner (if different)
49
- // has forgotten the reference to `this`. We use the element instead
50
- // of the public this.props because the post processing cannot determine
51
- // a ref. The ref conceptually lives on the element.
52
-
53
- // TODO: Should this even be possible? The owner cannot change because
54
- // it's forbidden by shouldUpdateReactComponent. The ref can change
55
- // if you swap the keys of but not the refs. Reconsider where this check
56
- // is made. It probably belongs where the key checking and
57
- // instantiateReactComponent is done.
58
-
59
- var prevEmpty = prevElement === null || prevElement === false;
60
- var nextEmpty = nextElement === null || nextElement === false;
61
-
62
- return (
63
- // This has a few false positives w/r/t empty components.
64
- prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref ||
65
- // If owner changes but we have an unchanged function ref, don't update refs
66
- typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner
67
- );
68
- };
69
-
70
- ReactRef.detachRefs = function (instance, element) {
71
- if (element === null || element === false) {
72
- return;
73
- }
74
- var ref = element.ref;
75
- if (ref != null) {
76
- detachRef(ref, instance, element._owner);
77
- }
78
- };
79
-
80
- module.exports = ReactRef;
@@ -1,22 +0,0 @@
1
- /**
2
- * Copyright 2014-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 ReactServerBatchingStrategy
10
- */
11
-
12
- 'use strict';
13
-
14
- var ReactServerBatchingStrategy = {
15
- isBatchingUpdates: false,
16
- batchedUpdates: function (callback) {
17
- // Don't do anything here. During the server rendering we don't want to
18
- // schedule any updates. We will simply ignore them.
19
- }
20
- };
21
-
22
- module.exports = ReactServerBatchingStrategy;