From cb2dd6331d4a5e0a71e84b30b161079d3a13b7b2 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 28 Aug 2017 11:29:12 +0200 Subject: [PATCH] improvments to the new local diff algorithm --- src/karax.nim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/karax.nim b/src/karax.nim index f68e3ff..2df1d9f 100644 --- a/src/karax.nim +++ b/src/karax.nim @@ -182,7 +182,7 @@ proc same(n: VNode, e: Node; nesting = 0): bool = for i in 0 ..< n.len: if not same(n[i], e[i], nesting+1): return false else: - kout toTag[n.kind], e.nodename + echo "VDOM: ", toTag[n.kind], " DOM: ", e.nodename proc replaceById(id: cstring; newTree: Node) = let x = document.getElementById(id) @@ -334,7 +334,8 @@ proc applyPatch(kxi: KaraxInstance) = if n.kind == VNodeKind.component: let x = VComponent(n) if x.onDetachImpl != nil: x.onDetachImpl(x) - n.dom = nil + # XXX for some reason this causes assertion errors otherwise: + if not kxi.surpressRedraws: n.dom = nil kxi.patchLen = 0 for i in 0..