anchor.diff:      return ancestor;
     }
   
  -  int _nodeDepth;
  -  void _ensureDepth() {
  -    if (_nodeDepth == null) {
  -      if (_parent != null) {
  -        _parent._ensureDepth();
  -        _nodeDepth = _parent._nodeDepth + 1;
  -      } else {
  -        _nodeDepth = 0;
  -      }
  -    }
  -  }
  -
  -  void _trace(String message) {
  -    if (!_shouldTrace)
  -      return;
  -
  -    _ensureDepth();
  -    print((' ' * _nodeDepth) + message);
  -  }
  -
  -  void _traceSync(_SyncOperation op, String key) {
  -    if (!_shouldTrace)
  -      return;
  -
  -    String opString = op.toString().toLowerCase();
  -    String outString = opString.substring(opString.indexOf('.') + 1);
  -    _trace('_sync($outString) $key');
  -  }
  -
     void removeChild(UINode node) {
  -    _traceSync(_SyncOperation.removal, node._key);
       node.remove();
     }
   
     // Returns the child which should be retained as the child of this node.
     UINode syncChild(UINode node, UINode oldNode, dynamic slot) {
  +
       if (node == oldNode) {
  -      _traceSync(_SyncOperation.identical, node == null ? '*null*' : node._key);
  +      assert(node == null || node.mounted);
         return node; // Nothing to do. Subtrees must be identical.
       }
   
       if (node == null) {
         // the child in this slot has gone away
  +      assert(oldNode.mounted);
         removeChild(oldNode);
  +      assert(!oldNode.mounted);
         return null;
       }
  -    assert(oldNode == null || node._key == oldNode._key);
  -
  -    // TODO(rafaelw): This eagerly removes the old DOM. It may be that a
  -    // new component was built that could re-use some of it. Consider
  -    // syncing the new VDOM against the old one.
  -    if (oldNode != null && node._key != oldNode._key) {
  -      removeChild(oldNode);
  -    }
  -
  -    if (node._willSync(oldNode)) {
  -      _traceSync(_SyncOperation.stateful, node._key);
  +
  +    if (oldNode != null && node._key == oldNode._key && node._willSync(oldNode)) {
  +      assert(oldNode.mounted);
  +      assert(!node.mounted);
         oldNode._sync(node, slot);
  -      node._defunct = true;
         assert(oldNode.root is RenderObject);
         return oldNode;
       }
   
  -    assert(!node._defunct);
  -    node._parent = this;
  -
  -    if (oldNode == null) {
  -      _traceSync(_SyncOperation.insertion, node._key);
  -    } else {
  -      _traceSync(_SyncOperation.stateless, node._key);
  -    }
  +    if (oldNode != null && node._key != oldNode._key) {
  +      assert(oldNode.mounted);
  +      removeChild(oldNode);
  +      oldNode = null;
  +    }
  +
  +    assert(!node.mounted);
  +    node.setParent(this);
       node._sync(oldNode, slot);
  -    if (oldNode != null)
  -      oldNode._defunct = true;
  -
       assert(node.root is RenderObject);
       return node;
     }
  
positive.code:         ancestor.insert(this, slot);
      } else {
        root = old.root;
        assert(root != null);
      }
  
      _nodeMap[root] = this;
      syncRenderObject(old);
    }
  
    void syncRenderObject(RenderObjectWrapper old) {
      ParentData parentData = null;
      UINode parent = _parent;
      while (parent != null && parent is! RenderObjectWrapper) {
        if (parent is ParentDataNode && parent.parentData != null) {
          if (parentData != null)
            parentData.merge(parent.parentData); // this will throw if the types aren't the same
          else
            parentData = parent.parentData;
        }
        parent = parent._parent;
      }
      if (parentData != null) {
        assert(root.parentData != null);
        root.parentData.merge(parentData); // this will throw if the types aren't approriate
        assert(parent != null);
        assert(parent.root != null);
        parent.root.markNeedsLayout();
      }
    }
  
  
negative.code:       : this(key: key, stateful: stateful);
  
    void _didMount() {
      super._didMount();
      if (_mountCallbacks != null)
        for (Function fn in _mountCallbacks)
          fn();
    }
  
    void _didUnmount() {
      super._didUnmount();
      if (_unmountCallbacks != null)
        for (Function fn in _unmountCallbacks)
          fn();
    }
  
    // TODO(rafaelw): It seems wrong to expose DOM at all. This is presently
  