react 15.3.1-rc.2 → 15.4.0-rc.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 (190) hide show
  1. package/dist/react-with-addons.js +3961 -21387
  2. package/dist/react-with-addons.min.js +3 -6
  3. package/dist/react.js +2701 -19464
  4. package/dist/react.min.js +2 -6
  5. package/lib/LinkedStateMixin.js +1 -2
  6. package/lib/PooledClass.js +3 -0
  7. package/lib/ReactAddonsDOMDependencies.js +36 -0
  8. package/lib/ReactAddonsDOMDependenciesUMDShim.js +32 -0
  9. package/lib/ReactCSSTransitionGroup.js +60 -42
  10. package/lib/ReactCSSTransitionGroupChild.js +2 -2
  11. package/lib/ReactClass.js +38 -53
  12. package/lib/ReactComponentTreeHook.js +84 -100
  13. package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +5 -7
  14. package/lib/ReactCurrentOwner.js +1 -1
  15. package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +6 -4
  16. package/lib/ReactElement.js +6 -29
  17. package/lib/ReactElementSymbol.js +20 -0
  18. package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +4 -9
  19. package/lib/ReactElementValidator.js +1 -2
  20. package/lib/ReactPropTypeLocationNames.js +1 -0
  21. package/lib/ReactPropTypeLocations.js +2 -11
  22. package/lib/ReactPropTypes.js +30 -13
  23. package/lib/ReactPropTypesSecret.js +1 -0
  24. package/lib/ReactTransitionEvents.js +1 -1
  25. package/lib/ReactTransitionGroup.js +145 -141
  26. package/lib/ReactUMDEntry.js +11 -5
  27. package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +4 -6
  28. package/lib/ReactVersion.js +1 -1
  29. package/lib/ReactWithAddons.js +15 -2
  30. package/lib/ReactWithAddonsUMDEntry.js +11 -5
  31. package/lib/canDefineProperty.js +2 -0
  32. package/lib/onlyChild.js +1 -1
  33. package/lib/traverseAllChildren.js +11 -2
  34. package/lib/update.js +6 -7
  35. package/package.json +2 -2
  36. package/lib/AutoFocusUtils.js +0 -24
  37. package/lib/BeforeInputEventPlugin.js +0 -388
  38. package/lib/CSSProperty.js +0 -148
  39. package/lib/CSSPropertyOperations.js +0 -205
  40. package/lib/CallbackQueue.js +0 -106
  41. package/lib/ChangeEventPlugin.js +0 -325
  42. package/lib/DOMChildrenOperations.js +0 -194
  43. package/lib/DOMLazyTree.js +0 -118
  44. package/lib/DOMProperty.js +0 -206
  45. package/lib/DOMPropertyOperations.js +0 -221
  46. package/lib/Danger.js +0 -48
  47. package/lib/DefaultEventPluginOrder.js +0 -27
  48. package/lib/DisabledInputUtils.js +0 -50
  49. package/lib/EnterLeaveEventPlugin.js +0 -105
  50. package/lib/EventConstants.js +0 -97
  51. package/lib/EventPluginHub.js +0 -251
  52. package/lib/EventPluginRegistry.js +0 -247
  53. package/lib/EventPluginUtils.js +0 -229
  54. package/lib/EventPropagators.js +0 -137
  55. package/lib/FallbackCompositionState.js +0 -95
  56. package/lib/HTMLDOMPropertyConfig.js +0 -209
  57. package/lib/LinkedValueUtils.js +0 -136
  58. package/lib/NativeMethodsMixin.js +0 -167
  59. package/lib/ReactBrowserEventEmitter.js +0 -317
  60. package/lib/ReactChildReconciler.js +0 -154
  61. package/lib/ReactChildrenMutationWarningHook.js +0 -54
  62. package/lib/ReactComponentBrowserEnvironment.js +0 -30
  63. package/lib/ReactComponentEnvironment.js +0 -45
  64. package/lib/ReactComponentTreeTestUtils.js +0 -87
  65. package/lib/ReactCompositeComponent.js +0 -920
  66. package/lib/ReactDOM.js +0 -110
  67. package/lib/ReactDOMButton.js +0 -24
  68. package/lib/ReactDOMComponent.js +0 -1005
  69. package/lib/ReactDOMComponentTree.js +0 -188
  70. package/lib/ReactDOMContainerInfo.js +0 -33
  71. package/lib/ReactDOMEmptyComponent.js +0 -60
  72. package/lib/ReactDOMFiber.js +0 -78
  73. package/lib/ReactDOMIDOperations.js +0 -34
  74. package/lib/ReactDOMInput.js +0 -269
  75. package/lib/ReactDOMNullInputValuePropHook.js +0 -43
  76. package/lib/ReactDOMOption.js +0 -123
  77. package/lib/ReactDOMSelect.js +0 -201
  78. package/lib/ReactDOMSelection.js +0 -212
  79. package/lib/ReactDOMServer.js +0 -26
  80. package/lib/ReactDOMTextComponent.js +0 -164
  81. package/lib/ReactDOMTextarea.js +0 -155
  82. package/lib/ReactDOMTreeTraversal.js +0 -136
  83. package/lib/ReactDOMUnknownPropertyHook.js +0 -112
  84. package/lib/ReactDebugTool.js +0 -307
  85. package/lib/ReactDefaultBatchingStrategy.js +0 -68
  86. package/lib/ReactDefaultInjection.js +0 -84
  87. package/lib/ReactEmptyComponent.js +0 -30
  88. package/lib/ReactErrorUtils.js +0 -76
  89. package/lib/ReactEventEmitterMixin.js +0 -33
  90. package/lib/ReactEventListener.js +0 -157
  91. package/lib/ReactFeatureFlags.js +0 -22
  92. package/lib/ReactHostComponent.js +0 -76
  93. package/lib/ReactHostOperationHistoryHook.js +0 -37
  94. package/lib/ReactInjection.js +0 -36
  95. package/lib/ReactInputSelection.js +0 -124
  96. package/lib/ReactInstanceHandles.js +0 -302
  97. package/lib/ReactInstanceMap.js +0 -48
  98. package/lib/ReactInstrumentation.js +0 -21
  99. package/lib/ReactInvalidSetStateWarningHook.js +0 -36
  100. package/lib/ReactMarkupChecksum.js +0 -50
  101. package/lib/ReactMount.js +0 -495
  102. package/lib/ReactMultiChild.js +0 -451
  103. package/lib/ReactMultiChildUpdateTypes.js +0 -32
  104. package/lib/ReactNative.js +0 -71
  105. package/lib/ReactNativeAttributePayload.js +0 -371
  106. package/lib/ReactNativeBaseComponent.js +0 -198
  107. package/lib/ReactNativeBridgeEventPlugin.js +0 -60
  108. package/lib/ReactNativeComponentEnvironment.js +0 -31
  109. package/lib/ReactNativeComponentTree.js +0 -68
  110. package/lib/ReactNativeContainerInfo.js +0 -21
  111. package/lib/ReactNativeDOMIDOperations.js +0 -79
  112. package/lib/ReactNativeDefaultInjection.js +0 -101
  113. package/lib/ReactNativeEventEmitter.js +0 -191
  114. package/lib/ReactNativeEventPluginOrder.js +0 -16
  115. package/lib/ReactNativeGlobalResponderHandler.js +0 -25
  116. package/lib/ReactNativeMount.js +0 -193
  117. package/lib/ReactNativePropRegistry.js +0 -52
  118. package/lib/ReactNativeReconcileTransaction.js +0 -116
  119. package/lib/ReactNativeTagHandles.js +0 -56
  120. package/lib/ReactNativeTextComponent.js +0 -71
  121. package/lib/ReactNativeTreeTraversal.js +0 -127
  122. package/lib/ReactNodeTypes.js +0 -40
  123. package/lib/ReactNoop.js +0 -173
  124. package/lib/ReactOwner.js +0 -94
  125. package/lib/ReactPerf.js +0 -494
  126. package/lib/ReactReconcileTransaction.js +0 -178
  127. package/lib/ReactReconciler.js +0 -168
  128. package/lib/ReactRef.js +0 -80
  129. package/lib/ReactServerBatchingStrategy.js +0 -22
  130. package/lib/ReactServerRendering.js +0 -90
  131. package/lib/ReactServerRenderingTransaction.js +0 -90
  132. package/lib/ReactServerUpdateQueue.js +0 -141
  133. package/lib/ReactSimpleEmptyComponent.js +0 -37
  134. package/lib/ReactTestMount.js +0 -123
  135. package/lib/ReactTestReconcileTransaction.js +0 -108
  136. package/lib/ReactTestRenderer.js +0 -144
  137. package/lib/ReactTestUtils.js +0 -518
  138. package/lib/ReactUpdateQueue.js +0 -226
  139. package/lib/ReactUpdates.js +0 -251
  140. package/lib/ResponderEventPlugin.js +0 -510
  141. package/lib/ResponderSyntheticEvent.js +0 -39
  142. package/lib/ResponderTouchHistoryStore.js +0 -184
  143. package/lib/SVGDOMPropertyConfig.js +0 -302
  144. package/lib/SelectEventPlugin.js +0 -196
  145. package/lib/SimpleEventPlugin.js +0 -635
  146. package/lib/SyntheticAnimationEvent.js +0 -39
  147. package/lib/SyntheticClipboardEvent.js +0 -38
  148. package/lib/SyntheticCompositionEvent.js +0 -36
  149. package/lib/SyntheticDragEvent.js +0 -36
  150. package/lib/SyntheticEvent.js +0 -267
  151. package/lib/SyntheticFocusEvent.js +0 -36
  152. package/lib/SyntheticInputEvent.js +0 -37
  153. package/lib/SyntheticKeyboardEvent.js +0 -84
  154. package/lib/SyntheticMouseEvent.js +0 -72
  155. package/lib/SyntheticTouchEvent.js +0 -45
  156. package/lib/SyntheticTransitionEvent.js +0 -39
  157. package/lib/SyntheticUIEvent.js +0 -59
  158. package/lib/SyntheticWheelEvent.js +0 -54
  159. package/lib/TapEventPlugin.js +0 -110
  160. package/lib/TouchHistoryMath.js +0 -99
  161. package/lib/Transaction.js +0 -233
  162. package/lib/ViewportMetrics.js +0 -27
  163. package/lib/accumulate.js +0 -46
  164. package/lib/accumulateInto.js +0 -58
  165. package/lib/adler32.js +0 -44
  166. package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
  167. package/lib/createReactNativeComponentClass.js +0 -42
  168. package/lib/dangerousStyleValue.js +0 -79
  169. package/lib/escapeTextContentForBrowser.js +0 -122
  170. package/lib/findDOMNode.js +0 -60
  171. package/lib/findNodeHandle.js +0 -91
  172. package/lib/forEachAccumulated.js +0 -31
  173. package/lib/getEventCharCode.js +0 -50
  174. package/lib/getEventKey.js +0 -102
  175. package/lib/getEventModifierState.js +0 -43
  176. package/lib/getEventTarget.js +0 -35
  177. package/lib/getHostComponentFromComposite.js +0 -30
  178. package/lib/getNodeForCharacterOffset.js +0 -74
  179. package/lib/getTestDocument.js +0 -21
  180. package/lib/getTextContentAccessor.js +0 -33
  181. package/lib/getVendorPrefixedEventName.js +0 -101
  182. package/lib/instantiateReactComponent.js +0 -119
  183. package/lib/isEventSupported.js +0 -60
  184. package/lib/isTextInputElement.js +0 -51
  185. package/lib/quoteAttributeValueForBrowser.js +0 -26
  186. package/lib/reactComponentExpect.js +0 -217
  187. package/lib/setInnerHTML.js +0 -98
  188. package/lib/setTextContent.js +0 -48
  189. package/lib/shouldUpdateReactComponent.js +0 -42
  190. package/lib/validateDOMNesting.js +0 -369
@@ -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;