Skip to content

Commit

Permalink
chore: remove dev logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Feb 11, 2023
1 parent c5f901b commit 3a59232
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 33 deletions.
9 changes: 0 additions & 9 deletions client/dist/ui.cjs.development.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/ui.cjs.development.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/ui.cjs.production.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/ui.cjs.production.min.js.map

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions client/dist/ui.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/ui.esm.js.map

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions client/src/engine/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export default class Dom {
const newNodes = Array.prototype.slice.call(newNode.children);
const oldNodes = Array.prototype.slice.call(oldNode.children);

console.log('diffing elements', newNodes, oldNodes);

/**
* Get the type for a node
* @param {Node} node The node
Expand Down Expand Up @@ -46,12 +44,9 @@ export default class Dom {
for (let index = 0; index < newNodes.length; index++) {
const node = newNodes[index];

console.log('diffing node', newNodes[index], oldNodes[index], index);

if (!oldNodes[index]) {
const newNodeClone = node.cloneNode(true);
oldNode.appendChild(newNodeClone);
console.log('adding new UI node', newNodeClone);
initComponent(newNodeClone);
continue;
}
Expand Down Expand Up @@ -132,7 +127,6 @@ export default class Dom {
newNodeClone,
oldNodes[index]
);
console.log('replacing leaf UI node', newNodeClone, oldNodes[index]);
initComponent(newNodeClone);
}
continue;
Expand All @@ -145,7 +139,6 @@ export default class Dom {
newNodeClone,
oldNodes[index]
);
console.log('replacing node', newNodeClone, oldNodes[index]);
initComponent(newNodeClone);
continue;
}
Expand All @@ -156,15 +149,13 @@ export default class Dom {
templateContent &&
templateContent !== getNodeContent(oldNodes[index])
) {
console.log('updating textContent', templateContent, oldNodes[index]);
oldNodes[index].textContent = templateContent;
}

if (
oldNodes[index].children.length > 0 &&
node.children.length < 1
) {
console.log('clearing innerHTMl', node, oldNodes[index]);
oldNodes[index].innerHTML = '';
continue;
}
Expand All @@ -174,14 +165,12 @@ export default class Dom {
node.children.length > 0
) {
const fragment = document.createDocumentFragment();
console.log('fragmenting', node, fragment);
Dom.diff(node, fragment as any);
oldNodes[index].appendChild(fragment);
continue;
}

if (node.children.length > 0) {
console.log('diffing children', node, oldNodes[index]);
Dom.diffElements(node, oldNodes[index]);
}
}
Expand Down

0 comments on commit 3a59232

Please sign in to comment.