marko 5.39.44 → 5.39.45
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/runtime/helpers/load-tag.js +28 -12
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +9 -9
- package/dist/runtime/helpers/tags-compat/runtime-html.js +43 -28
- package/dist/runtime/html/AsyncStream.js +10 -10
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +2 -2
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/renderable.js +1 -1
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +65 -65
- package/dist/runtime/vdom/VComment.js +7 -7
- package/dist/runtime/vdom/VComponent.js +3 -3
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +32 -32
- package/dist/runtime/vdom/VFragment.js +5 -5
- package/dist/runtime/vdom/VNode.js +29 -29
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/const-element.js +3 -3
- package/dist/runtime/vdom/hot-reload.js +2 -2
- package/dist/runtime/vdom/morphdom/fragment.js +3 -3
- package/dist/runtime/vdom/morphdom/helpers.js +1 -1
- package/dist/runtime/vdom/morphdom/index.js +34 -34
- package/dist/runtime/vdom/vdom.js +15 -15
- package/dist/translator/util/get-component-files.js +1 -1
- package/dist/translator/util/load-import.js +2 -1
- package/package.json +3 -3
- package/src/runtime/helpers/load-tag.js +28 -12
- package/src/runtime/helpers/tags-compat/runtime-html.js +42 -27
- package/src/translator/util/load-import.js +1 -0
|
@@ -3,78 +3,78 @@
|
|
|
3
3
|
function VNode() {}
|
|
4
4
|
|
|
5
5
|
VNode.prototype = {
|
|
6
|
-
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
6
|
+
cc_: function (finalChildCount, ownerComponent) {
|
|
7
|
+
this.cr_ = finalChildCount;
|
|
8
|
+
this.cs_ = 0;
|
|
9
|
+
this.cj_ = null;
|
|
10
|
+
this.ct_ = null;
|
|
11
|
+
this.cg_ = null;
|
|
9
12
|
this.ch_ = null;
|
|
10
|
-
this.cr_ = null;
|
|
11
|
-
this.ce_ = null;
|
|
12
|
-
this.cf_ = null;
|
|
13
13
|
this._P_ = ownerComponent;
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
get aD_() {
|
|
17
|
-
var firstChild = this.
|
|
17
|
+
var firstChild = this.cj_;
|
|
18
18
|
|
|
19
|
-
if (firstChild && firstChild.
|
|
19
|
+
if (firstChild && firstChild.ci_) {
|
|
20
20
|
var nestedFirstChild = firstChild.aD_;
|
|
21
21
|
// The first child is a DocumentFragment node.
|
|
22
22
|
// If the DocumentFragment node has a first child then we will return that.
|
|
23
23
|
// Otherwise, the DocumentFragment node is not *really* the first child and
|
|
24
24
|
// we need to skip to its next sibling
|
|
25
|
-
return nestedFirstChild || firstChild.
|
|
25
|
+
return nestedFirstChild || firstChild.cu_;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return firstChild;
|
|
29
29
|
},
|
|
30
30
|
|
|
31
|
-
get
|
|
32
|
-
var nextSibling = this.
|
|
31
|
+
get cu_() {
|
|
32
|
+
var nextSibling = this.ch_;
|
|
33
33
|
|
|
34
34
|
if (nextSibling) {
|
|
35
|
-
if (nextSibling.
|
|
35
|
+
if (nextSibling.ci_) {
|
|
36
36
|
var firstChild = nextSibling.aD_;
|
|
37
|
-
return firstChild || nextSibling.
|
|
37
|
+
return firstChild || nextSibling.cu_;
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
|
-
var parentNode = this.
|
|
41
|
-
if (parentNode && parentNode.
|
|
42
|
-
return parentNode.
|
|
40
|
+
var parentNode = this.cg_;
|
|
41
|
+
if (parentNode && parentNode.ci_) {
|
|
42
|
+
return parentNode.cu_;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
return nextSibling;
|
|
47
47
|
},
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
this.
|
|
49
|
+
bW_: function (child) {
|
|
50
|
+
this.cs_++;
|
|
51
51
|
|
|
52
|
-
if (hasTextContent(this.
|
|
53
|
-
if (child.
|
|
54
|
-
this.
|
|
52
|
+
if (hasTextContent(this.cl_)) {
|
|
53
|
+
if (child.cv_) {
|
|
54
|
+
this.cm_ += child.cd_;
|
|
55
55
|
} else {
|
|
56
56
|
throw TypeError();
|
|
57
57
|
}
|
|
58
58
|
} else {
|
|
59
|
-
var lastChild = this.
|
|
59
|
+
var lastChild = this.ct_;
|
|
60
60
|
|
|
61
|
-
child.
|
|
61
|
+
child.cg_ = this;
|
|
62
62
|
|
|
63
63
|
if (lastChild) {
|
|
64
|
-
lastChild.
|
|
64
|
+
lastChild.ch_ = child;
|
|
65
65
|
} else {
|
|
66
|
-
this.
|
|
66
|
+
this.cj_ = child;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
this.
|
|
69
|
+
this.ct_ = child;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
return child;
|
|
73
73
|
},
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
if (this.
|
|
77
|
-
return this.
|
|
75
|
+
co_: function finishChild() {
|
|
76
|
+
if (this.cs_ === this.cr_ && this.cg_) {
|
|
77
|
+
return this.cg_.co_();
|
|
78
78
|
} else {
|
|
79
79
|
return this;
|
|
80
80
|
}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
var VNode = require("./VNode");
|
|
3
3
|
|
|
4
4
|
function VText(value, ownerComponent) {
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
5
|
+
this.cc_(-1 /* no children */, ownerComponent);
|
|
6
|
+
this.cd_ = value;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
VText.prototype = {
|
|
10
|
-
|
|
10
|
+
cv_: true,
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
ce_: 3,
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
return (host.ownerDocument || host).createTextNode(this.
|
|
14
|
+
bv_: function (host) {
|
|
15
|
+
return (host.ownerDocument || host).createTextNode(this.cd_);
|
|
16
16
|
},
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
return new VText(this.
|
|
18
|
+
bX_: function () {
|
|
19
|
+
return new VText(this.cd_);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var VElement = require("../vdom").
|
|
3
|
+
var VElement = require("../vdom").bE_;
|
|
4
4
|
var i = 0;
|
|
5
5
|
|
|
6
6
|
module.exports = function (tagName, attrs, childCount) {
|
|
@@ -13,12 +13,12 @@ function ConstVElement(tagName, attrs, childCount) {
|
|
|
13
13
|
|
|
14
14
|
ConstVElement.prototype = Object.create(VElement.prototype);
|
|
15
15
|
ConstVElement.prototype.e = function (tagName, attrs, childCount) {
|
|
16
|
-
var child = this.
|
|
16
|
+
var child = this.bW_(
|
|
17
17
|
new ConstVElement(tagName, attrs, childCount)
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
if (childCount === 0) {
|
|
21
|
-
return this.
|
|
21
|
+
return this.co_();
|
|
22
22
|
} else {
|
|
23
23
|
return child;
|
|
24
24
|
}
|
|
@@ -51,7 +51,7 @@ exports.t = runtime.t = function (typeName) {
|
|
|
51
51
|
instance.R_(input, out);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
instance.
|
|
54
|
+
instance.cw_ = true;
|
|
55
55
|
instance.ar_();
|
|
56
56
|
instance._z_ = false;
|
|
57
57
|
|
|
@@ -85,7 +85,7 @@ registry._I_ = function (typeName, id) {
|
|
|
85
85
|
if (instances) {
|
|
86
86
|
instances.add(instance);
|
|
87
87
|
instance.once("destroy", function () {
|
|
88
|
-
if (!instance.
|
|
88
|
+
if (!instance.cw_) {
|
|
89
89
|
instances.delete(instance);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
@@ -80,8 +80,8 @@ function createFragmentNode(startNode, nextNode, parentNode) {
|
|
|
80
80
|
|
|
81
81
|
function beginFragmentNode(startNode, parentNode) {
|
|
82
82
|
var fragment = createFragmentNode(startNode, null, parentNode);
|
|
83
|
-
fragment.
|
|
84
|
-
fragment.
|
|
83
|
+
fragment.cx_ = function (nextNode) {
|
|
84
|
+
fragment.cx_ = null;
|
|
85
85
|
insertBefore(
|
|
86
86
|
fragment.endNode,
|
|
87
87
|
nextNode,
|
|
@@ -92,4 +92,4 @@ function beginFragmentNode(startNode, parentNode) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
exports._m_ = createFragmentNode;
|
|
95
|
-
exports.
|
|
95
|
+
exports.cy_ = beginFragmentNode;
|
|
@@ -8,12 +8,12 @@ var normalizeComponentKey = componentsUtil._X_;
|
|
|
8
8
|
var domData = require("../../components/dom-data");
|
|
9
9
|
var eventDelegation = require("../../components/event-delegation");
|
|
10
10
|
var KeySequence = require("../../components/KeySequence");
|
|
11
|
-
var VElement = require("../vdom").
|
|
11
|
+
var VElement = require("../vdom").bE_;
|
|
12
12
|
var fragment = require("./fragment");
|
|
13
13
|
var helpers = require("./helpers");
|
|
14
14
|
var isTextOnly = require("../is-text-only");
|
|
15
|
-
var virtualizeElement = VElement.
|
|
16
|
-
var morphAttrs = VElement.
|
|
15
|
+
var virtualizeElement = VElement.cp_;
|
|
16
|
+
var morphAttrs = VElement.cq_;
|
|
17
17
|
var keysByDOMNode = domData._p_;
|
|
18
18
|
var componentByDOMNode = domData._r_;
|
|
19
19
|
var vElementByDOMNode = domData._N_;
|
|
@@ -21,11 +21,11 @@ var detachedByDOMNode = domData.aZ_;
|
|
|
21
21
|
|
|
22
22
|
var insertBefore = helpers.bi_;
|
|
23
23
|
var insertAfter = helpers.bj_;
|
|
24
|
-
var nextSibling = helpers.
|
|
24
|
+
var nextSibling = helpers.cu_;
|
|
25
25
|
var firstChild = helpers.aD_;
|
|
26
26
|
var removeChild = helpers.bk_;
|
|
27
27
|
var createFragmentNode = fragment._m_;
|
|
28
|
-
var beginFragmentNode = fragment.
|
|
28
|
+
var beginFragmentNode = fragment.cy_;
|
|
29
29
|
|
|
30
30
|
var ELEMENT_NODE = 1;
|
|
31
31
|
var TEXT_NODE = 3;
|
|
@@ -43,7 +43,7 @@ function isAutoKey(key) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function compareNodeNames(fromEl, toEl) {
|
|
46
|
-
return fromEl.
|
|
46
|
+
return fromEl.cl_ === toEl.cl_;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function caseInsensitiveCompare(a, b) {
|
|
@@ -74,12 +74,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
74
74
|
ownerComponent,
|
|
75
75
|
parentComponent)
|
|
76
76
|
{
|
|
77
|
-
var realNode = vNode.
|
|
77
|
+
var realNode = vNode.bv_(host, parentEl.namespaceURI);
|
|
78
78
|
insertBefore(realNode, referenceEl, parentEl);
|
|
79
79
|
|
|
80
80
|
if (
|
|
81
|
-
vNode.
|
|
82
|
-
vNode.
|
|
81
|
+
vNode.ce_ === ELEMENT_NODE ||
|
|
82
|
+
vNode.ce_ === FRAGMENT_NODE)
|
|
83
83
|
{
|
|
84
84
|
if (key) {
|
|
85
85
|
keysByDOMNode.set(realNode, key);
|
|
@@ -88,7 +88,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
88
88
|
realNode;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
if (!isTextOnly(vNode.
|
|
91
|
+
if (!isTextOnly(vNode.cl_)) {
|
|
92
92
|
morphChildren(realNode, vNode, parentComponent);
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -162,9 +162,9 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
162
162
|
var fromComponent;
|
|
163
163
|
|
|
164
164
|
outer: while (curToNodeChild) {
|
|
165
|
-
toNextSibling = curToNodeChild.
|
|
166
|
-
curToNodeType = curToNodeChild.
|
|
167
|
-
curToNodeKey = curToNodeChild.
|
|
165
|
+
toNextSibling = curToNodeChild.cu_;
|
|
166
|
+
curToNodeType = curToNodeChild.ce_;
|
|
167
|
+
curToNodeKey = curToNodeChild.cf_;
|
|
168
168
|
|
|
169
169
|
// Skip <!doctype>
|
|
170
170
|
if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {
|
|
@@ -283,7 +283,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
283
283
|
|
|
284
284
|
if (
|
|
285
285
|
curVFromNodeChild &&
|
|
286
|
-
curToNodeType === curVFromNodeChild.
|
|
286
|
+
curToNodeType === curVFromNodeChild.ce_ && (
|
|
287
287
|
curToNodeType !== ELEMENT_NODE ||
|
|
288
288
|
compareNodeNames(curToNodeChild, curVFromNodeChild)))
|
|
289
289
|
{
|
|
@@ -328,11 +328,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
328
328
|
curToNodeChild.ag_ ||
|
|
329
329
|
caseInsensitiveCompare(
|
|
330
330
|
curFromNodeChild.nodeName,
|
|
331
|
-
curToNodeChild.
|
|
331
|
+
curToNodeChild.cl_ || ""
|
|
332
332
|
)))
|
|
333
333
|
{
|
|
334
334
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
|
335
|
-
curVFromNodeChild.
|
|
335
|
+
curVFromNodeChild.cl_ = curToNodeChild.cl_;
|
|
336
336
|
keysByDOMNode.set(curFromNodeChild, curToNodeKey);
|
|
337
337
|
referenceComponent.L_[curToNodeKey] =
|
|
338
338
|
curFromNodeChild;
|
|
@@ -352,7 +352,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
352
352
|
curFromNodeChild = fromNextSibling;
|
|
353
353
|
continue;
|
|
354
354
|
} else if (
|
|
355
|
-
curToNodeChild.
|
|
355
|
+
curToNodeChild.ce_ === FRAGMENT_NODE &&
|
|
356
356
|
curFromNodeChild.nodeType === COMMENT_NODE)
|
|
357
357
|
{
|
|
358
358
|
var content = curFromNodeChild.nodeValue;
|
|
@@ -418,7 +418,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
418
418
|
|
|
419
419
|
if (
|
|
420
420
|
curVFromNodeChild &&
|
|
421
|
-
curToNodeType === curVFromNodeChild.
|
|
421
|
+
curToNodeType === curVFromNodeChild.ce_ && (
|
|
422
422
|
curToNodeType !== ELEMENT_NODE ||
|
|
423
423
|
compareNodeNames(curVFromNodeChild, curToNodeChild)))
|
|
424
424
|
{
|
|
@@ -436,7 +436,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
436
436
|
|
|
437
437
|
if (
|
|
438
438
|
toNextSibling &&
|
|
439
|
-
toNextSibling.
|
|
439
|
+
toNextSibling.cf_ === curFromNodeKey)
|
|
440
440
|
{
|
|
441
441
|
// Single element swap
|
|
442
442
|
|
|
@@ -549,18 +549,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
549
549
|
|
|
550
550
|
if (
|
|
551
551
|
caseInsensitiveCompare(
|
|
552
|
-
curVFromNodeChild.
|
|
553
|
-
curToNodeChild.
|
|
552
|
+
curVFromNodeChild.cl_,
|
|
553
|
+
curToNodeChild.cl_
|
|
554
554
|
))
|
|
555
555
|
{
|
|
556
|
-
curVFromNodeChild.
|
|
556
|
+
curVFromNodeChild.cl_ = curToNodeChild.cl_;
|
|
557
557
|
}
|
|
558
558
|
} else {
|
|
559
559
|
// Skip over nodes that don't look like ours...
|
|
560
560
|
curFromNodeChild = fromNextSibling;
|
|
561
561
|
continue;
|
|
562
562
|
}
|
|
563
|
-
} else if (curVFromNodeChild.
|
|
563
|
+
} else if (curVFromNodeChild.cf_) {
|
|
564
564
|
// We have a keyed element here but our target VDOM node
|
|
565
565
|
// is not keyed so this not doesn't belong
|
|
566
566
|
isCompatible = false;
|
|
@@ -587,18 +587,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
587
587
|
{
|
|
588
588
|
// Both nodes being compared are Text or Comment nodes
|
|
589
589
|
isCompatible = true;
|
|
590
|
-
var curToNodeValue = curToNodeChild.
|
|
590
|
+
var curToNodeValue = curToNodeChild.cd_;
|
|
591
591
|
var curFromNodeValue = curFromNodeChild.nodeValue;
|
|
592
592
|
if (curFromNodeValue !== curToNodeValue) {
|
|
593
593
|
if (
|
|
594
594
|
isHydrate &&
|
|
595
595
|
toNextSibling &&
|
|
596
596
|
curFromNodeType === TEXT_NODE &&
|
|
597
|
-
toNextSibling.
|
|
597
|
+
toNextSibling.ce_ === TEXT_NODE &&
|
|
598
598
|
curFromNodeValue.startsWith(curToNodeValue) &&
|
|
599
599
|
curFromNodeValue.
|
|
600
600
|
slice(curToNodeValue.length).
|
|
601
|
-
startsWith(toNextSibling.
|
|
601
|
+
startsWith(toNextSibling.cd_))
|
|
602
602
|
{
|
|
603
603
|
// In hydrate mode we can use splitText to more efficiently handle
|
|
604
604
|
// adjacent text vdom nodes that were merged.
|
|
@@ -643,10 +643,10 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
// We have processed all of the "to nodes".
|
|
646
|
-
if (fromNode.
|
|
646
|
+
if (fromNode.cx_) {
|
|
647
647
|
// If we are in an unfinished fragment, we have reached the end of the nodes
|
|
648
648
|
// we were matching up and need to end the fragment
|
|
649
|
-
fromNode.
|
|
649
|
+
fromNode.cx_(curFromNodeChild);
|
|
650
650
|
} else {
|
|
651
651
|
// If curFromNodeChild is non-null then we still have some from nodes
|
|
652
652
|
// left over that need to be removed
|
|
@@ -686,11 +686,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
686
686
|
}
|
|
687
687
|
|
|
688
688
|
function morphEl(fromEl, vFromEl, toEl, parentComponent) {
|
|
689
|
-
var nodeName = toEl.
|
|
690
|
-
var constId = toEl.
|
|
689
|
+
var nodeName = toEl.cl_;
|
|
690
|
+
var constId = toEl.cn_;
|
|
691
691
|
vElementByDOMNode.set(fromEl, toEl);
|
|
692
692
|
|
|
693
|
-
if (constId !== undefined && vFromEl.
|
|
693
|
+
if (constId !== undefined && vFromEl.cn_ === constId) {
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
696
|
|
|
@@ -701,11 +701,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
701
701
|
}
|
|
702
702
|
|
|
703
703
|
if (isTextOnly(nodeName)) {
|
|
704
|
-
if (toEl.
|
|
704
|
+
if (toEl.cm_ !== vFromEl.cm_) {
|
|
705
705
|
if (nodeName === "textarea") {
|
|
706
|
-
fromEl.value = toEl.
|
|
706
|
+
fromEl.value = toEl.cm_;
|
|
707
707
|
} else {
|
|
708
|
-
fromEl.textContent = toEl.
|
|
708
|
+
fromEl.textContent = toEl.cm_;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
} else {
|
|
@@ -12,7 +12,7 @@ var specialHtmlRegexp = /[&<]/;
|
|
|
12
12
|
function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
|
13
13
|
var curChild = node.firstChild;
|
|
14
14
|
while (curChild) {
|
|
15
|
-
vdomParent.
|
|
15
|
+
vdomParent.bW_(virtualize(curChild, ownerComponent));
|
|
16
16
|
curChild = curChild.nextSibling;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -20,7 +20,7 @@ function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
|
|
20
20
|
function virtualize(node, ownerComponent) {
|
|
21
21
|
switch (node.nodeType) {
|
|
22
22
|
case 1:
|
|
23
|
-
return VElement.
|
|
23
|
+
return VElement.cp_(node, virtualizeChildNodes, ownerComponent);
|
|
24
24
|
case 3:
|
|
25
25
|
return new VText(node.nodeValue, ownerComponent);
|
|
26
26
|
case 8:
|
|
@@ -43,7 +43,7 @@ function virtualizeHTML(html, ownerComponent) {
|
|
|
43
43
|
|
|
44
44
|
while (curChild) {
|
|
45
45
|
virtualized = virtualize(curChild, ownerComponent);
|
|
46
|
-
if (virtualized) vdomFragment.
|
|
46
|
+
if (virtualized) vdomFragment.bW_(virtualized);
|
|
47
47
|
curChild = curChild.nextSibling;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -70,19 +70,19 @@ Node_prototype.t = function (value) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
this.
|
|
74
|
-
return this.
|
|
73
|
+
this.bW_(vdomNode || new VText(value.toString()));
|
|
74
|
+
return this.co_();
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
Node_prototype.
|
|
78
|
-
return this.
|
|
77
|
+
Node_prototype.ca_ = function () {
|
|
78
|
+
return this.bW_(new VDocumentFragment());
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
exports.
|
|
82
|
-
exports.
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.
|
|
81
|
+
exports.bF_ = VComment;
|
|
82
|
+
exports.bG_ = VDocumentFragment;
|
|
83
|
+
exports.bE_ = VElement;
|
|
84
|
+
exports.bH_ = VText;
|
|
85
|
+
exports.bI_ = VComponent;
|
|
86
|
+
exports.bJ_ = VFragment;
|
|
87
|
+
exports.cp_ = virtualize;
|
|
88
|
+
exports.bK_ = virtualizeHTML;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _escapeRegexp = require("./escape-regexp");function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
4
4
|
|
|
5
|
-
const COMPONENT_FILES_KEY = "
|
|
5
|
+
const COMPONENT_FILES_KEY = "cz_";
|
|
6
6
|
|
|
7
7
|
function getComponentFiles({ hub: { file } }) {
|
|
8
8
|
const meta = file.metadata.marko;
|
|
@@ -130,7 +130,8 @@ function translateLoadTag(path, tagName, relativePath) {
|
|
|
130
130
|
);
|
|
131
131
|
loadArgs = [
|
|
132
132
|
_compiler.types.stringLiteral(childFile.metadata.marko.id),
|
|
133
|
-
_compiler.types.identifier(tagName)
|
|
133
|
+
_compiler.types.identifier(tagName),
|
|
134
|
+
(0, _babelUtils.importNamed)(file, linkAssets.runtime, "flush", "marko_asset_flush")];
|
|
134
135
|
|
|
135
136
|
if (triggers) loadArgs.push(_compiler.types.valueToNode(triggers));
|
|
136
137
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "5.39.
|
|
3
|
+
"version": "5.39.45",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
|
6
6
|
"keywords": [
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"types": "index.d.ts",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@marko/compiler": "^5.42.8",
|
|
71
|
-
"@marko/runtime-tags": "^6.
|
|
71
|
+
"@marko/runtime-tags": "^6.4.2",
|
|
72
72
|
"app-module-path": "^2.2.0",
|
|
73
73
|
"argly": "^1.2.0",
|
|
74
74
|
"browser-refresh-client": "1.1.4",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"warp10": "^2.1.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"marko": "5.39.
|
|
87
|
+
"marko": "5.39.45"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=22"
|
|
@@ -9,7 +9,6 @@ var DEFAULT_RUNTIME_ID = "M";
|
|
|
9
9
|
var kAssets = Symbol();
|
|
10
10
|
var kBlockIndex = Symbol();
|
|
11
11
|
var kDeferIndex = Symbol();
|
|
12
|
-
var assetFlush;
|
|
13
12
|
|
|
14
13
|
exports.withPageAssets = function withPageAssets(
|
|
15
14
|
typeId,
|
|
@@ -17,7 +16,6 @@ exports.withPageAssets = function withPageAssets(
|
|
|
17
16
|
runtime,
|
|
18
17
|
runtimeId,
|
|
19
18
|
) {
|
|
20
|
-
assetFlush = runtime;
|
|
21
19
|
var flushBeforeInput = { renderBody: flush };
|
|
22
20
|
return createFacade(template, function (input, out) {
|
|
23
21
|
var g = out.global;
|
|
@@ -44,7 +42,7 @@ exports.withPageAssets = function withPageAssets(
|
|
|
44
42
|
var key = out.___assignedKey;
|
|
45
43
|
var def = out.___assignedComponentDef;
|
|
46
44
|
var component = def && def.___component;
|
|
47
|
-
addAsset(g, typeId);
|
|
45
|
+
addAsset(g, typeId, runtime);
|
|
48
46
|
|
|
49
47
|
if (hasAssets) {
|
|
50
48
|
if (willRerender(def)) {
|
|
@@ -69,26 +67,44 @@ exports.withPageAssets = function withPageAssets(
|
|
|
69
67
|
});
|
|
70
68
|
};
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
// Its importer passes the bundler's resolver, so it resolves on a page of either
|
|
71
|
+
// API, whichever page entry rendered.
|
|
72
|
+
exports.withLoadAssets = function withLoadAssets(
|
|
73
|
+
typeId,
|
|
74
|
+
template,
|
|
75
|
+
assetFlush,
|
|
76
|
+
triggers,
|
|
77
|
+
) {
|
|
73
78
|
return createFacade(template, function (input, out) {
|
|
74
79
|
var key = out.___assignedKey;
|
|
75
80
|
var def = out.___assignedComponentDef;
|
|
76
|
-
addAsset(out.global, typeId, triggers);
|
|
77
81
|
|
|
78
82
|
if (willRerender(def)) {
|
|
79
83
|
out.bf(key + "s", def.___component, true);
|
|
80
|
-
|
|
84
|
+
writeLoadAsset(out, typeId, assetFlush, triggers);
|
|
81
85
|
out.ef();
|
|
82
86
|
out.bf(key, def.___component, true);
|
|
83
87
|
template._(input, out);
|
|
84
88
|
out.ef();
|
|
85
89
|
} else {
|
|
86
|
-
|
|
90
|
+
writeLoadAsset(out, typeId, assetFlush, triggers);
|
|
87
91
|
template._(input, out);
|
|
88
92
|
}
|
|
89
93
|
});
|
|
90
94
|
};
|
|
91
95
|
|
|
96
|
+
// Within Tags content the Tags writer places it apart from what a `@catch` drops,
|
|
97
|
+
// and leaves the page's own entry to the page.
|
|
98
|
+
function writeLoadAsset(out, typeId, assetFlush, triggers) {
|
|
99
|
+
var tagsCompat = exports.___tagsCompat;
|
|
100
|
+
if (tagsCompat && tagsCompat.getChunk()) {
|
|
101
|
+
tagsCompat.writeLoadAsset(typeId, assetFlush, triggers);
|
|
102
|
+
} else {
|
|
103
|
+
addAsset(out.global, typeId, assetFlush, triggers);
|
|
104
|
+
flush(out);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
92
108
|
function createFacade(template, render) {
|
|
93
109
|
// Under hot reload the template's `_` is an accessor, which a normal
|
|
94
110
|
// assignment through the facade's prototype chain would invoke (storing
|
|
@@ -116,12 +132,12 @@ function flush(out) {
|
|
|
116
132
|
var di = g[kDeferIndex];
|
|
117
133
|
|
|
118
134
|
for (; bi < length; bi++) {
|
|
119
|
-
result +=
|
|
135
|
+
result += assets[bi].flush(g, "block", assets[bi].id);
|
|
120
136
|
}
|
|
121
137
|
|
|
122
138
|
for (; di < length; di++) {
|
|
123
139
|
var asset = assets[di];
|
|
124
|
-
var deferHTML =
|
|
140
|
+
var deferHTML = asset.flush(g, "defer", asset.id);
|
|
125
141
|
if (asset.triggers) {
|
|
126
142
|
if (deferHTML) out.script(triggerScript(deferHTML, asset.triggers));
|
|
127
143
|
} else {
|
|
@@ -134,17 +150,17 @@ function flush(out) {
|
|
|
134
150
|
out.write(result);
|
|
135
151
|
}
|
|
136
152
|
|
|
137
|
-
function addAsset(g, id, triggers) {
|
|
153
|
+
function addAsset(g, id, assetFlush, triggers) {
|
|
138
154
|
var assets = g[kAssets];
|
|
139
155
|
if (!assets) {
|
|
140
|
-
g[kAssets] = [{ id: id, triggers: triggers }];
|
|
156
|
+
g[kAssets] = [{ id: id, flush: assetFlush, triggers: triggers }];
|
|
141
157
|
g[kBlockIndex] = g[kDeferIndex] = 0;
|
|
142
158
|
} else if (
|
|
143
159
|
!assets.find(function (a) {
|
|
144
160
|
return a.id === id;
|
|
145
161
|
})
|
|
146
162
|
) {
|
|
147
|
-
assets.push({ id: id, triggers: triggers });
|
|
163
|
+
assets.push({ id: id, flush: assetFlush, triggers: triggers });
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
166
|
|