marko 6.3.30 → 6.3.31
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.
- package/dist/debug/dom.js +16 -11
- package/dist/debug/dom.mjs +16 -11
- package/dist/dom/walker.d.ts +0 -1
- package/dist/dom.js +14 -11
- package/dist/dom.mjs +14 -11
- package/package.json +2 -2
package/dist/debug/dom.js
CHANGED
|
@@ -650,9 +650,10 @@ function _hoist_resume(id, ...path) {
|
|
|
650
650
|
}
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region src/dom/walker.ts
|
|
653
|
-
|
|
653
|
+
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
654
|
+
let currentNode;
|
|
654
655
|
function walk(startNode, walkCodes, branch) {
|
|
655
|
-
|
|
656
|
+
currentNode = startNode;
|
|
656
657
|
walkInternal(0, walkCodes, branch);
|
|
657
658
|
}
|
|
658
659
|
const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
@@ -664,11 +665,9 @@ const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
|
664
665
|
value = walkCodes.charCodeAt(currentWalkIndex++);
|
|
665
666
|
currentMultiplier = storedMultiplier;
|
|
666
667
|
storedMultiplier = 0;
|
|
667
|
-
if (value === 32)
|
|
668
|
-
|
|
669
|
-
scope[getDebugKey(currentScopeIndex++,
|
|
670
|
-
} else if (value === 37 || value === 49) {
|
|
671
|
-
walker.currentNode.replaceWith(walker.currentNode = scope[getDebugKey(currentScopeIndex++, "#text")] = new Text());
|
|
668
|
+
if (value === 32) scope[getDebugKey(currentScopeIndex++, currentNode)] = currentNode;
|
|
669
|
+
else if (value === 37 || value === 49) {
|
|
670
|
+
currentNode.replaceWith(currentNode = scope[getDebugKey(currentScopeIndex++, "#text")] = new Text());
|
|
672
671
|
if (value === 49) scope[getDebugKey(currentScopeIndex++, "#scopeOffset")] = skipScope();
|
|
673
672
|
} else if (value === 38) return currentWalkIndex;
|
|
674
673
|
else if (value === 47 || value === 48) {
|
|
@@ -676,14 +675,14 @@ const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
|
676
675
|
if (value === 48) scope[getDebugKey(currentScopeIndex++, "#scopeOffset")] = skipScope();
|
|
677
676
|
} else if (value < 92) {
|
|
678
677
|
value = 25 * currentMultiplier + value - 67;
|
|
679
|
-
while (value--)
|
|
678
|
+
while (value--) walkNextNode();
|
|
680
679
|
} else if (value < 107) {
|
|
681
680
|
value = 10 * currentMultiplier + value - 97;
|
|
682
|
-
while (value--)
|
|
681
|
+
while (value--) walkNextSibling();
|
|
683
682
|
} else if (value < 117) {
|
|
684
683
|
value = 10 * currentMultiplier + value - 107;
|
|
685
|
-
while (value--)
|
|
686
|
-
|
|
684
|
+
while (value--) currentNode = currentNode.parentNode || currentNode;
|
|
685
|
+
walkNextSibling();
|
|
687
686
|
} else {
|
|
688
687
|
if (value < 117 || value > 126) throw new Error(`Unknown walk code: ${value}`);
|
|
689
688
|
storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
@@ -697,6 +696,12 @@ function getDebugKey(index, node) {
|
|
|
697
696
|
else if (node.nodeType === 1) return `#${node.tagName.toLowerCase()}/${index}`;
|
|
698
697
|
return index;
|
|
699
698
|
}
|
|
699
|
+
const walkNextNode = () => {
|
|
700
|
+
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
701
|
+
while (!currentNode.nextSibling && currentNode.parentNode) currentNode = currentNode.parentNode;
|
|
702
|
+
walkNextSibling();
|
|
703
|
+
};
|
|
704
|
+
const walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode;
|
|
700
705
|
//#endregion
|
|
701
706
|
//#region src/dom/resume.ts
|
|
702
707
|
const registeredValues = {};
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -648,9 +648,10 @@ function _hoist_resume(id, ...path) {
|
|
|
648
648
|
}
|
|
649
649
|
//#endregion
|
|
650
650
|
//#region src/dom/walker.ts
|
|
651
|
-
|
|
651
|
+
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
652
|
+
let currentNode;
|
|
652
653
|
function walk(startNode, walkCodes, branch) {
|
|
653
|
-
|
|
654
|
+
currentNode = startNode;
|
|
654
655
|
walkInternal(0, walkCodes, branch);
|
|
655
656
|
}
|
|
656
657
|
const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
@@ -662,11 +663,9 @@ const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
|
662
663
|
value = walkCodes.charCodeAt(currentWalkIndex++);
|
|
663
664
|
currentMultiplier = storedMultiplier;
|
|
664
665
|
storedMultiplier = 0;
|
|
665
|
-
if (value === 32)
|
|
666
|
-
|
|
667
|
-
scope[getDebugKey(currentScopeIndex++,
|
|
668
|
-
} else if (value === 37 || value === 49) {
|
|
669
|
-
walker.currentNode.replaceWith(walker.currentNode = scope[getDebugKey(currentScopeIndex++, "#text")] = new Text());
|
|
666
|
+
if (value === 32) scope[getDebugKey(currentScopeIndex++, currentNode)] = currentNode;
|
|
667
|
+
else if (value === 37 || value === 49) {
|
|
668
|
+
currentNode.replaceWith(currentNode = scope[getDebugKey(currentScopeIndex++, "#text")] = new Text());
|
|
670
669
|
if (value === 49) scope[getDebugKey(currentScopeIndex++, "#scopeOffset")] = skipScope();
|
|
671
670
|
} else if (value === 38) return currentWalkIndex;
|
|
672
671
|
else if (value === 47 || value === 48) {
|
|
@@ -674,14 +673,14 @@ const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
|
674
673
|
if (value === 48) scope[getDebugKey(currentScopeIndex++, "#scopeOffset")] = skipScope();
|
|
675
674
|
} else if (value < 92) {
|
|
676
675
|
value = 25 * currentMultiplier + value - 67;
|
|
677
|
-
while (value--)
|
|
676
|
+
while (value--) walkNextNode();
|
|
678
677
|
} else if (value < 107) {
|
|
679
678
|
value = 10 * currentMultiplier + value - 97;
|
|
680
|
-
while (value--)
|
|
679
|
+
while (value--) walkNextSibling();
|
|
681
680
|
} else if (value < 117) {
|
|
682
681
|
value = 10 * currentMultiplier + value - 107;
|
|
683
|
-
while (value--)
|
|
684
|
-
|
|
682
|
+
while (value--) currentNode = currentNode.parentNode || currentNode;
|
|
683
|
+
walkNextSibling();
|
|
685
684
|
} else {
|
|
686
685
|
if (value < 117 || value > 126) throw new Error(`Unknown walk code: ${value}`);
|
|
687
686
|
storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
@@ -695,6 +694,12 @@ function getDebugKey(index, node) {
|
|
|
695
694
|
else if (node.nodeType === 1) return `#${node.tagName.toLowerCase()}/${index}`;
|
|
696
695
|
return index;
|
|
697
696
|
}
|
|
697
|
+
const walkNextNode = () => {
|
|
698
|
+
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
699
|
+
while (!currentNode.nextSibling && currentNode.parentNode) currentNode = currentNode.parentNode;
|
|
700
|
+
walkNextSibling();
|
|
701
|
+
};
|
|
702
|
+
const walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode;
|
|
698
703
|
//#endregion
|
|
699
704
|
//#region src/dom/resume.ts
|
|
700
705
|
const registeredValues = {};
|
package/dist/dom/walker.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type BranchScope } from "../common/types";
|
|
2
|
-
export declare const walker: TreeWalker;
|
|
3
2
|
export declare function walk(startNode: Node, walkCodes: string, branch: BranchScope): void;
|
|
4
3
|
export declare function getDebugKey(index: number, node: Node | string): string | number;
|
package/dist/dom.js
CHANGED
|
@@ -6,21 +6,23 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
6
6
|
return str;
|
|
7
7
|
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), delegate = (type, handler) => handler[type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes, destroyNestedScopes = function destroyNestedScopes(scope) {
|
|
8
8
|
scope.H = 0, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(cleanupScope);
|
|
9
|
-
}, isScheduled, channel, _return = (scope, value) => scope.T?.(value), _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(),
|
|
9
|
+
}, isScheduled, channel, _return = (scope, value) => scope.T?.(value), _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(), currentNode, walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
10
10
|
let value, currentMultiplier, storedMultiplier = 0, currentScopeIndex = 0;
|
|
11
|
-
for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32)
|
|
12
|
-
|
|
13
|
-
scope[decodeAccessor(currentScopeIndex++)] = node;
|
|
14
|
-
} else if (value === 37 || value === 49) walker.currentNode.replaceWith(walker.currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
11
|
+
for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32) scope[decodeAccessor(currentScopeIndex++)] = currentNode;
|
|
12
|
+
else if (value === 37 || value === 49) currentNode.replaceWith(currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
15
13
|
else if (value === 38) return currentWalkIndex;
|
|
16
14
|
else if (value === 47 || value === 48) currentWalkIndex = walkInternal(currentWalkIndex, walkCodes, scope[decodeAccessor(currentScopeIndex++)] = createScope(scope.$, scope.F)), value === 48 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
17
|
-
else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;)
|
|
18
|
-
else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;)
|
|
15
|
+
else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;) walkNextNode();
|
|
16
|
+
else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;) walkNextSibling();
|
|
19
17
|
else if (value < 117) {
|
|
20
|
-
for (value = 10 * currentMultiplier + value - 107; value--;)
|
|
21
|
-
|
|
18
|
+
for (value = 10 * currentMultiplier + value - 107; value--;) currentNode = currentNode.parentNode || currentNode;
|
|
19
|
+
walkNextSibling();
|
|
22
20
|
} else storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
23
|
-
},
|
|
21
|
+
}, walkNextNode = () => {
|
|
22
|
+
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
23
|
+
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
24
|
+
walkNextSibling();
|
|
25
|
+
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, branchesEnabled, embedRenders, readyIds, isResuming, cloneCache = {}, R = /[^\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
24
26
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
25
27
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
26
28
|
return enableBranches(), (scope, newRenderer, getInput) => {
|
|
@@ -409,8 +411,9 @@ function _hoist_resume(id, ...path) {
|
|
|
409
411
|
}
|
|
410
412
|
//#endregion
|
|
411
413
|
//#region src/dom/walker.ts
|
|
414
|
+
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
412
415
|
function walk(startNode, walkCodes, branch) {
|
|
413
|
-
|
|
416
|
+
currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
414
417
|
}
|
|
415
418
|
//#endregion
|
|
416
419
|
//#region src/dom/resume.ts
|
package/dist/dom.mjs
CHANGED
|
@@ -6,21 +6,23 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
6
6
|
return str;
|
|
7
7
|
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), delegate = (type, handler) => handler[type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes, destroyNestedScopes = function destroyNestedScopes(scope) {
|
|
8
8
|
scope.H = 0, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(cleanupScope);
|
|
9
|
-
}, isScheduled, channel, _return = (scope, value) => scope.T?.(value), _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(),
|
|
9
|
+
}, isScheduled, channel, _return = (scope, value) => scope.T?.(value), _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(), currentNode, walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
10
10
|
let value, currentMultiplier, storedMultiplier = 0, currentScopeIndex = 0;
|
|
11
|
-
for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32)
|
|
12
|
-
|
|
13
|
-
scope[decodeAccessor(currentScopeIndex++)] = node;
|
|
14
|
-
} else if (value === 37 || value === 49) walker.currentNode.replaceWith(walker.currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
11
|
+
for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32) scope[decodeAccessor(currentScopeIndex++)] = currentNode;
|
|
12
|
+
else if (value === 37 || value === 49) currentNode.replaceWith(currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
15
13
|
else if (value === 38) return currentWalkIndex;
|
|
16
14
|
else if (value === 47 || value === 48) currentWalkIndex = walkInternal(currentWalkIndex, walkCodes, scope[decodeAccessor(currentScopeIndex++)] = createScope(scope.$, scope.F)), value === 48 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
17
|
-
else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;)
|
|
18
|
-
else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;)
|
|
15
|
+
else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;) walkNextNode();
|
|
16
|
+
else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;) walkNextSibling();
|
|
19
17
|
else if (value < 117) {
|
|
20
|
-
for (value = 10 * currentMultiplier + value - 107; value--;)
|
|
21
|
-
|
|
18
|
+
for (value = 10 * currentMultiplier + value - 107; value--;) currentNode = currentNode.parentNode || currentNode;
|
|
19
|
+
walkNextSibling();
|
|
22
20
|
} else storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
23
|
-
},
|
|
21
|
+
}, walkNextNode = () => {
|
|
22
|
+
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
23
|
+
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
24
|
+
walkNextSibling();
|
|
25
|
+
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, branchesEnabled, embedRenders, readyIds, isResuming, cloneCache = {}, R = /[^\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
24
26
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
25
27
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
26
28
|
return enableBranches(), (scope, newRenderer, getInput) => {
|
|
@@ -408,8 +410,9 @@ function _hoist_resume(id, ...path) {
|
|
|
408
410
|
}
|
|
409
411
|
//#endregion
|
|
410
412
|
//#region src/dom/walker.ts
|
|
413
|
+
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
411
414
|
function walk(startNode, walkCodes, branch) {
|
|
412
|
-
|
|
415
|
+
currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
413
416
|
}
|
|
414
417
|
//#endregion
|
|
415
418
|
//#region src/dom/resume.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.31",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"magic-string": "^0.30.21"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@marko/runtime-tags": "npm:marko@6.3.
|
|
57
|
+
"@marko/runtime-tags": "npm:marko@6.3.31",
|
|
58
58
|
"marko": "5.39.30"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|