createComment(text: string): HostNode
setText(node: HostNode, text: string): void
setElementText(node: HostElement, text: string): void
- parentNode(node: HostNode): HostNode | null
+ parentNode(node: HostNode): HostElement | null
nextSibling(node: HostNode): HostNode | null
querySelector(selector: string): HostElement | null
}
// children fast path
const oldDynamicChildren = n1.dynamicChildren!
for (let i = 0; i < dynamicChildren.length; i++) {
+ const oldVNode = oldDynamicChildren[i]
patch(
- oldDynamicChildren[i],
+ oldVNode,
dynamicChildren[i],
- el,
+ hostParentNode(oldVNode.el!)!,
null,
parentComponent,
parentSuspense,
export const nodeOps = {
insert: (child: Node, parent: Node, anchor?: Node) => {
if (anchor != null) {
- parent.insertBefore(child, anchor)
+ try {
+ parent.insertBefore(child, anchor)
+ } catch (e) {
+ debugger
+ }
} else {
parent.appendChild(child)
}
el.textContent = text
},
- parentNode: (node: Node): Node | null => node.parentNode,
+ parentNode: (node: Node): HTMLElement | null =>
+ node.parentNode as HTMLElement,
nextSibling: (node: Node): Node | null => node.nextSibling,