react 15.2.0 → 15.2.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.
- package/dist/react-with-addons.js +1099 -999
- package/dist/react-with-addons.min.js +6 -7
- package/dist/react.js +1034 -935
- package/dist/react.min.js +6 -6
- package/lib/DOMProperty.js +0 -9
- package/lib/DOMPropertyOperations.js +4 -12
- package/lib/Danger.js +0 -98
- package/lib/KeyEscapeUtils.js +2 -1
- package/lib/PooledClass.js +1 -1
- package/lib/ReactChildReconciler.js +3 -3
- package/lib/ReactComponentTreeDevtool.js +0 -5
- package/lib/ReactCompositeComponent.js +23 -13
- package/lib/ReactDOMComponent.js +1 -1
- package/lib/ReactDOMDebugTool.js +11 -11
- package/lib/ReactDOMFiber.js +78 -0
- package/lib/ReactDOMInput.js +17 -15
- package/lib/ReactDOMInstrumentation.js +7 -2
- package/lib/ReactDOMNullInputValuePropDevtool.js +43 -0
- package/lib/ReactDOMSelect.js +0 -13
- package/lib/ReactDOMTextarea.js +0 -14
- package/lib/ReactDebugTool.js +75 -83
- package/lib/ReactFeatureFlags.js +1 -0
- package/lib/ReactInstrumentation.js +7 -2
- package/lib/ReactMount.js +15 -17
- package/lib/ReactMultiChild.js +8 -3
- package/lib/ReactNativeMount.js +2 -13
- package/lib/ReactNativeReconcileTransaction.js +16 -0
- package/lib/ReactNodeTypes.js +1 -0
- package/lib/ReactNoop.js +100 -3
- package/lib/ReactNoopUpdateQueue.js +6 -5
- package/lib/ReactReconcileTransaction.js +16 -0
- package/lib/ReactServerRendering.js +1 -5
- package/lib/ReactServerRenderingTransaction.js +17 -0
- package/lib/ReactServerUpdateQueue.js +141 -0
- package/lib/ReactTestMount.js +1 -12
- package/lib/ReactTestReconcileTransaction.js +8 -0
- package/lib/ReactTransitionGroup.js +1 -0
- package/lib/ReactUpdateQueue.js +4 -2
- package/lib/ReactUpdates.js +1 -10
- package/lib/ReactVersion.js +1 -1
- package/lib/ResponderEventPlugin.js +1 -1
- package/lib/ResponderTouchHistoryStore.js +97 -95
- package/lib/accumulate.js +14 -14
- package/lib/accumulateInto.js +8 -11
- package/lib/adler32.js +1 -0
- package/lib/checkReactTypeSpec.js +7 -5
- package/lib/deprecated.js +7 -1
- package/lib/flattenChildren.js +11 -8
- package/lib/forEachAccumulated.js +3 -2
- package/lib/getIteratorFn.js +1 -0
- package/lib/instantiateReactComponent.js +8 -7
- package/lib/isTextInputElement.js +11 -1
- package/lib/reactProdInvariant.js +1 -0
- package/package.json +1 -1
package/lib/ReactFeatureFlags.js
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var debugTool = null;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
17
|
+
var ReactDebugTool = require('./ReactDebugTool');
|
|
18
|
+
debugTool = ReactDebugTool;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { debugTool: debugTool };
|
package/lib/ReactMount.js
CHANGED
|
@@ -22,6 +22,7 @@ var ReactDOMContainerInfo = require('./ReactDOMContainerInfo');
|
|
|
22
22
|
var ReactDOMFeatureFlags = require('./ReactDOMFeatureFlags');
|
|
23
23
|
var ReactElement = require('./ReactElement');
|
|
24
24
|
var ReactFeatureFlags = require('./ReactFeatureFlags');
|
|
25
|
+
var ReactInstanceMap = require('./ReactInstanceMap');
|
|
25
26
|
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
26
27
|
var ReactMarkupChecksum = require('./ReactMarkupChecksum');
|
|
27
28
|
var ReactReconciler = require('./ReactReconciler');
|
|
@@ -247,9 +248,9 @@ var ReactMount = {
|
|
|
247
248
|
* @param {DOMElement} container container to render into
|
|
248
249
|
* @param {?function} callback function triggered on completion
|
|
249
250
|
*/
|
|
250
|
-
_updateRootComponent: function (prevComponent, nextElement, container, callback) {
|
|
251
|
+
_updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
|
|
251
252
|
ReactMount.scrollMonitor(container, function () {
|
|
252
|
-
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
|
|
253
|
+
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
|
|
253
254
|
if (callback) {
|
|
254
255
|
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
|
|
255
256
|
}
|
|
@@ -267,10 +268,6 @@ var ReactMount = {
|
|
|
267
268
|
* @return {ReactComponent} nextComponent
|
|
268
269
|
*/
|
|
269
270
|
_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
|
|
270
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
271
|
-
ReactInstrumentation.debugTool.onBeginFlush();
|
|
272
|
-
}
|
|
273
|
-
|
|
274
271
|
// Various parts of our code (such as ReactCompositeComponent's
|
|
275
272
|
// _renderValidatedComponent) assume that calls to render aren't nested;
|
|
276
273
|
// verify that that's the case.
|
|
@@ -279,13 +276,7 @@ var ReactMount = {
|
|
|
279
276
|
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
|
|
280
277
|
|
|
281
278
|
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
|
|
282
|
-
var componentInstance = instantiateReactComponent(nextElement);
|
|
283
|
-
|
|
284
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
285
|
-
// Mute future events from the top level wrapper.
|
|
286
|
-
// It is an implementation detail that devtools should not know about.
|
|
287
|
-
componentInstance._debugID = 0;
|
|
288
|
-
}
|
|
279
|
+
var componentInstance = instantiateReactComponent(nextElement, false);
|
|
289
280
|
|
|
290
281
|
// The initial render is synchronous but any updates that happen during
|
|
291
282
|
// rendering, in componentWillMount or componentDidMount, will be batched
|
|
@@ -299,7 +290,6 @@ var ReactMount = {
|
|
|
299
290
|
if (process.env.NODE_ENV !== 'production') {
|
|
300
291
|
// The instance here is TopLevelWrapper so we report mount for its child.
|
|
301
292
|
ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
|
|
302
|
-
ReactInstrumentation.debugTool.onEndFlush();
|
|
303
293
|
}
|
|
304
294
|
|
|
305
295
|
return componentInstance;
|
|
@@ -319,7 +309,7 @@ var ReactMount = {
|
|
|
319
309
|
* @return {ReactComponent} Component instance rendered in `container`.
|
|
320
310
|
*/
|
|
321
311
|
renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
|
322
|
-
!(parentComponent != null && parentComponent
|
|
312
|
+
!(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
|
|
323
313
|
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
|
|
324
314
|
},
|
|
325
315
|
|
|
@@ -333,6 +323,14 @@ var ReactMount = {
|
|
|
333
323
|
|
|
334
324
|
var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
|
|
335
325
|
|
|
326
|
+
var nextContext;
|
|
327
|
+
if (parentComponent) {
|
|
328
|
+
var parentInst = ReactInstanceMap.get(parentComponent);
|
|
329
|
+
nextContext = parentInst._processChildContext(parentInst._context);
|
|
330
|
+
} else {
|
|
331
|
+
nextContext = emptyObject;
|
|
332
|
+
}
|
|
333
|
+
|
|
336
334
|
var prevComponent = getTopLevelWrapperInContainer(container);
|
|
337
335
|
|
|
338
336
|
if (prevComponent) {
|
|
@@ -343,7 +341,7 @@ var ReactMount = {
|
|
|
343
341
|
var updatedCallback = callback && function () {
|
|
344
342
|
callback.call(publicInst);
|
|
345
343
|
};
|
|
346
|
-
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
|
|
344
|
+
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
|
|
347
345
|
return publicInst;
|
|
348
346
|
} else {
|
|
349
347
|
ReactMount.unmountComponentAtNode(container);
|
|
@@ -370,7 +368,7 @@ var ReactMount = {
|
|
|
370
368
|
}
|
|
371
369
|
|
|
372
370
|
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
|
|
373
|
-
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup,
|
|
371
|
+
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
|
|
374
372
|
if (callback) {
|
|
375
373
|
callback.call(component);
|
|
376
374
|
}
|
package/lib/ReactMultiChild.js
CHANGED
|
@@ -158,9 +158,14 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
setChildrenForInstrumentation = function (children) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
var debugID = getDebugID(this);
|
|
162
|
+
// TODO: React Native empty components are also multichild.
|
|
163
|
+
// This means they still get into this method but don't have _debugID.
|
|
164
|
+
if (debugID !== 0) {
|
|
165
|
+
ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
|
|
166
|
+
return children[key]._debugID;
|
|
167
|
+
}) : []);
|
|
168
|
+
}
|
|
164
169
|
};
|
|
165
170
|
}
|
|
166
171
|
|
package/lib/ReactNativeMount.js
CHANGED
|
@@ -89,7 +89,7 @@ var ReactNativeMount = {
|
|
|
89
89
|
var prevWrappedElement = prevComponent._currentElement;
|
|
90
90
|
var prevElement = prevWrappedElement.props;
|
|
91
91
|
if (shouldUpdateReactComponent(prevElement, nextElement)) {
|
|
92
|
-
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextWrappedElement);
|
|
92
|
+
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject);
|
|
93
93
|
if (callback) {
|
|
94
94
|
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
|
|
95
95
|
}
|
|
@@ -106,19 +106,9 @@ var ReactNativeMount = {
|
|
|
106
106
|
|
|
107
107
|
ReactNativeTagHandles.assertRootTag(containerTag);
|
|
108
108
|
|
|
109
|
-
var instance = instantiateReactComponent(nextWrappedElement);
|
|
109
|
+
var instance = instantiateReactComponent(nextWrappedElement, false);
|
|
110
110
|
ReactNativeMount._instancesByContainerID[containerTag] = instance;
|
|
111
111
|
|
|
112
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
113
|
-
// Mute future events from the top level wrapper.
|
|
114
|
-
// It is an implementation detail that devtools should not know about.
|
|
115
|
-
instance._debugID = 0;
|
|
116
|
-
|
|
117
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
118
|
-
ReactInstrumentation.debugTool.onBeginFlush();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
112
|
// The initial render is synchronous but any updates that happen during
|
|
123
113
|
// rendering, in componentWillMount or componentDidMount, will be batched
|
|
124
114
|
// according to the current batching strategy.
|
|
@@ -127,7 +117,6 @@ var ReactNativeMount = {
|
|
|
127
117
|
if (process.env.NODE_ENV !== 'production') {
|
|
128
118
|
// The instance here is TopLevelWrapper so we report mount for its child.
|
|
129
119
|
ReactInstrumentation.debugTool.onMountRootComponent(instance._renderedComponent._debugID);
|
|
130
|
-
ReactInstrumentation.debugTool.onEndFlush();
|
|
131
120
|
}
|
|
132
121
|
var component = instance.getPublicInstance();
|
|
133
122
|
if (callback) {
|
|
@@ -16,6 +16,8 @@ var _assign = require('object-assign');
|
|
|
16
16
|
var CallbackQueue = require('./CallbackQueue');
|
|
17
17
|
var PooledClass = require('./PooledClass');
|
|
18
18
|
var Transaction = require('./Transaction');
|
|
19
|
+
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
20
|
+
var ReactUpdateQueue = require('./ReactUpdateQueue');
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks during
|
|
@@ -44,6 +46,13 @@ var ON_DOM_READY_QUEUEING = {
|
|
|
44
46
|
*/
|
|
45
47
|
var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
|
|
46
48
|
|
|
49
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
50
|
+
TRANSACTION_WRAPPERS.push({
|
|
51
|
+
initialize: ReactInstrumentation.debugTool.onBeginFlush,
|
|
52
|
+
close: ReactInstrumentation.debugTool.onEndFlush
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
/**
|
|
48
57
|
* Currently:
|
|
49
58
|
* - The order that these are listed in the transaction is critical:
|
|
@@ -83,6 +92,13 @@ var Mixin = {
|
|
|
83
92
|
return this.reactMountReady;
|
|
84
93
|
},
|
|
85
94
|
|
|
95
|
+
/**
|
|
96
|
+
* @return {object} The queue to collect React async events.
|
|
97
|
+
*/
|
|
98
|
+
getUpdateQueue: function () {
|
|
99
|
+
return ReactUpdateQueue;
|
|
100
|
+
},
|
|
101
|
+
|
|
86
102
|
/**
|
|
87
103
|
* `PooledClass` looks for this, and will invoke this before allowing this
|
|
88
104
|
* instance to be reused.
|
package/lib/ReactNodeTypes.js
CHANGED
package/lib/ReactNoop.js
CHANGED
|
@@ -24,8 +24,59 @@ var ReactFiberReconciler = require('./ReactFiberReconciler');
|
|
|
24
24
|
var scheduledHighPriCallback = null;
|
|
25
25
|
var scheduledLowPriCallback = null;
|
|
26
26
|
|
|
27
|
+
var TERMINAL_TAG = 99;
|
|
28
|
+
|
|
29
|
+
var instanceCounter = 0;
|
|
30
|
+
|
|
31
|
+
function recursivelyAppendChildren(flatArray, child) {
|
|
32
|
+
if (!child) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (child.tag === TERMINAL_TAG) {
|
|
36
|
+
flatArray.push(child);
|
|
37
|
+
} else {
|
|
38
|
+
var node = child;
|
|
39
|
+
do {
|
|
40
|
+
recursivelyAppendChildren(flatArray, node.output);
|
|
41
|
+
} while (node = node.sibling);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function flattenChildren(children) {
|
|
46
|
+
var flatArray = [];
|
|
47
|
+
recursivelyAppendChildren(flatArray, children);
|
|
48
|
+
return flatArray;
|
|
49
|
+
}
|
|
50
|
+
|
|
27
51
|
var NoopRenderer = ReactFiberReconciler({
|
|
28
|
-
|
|
52
|
+
updateContainer: function (containerInfo, children) {
|
|
53
|
+
console.log('Update container #' + containerInfo.rootID);
|
|
54
|
+
containerInfo.children = flattenChildren(children);
|
|
55
|
+
},
|
|
56
|
+
createInstance: function (type, props, children) {
|
|
57
|
+
console.log('Create instance #' + instanceCounter);
|
|
58
|
+
var inst = {
|
|
59
|
+
tag: TERMINAL_TAG,
|
|
60
|
+
id: instanceCounter++,
|
|
61
|
+
type: type,
|
|
62
|
+
children: flattenChildren(children)
|
|
63
|
+
};
|
|
64
|
+
// Hide from unit tests
|
|
65
|
+
Object.defineProperty(inst, 'tag', { value: inst.tag, enumerable: false });
|
|
66
|
+
Object.defineProperty(inst, 'id', { value: inst.id, enumerable: false });
|
|
67
|
+
return inst;
|
|
68
|
+
},
|
|
69
|
+
prepareUpdate: function (instance, oldProps, newProps, children) {
|
|
70
|
+
console.log('Prepare for update on #' + instance.id);
|
|
71
|
+
return true;
|
|
72
|
+
},
|
|
73
|
+
commitUpdate: function (instance, oldProps, newProps, children) {
|
|
74
|
+
console.log('Commit update on #' + instance.id);
|
|
75
|
+
instance.children = flattenChildren(children);
|
|
76
|
+
},
|
|
77
|
+
deleteInstance: function (instance) {
|
|
78
|
+
console.log('Delete #' + instance.id);
|
|
79
|
+
},
|
|
29
80
|
scheduleHighPriCallback: function (callback) {
|
|
30
81
|
scheduledHighPriCallback = callback;
|
|
31
82
|
},
|
|
@@ -34,10 +85,20 @@ var NoopRenderer = ReactFiberReconciler({
|
|
|
34
85
|
}
|
|
35
86
|
});
|
|
36
87
|
|
|
88
|
+
var rootContainer = { rootID: 0, children: [] };
|
|
89
|
+
|
|
90
|
+
var root = null;
|
|
91
|
+
|
|
37
92
|
var ReactNoop = {
|
|
38
|
-
render: function (element) {
|
|
39
93
|
|
|
40
|
-
|
|
94
|
+
root: rootContainer,
|
|
95
|
+
|
|
96
|
+
render: function (element) {
|
|
97
|
+
if (!root) {
|
|
98
|
+
root = NoopRenderer.mountContainer(element, rootContainer);
|
|
99
|
+
} else {
|
|
100
|
+
NoopRenderer.updateContainer(element, root);
|
|
101
|
+
}
|
|
41
102
|
},
|
|
42
103
|
flushHighPri: function () {
|
|
43
104
|
var cb = scheduledHighPriCallback;
|
|
@@ -70,6 +131,42 @@ var ReactNoop = {
|
|
|
70
131
|
flush: function () {
|
|
71
132
|
ReactNoop.flushHighPri();
|
|
72
133
|
ReactNoop.flushLowPri();
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
// Logs the current state of the tree.
|
|
138
|
+
dumpTree: function () {
|
|
139
|
+
if (!root) {
|
|
140
|
+
console.log('Nothing rendered yet.');
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function logHostInstances(children, depth) {
|
|
145
|
+
for (var i = 0; i < children.length; i++) {
|
|
146
|
+
var child = children[i];
|
|
147
|
+
console.log(' '.repeat(depth) + '- ' + child.type + '#' + child.id);
|
|
148
|
+
logHostInstances(child.children, depth + 1);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function logContainer(container, depth) {
|
|
152
|
+
console.log(' '.repeat(depth) + '- [root#' + container.rootID + ']');
|
|
153
|
+
logHostInstances(container.children, depth + 1);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function logFiber(fiber, depth) {
|
|
157
|
+
console.log(' '.repeat(depth) + '- ' + (fiber.type ? fiber.type.name || fiber.type : '[root]'), '[' + fiber.pendingWorkPriority + (fiber.pendingProps ? '*' : '') + ']');
|
|
158
|
+
if (fiber.child) {
|
|
159
|
+
logFiber(fiber.child, depth + 1);
|
|
160
|
+
}
|
|
161
|
+
if (fiber.sibling) {
|
|
162
|
+
logFiber(fiber.sibling, depth);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
console.log('HOST INSTANCES:');
|
|
167
|
+
logContainer(rootContainer, 0);
|
|
168
|
+
console.log('FIBERS:');
|
|
169
|
+
logFiber(root.stateNode.current, 0);
|
|
73
170
|
}
|
|
74
171
|
};
|
|
75
172
|
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
var warning = require('fbjs/lib/warning');
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function warnNoop(publicInstance, callerName) {
|
|
17
17
|
if (process.env.NODE_ENV !== 'production') {
|
|
18
|
-
|
|
18
|
+
var constructor = publicInstance.constructor;
|
|
19
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -59,7 +60,7 @@ var ReactNoopUpdateQueue = {
|
|
|
59
60
|
* @internal
|
|
60
61
|
*/
|
|
61
62
|
enqueueForceUpdate: function (publicInstance) {
|
|
62
|
-
|
|
63
|
+
warnNoop(publicInstance, 'forceUpdate');
|
|
63
64
|
},
|
|
64
65
|
|
|
65
66
|
/**
|
|
@@ -74,7 +75,7 @@ var ReactNoopUpdateQueue = {
|
|
|
74
75
|
* @internal
|
|
75
76
|
*/
|
|
76
77
|
enqueueReplaceState: function (publicInstance, completeState) {
|
|
77
|
-
|
|
78
|
+
warnNoop(publicInstance, 'replaceState');
|
|
78
79
|
},
|
|
79
80
|
|
|
80
81
|
/**
|
|
@@ -88,7 +89,7 @@ var ReactNoopUpdateQueue = {
|
|
|
88
89
|
* @internal
|
|
89
90
|
*/
|
|
90
91
|
enqueueSetState: function (publicInstance, partialState) {
|
|
91
|
-
|
|
92
|
+
warnNoop(publicInstance, 'setState');
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
95
|
|
|
@@ -17,7 +17,9 @@ var CallbackQueue = require('./CallbackQueue');
|
|
|
17
17
|
var PooledClass = require('./PooledClass');
|
|
18
18
|
var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
|
|
19
19
|
var ReactInputSelection = require('./ReactInputSelection');
|
|
20
|
+
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
20
21
|
var Transaction = require('./Transaction');
|
|
22
|
+
var ReactUpdateQueue = require('./ReactUpdateQueue');
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* Ensures that, when possible, the selection range (currently selected text
|
|
@@ -87,6 +89,13 @@ var ON_DOM_READY_QUEUEING = {
|
|
|
87
89
|
*/
|
|
88
90
|
var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
|
|
89
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
|
+
|
|
90
99
|
/**
|
|
91
100
|
* Currently:
|
|
92
101
|
* - The order that these are listed in the transaction is critical:
|
|
@@ -132,6 +141,13 @@ var Mixin = {
|
|
|
132
141
|
return this.reactMountReady;
|
|
133
142
|
},
|
|
134
143
|
|
|
144
|
+
/**
|
|
145
|
+
* @return {object} The queue to collect React async events.
|
|
146
|
+
*/
|
|
147
|
+
getUpdateQueue: function () {
|
|
148
|
+
return ReactUpdateQueue;
|
|
149
|
+
},
|
|
150
|
+
|
|
135
151
|
/**
|
|
136
152
|
* Save current transaction state -- if the return value from this method is
|
|
137
153
|
* passed to `rollback`, the transaction will be reset to that state.
|
|
@@ -38,14 +38,10 @@ function renderToStringImpl(element, makeStaticMarkup) {
|
|
|
38
38
|
transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
|
|
39
39
|
|
|
40
40
|
return transaction.perform(function () {
|
|
41
|
-
|
|
42
|
-
ReactInstrumentation.debugTool.onBeginFlush();
|
|
43
|
-
}
|
|
44
|
-
var componentInstance = instantiateReactComponent(element);
|
|
41
|
+
var componentInstance = instantiateReactComponent(element, true);
|
|
45
42
|
var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject);
|
|
46
43
|
if (process.env.NODE_ENV !== 'production') {
|
|
47
44
|
ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
|
|
48
|
-
ReactInstrumentation.debugTool.onEndFlush();
|
|
49
45
|
}
|
|
50
46
|
if (!makeStaticMarkup) {
|
|
51
47
|
markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
|
|
@@ -15,6 +15,8 @@ var _assign = require('object-assign');
|
|
|
15
15
|
|
|
16
16
|
var PooledClass = require('./PooledClass');
|
|
17
17
|
var Transaction = require('./Transaction');
|
|
18
|
+
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
19
|
+
var ReactServerUpdateQueue = require('./ReactServerUpdateQueue');
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* Executed within the scope of the `Transaction` instance. Consider these as
|
|
@@ -23,6 +25,13 @@ var Transaction = require('./Transaction');
|
|
|
23
25
|
*/
|
|
24
26
|
var TRANSACTION_WRAPPERS = [];
|
|
25
27
|
|
|
28
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
29
|
+
TRANSACTION_WRAPPERS.push({
|
|
30
|
+
initialize: ReactInstrumentation.debugTool.onBeginFlush,
|
|
31
|
+
close: ReactInstrumentation.debugTool.onEndFlush
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
var noopCallbackQueue = {
|
|
27
36
|
enqueue: function () {}
|
|
28
37
|
};
|
|
@@ -35,6 +44,7 @@ function ReactServerRenderingTransaction(renderToStaticMarkup) {
|
|
|
35
44
|
this.reinitializeTransaction();
|
|
36
45
|
this.renderToStaticMarkup = renderToStaticMarkup;
|
|
37
46
|
this.useCreateElement = false;
|
|
47
|
+
this.updateQueue = new ReactServerUpdateQueue(this);
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
var Mixin = {
|
|
@@ -55,6 +65,13 @@ var Mixin = {
|
|
|
55
65
|
return noopCallbackQueue;
|
|
56
66
|
},
|
|
57
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @return {object} The queue to collect React async events.
|
|
70
|
+
*/
|
|
71
|
+
getUpdateQueue: function () {
|
|
72
|
+
return this.updateQueue;
|
|
73
|
+
},
|
|
74
|
+
|
|
58
75
|
/**
|
|
59
76
|
* `PooledClass` looks for this, and will invoke this before allowing this
|
|
60
77
|
* instance to be reused.
|