react 15.3.0 → 15.3.1-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.
- package/dist/react-with-addons.js +1024 -1174
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +956 -1106
- package/dist/react.min.js +6 -6
- package/lib/DOMPropertyOperations.js +0 -7
- package/lib/EventPluginHub.js +2 -0
- package/lib/ReactChildReconciler.js +11 -8
- package/lib/{ReactChildrenMutationWarningDevtool.js → ReactChildrenMutationWarningHook.js} +11 -19
- package/lib/ReactComponentBrowserEnvironment.js +1 -10
- package/lib/ReactComponentEnvironment.js +0 -8
- package/lib/ReactComponentTreeDevtool.js +2 -205
- package/lib/ReactComponentTreeHook.js +248 -0
- package/lib/ReactComponentTreeTestUtils.js +11 -11
- package/lib/ReactCompositeComponent.js +10 -34
- package/lib/ReactDOM.js +9 -0
- package/lib/ReactDOMComponent.js +21 -42
- package/lib/ReactDOMComponentTree.js +1 -1
- package/lib/ReactDOMEmptyComponent.js +1 -1
- package/lib/ReactDOMInput.js +20 -2
- package/lib/{ReactDOMNullInputValuePropDevtool.js → ReactDOMNullInputValuePropHook.js} +5 -5
- package/lib/ReactDOMSelect.js +5 -4
- package/lib/ReactDOMTextComponent.js +1 -8
- package/lib/{ReactDOMUnknownPropertyDevtool.js → ReactDOMUnknownPropertyHook.js} +8 -8
- package/lib/ReactDebugTool.js +63 -77
- package/lib/ReactElementValidator.js +5 -3
- package/lib/{ReactHostOperationHistoryDevtool.js → ReactHostOperationHistoryHook.js} +4 -4
- package/lib/{ReactInvalidSetStateWarningDevTool.js → ReactInvalidSetStateWarningHook.js} +3 -3
- package/lib/ReactMount.js +3 -7
- package/lib/ReactMultiChild.js +11 -13
- package/lib/ReactNativeBaseComponent.js +5 -3
- package/lib/ReactNativeComponentEnvironment.js +0 -7
- package/lib/ReactNativeMount.js +2 -5
- package/lib/ReactNativeTextComponent.js +2 -10
- package/lib/ReactReconciler.js +5 -11
- package/lib/ReactServerRendering.js +2 -1
- package/lib/ReactSimpleEmptyComponent.js +3 -2
- package/lib/ReactTestMount.js +0 -5
- package/lib/ReactTestUtils.js +5 -5
- package/lib/ReactVersion.js +1 -1
- package/lib/ResponderEventPlugin.js +6 -5
- package/lib/SimpleEventPlugin.js +2 -0
- package/lib/SyntheticEvent.js +8 -1
- package/lib/checkReactTypeSpec.js +6 -6
- package/lib/createReactNativeComponentClass.js +1 -1
- package/lib/flattenChildren.js +7 -5
- package/lib/instantiateReactComponent.js +1 -28
- package/package.json +1 -1
- package/lib/ReactDOMDebugTool.js +0 -67
- package/lib/ReactDOMInstrumentation.js +0 -21
- package/lib/createHierarchyRenderer.js +0 -85
package/lib/ReactDebugTool.js
CHANGED
|
@@ -11,29 +11,35 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
14
|
+
var ReactInvalidSetStateWarningHook = require('./ReactInvalidSetStateWarningHook');
|
|
15
|
+
var ReactHostOperationHistoryHook = require('./ReactHostOperationHistoryHook');
|
|
16
|
+
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
17
|
+
var ReactChildrenMutationWarningHook = require('./ReactChildrenMutationWarningHook');
|
|
18
18
|
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
19
19
|
|
|
20
20
|
var performanceNow = require('fbjs/lib/performanceNow');
|
|
21
21
|
var warning = require('fbjs/lib/warning');
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
var
|
|
23
|
+
var hooks = [];
|
|
24
|
+
var didHookThrowForEvent = {};
|
|
25
25
|
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
|
|
27
|
+
try {
|
|
28
|
+
fn.call(context, arg1, arg2, arg3, arg4, arg5);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
|
|
31
|
+
didHookThrowForEvent[event] = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
|
|
36
|
+
for (var i = 0; i < hooks.length; i++) {
|
|
37
|
+
var hook = hooks[i];
|
|
38
|
+
var fn = hook[event];
|
|
39
|
+
if (fn) {
|
|
40
|
+
callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
|
|
35
41
|
}
|
|
36
|
-
}
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
var isProfiling = false;
|
|
@@ -50,21 +56,21 @@ var currentTimerType = null;
|
|
|
50
56
|
var lifeCycleTimerHasWarned = false;
|
|
51
57
|
|
|
52
58
|
function clearHistory() {
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
ReactComponentTreeHook.purgeUnmountedComponents();
|
|
60
|
+
ReactHostOperationHistoryHook.clearHistory();
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
function getTreeSnapshot(registeredIDs) {
|
|
58
64
|
return registeredIDs.reduce(function (tree, id) {
|
|
59
|
-
var ownerID =
|
|
60
|
-
var parentID =
|
|
65
|
+
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
66
|
+
var parentID = ReactComponentTreeHook.getParentID(id);
|
|
61
67
|
tree[id] = {
|
|
62
|
-
displayName:
|
|
63
|
-
text:
|
|
64
|
-
updateCount:
|
|
65
|
-
childIDs:
|
|
68
|
+
displayName: ReactComponentTreeHook.getDisplayName(id),
|
|
69
|
+
text: ReactComponentTreeHook.getText(id),
|
|
70
|
+
updateCount: ReactComponentTreeHook.getUpdateCount(id),
|
|
71
|
+
childIDs: ReactComponentTreeHook.getChildIDs(id),
|
|
66
72
|
// Text nodes don't have owners but this is close enough.
|
|
67
|
-
ownerID: ownerID ||
|
|
73
|
+
ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID),
|
|
68
74
|
parentID: parentID
|
|
69
75
|
};
|
|
70
76
|
return tree;
|
|
@@ -74,7 +80,7 @@ function getTreeSnapshot(registeredIDs) {
|
|
|
74
80
|
function resetMeasurements() {
|
|
75
81
|
var previousStartTime = currentFlushStartTime;
|
|
76
82
|
var previousMeasurements = currentFlushMeasurements || [];
|
|
77
|
-
var previousOperations =
|
|
83
|
+
var previousOperations = ReactHostOperationHistoryHook.getHistory();
|
|
78
84
|
|
|
79
85
|
if (currentFlushNesting === 0) {
|
|
80
86
|
currentFlushStartTime = null;
|
|
@@ -84,7 +90,7 @@ function resetMeasurements() {
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
if (previousMeasurements.length || previousOperations.length) {
|
|
87
|
-
var registeredIDs =
|
|
93
|
+
var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
|
|
88
94
|
flushHistory.push({
|
|
89
95
|
duration: performanceNow() - previousStartTime,
|
|
90
96
|
measurements: previousMeasurements || [],
|
|
@@ -99,7 +105,14 @@ function resetMeasurements() {
|
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
function checkDebugID(debugID) {
|
|
102
|
-
|
|
108
|
+
var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
|
|
109
|
+
|
|
110
|
+
if (allowRoot && debugID === 0) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (!debugID) {
|
|
114
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
|
|
115
|
+
}
|
|
103
116
|
}
|
|
104
117
|
|
|
105
118
|
function beginLifeCycleTimer(debugID, timerType) {
|
|
@@ -167,13 +180,13 @@ function resumeCurrentLifeCycleTimer() {
|
|
|
167
180
|
}
|
|
168
181
|
|
|
169
182
|
var ReactDebugTool = {
|
|
170
|
-
|
|
171
|
-
|
|
183
|
+
addHook: function (hook) {
|
|
184
|
+
hooks.push(hook);
|
|
172
185
|
},
|
|
173
|
-
|
|
174
|
-
for (var i = 0; i <
|
|
175
|
-
if (
|
|
176
|
-
|
|
186
|
+
removeHook: function (hook) {
|
|
187
|
+
for (var i = 0; i < hooks.length; i++) {
|
|
188
|
+
if (hooks[i] === hook) {
|
|
189
|
+
hooks.splice(i, 1);
|
|
177
190
|
i--;
|
|
178
191
|
}
|
|
179
192
|
}
|
|
@@ -189,7 +202,7 @@ var ReactDebugTool = {
|
|
|
189
202
|
isProfiling = true;
|
|
190
203
|
flushHistory.length = 0;
|
|
191
204
|
resetMeasurements();
|
|
192
|
-
ReactDebugTool.
|
|
205
|
+
ReactDebugTool.addHook(ReactHostOperationHistoryHook);
|
|
193
206
|
},
|
|
194
207
|
endProfiling: function () {
|
|
195
208
|
if (!isProfiling) {
|
|
@@ -198,7 +211,7 @@ var ReactDebugTool = {
|
|
|
198
211
|
|
|
199
212
|
isProfiling = false;
|
|
200
213
|
resetMeasurements();
|
|
201
|
-
ReactDebugTool.
|
|
214
|
+
ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
|
|
202
215
|
},
|
|
203
216
|
getFlushHistory: function () {
|
|
204
217
|
return flushHistory;
|
|
@@ -225,14 +238,6 @@ var ReactDebugTool = {
|
|
|
225
238
|
endLifeCycleTimer(debugID, timerType);
|
|
226
239
|
emitEvent('onEndLifeCycleTimer', debugID, timerType);
|
|
227
240
|
},
|
|
228
|
-
onBeginReconcilerTimer: function (debugID, timerType) {
|
|
229
|
-
checkDebugID(debugID);
|
|
230
|
-
emitEvent('onBeginReconcilerTimer', debugID, timerType);
|
|
231
|
-
},
|
|
232
|
-
onEndReconcilerTimer: function (debugID, timerType) {
|
|
233
|
-
checkDebugID(debugID);
|
|
234
|
-
emitEvent('onEndReconcilerTimer', debugID, timerType);
|
|
235
|
-
},
|
|
236
241
|
onError: function (debugID) {
|
|
237
242
|
if (currentTimerDebugID != null) {
|
|
238
243
|
endLifeCycleTimer(currentTimerDebugID, currentTimerType);
|
|
@@ -249,45 +254,18 @@ var ReactDebugTool = {
|
|
|
249
254
|
checkDebugID(debugID);
|
|
250
255
|
emitEvent('onHostOperation', debugID, type, payload);
|
|
251
256
|
},
|
|
252
|
-
onComponentHasMounted: function (debugID) {
|
|
253
|
-
checkDebugID(debugID);
|
|
254
|
-
emitEvent('onComponentHasMounted', debugID);
|
|
255
|
-
},
|
|
256
|
-
onComponentHasUpdated: function (debugID) {
|
|
257
|
-
checkDebugID(debugID);
|
|
258
|
-
emitEvent('onComponentHasUpdated', debugID);
|
|
259
|
-
},
|
|
260
257
|
onSetState: function () {
|
|
261
258
|
emitEvent('onSetState');
|
|
262
259
|
},
|
|
263
|
-
onSetDisplayName: function (debugID, displayName) {
|
|
264
|
-
checkDebugID(debugID);
|
|
265
|
-
emitEvent('onSetDisplayName', debugID, displayName);
|
|
266
|
-
},
|
|
267
260
|
onSetChildren: function (debugID, childDebugIDs) {
|
|
268
261
|
checkDebugID(debugID);
|
|
269
262
|
childDebugIDs.forEach(checkDebugID);
|
|
270
263
|
emitEvent('onSetChildren', debugID, childDebugIDs);
|
|
271
264
|
},
|
|
272
|
-
|
|
273
|
-
checkDebugID(debugID);
|
|
274
|
-
emitEvent('onSetOwner', debugID, ownerDebugID);
|
|
275
|
-
},
|
|
276
|
-
onSetParent: function (debugID, parentDebugID) {
|
|
277
|
-
checkDebugID(debugID);
|
|
278
|
-
emitEvent('onSetParent', debugID, parentDebugID);
|
|
279
|
-
},
|
|
280
|
-
onSetText: function (debugID, text) {
|
|
265
|
+
onBeforeMountComponent: function (debugID, element, parentDebugID) {
|
|
281
266
|
checkDebugID(debugID);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
onMountRootComponent: function (debugID) {
|
|
285
|
-
checkDebugID(debugID);
|
|
286
|
-
emitEvent('onMountRootComponent', debugID);
|
|
287
|
-
},
|
|
288
|
-
onBeforeMountComponent: function (debugID, element) {
|
|
289
|
-
checkDebugID(debugID);
|
|
290
|
-
emitEvent('onBeforeMountComponent', debugID, element);
|
|
267
|
+
checkDebugID(parentDebugID, true);
|
|
268
|
+
emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
|
|
291
269
|
},
|
|
292
270
|
onMountComponent: function (debugID) {
|
|
293
271
|
checkDebugID(debugID);
|
|
@@ -301,6 +279,10 @@ var ReactDebugTool = {
|
|
|
301
279
|
checkDebugID(debugID);
|
|
302
280
|
emitEvent('onUpdateComponent', debugID);
|
|
303
281
|
},
|
|
282
|
+
onBeforeUnmountComponent: function (debugID) {
|
|
283
|
+
checkDebugID(debugID);
|
|
284
|
+
emitEvent('onBeforeUnmountComponent', debugID);
|
|
285
|
+
},
|
|
304
286
|
onUnmountComponent: function (debugID) {
|
|
305
287
|
checkDebugID(debugID);
|
|
306
288
|
emitEvent('onUnmountComponent', debugID);
|
|
@@ -310,9 +292,13 @@ var ReactDebugTool = {
|
|
|
310
292
|
}
|
|
311
293
|
};
|
|
312
294
|
|
|
313
|
-
|
|
314
|
-
ReactDebugTool.addDevtool
|
|
315
|
-
ReactDebugTool.
|
|
295
|
+
// TODO remove these when RN/www gets updated
|
|
296
|
+
ReactDebugTool.addDevtool = ReactDebugTool.addHook;
|
|
297
|
+
ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
|
|
298
|
+
|
|
299
|
+
ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
|
|
300
|
+
ReactDebugTool.addHook(ReactComponentTreeHook);
|
|
301
|
+
ReactDebugTool.addHook(ReactChildrenMutationWarningHook);
|
|
316
302
|
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
|
317
303
|
if (/[?&]react_perf\b/.test(url)) {
|
|
318
304
|
ReactDebugTool.beginProfiling();
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
'use strict';
|
|
20
20
|
|
|
21
21
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
22
|
-
var
|
|
22
|
+
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
23
23
|
var ReactElement = require('./ReactElement');
|
|
24
24
|
var ReactPropTypeLocations = require('./ReactPropTypeLocations');
|
|
25
25
|
|
|
@@ -92,7 +92,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
92
92
|
childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner,
|
|
95
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -163,7 +163,9 @@ var ReactElementValidator = {
|
|
|
163
163
|
var validType = typeof type === 'string' || typeof type === 'function';
|
|
164
164
|
// We warn in this case but don't throw. We expect the element creation to
|
|
165
165
|
// succeed and there will likely be errors in render.
|
|
166
|
-
|
|
166
|
+
if (!validType) {
|
|
167
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;
|
|
168
|
+
}
|
|
167
169
|
|
|
168
170
|
var element = ReactElement.createElement.apply(this, arguments);
|
|
169
171
|
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule
|
|
9
|
+
* @providesModule ReactHostOperationHistoryHook
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
var history = [];
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var ReactHostOperationHistoryHook = {
|
|
17
17
|
onHostOperation: function (debugID, type, payload) {
|
|
18
18
|
history.push({
|
|
19
19
|
instanceID: debugID,
|
|
@@ -22,7 +22,7 @@ var ReactHostOperationHistoryDevtool = {
|
|
|
22
22
|
});
|
|
23
23
|
},
|
|
24
24
|
clearHistory: function () {
|
|
25
|
-
if (
|
|
25
|
+
if (ReactHostOperationHistoryHook._preventClearing) {
|
|
26
26
|
// Should only be used for tests.
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
@@ -34,4 +34,4 @@ var ReactHostOperationHistoryDevtool = {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
module.exports =
|
|
37
|
+
module.exports = ReactHostOperationHistoryHook;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule
|
|
9
|
+
* @providesModule ReactInvalidSetStateWarningHook
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
@@ -21,7 +21,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var ReactInvalidSetStateWarningHook = {
|
|
25
25
|
onBeginProcessingChildContext: function () {
|
|
26
26
|
processingChildContext = true;
|
|
27
27
|
},
|
|
@@ -33,4 +33,4 @@ var ReactInvalidSetStateWarningDevTool = {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
module.exports =
|
|
36
|
+
module.exports = ReactInvalidSetStateWarningHook;
|
package/lib/ReactMount.js
CHANGED
|
@@ -102,7 +102,8 @@ function mountComponentIntoNode(wrapperInstance, container, transaction, shouldR
|
|
|
102
102
|
console.time(markerName);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context
|
|
105
|
+
var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
|
|
106
|
+
);
|
|
106
107
|
|
|
107
108
|
if (markerName) {
|
|
108
109
|
console.timeEnd(markerName);
|
|
@@ -260,7 +261,7 @@ var ReactMount = {
|
|
|
260
261
|
},
|
|
261
262
|
|
|
262
263
|
/**
|
|
263
|
-
* Render a new component into the DOM. Hooked by
|
|
264
|
+
* Render a new component into the DOM. Hooked by hooks!
|
|
264
265
|
*
|
|
265
266
|
* @param {ReactElement} nextElement element to render
|
|
266
267
|
* @param {DOMElement} container container to render into
|
|
@@ -287,11 +288,6 @@ var ReactMount = {
|
|
|
287
288
|
var wrapperID = componentInstance._instance.rootID;
|
|
288
289
|
instancesByReactRootID[wrapperID] = componentInstance;
|
|
289
290
|
|
|
290
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
291
|
-
// The instance here is TopLevelWrapper so we report mount for its child.
|
|
292
|
-
ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
291
|
return componentInstance;
|
|
296
292
|
},
|
|
297
293
|
|
package/lib/ReactMultiChild.js
CHANGED
|
@@ -139,7 +139,6 @@ function processQueue(inst, updateQueue) {
|
|
|
139
139
|
ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
var setParentForInstrumentation = emptyFunction;
|
|
143
142
|
var setChildrenForInstrumentation = emptyFunction;
|
|
144
143
|
if (process.env.NODE_ENV !== 'production') {
|
|
145
144
|
var getDebugID = function (inst) {
|
|
@@ -152,11 +151,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
152
151
|
}
|
|
153
152
|
return inst._debugID;
|
|
154
153
|
};
|
|
155
|
-
setParentForInstrumentation = function (child) {
|
|
156
|
-
if (child._debugID !== 0) {
|
|
157
|
-
ReactInstrumentation.debugTool.onSetParent(child._debugID, getDebugID(this));
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
154
|
setChildrenForInstrumentation = function (children) {
|
|
161
155
|
var debugID = getDebugID(this);
|
|
162
156
|
// TODO: React Native empty components are also multichild.
|
|
@@ -188,10 +182,11 @@ var ReactMultiChild = {
|
|
|
188
182
|
|
|
189
183
|
_reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
|
|
190
184
|
if (process.env.NODE_ENV !== 'production') {
|
|
185
|
+
var selfDebugID = getDebugID(this);
|
|
191
186
|
if (this._currentElement) {
|
|
192
187
|
try {
|
|
193
188
|
ReactCurrentOwner.current = this._currentElement._owner;
|
|
194
|
-
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context,
|
|
189
|
+
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
|
|
195
190
|
} finally {
|
|
196
191
|
ReactCurrentOwner.current = null;
|
|
197
192
|
}
|
|
@@ -202,20 +197,22 @@ var ReactMultiChild = {
|
|
|
202
197
|
|
|
203
198
|
_reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
|
|
204
199
|
var nextChildren;
|
|
200
|
+
var selfDebugID = 0;
|
|
205
201
|
if (process.env.NODE_ENV !== 'production') {
|
|
202
|
+
selfDebugID = getDebugID(this);
|
|
206
203
|
if (this._currentElement) {
|
|
207
204
|
try {
|
|
208
205
|
ReactCurrentOwner.current = this._currentElement._owner;
|
|
209
|
-
nextChildren = flattenChildren(nextNestedChildrenElements,
|
|
206
|
+
nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
|
|
210
207
|
} finally {
|
|
211
208
|
ReactCurrentOwner.current = null;
|
|
212
209
|
}
|
|
213
|
-
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context);
|
|
210
|
+
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
|
|
214
211
|
return nextChildren;
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
|
-
nextChildren = flattenChildren(nextNestedChildrenElements);
|
|
218
|
-
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context);
|
|
214
|
+
nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
|
|
215
|
+
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
|
|
219
216
|
return nextChildren;
|
|
220
217
|
},
|
|
221
218
|
|
|
@@ -236,10 +233,11 @@ var ReactMultiChild = {
|
|
|
236
233
|
for (var name in children) {
|
|
237
234
|
if (children.hasOwnProperty(name)) {
|
|
238
235
|
var child = children[name];
|
|
236
|
+
var selfDebugID = 0;
|
|
239
237
|
if (process.env.NODE_ENV !== 'production') {
|
|
240
|
-
|
|
238
|
+
selfDebugID = getDebugID(this);
|
|
241
239
|
}
|
|
242
|
-
var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context);
|
|
240
|
+
var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
|
|
243
241
|
child._mountIndex = index++;
|
|
244
242
|
mountImages.push(mountImage);
|
|
245
243
|
}
|
|
@@ -54,7 +54,7 @@ ReactNativeBaseComponent.Mixin = {
|
|
|
54
54
|
ReactNativeComponentTree.uncacheNode(this);
|
|
55
55
|
deleteAllListeners(this);
|
|
56
56
|
this.unmountChildren();
|
|
57
|
-
this._rootNodeID =
|
|
57
|
+
this._rootNodeID = 0;
|
|
58
58
|
},
|
|
59
59
|
|
|
60
60
|
/**
|
|
@@ -155,8 +155,10 @@ ReactNativeBaseComponent.Mixin = {
|
|
|
155
155
|
},
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
* @param {
|
|
159
|
-
* @param {
|
|
158
|
+
* @param {ReactNativeReconcileTransaction} transaction
|
|
159
|
+
* @param {?ReactNativeBaseComponent} the parent component instance
|
|
160
|
+
* @param {?object} info about the host container
|
|
161
|
+
* @param {object} context
|
|
160
162
|
* @return {string} Unique iOS view tag.
|
|
161
163
|
*/
|
|
162
164
|
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|