Skip to content

Commit

Permalink
Remove now-unused _rootNodeID from composites
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebits committed Nov 4, 2015
1 parent e48c8be commit 3cebada
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 38 deletions.
7 changes: 0 additions & 7 deletions src/renderers/dom/client/ReactMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,19 @@ function internalGetID(node) {
* Mounts this component and inserts it into the DOM.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {string} rootID DOM ID of the root node.
* @param {DOMElement} container DOM element to mount into.
* @param {ReactReconcileTransaction} transaction
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function mountComponentIntoNode(
wrapperInstance,
rootID,
container,
transaction,
shouldReuseMarkup,
context
) {
var markup = ReactReconciler.mountComponent(
wrapperInstance,
rootID,
transaction,
null,
ReactDOMContainerInfo(wrapperInstance, container),
Expand All @@ -118,13 +115,11 @@ function mountComponentIntoNode(
* Batched mount.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {string} rootID DOM ID of the root node.
* @param {DOMElement} container DOM element to mount into.
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function batchedMountComponentIntoNode(
componentInstance,
rootID,
container,
shouldReuseMarkup,
context
Expand All @@ -137,7 +132,6 @@ function batchedMountComponentIntoNode(
mountComponentIntoNode,
null,
componentInstance,
rootID,
container,
transaction,
shouldReuseMarkup,
Expand Down Expand Up @@ -311,7 +305,6 @@ var ReactMount = {
ReactUpdates.batchedUpdates(
batchedMountComponentIntoNode,
componentInstance,
'',
container,
shouldReuseMarkup,
context
Expand Down
1 change: 0 additions & 1 deletion src/renderers/dom/server/ReactServerRendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function renderToStringImpl(element, makeStaticMarkup) {
return transaction.perform(function() {
var componentInstance = instantiateReactComponent(element, null);
var markup = componentInstance.mountComponent(
'',
transaction,
null,
ReactDOMContainerInfo(),
Expand Down
2 changes: 0 additions & 2 deletions src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,13 @@ ReactDOMComponent.Mixin = {
* is not idempotent.
*
* @internal
* @param {string} rootID The root DOM ID for this node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?ReactDOMComponent} the containing DOM component instance
* @param {?object} info about the native container
* @param {object} context
* @return {string} The computed markup.
*/
mountComponent: function(
rootID,
transaction,
nativeParent,
nativeContainerInfo,
Expand Down
2 changes: 0 additions & 2 deletions src/renderers/dom/shared/ReactDOMTextComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ assign(ReactDOMTextComponent.prototype, {
* Creates the markup for this text node. This node is not intended to have
* any features besides containing text content.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function(
rootID,
transaction,
nativeParent,
nativeContainerInfo,
Expand Down
5 changes: 0 additions & 5 deletions src/renderers/shared/reconciler/ReactCompositeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ var ReactCompositeComponentMixin = {
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?object} nativeParent
* @param {?object} nativeContainerInfo
Expand All @@ -130,15 +129,13 @@ var ReactCompositeComponentMixin = {
* @internal
*/
mountComponent: function(
rootID,
transaction,
nativeParent,
nativeContainerInfo,
context
) {
this._context = context;
this._mountOrder = nextMountID++;
this._rootNodeID = rootID;
this._nativeParent = nativeParent;
this._nativeContainerInfo = nativeContainerInfo;

Expand Down Expand Up @@ -302,7 +299,6 @@ var ReactCompositeComponentMixin = {

var markup = ReactReconciler.mountComponent(
this._renderedComponent,
rootID,
transaction,
nativeParent,
nativeContainerInfo,
Expand Down Expand Up @@ -764,7 +760,6 @@ var ReactCompositeComponentMixin = {
);
var nextMarkup = ReactReconciler.mountComponent(
this._renderedComponent,
this._rootNodeID,
transaction,
this._nativeParent,
this._nativeContainerInfo,
Expand Down
7 changes: 1 addition & 6 deletions src/renderers/shared/reconciler/ReactEmptyComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,19 @@ var ReactEmptyComponentInjection = {

var ReactEmptyComponent = function(instantiate) {
this._currentElement = null;
this._rootNodeID = null;
this._renderedComponent = instantiate(placeholderElement);
};
assign(ReactEmptyComponent.prototype, {
construct: function(element) {
},
mountComponent: function(
rootID,
transaction,
nativeParent,
nativeContainerInfo,
context
) {
this._rootNodeID = rootID;
return ReactReconciler.mountComponent(
this._renderedComponent,
rootID,
transaction,
nativeParent,
nativeContainerInfo,
Expand All @@ -54,9 +50,8 @@ assign(ReactEmptyComponent.prototype, {
getNativeNode: function() {
return ReactReconciler.getNativeNode(this._renderedComponent);
},
unmountComponent: function(rootID, transaction, context) {
unmountComponent: function() {
ReactReconciler.unmountComponent(this._renderedComponent);
this._rootNodeID = null;
this._renderedComponent = null;
},
});
Expand Down
9 changes: 3 additions & 6 deletions src/renderers/shared/reconciler/ReactMultiChild.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ var ReactMultiChild = {
var child = children[name];
var mountImage = ReactReconciler.mountComponent(
child,
name,
transaction,
this,
this._nativeContainerInfo,
Expand Down Expand Up @@ -394,8 +393,8 @@ var ReactMultiChild = {
this._unmountChild(prevChild);
}
// The child must be instantiated before it's mounted.
this._mountChildByNameAtIndex(
nextChild, name, nextIndex, transaction, context
this._mountChildAtIndex(
nextChild, nextIndex, transaction, context
);
}
nextIndex++;
Expand Down Expand Up @@ -502,15 +501,13 @@ var ReactMultiChild = {
* @param {ReactReconcileTransaction} transaction
* @private
*/
_mountChildByNameAtIndex: function(
_mountChildAtIndex: function(
child,
name,
index,
transaction,
context) {
var mountImage = ReactReconciler.mountComponent(
child,
name,
transaction,
this,
this._nativeContainerInfo,
Expand Down
3 changes: 0 additions & 3 deletions src/renderers/shared/reconciler/ReactReconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var ReactReconciler = {
* Initializes the component, renders markup, and registers event listeners.
*
* @param {ReactComponent} internalInstance
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?object} the containing native component instance
* @param {?object} info about the native container
Expand All @@ -37,14 +36,12 @@ var ReactReconciler = {
*/
mountComponent: function(
internalInstance,
rootID,
transaction,
nativeParent,
nativeContainerInfo,
context
) {
var markup = internalInstance.mountComponent(
rootID,
transaction,
nativeParent,
nativeContainerInfo,
Expand Down
7 changes: 1 addition & 6 deletions src/test/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

'use strict';

var ClientReactRootIndex = require('ClientReactRootIndex');
var EventConstants = require('EventConstants');
var EventPluginHub = require('EventPluginHub');
var EventPluginRegistry = require('EventPluginRegistry');
Expand All @@ -22,7 +21,6 @@ var ReactDOMComponentTree = require('ReactDOMComponentTree');
var ReactElement = require('ReactElement');
var ReactBrowserEventEmitter = require('ReactBrowserEventEmitter');
var ReactCompositeComponent = require('ReactCompositeComponent');
var ReactInstanceHandles = require('ReactInstanceHandles');
var ReactInstanceMap = require('ReactInstanceMap');
var ReactUpdates = require('ReactUpdates');
var SyntheticEvent = require('SyntheticEvent');
Expand Down Expand Up @@ -447,13 +445,10 @@ ReactShallowRenderer.prototype._render = function(element, transaction, context)
if (this._instance) {
this._instance.receiveComponent(element, transaction, context);
} else {
var rootID = ReactInstanceHandles.createReactRootID(
ClientReactRootIndex.createReactRootIndex()
);
var instance = new ShallowComponentWrapper(element.type);
instance.construct(element);

instance.mountComponent(rootID, transaction, null, null, context);
instance.mountComponent(transaction, null, null, context);

this._instance = instance;
}
Expand Down

0 comments on commit 3cebada

Please sign in to comment.