@samitouri / QOS-React-2 / commits / a4459558c1

Cleaned up a few names in the reconciler.

Jim committed Jul 17, 2015 at 21:47 UTC a4459558c11f688ddf2ddbbb59140c008e6067b1
2 files changed +14 -15
src/renderers/shared/reconciler/ReactChildReconciler.js
+3 -3
@@ -51,7 +51,7 @@ var ReactChildReconciler = {
51 * Updates the rendered children and returns a new set of children.
52 *
53 * @param {?object} prevChildren Previously initialized set of children.
54 - * @param {?object} nextNestedChildNodes Nested child maps.
54 + * @param {?object} nextNestedChildrenElements Nested child element maps.
55 * @param {ReactReconcileTransaction} transaction
56 * @param {object} context
57 * @return {?object} A new set of child instances.
@@ -59,7 +59,7 @@ var ReactChildReconciler = {
59 */
60 updateChildren: function(
61 prevChildren,
62 - nextNestedChildNodes,
62 + nextNestedChildrenElements,
63 transaction,
64 context) {
65 // We currently don't have a way to track moves here but if we use iterators
@@ -67,7 +67,7 @@ var ReactChildReconciler = {
67 // moved.
68 // TODO: If nothing has changed, return the prevChildren object so that we
69 // can quickly bailout if nothing has changed.
70 - var nextChildren = flattenChildren(nextNestedChildNodes);
70 + var nextChildren = flattenChildren(nextNestedChildrenElements);
71 if (!nextChildren && !prevChildren) {
72 return null;
73 }
src/renderers/shared/reconciler/ReactMultiChild.js
+11 -12
@@ -219,7 +219,7 @@ var ReactMultiChild = {
219 // TODO: The setTextContent operation should be enough
220 for (var name in prevChildren) {
221 if (prevChildren.hasOwnProperty(name)) {
222 - this._unmountChildByName(prevChildren[name], name);
222 + this._unmountChild(prevChildren[name]);
223 }
224 }
225 // Set new text content.
@@ -240,15 +240,15 @@ var ReactMultiChild = {
240 /**
241 * Updates the rendered children with new children.
242 *
243 - * @param {?object} nextNestedChildren Nested child maps.
243 + * @param {?object} nextNestedChildrenElements Nested child element maps.
244 * @param {ReactReconcileTransaction} transaction
245 * @internal
246 */
247 - updateChildren: function(nextNestedChildren, transaction, context) {
247 + updateChildren: function(nextNestedChildrenElements, transaction, context) {
248 updateDepth++;
249 var errorThrown = true;
250 try {
251 - this._updateChildren(nextNestedChildren, transaction, context);
251 + this._updateChildren(nextNestedChildrenElements, transaction, context);
252 errorThrown = false;
253 } finally {
254 updateDepth--;
@@ -267,15 +267,15 @@ var ReactMultiChild = {
267 * Improve performance by isolating this hot code path from the try/catch
268 * block in `updateChildren`.
269 *
270 - * @param {?object} nextNestedChildren Nested child maps.
270 + * @param {?object} nextNestedChildrenElements Nested child element maps.
271 * @param {ReactReconcileTransaction} transaction
272 * @final
273 * @protected
274 */
275 - _updateChildren: function(nextNestedChildren, transaction, context) {
275 + _updateChildren: function(nextNestedChildrenElements, transaction, context) {
276 var prevChildren = this._renderedChildren;
277 var nextChildren = ReactChildReconciler.updateChildren(
278 - prevChildren, nextNestedChildren, transaction, context
278 + prevChildren, nextNestedChildrenElements, transaction, context
279 );
280 this._renderedChildren = nextChildren;
281 if (!nextChildren && !prevChildren) {
@@ -300,7 +300,7 @@ var ReactMultiChild = {
300 if (prevChild) {
301 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
302 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
303 - this._unmountChildByName(prevChild, name);
303 + this._unmountChild(prevChild);
304 }
305 // The child must be instantiated before it's mounted.
306 this._mountChildByNameAtIndex(
@@ -313,7 +313,7 @@ var ReactMultiChild = {
313 for (name in prevChildren) {
314 if (prevChildren.hasOwnProperty(name) &&
315 !(nextChildren && nextChildren.hasOwnProperty(name))) {
316 - this._unmountChildByName(prevChildren[name], name);
316 + this._unmountChild(prevChildren[name]);
317 }
318 }
319 },
@@ -408,15 +408,14 @@ var ReactMultiChild = {
408 },
409
410 /**
411 - * Unmounts a rendered child by name.
411 + * Unmounts a rendered child.
412 *
413 * NOTE: This is part of `updateChildren` and is here for readability.
414 *
415 * @param {ReactComponent} child Component to unmount.
416 - * @param {string} name Name of the child in `this._renderedChildren`.
416 * @private
417 */
419 - _unmountChildByName: function(child, name) {
418 + _unmountChild: function(child) {
419 this.removeChild(child);
420 child._mountIndex = null;
421 },