Remove now-unused _rootNodeID from composites
Ben Alpert committed
Oct 18, 2015 at 15:50 UTC
3cebadaa6ba548084a98cda8deae80a9e4bc21e4
9 files changed
+5
-38
src/renderers/dom/client/ReactMount.js
-7
@@ -83,14 +83,12 @@ function internalGetID(node) {
83
* Mounts this component and inserts it into the DOM.
84
*
85
* @param {ReactComponent} componentInstance The instance to mount.
86
- * @param {string} rootID DOM ID of the root node.
86
* @param {DOMElement} container DOM element to mount into.
87
* @param {ReactReconcileTransaction} transaction
88
* @param {boolean} shouldReuseMarkup If true, do not insert markup
89
*/
90
function mountComponentIntoNode(
91
wrapperInstance,
93
- rootID,
92
container,
93
transaction,
94
shouldReuseMarkup,
@@ -98,7 +96,6 @@ function mountComponentIntoNode(
96
) {
97
var markup = ReactReconciler.mountComponent(
98
wrapperInstance,
101
- rootID,
99
transaction,
100
null,
101
ReactDOMContainerInfo(wrapperInstance, container),
@@ -118,13 +115,11 @@ function mountComponentIntoNode(
115
* Batched mount.
116
*
117
* @param {ReactComponent} componentInstance The instance to mount.
121
- * @param {string} rootID DOM ID of the root node.
118
* @param {DOMElement} container DOM element to mount into.
119
* @param {boolean} shouldReuseMarkup If true, do not insert markup
120
*/
121
function batchedMountComponentIntoNode(
122
componentInstance,
127
- rootID,
123
container,
124
shouldReuseMarkup,
125
context
@@ -137,7 +132,6 @@ function batchedMountComponentIntoNode(
132
mountComponentIntoNode,
133
null,
134
componentInstance,
140
- rootID,
135
container,
136
transaction,
137
shouldReuseMarkup,
@@ -311,7 +305,6 @@ var ReactMount = {
305
ReactUpdates.batchedUpdates(
306
batchedMountComponentIntoNode,
307
componentInstance,
314
- '',
308
container,
309
shouldReuseMarkup,
310
context
src/renderers/dom/server/ReactServerRendering.js
-1
@@ -43,7 +43,6 @@ function renderToStringImpl(element, makeStaticMarkup) {
43
return transaction.perform(function() {
44
var componentInstance = instantiateReactComponent(element, null);
45
var markup = componentInstance.mountComponent(
46
- '',
46
transaction,
47
null,
48
ReactDOMContainerInfo(),
src/renderers/dom/shared/ReactDOMComponent.js
-2
@@ -543,7 +543,6 @@ ReactDOMComponent.Mixin = {
543
* is not idempotent.
544
*
545
* @internal
546
- * @param {string} rootID The root DOM ID for this node.
546
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
547
* @param {?ReactDOMComponent} the containing DOM component instance
548
* @param {?object} info about the native container
@@ -551,7 +550,6 @@ ReactDOMComponent.Mixin = {
550
* @return {string} The computed markup.
551
*/
552
mountComponent: function(
554
- rootID,
553
transaction,
554
nativeParent,
555
nativeContainerInfo,
src/renderers/dom/shared/ReactDOMTextComponent.js
-2
@@ -66,13 +66,11 @@ assign(ReactDOMTextComponent.prototype, {
66
* Creates the markup for this text node. This node is not intended to have
67
* any features besides containing text content.
68
*
69
- * @param {string} rootID DOM ID of the root node.
69
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
70
* @return {string} Markup for this text node.
71
* @internal
72
*/
73
mountComponent: function(
75
- rootID,
74
transaction,
75
nativeParent,
76
nativeContainerInfo,
src/renderers/shared/reconciler/ReactCompositeComponent.js
-5
@@ -120,7 +120,6 @@ var ReactCompositeComponentMixin = {
120
/**
121
* Initializes the component, renders markup, and registers event listeners.
122
*
123
- * @param {string} rootID DOM ID of the root node.
123
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
124
* @param {?object} nativeParent
125
* @param {?object} nativeContainerInfo
@@ -130,7 +129,6 @@ var ReactCompositeComponentMixin = {
129
* @internal
130
*/
131
mountComponent: function(
133
- rootID,
132
transaction,
133
nativeParent,
134
nativeContainerInfo,
@@ -138,7 +136,6 @@ var ReactCompositeComponentMixin = {
136
) {
137
this._context = context;
138
this._mountOrder = nextMountID++;
141
- this._rootNodeID = rootID;
139
this._nativeParent = nativeParent;
140
this._nativeContainerInfo = nativeContainerInfo;
141
@@ -302,7 +299,6 @@ var ReactCompositeComponentMixin = {
299
300
var markup = ReactReconciler.mountComponent(
301
this._renderedComponent,
305
- rootID,
302
transaction,
303
nativeParent,
304
nativeContainerInfo,
@@ -764,7 +760,6 @@ var ReactCompositeComponentMixin = {
760
);
761
var nextMarkup = ReactReconciler.mountComponent(
762
this._renderedComponent,
767
- this._rootNodeID,
763
transaction,
764
this._nativeParent,
765
this._nativeContainerInfo,
src/renderers/shared/reconciler/ReactEmptyComponent.js
+1
-6
@@ -26,23 +26,19 @@ var ReactEmptyComponentInjection = {
26
27
var ReactEmptyComponent = function(instantiate) {
28
this._currentElement = null;
29
- this._rootNodeID = null;
29
this._renderedComponent = instantiate(placeholderElement);
30
};
31
assign(ReactEmptyComponent.prototype, {
32
construct: function(element) {
33
},
34
mountComponent: function(
36
- rootID,
35
transaction,
36
nativeParent,
37
nativeContainerInfo,
38
context
39
) {
42
- this._rootNodeID = rootID;
40
return ReactReconciler.mountComponent(
41
this._renderedComponent,
45
- rootID,
42
transaction,
43
nativeParent,
44
nativeContainerInfo,
@@ -54,9 +50,8 @@ assign(ReactEmptyComponent.prototype, {
50
getNativeNode: function() {
51
return ReactReconciler.getNativeNode(this._renderedComponent);
52
},
57
- unmountComponent: function(rootID, transaction, context) {
53
+ unmountComponent: function() {
54
ReactReconciler.unmountComponent(this._renderedComponent);
59
- this._rootNodeID = null;
55
this._renderedComponent = null;
56
},
57
});
src/renderers/shared/reconciler/ReactMultiChild.js
+3
-6
@@ -251,7 +251,6 @@ var ReactMultiChild = {
251
var child = children[name];
252
var mountImage = ReactReconciler.mountComponent(
253
child,
254
- name,
254
transaction,
255
this,
256
this._nativeContainerInfo,
@@ -394,8 +393,8 @@ var ReactMultiChild = {
393
this._unmountChild(prevChild);
394
}
395
// The child must be instantiated before it's mounted.
397
- this._mountChildByNameAtIndex(
398
- nextChild, name, nextIndex, transaction, context
396
+ this._mountChildAtIndex(
397
+ nextChild, nextIndex, transaction, context
398
);
399
}
400
nextIndex++;
@@ -502,15 +501,13 @@ var ReactMultiChild = {
501
* @param {ReactReconcileTransaction} transaction
502
* @private
503
*/
505
- _mountChildByNameAtIndex: function(
504
+ _mountChildAtIndex: function(
505
child,
507
- name,
506
index,
507
transaction,
508
context) {
509
var mountImage = ReactReconciler.mountComponent(
510
child,
513
- name,
511
transaction,
512
this,
513
this._nativeContainerInfo,
src/renderers/shared/reconciler/ReactReconciler.js
-3
@@ -27,7 +27,6 @@ var ReactReconciler = {
27
* Initializes the component, renders markup, and registers event listeners.
28
*
29
* @param {ReactComponent} internalInstance
30
- * @param {string} rootID DOM ID of the root node.
30
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
31
* @param {?object} the containing native component instance
32
* @param {?object} info about the native container
@@ -37,14 +36,12 @@ var ReactReconciler = {
36
*/
37
mountComponent: function(
38
internalInstance,
40
- rootID,
39
transaction,
40
nativeParent,
41
nativeContainerInfo,
42
context
43
) {
44
var markup = internalInstance.mountComponent(
47
- rootID,
45
transaction,
46
nativeParent,
47
nativeContainerInfo,
src/test/ReactTestUtils.js
+1
-6
@@ -11,7 +11,6 @@
11
12
'use strict';
13
14
-var ClientReactRootIndex = require('ClientReactRootIndex');
14
var EventConstants = require('EventConstants');
15
var EventPluginHub = require('EventPluginHub');
16
var EventPluginRegistry = require('EventPluginRegistry');
@@ -22,7 +21,6 @@ var ReactDOMComponentTree = require('ReactDOMComponentTree');
21
var ReactElement = require('ReactElement');
22
var ReactBrowserEventEmitter = require('ReactBrowserEventEmitter');
23
var ReactCompositeComponent = require('ReactCompositeComponent');
25
-var ReactInstanceHandles = require('ReactInstanceHandles');
24
var ReactInstanceMap = require('ReactInstanceMap');
25
var ReactUpdates = require('ReactUpdates');
26
var SyntheticEvent = require('SyntheticEvent');
@@ -447,13 +445,10 @@ ReactShallowRenderer.prototype._render = function(element, transaction, context)
445
if (this._instance) {
446
this._instance.receiveComponent(element, transaction, context);
447
} else {
450
- var rootID = ReactInstanceHandles.createReactRootID(
451
- ClientReactRootIndex.createReactRootIndex()
452
- );
448
var instance = new ShallowComponentWrapper(element.type);
449
instance.construct(element);
450
456
- instance.mountComponent(rootID, transaction, null, null, context);
451
+ instance.mountComponent(transaction, null, null, context);
452
453
this._instance = instance;
454
}