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/ReactDOMInput.js
CHANGED
|
@@ -25,7 +25,6 @@ var warning = require('fbjs/lib/warning');
|
|
|
25
25
|
|
|
26
26
|
var didWarnValueLink = false;
|
|
27
27
|
var didWarnCheckedLink = false;
|
|
28
|
-
var didWarnValueNull = false;
|
|
29
28
|
var didWarnValueDefaultValue = false;
|
|
30
29
|
var didWarnCheckedDefaultChecked = false;
|
|
31
30
|
var didWarnControlledToUncontrolled = false;
|
|
@@ -38,14 +37,6 @@ function forceUpdateIfMounted() {
|
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
function warnIfValueIsNull(props) {
|
|
42
|
-
if (props != null && props.value === null && !didWarnValueNull) {
|
|
43
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `input` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
|
|
44
|
-
|
|
45
|
-
didWarnValueNull = true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
40
|
function isControlled(props) {
|
|
50
41
|
var usesChecked = props.type === 'checkbox' || props.type === 'radio';
|
|
51
42
|
return usesChecked ? props.checked !== undefined : props.value !== undefined;
|
|
@@ -109,7 +100,6 @@ var ReactDOMInput = {
|
|
|
109
100
|
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
|
110
101
|
didWarnValueDefaultValue = true;
|
|
111
102
|
}
|
|
112
|
-
warnIfValueIsNull(props);
|
|
113
103
|
}
|
|
114
104
|
|
|
115
105
|
var defaultValue = props.defaultValue;
|
|
@@ -129,8 +119,6 @@ var ReactDOMInput = {
|
|
|
129
119
|
var props = inst._currentElement.props;
|
|
130
120
|
|
|
131
121
|
if (process.env.NODE_ENV !== 'production') {
|
|
132
|
-
warnIfValueIsNull(props);
|
|
133
|
-
|
|
134
122
|
var controlled = isControlled(props);
|
|
135
123
|
var owner = inst._currentElement._owner;
|
|
136
124
|
|
|
@@ -173,10 +161,20 @@ var ReactDOMInput = {
|
|
|
173
161
|
},
|
|
174
162
|
|
|
175
163
|
postMountWrapper: function (inst) {
|
|
164
|
+
var props = inst._currentElement.props;
|
|
165
|
+
|
|
176
166
|
// This is in postMount because we need access to the DOM node, which is not
|
|
177
167
|
// available until after the component has mounted.
|
|
178
168
|
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
|
179
|
-
|
|
169
|
+
|
|
170
|
+
// Detach value from defaultValue. We won't do anything if we're working on
|
|
171
|
+
// submit or reset inputs as those values & defaultValues are linked. They
|
|
172
|
+
// are not resetable nodes so this operation doesn't matter and actually
|
|
173
|
+
// removes browser-default values (eg "Submit Query") when no value is
|
|
174
|
+
// provided.
|
|
175
|
+
if (props.type !== 'submit' && props.type !== 'reset') {
|
|
176
|
+
node.value = node.value;
|
|
177
|
+
}
|
|
180
178
|
|
|
181
179
|
// Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
|
|
182
180
|
// this is needed to work around a chrome bug where setting defaultChecked
|
|
@@ -184,10 +182,14 @@ var ReactDOMInput = {
|
|
|
184
182
|
// Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
|
|
185
183
|
// We need to temporarily unset name to avoid disrupting radio button groups.
|
|
186
184
|
var name = node.name;
|
|
187
|
-
|
|
185
|
+
if (name !== '') {
|
|
186
|
+
node.name = '';
|
|
187
|
+
}
|
|
188
188
|
node.defaultChecked = !node.defaultChecked;
|
|
189
189
|
node.defaultChecked = !node.defaultChecked;
|
|
190
|
-
|
|
190
|
+
if (name !== '') {
|
|
191
|
+
node.name = name;
|
|
192
|
+
}
|
|
191
193
|
}
|
|
192
194
|
};
|
|
193
195
|
|
|
@@ -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 ReactDOMDebugTool = require('./ReactDOMDebugTool');
|
|
18
|
+
debugTool = ReactDOMDebugTool;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { debugTool: debugTool };
|
|
@@ -0,0 +1,43 @@
|
|
|
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 ReactDOMNullInputValuePropDevtool
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
|
|
15
|
+
|
|
16
|
+
var warning = require('fbjs/lib/warning');
|
|
17
|
+
|
|
18
|
+
var didWarnValueNull = false;
|
|
19
|
+
|
|
20
|
+
function handleElement(debugID, element) {
|
|
21
|
+
if (element == null) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (element.props != null && element.props.value === null && !didWarnValueNull) {
|
|
28
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0;
|
|
29
|
+
|
|
30
|
+
didWarnValueNull = true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var ReactDOMUnknownPropertyDevtool = {
|
|
35
|
+
onBeforeMountComponent: function (debugID, element) {
|
|
36
|
+
handleElement(debugID, element);
|
|
37
|
+
},
|
|
38
|
+
onBeforeUpdateComponent: function (debugID, element) {
|
|
39
|
+
handleElement(debugID, element);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
module.exports = ReactDOMUnknownPropertyDevtool;
|
package/lib/ReactDOMSelect.js
CHANGED
|
@@ -21,7 +21,6 @@ var ReactUpdates = require('./ReactUpdates');
|
|
|
21
21
|
var warning = require('fbjs/lib/warning');
|
|
22
22
|
|
|
23
23
|
var didWarnValueLink = false;
|
|
24
|
-
var didWarnValueNull = false;
|
|
25
24
|
var didWarnValueDefaultValue = false;
|
|
26
25
|
|
|
27
26
|
function updateOptionsIfPendingUpdateAndMounted() {
|
|
@@ -47,14 +46,6 @@ function getDeclarationErrorAddendum(owner) {
|
|
|
47
46
|
return '';
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
function warnIfValueIsNull(props) {
|
|
51
|
-
if (props != null && props.value === null && !didWarnValueNull) {
|
|
52
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `select` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
|
|
53
|
-
|
|
54
|
-
didWarnValueNull = true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
49
|
var valuePropNames = ['value', 'defaultValue'];
|
|
59
50
|
|
|
60
51
|
/**
|
|
@@ -146,7 +137,6 @@ var ReactDOMSelect = {
|
|
|
146
137
|
mountWrapper: function (inst, props) {
|
|
147
138
|
if (process.env.NODE_ENV !== 'production') {
|
|
148
139
|
checkSelectPropTypes(inst, props);
|
|
149
|
-
warnIfValueIsNull(props);
|
|
150
140
|
}
|
|
151
141
|
|
|
152
142
|
var value = LinkedValueUtils.getValue(props);
|
|
@@ -172,9 +162,6 @@ var ReactDOMSelect = {
|
|
|
172
162
|
|
|
173
163
|
postUpdateWrapper: function (inst) {
|
|
174
164
|
var props = inst._currentElement.props;
|
|
175
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
176
|
-
warnIfValueIsNull(props);
|
|
177
|
-
}
|
|
178
165
|
|
|
179
166
|
// After the initial mount, we control selected-ness manually so don't pass
|
|
180
167
|
// this value down
|
package/lib/ReactDOMTextarea.js
CHANGED
|
@@ -23,7 +23,6 @@ var invariant = require('fbjs/lib/invariant');
|
|
|
23
23
|
var warning = require('fbjs/lib/warning');
|
|
24
24
|
|
|
25
25
|
var didWarnValueLink = false;
|
|
26
|
-
var didWarnValueNull = false;
|
|
27
26
|
var didWarnValDefaultVal = false;
|
|
28
27
|
|
|
29
28
|
function forceUpdateIfMounted() {
|
|
@@ -33,14 +32,6 @@ function forceUpdateIfMounted() {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
function warnIfValueIsNull(props) {
|
|
37
|
-
if (props != null && props.value === null && !didWarnValueNull) {
|
|
38
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `textarea` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
|
|
39
|
-
|
|
40
|
-
didWarnValueNull = true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
/**
|
|
45
36
|
* Implements a <textarea> host component that allows setting `value`, and
|
|
46
37
|
* `defaultValue`. This differs from the traditional DOM API because value is
|
|
@@ -86,7 +77,6 @@ var ReactDOMTextarea = {
|
|
|
86
77
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
|
87
78
|
didWarnValDefaultVal = true;
|
|
88
79
|
}
|
|
89
|
-
warnIfValueIsNull(props);
|
|
90
80
|
}
|
|
91
81
|
|
|
92
82
|
var value = LinkedValueUtils.getValue(props);
|
|
@@ -125,10 +115,6 @@ var ReactDOMTextarea = {
|
|
|
125
115
|
updateWrapper: function (inst) {
|
|
126
116
|
var props = inst._currentElement.props;
|
|
127
117
|
|
|
128
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
129
|
-
warnIfValueIsNull(props);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
118
|
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
|
133
119
|
var value = LinkedValueUtils.getValue(props);
|
|
134
120
|
if (value != null) {
|
package/lib/ReactDebugTool.js
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool');
|
|
15
|
+
var ReactHostOperationHistoryDevtool = require('./ReactHostOperationHistoryDevtool');
|
|
16
|
+
var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
|
|
14
17
|
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
15
18
|
|
|
16
19
|
var performanceNow = require('fbjs/lib/performanceNow');
|
|
@@ -20,18 +23,16 @@ var eventHandlers = [];
|
|
|
20
23
|
var handlerDoesThrowForEvent = {};
|
|
21
24
|
|
|
22
25
|
function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
|
|
28
|
-
}
|
|
29
|
-
} catch (e) {
|
|
30
|
-
process.env.NODE_ENV !== 'production' ? warning(handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e + '\n' + e.stack) : void 0;
|
|
31
|
-
handlerDoesThrowForEvent[handlerFunctionName] = true;
|
|
26
|
+
eventHandlers.forEach(function (handler) {
|
|
27
|
+
try {
|
|
28
|
+
if (handler[handlerFunctionName]) {
|
|
29
|
+
handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
|
|
32
30
|
}
|
|
33
|
-
})
|
|
34
|
-
|
|
31
|
+
} catch (e) {
|
|
32
|
+
process.env.NODE_ENV !== 'production' ? warning(handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e + '\n' + e.stack) : void 0;
|
|
33
|
+
handlerDoesThrowForEvent[handlerFunctionName] = true;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
var isProfiling = false;
|
|
@@ -68,32 +69,30 @@ function getTreeSnapshot(registeredIDs) {
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
function resetMeasurements() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var previousOperations = ReactHostOperationHistoryDevtool.getHistory();
|
|
75
|
-
|
|
76
|
-
if (!isProfiling || currentFlushNesting === 0) {
|
|
77
|
-
currentFlushStartTime = null;
|
|
78
|
-
currentFlushMeasurements = null;
|
|
79
|
-
clearHistory();
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (previousMeasurements.length || previousOperations.length) {
|
|
84
|
-
var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
|
|
85
|
-
flushHistory.push({
|
|
86
|
-
duration: performanceNow() - previousStartTime,
|
|
87
|
-
measurements: previousMeasurements || [],
|
|
88
|
-
operations: previousOperations || [],
|
|
89
|
-
treeSnapshot: getTreeSnapshot(registeredIDs)
|
|
90
|
-
});
|
|
91
|
-
}
|
|
72
|
+
var previousStartTime = currentFlushStartTime;
|
|
73
|
+
var previousMeasurements = currentFlushMeasurements || [];
|
|
74
|
+
var previousOperations = ReactHostOperationHistoryDevtool.getHistory();
|
|
92
75
|
|
|
76
|
+
if (currentFlushNesting === 0) {
|
|
77
|
+
currentFlushStartTime = null;
|
|
78
|
+
currentFlushMeasurements = null;
|
|
93
79
|
clearHistory();
|
|
94
|
-
|
|
95
|
-
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (previousMeasurements.length || previousOperations.length) {
|
|
84
|
+
var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
|
|
85
|
+
flushHistory.push({
|
|
86
|
+
duration: performanceNow() - previousStartTime,
|
|
87
|
+
measurements: previousMeasurements || [],
|
|
88
|
+
operations: previousOperations || [],
|
|
89
|
+
treeSnapshot: getTreeSnapshot(registeredIDs)
|
|
90
|
+
});
|
|
96
91
|
}
|
|
92
|
+
|
|
93
|
+
clearHistory();
|
|
94
|
+
currentFlushStartTime = performanceNow();
|
|
95
|
+
currentFlushMeasurements = [];
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
function checkDebugID(debugID) {
|
|
@@ -101,7 +100,7 @@ function checkDebugID(debugID) {
|
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
function beginLifeCycleTimer(debugID, timerType) {
|
|
104
|
-
if (
|
|
103
|
+
if (currentFlushNesting === 0) {
|
|
105
104
|
return;
|
|
106
105
|
}
|
|
107
106
|
process.env.NODE_ENV !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
|
@@ -112,15 +111,17 @@ function beginLifeCycleTimer(debugID, timerType) {
|
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
function endLifeCycleTimer(debugID, timerType) {
|
|
115
|
-
if (
|
|
114
|
+
if (currentFlushNesting === 0) {
|
|
116
115
|
return;
|
|
117
116
|
}
|
|
118
117
|
process.env.NODE_ENV !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
if (isProfiling) {
|
|
119
|
+
currentFlushMeasurements.push({
|
|
120
|
+
timerType: timerType,
|
|
121
|
+
instanceID: debugID,
|
|
122
|
+
duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
|
|
123
|
+
});
|
|
124
|
+
}
|
|
124
125
|
currentTimerStartTime = null;
|
|
125
126
|
currentTimerNestedFlushDuration = null;
|
|
126
127
|
currentTimerDebugID = null;
|
|
@@ -172,57 +173,47 @@ var ReactDebugTool = {
|
|
|
172
173
|
return isProfiling;
|
|
173
174
|
},
|
|
174
175
|
beginProfiling: function () {
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
isProfiling = true;
|
|
181
|
-
flushHistory.length = 0;
|
|
182
|
-
resetMeasurements();
|
|
176
|
+
if (isProfiling) {
|
|
177
|
+
return;
|
|
183
178
|
}
|
|
179
|
+
|
|
180
|
+
isProfiling = true;
|
|
181
|
+
flushHistory.length = 0;
|
|
182
|
+
resetMeasurements();
|
|
183
|
+
ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool);
|
|
184
184
|
},
|
|
185
185
|
endProfiling: function () {
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
isProfiling = false;
|
|
192
|
-
resetMeasurements();
|
|
186
|
+
if (!isProfiling) {
|
|
187
|
+
return;
|
|
193
188
|
}
|
|
189
|
+
|
|
190
|
+
isProfiling = false;
|
|
191
|
+
resetMeasurements();
|
|
192
|
+
ReactDebugTool.removeDevtool(ReactHostOperationHistoryDevtool);
|
|
194
193
|
},
|
|
195
194
|
getFlushHistory: function () {
|
|
196
195
|
return flushHistory;
|
|
197
196
|
},
|
|
198
197
|
onBeginFlush: function () {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
pauseCurrentLifeCycleTimer();
|
|
203
|
-
}
|
|
198
|
+
currentFlushNesting++;
|
|
199
|
+
resetMeasurements();
|
|
200
|
+
pauseCurrentLifeCycleTimer();
|
|
204
201
|
emitEvent('onBeginFlush');
|
|
205
202
|
},
|
|
206
203
|
onEndFlush: function () {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
resumeCurrentLifeCycleTimer();
|
|
211
|
-
}
|
|
204
|
+
resetMeasurements();
|
|
205
|
+
currentFlushNesting--;
|
|
206
|
+
resumeCurrentLifeCycleTimer();
|
|
212
207
|
emitEvent('onEndFlush');
|
|
213
208
|
},
|
|
214
209
|
onBeginLifeCycleTimer: function (debugID, timerType) {
|
|
215
210
|
checkDebugID(debugID);
|
|
216
211
|
emitEvent('onBeginLifeCycleTimer', debugID, timerType);
|
|
217
|
-
|
|
218
|
-
beginLifeCycleTimer(debugID, timerType);
|
|
219
|
-
}
|
|
212
|
+
beginLifeCycleTimer(debugID, timerType);
|
|
220
213
|
},
|
|
221
214
|
onEndLifeCycleTimer: function (debugID, timerType) {
|
|
222
215
|
checkDebugID(debugID);
|
|
223
|
-
|
|
224
|
-
endLifeCycleTimer(debugID, timerType);
|
|
225
|
-
}
|
|
216
|
+
endLifeCycleTimer(debugID, timerType);
|
|
226
217
|
emitEvent('onEndLifeCycleTimer', debugID, timerType);
|
|
227
218
|
},
|
|
228
219
|
onBeginReconcilerTimer: function (debugID, timerType) {
|
|
@@ -233,6 +224,12 @@ var ReactDebugTool = {
|
|
|
233
224
|
checkDebugID(debugID);
|
|
234
225
|
emitEvent('onEndReconcilerTimer', debugID, timerType);
|
|
235
226
|
},
|
|
227
|
+
onError: function (debugID) {
|
|
228
|
+
if (currentTimerDebugID != null) {
|
|
229
|
+
endLifeCycleTimer(currentTimerDebugID, currentTimerType);
|
|
230
|
+
}
|
|
231
|
+
emitEvent('onError', debugID);
|
|
232
|
+
},
|
|
236
233
|
onBeginProcessingChildContext: function () {
|
|
237
234
|
emitEvent('onBeginProcessingChildContext');
|
|
238
235
|
},
|
|
@@ -252,6 +249,7 @@ var ReactDebugTool = {
|
|
|
252
249
|
},
|
|
253
250
|
onSetChildren: function (debugID, childDebugIDs) {
|
|
254
251
|
checkDebugID(debugID);
|
|
252
|
+
childDebugIDs.forEach(checkDebugID);
|
|
255
253
|
emitEvent('onSetChildren', debugID, childDebugIDs);
|
|
256
254
|
},
|
|
257
255
|
onSetOwner: function (debugID, ownerDebugID) {
|
|
@@ -295,17 +293,11 @@ var ReactDebugTool = {
|
|
|
295
293
|
}
|
|
296
294
|
};
|
|
297
295
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
ReactDebugTool.
|
|
303
|
-
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
|
|
304
|
-
ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool);
|
|
305
|
-
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
|
306
|
-
if (/[?&]react_perf\b/.test(url)) {
|
|
307
|
-
ReactDebugTool.beginProfiling();
|
|
308
|
-
}
|
|
296
|
+
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
|
|
297
|
+
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
|
|
298
|
+
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
|
299
|
+
if (/[?&]react_perf\b/.test(url)) {
|
|
300
|
+
ReactDebugTool.beginProfiling();
|
|
309
301
|
}
|
|
310
302
|
|
|
311
303
|
module.exports = ReactDebugTool;
|