j-templates 7.0.86 → 7.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -183,12 +183,4 @@ exports.DOMNodeConfig = {
183
183
  target.appendChild(child);
184
184
  }
185
185
  },
186
- reconcileChild(target, child) {
187
- const newChild = getHTMLNode(child, target.firstChild);
188
- if (target.firstChild === newChild)
189
- return;
190
- target.appendChild(newChild);
191
- while (target.firstChild !== newChild)
192
- target.removeChild(target.firstChild);
193
- },
194
186
  };
@@ -39,6 +39,5 @@ export interface INodeConfig {
39
39
  getNextSibling(target: any): any;
40
40
  replaceChildren(target: any, children: any[]): void;
41
41
  reconcileChildren(target: any, children: any[]): void;
42
- reconcileChild(target: any, child: any): void;
43
42
  }
44
43
  export declare const NodeConfig: INodeConfig;
package/Node/vNode.js CHANGED
@@ -305,7 +305,7 @@ function UpdateChildren(vnode, init = false, skipInit = false) {
305
305
  if (vnode.children.length === 1 &&
306
306
  vnode.children[0][1].length === 1 &&
307
307
  vnode.children[0][1][0].node) {
308
- nodeConfig_1.NodeConfig.reconcileChild(vnode.node, vnode.children[0][1][0].node);
308
+ nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
309
309
  return;
310
310
  }
311
311
  const children = vnode.children;
@@ -327,19 +327,13 @@ function UpdateChildren(vnode, init = false, skipInit = false) {
327
327
  if (vnode.destroyed || children !== vnode.children)
328
328
  return;
329
329
  if (init || !async) {
330
- if (vnode.children.length === 1 && vnode.children[0][1].length === 1)
331
- nodeConfig_1.NodeConfig.reconcileChild(vnode.node, vnode.children[0][1][0].node);
332
- else
333
- nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
330
+ nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
334
331
  }
335
332
  else
336
333
  nodeConfig_1.NodeConfig.scheduleUpdate(function () {
337
334
  if (vnode.destroyed || children !== vnode.children)
338
335
  return;
339
- if (vnode.children.length === 1 && vnode.children[0][1].length === 1)
340
- nodeConfig_1.NodeConfig.reconcileChild(vnode.node, vnode.children[0][1][0].node);
341
- else
342
- nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
336
+ nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
343
337
  });
344
338
  });
345
339
  });
@@ -422,8 +422,9 @@ function DestroyScope(scope) {
422
422
  emitter_1.Emitter.Clear(scope.emitter);
423
423
  for (const key in scope.scopes)
424
424
  DestroyScope(scope.scopes[key]);
425
- for (let x = 0; x < scope.emitters.length; x++)
426
- emitter_1.Emitter.Remove(scope.emitters[x], scope.setCallback);
425
+ if (scope.emitters !== null)
426
+ for (let x = 0; x < scope.emitters.length; x++)
427
+ emitter_1.Emitter.Remove(scope.emitters[x], scope.setCallback);
427
428
  scope.value = undefined;
428
429
  scope.scopes = null;
429
430
  scope.emitters = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "j-templates",
3
- "version": "7.0.86",
3
+ "version": "7.0.88",
4
4
  "description": "j-templates",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TypesInCode/jTemplates",