marko 5.32.15 → 5.33.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/markoc +1 -1
- package/dist/node_modules/@internal/components-entry/index.js +5 -7
- package/dist/runtime/helpers/dynamic-tag.js +5 -1
- package/dist/runtime/helpers/tags-compat-dom.js +265 -0
- package/dist/runtime/helpers/tags-compat-html.js +167 -0
- package/dist/runtime/html/AsyncStream.js +96 -13
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +3 -3
- package/dist/runtime/html/helpers/data-marko.js +1 -1
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/renderable.js +52 -3
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +67 -67
- package/dist/runtime/vdom/VComponent.js +3 -3
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +35 -35
- package/dist/runtime/vdom/VFragment.js +5 -5
- package/dist/runtime/vdom/VNode.js +31 -31
- 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 +31 -31
- package/dist/runtime/vdom/vdom.js +14 -14
- package/docs/compiler.md +1 -1
- package/index.d.ts +4 -6
- package/package.json +83 -83
- package/src/node_modules/@internal/components-entry/index.js +5 -7
- package/src/runtime/helpers/dynamic-tag.js +5 -1
- package/src/runtime/helpers/tags-compat-dom.js +265 -0
- package/src/runtime/helpers/tags-compat-html.js +167 -0
- package/src/runtime/html/AsyncStream.js +87 -4
- package/src/runtime/renderable.js +49 -0
@@ -6,16 +6,16 @@ var createFragmentNode = require("./morphdom/fragment")._h_;
|
|
6
6
|
var VNode = require("./VNode");
|
7
7
|
|
8
8
|
function VFragment(key, ownerComponent, preserve) {
|
9
|
-
this.
|
10
|
-
this.
|
9
|
+
this.c__(null /* childCount */, ownerComponent);
|
10
|
+
this.ca_ = key;
|
11
11
|
this.aa_ = preserve;
|
12
12
|
}
|
13
13
|
|
14
14
|
VFragment.prototype = {
|
15
|
-
|
16
|
-
|
15
|
+
cb_: 12,
|
16
|
+
bo_: function () {
|
17
17
|
var fragment = createFragmentNode();
|
18
|
-
keysByDOMNode.set(fragment, this.
|
18
|
+
keysByDOMNode.set(fragment, this.ca_);
|
19
19
|
vElementByDOMNode.set(fragment, this);
|
20
20
|
return fragment;
|
21
21
|
}
|
@@ -2,79 +2,79 @@
|
|
2
2
|
function VNode() {}
|
3
3
|
|
4
4
|
VNode.prototype = {
|
5
|
-
|
6
|
-
this.
|
7
|
-
this.
|
8
|
-
this.
|
9
|
-
this.
|
10
|
-
this.
|
11
|
-
this.
|
5
|
+
c__: function (finalChildCount, ownerComponent) {
|
6
|
+
this.co_ = finalChildCount;
|
7
|
+
this.cp_ = 0;
|
8
|
+
this.cf_ = null;
|
9
|
+
this.cq_ = null;
|
10
|
+
this.cc_ = null;
|
11
|
+
this.cd_ = null;
|
12
12
|
this._J_ = ownerComponent;
|
13
13
|
},
|
14
14
|
|
15
15
|
get ay_() {
|
16
|
-
var firstChild = this.
|
16
|
+
var firstChild = this.cf_;
|
17
17
|
|
18
|
-
if (firstChild && firstChild.
|
18
|
+
if (firstChild && firstChild.ce_) {
|
19
19
|
var nestedFirstChild = firstChild.ay_;
|
20
20
|
// The first child is a DocumentFragment node.
|
21
21
|
// If the DocumentFragment node has a first child then we will return that.
|
22
22
|
// Otherwise, the DocumentFragment node is not *really* the first child and
|
23
23
|
// we need to skip to its next sibling
|
24
|
-
return nestedFirstChild || firstChild.
|
24
|
+
return nestedFirstChild || firstChild.cr_;
|
25
25
|
}
|
26
26
|
|
27
27
|
return firstChild;
|
28
28
|
},
|
29
29
|
|
30
|
-
get
|
31
|
-
var nextSibling = this.
|
30
|
+
get cr_() {
|
31
|
+
var nextSibling = this.cd_;
|
32
32
|
|
33
33
|
if (nextSibling) {
|
34
|
-
if (nextSibling.
|
34
|
+
if (nextSibling.ce_) {
|
35
35
|
var firstChild = nextSibling.ay_;
|
36
|
-
return firstChild || nextSibling.
|
36
|
+
return firstChild || nextSibling.cr_;
|
37
37
|
}
|
38
38
|
} else {
|
39
|
-
var parentNode = this.
|
40
|
-
if (parentNode && parentNode.
|
41
|
-
return parentNode.
|
39
|
+
var parentNode = this.cc_;
|
40
|
+
if (parentNode && parentNode.ce_) {
|
41
|
+
return parentNode.cr_;
|
42
42
|
}
|
43
43
|
}
|
44
44
|
|
45
45
|
return nextSibling;
|
46
46
|
},
|
47
47
|
|
48
|
-
|
49
|
-
this.
|
48
|
+
bT_: function (child) {
|
49
|
+
this.cp_++;
|
50
50
|
|
51
|
-
if (this.
|
52
|
-
if (child.
|
53
|
-
var childValue = child.
|
54
|
-
this.
|
51
|
+
if (this.ch_ === "textarea") {
|
52
|
+
if (child.cs_) {
|
53
|
+
var childValue = child.ct_;
|
54
|
+
this.ci_ = (this.ci_ || "") + childValue;
|
55
55
|
} else {
|
56
56
|
throw TypeError();
|
57
57
|
}
|
58
58
|
} else {
|
59
|
-
var lastChild = this.
|
59
|
+
var lastChild = this.cq_;
|
60
60
|
|
61
|
-
child.
|
61
|
+
child.cc_ = this;
|
62
62
|
|
63
63
|
if (lastChild) {
|
64
|
-
lastChild.
|
64
|
+
lastChild.cd_ = child;
|
65
65
|
} else {
|
66
|
-
this.
|
66
|
+
this.cf_ = child;
|
67
67
|
}
|
68
68
|
|
69
|
-
this.
|
69
|
+
this.cq_ = child;
|
70
70
|
}
|
71
71
|
|
72
72
|
return child;
|
73
73
|
},
|
74
74
|
|
75
|
-
|
76
|
-
if (this.
|
77
|
-
return this.
|
75
|
+
ck_: function finishChild() {
|
76
|
+
if (this.cp_ === this.co_ && this.cc_) {
|
77
|
+
return this.cc_.ck_();
|
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.c__(-1 /* no children */, ownerComponent);
|
6
|
+
this.ct_ = value;
|
7
7
|
}
|
8
8
|
|
9
9
|
VText.prototype = {
|
10
|
-
|
10
|
+
cs_: true,
|
11
11
|
|
12
|
-
|
12
|
+
cb_: 3,
|
13
13
|
|
14
|
-
|
15
|
-
return (host.ownerDocument || host).createTextNode(this.
|
14
|
+
bo_: function (host) {
|
15
|
+
return (host.ownerDocument || host).createTextNode(this.ct_);
|
16
16
|
},
|
17
17
|
|
18
|
-
|
19
|
-
return new VText(this.
|
18
|
+
bU_: function () {
|
19
|
+
return new VText(this.ct_);
|
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").bC_;
|
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.bT_(
|
17
17
|
new ConstVElement(tagName, attrs, childCount)
|
18
18
|
);
|
19
19
|
|
20
20
|
if (childCount === 0) {
|
21
|
-
return this.
|
21
|
+
return this.ck_();
|
22
22
|
} else {
|
23
23
|
return child;
|
24
24
|
}
|
@@ -44,7 +44,7 @@ exports.t = runtime.t = function (typeName) {
|
|
44
44
|
instance.P_(input, out);
|
45
45
|
};
|
46
46
|
|
47
|
-
instance.
|
47
|
+
instance.cu_ = true;
|
48
48
|
instance.am_();
|
49
49
|
instance._t_ = false;
|
50
50
|
|
@@ -78,7 +78,7 @@ registry._C_ = function (typeName, id) {
|
|
78
78
|
if (instances) {
|
79
79
|
instances.add(instance);
|
80
80
|
instance.once("destroy", function () {
|
81
|
-
if (!instance.
|
81
|
+
if (!instance.cu_) {
|
82
82
|
instances.delete(instance);
|
83
83
|
}
|
84
84
|
});
|
@@ -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.cv_ = function (nextNode) {
|
84
|
+
fragment.cv_ = 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._h_ = createFragmentNode;
|
95
|
-
exports.
|
95
|
+
exports.cw_ = beginFragmentNode;
|
@@ -8,11 +8,11 @@ var normalizeComponentKey = componentsUtil._R_;
|
|
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").bC_;
|
12
12
|
var fragment = require("./fragment");
|
13
13
|
var helpers = require("./helpers");
|
14
|
-
var virtualizeElement = VElement.
|
15
|
-
var morphAttrs = VElement.
|
14
|
+
var virtualizeElement = VElement.cm_;
|
15
|
+
var morphAttrs = VElement.cn_;
|
16
16
|
var keysByDOMNode = domData._G_;
|
17
17
|
var componentByDOMNode = domData._l_;
|
18
18
|
var vElementByDOMNode = domData._H_;
|
@@ -20,11 +20,11 @@ var detachedByDOMNode = domData.aT_;
|
|
20
20
|
|
21
21
|
var insertBefore = helpers.bc_;
|
22
22
|
var insertAfter = helpers.bd_;
|
23
|
-
var nextSibling = helpers.
|
23
|
+
var nextSibling = helpers.cr_;
|
24
24
|
var firstChild = helpers.ay_;
|
25
25
|
var removeChild = helpers.be_;
|
26
26
|
var createFragmentNode = fragment._h_;
|
27
|
-
var beginFragmentNode = fragment.
|
27
|
+
var beginFragmentNode = fragment.cw_;
|
28
28
|
|
29
29
|
var ELEMENT_NODE = 1;
|
30
30
|
var TEXT_NODE = 3;
|
@@ -42,7 +42,7 @@ function isAutoKey(key) {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
function compareNodeNames(fromEl, toEl) {
|
45
|
-
return fromEl.
|
45
|
+
return fromEl.ch_ === toEl.ch_;
|
46
46
|
}
|
47
47
|
|
48
48
|
function caseInsensitiveCompare(a, b) {
|
@@ -73,12 +73,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
73
73
|
ownerComponent,
|
74
74
|
parentComponent)
|
75
75
|
{
|
76
|
-
var realNode = vNode.
|
76
|
+
var realNode = vNode.bo_(host, parentEl.namespaceURI);
|
77
77
|
insertBefore(realNode, referenceEl, parentEl);
|
78
78
|
|
79
79
|
if (
|
80
|
-
vNode.
|
81
|
-
vNode.
|
80
|
+
vNode.cb_ === ELEMENT_NODE ||
|
81
|
+
vNode.cb_ === FRAGMENT_NODE)
|
82
82
|
{
|
83
83
|
if (key) {
|
84
84
|
keysByDOMNode.set(realNode, key);
|
@@ -87,7 +87,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
87
87
|
realNode;
|
88
88
|
}
|
89
89
|
|
90
|
-
if (vNode.
|
90
|
+
if (vNode.ch_ !== "textarea") {
|
91
91
|
morphChildren(realNode, vNode, parentComponent);
|
92
92
|
}
|
93
93
|
|
@@ -161,9 +161,9 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
161
161
|
var fromComponent;
|
162
162
|
|
163
163
|
outer: while (curToNodeChild) {
|
164
|
-
toNextSibling = curToNodeChild.
|
165
|
-
curToNodeType = curToNodeChild.
|
166
|
-
curToNodeKey = curToNodeChild.
|
164
|
+
toNextSibling = curToNodeChild.cr_;
|
165
|
+
curToNodeType = curToNodeChild.cb_;
|
166
|
+
curToNodeKey = curToNodeChild.ca_;
|
167
167
|
|
168
168
|
// Skip <!doctype>
|
169
169
|
if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {
|
@@ -282,7 +282,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
282
282
|
|
283
283
|
if (
|
284
284
|
curVFromNodeChild &&
|
285
|
-
curToNodeType === curVFromNodeChild.
|
285
|
+
curToNodeType === curVFromNodeChild.cb_ && (
|
286
286
|
curToNodeType !== ELEMENT_NODE ||
|
287
287
|
compareNodeNames(curToNodeChild, curVFromNodeChild)))
|
288
288
|
{
|
@@ -327,11 +327,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
327
327
|
curToNodeChild.aa_ ||
|
328
328
|
caseInsensitiveCompare(
|
329
329
|
curFromNodeChild.nodeName,
|
330
|
-
curToNodeChild.
|
330
|
+
curToNodeChild.ch_ || ""
|
331
331
|
)))
|
332
332
|
{
|
333
333
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
334
|
-
curVFromNodeChild.
|
334
|
+
curVFromNodeChild.ch_ = curToNodeChild.ch_;
|
335
335
|
keysByDOMNode.set(curFromNodeChild, curToNodeKey);
|
336
336
|
referenceComponent.J_[curToNodeKey] =
|
337
337
|
curFromNodeChild;
|
@@ -351,7 +351,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
351
351
|
curFromNodeChild = fromNextSibling;
|
352
352
|
continue;
|
353
353
|
} else if (
|
354
|
-
curToNodeChild.
|
354
|
+
curToNodeChild.cb_ === FRAGMENT_NODE &&
|
355
355
|
curFromNodeChild.nodeType === COMMENT_NODE)
|
356
356
|
{
|
357
357
|
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.cb_ && (
|
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.ca_ === 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.ch_,
|
553
|
+
curToNodeChild.ch_
|
554
554
|
))
|
555
555
|
{
|
556
|
-
curVFromNodeChild.
|
556
|
+
curVFromNodeChild.ch_ = curToNodeChild.ch_;
|
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 (curFromNodeKey = curVFromNodeChild.
|
563
|
+
} else if (curFromNodeKey = curVFromNodeChild.ca_) {
|
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,7 +587,7 @@ 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.ct_;
|
591
591
|
var curFromNodeValue = curFromNodeChild.nodeValue;
|
592
592
|
if (curFromNodeValue !== curToNodeValue) {
|
593
593
|
if (
|
@@ -638,10 +638,10 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
638
638
|
}
|
639
639
|
|
640
640
|
// We have processed all of the "to nodes".
|
641
|
-
if (fromNode.
|
641
|
+
if (fromNode.cv_) {
|
642
642
|
// If we are in an unfinished fragment, we have reached the end of the nodes
|
643
643
|
// we were matching up and need to end the fragment
|
644
|
-
fromNode.
|
644
|
+
fromNode.cv_(curFromNodeChild);
|
645
645
|
} else {
|
646
646
|
// If curFromNodeChild is non-null then we still have some from nodes
|
647
647
|
// left over that need to be removed
|
@@ -681,11 +681,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
681
681
|
}
|
682
682
|
|
683
683
|
function morphEl(fromEl, vFromEl, toEl, parentComponent) {
|
684
|
-
var nodeName = toEl.
|
685
|
-
var constId = toEl.
|
684
|
+
var nodeName = toEl.ch_;
|
685
|
+
var constId = toEl.cj_;
|
686
686
|
vElementByDOMNode.set(fromEl, toEl);
|
687
687
|
|
688
|
-
if (constId !== undefined && vFromEl.
|
688
|
+
if (constId !== undefined && vFromEl.cj_ === constId) {
|
689
689
|
return;
|
690
690
|
}
|
691
691
|
|
@@ -696,8 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
696
696
|
}
|
697
697
|
|
698
698
|
if (nodeName === "textarea") {
|
699
|
-
var newValue = toEl.
|
700
|
-
var oldValue = vFromEl.
|
699
|
+
var newValue = toEl.ci_ || "";
|
700
|
+
var oldValue = vFromEl.ci_ || "";
|
701
701
|
if (oldValue !== newValue) {
|
702
702
|
fromEl.value = newValue;
|
703
703
|
}
|
@@ -11,7 +11,7 @@ var specialHtmlRegexp = /[&<]/;
|
|
11
11
|
function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
12
12
|
var curChild = node.firstChild;
|
13
13
|
while (curChild) {
|
14
|
-
vdomParent.
|
14
|
+
vdomParent.bT_(virtualize(curChild, ownerComponent));
|
15
15
|
curChild = curChild.nextSibling;
|
16
16
|
}
|
17
17
|
}
|
@@ -19,7 +19,7 @@ function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
|
19
19
|
function virtualize(node, ownerComponent) {
|
20
20
|
switch (node.nodeType) {
|
21
21
|
case 1:
|
22
|
-
return VElement.
|
22
|
+
return VElement.cm_(node, virtualizeChildNodes, ownerComponent);
|
23
23
|
case 3:
|
24
24
|
return new VText(node.nodeValue, ownerComponent);
|
25
25
|
case 11:
|
@@ -38,7 +38,7 @@ function virtualizeHTML(html, ownerComponent) {
|
|
38
38
|
var curChild = parseHTML(html);
|
39
39
|
|
40
40
|
while (curChild) {
|
41
|
-
vdomFragment.
|
41
|
+
vdomFragment.bT_(virtualize(curChild, ownerComponent));
|
42
42
|
curChild = curChild.nextSibling;
|
43
43
|
}
|
44
44
|
|
@@ -65,18 +65,18 @@ Node_prototype.t = function (value) {
|
|
65
65
|
}
|
66
66
|
}
|
67
67
|
|
68
|
-
this.
|
69
|
-
return this.
|
68
|
+
this.bT_(vdomNode || new VText(value.toString()));
|
69
|
+
return this.ck_();
|
70
70
|
};
|
71
71
|
|
72
|
-
Node_prototype.
|
73
|
-
return this.
|
72
|
+
Node_prototype.bY_ = function () {
|
73
|
+
return this.bT_(new VDocumentFragment());
|
74
74
|
};
|
75
75
|
|
76
|
-
exports.
|
77
|
-
exports.
|
78
|
-
exports.
|
79
|
-
exports.
|
80
|
-
exports.
|
81
|
-
exports.
|
82
|
-
exports.
|
76
|
+
exports.bD_ = VDocumentFragment;
|
77
|
+
exports.bC_ = VElement;
|
78
|
+
exports.bE_ = VText;
|
79
|
+
exports.bF_ = VComponent;
|
80
|
+
exports.bG_ = VFragment;
|
81
|
+
exports.cm_ = virtualize;
|
82
|
+
exports.bH_ = virtualizeHTML;
|
package/docs/compiler.md
CHANGED
@@ -463,4 +463,4 @@ For full definitions, view the source code for Babel and Marko:
|
|
463
463
|
|
464
464
|
- [Babel’s Core Definitions](https://github.com/babel/babel/blob/master/packages/babel-types/src/definitions/core.js)
|
465
465
|
- [Babel’s Extended Definitions](https://github.com/babel/babel/tree/master/packages/babel-types/src/definitions)
|
466
|
-
- [Marko’s Definitions](https://github.com/marko-js/marko/blob/
|
466
|
+
- [Marko’s Definitions](https://github.com/marko-js/marko/blob/main/packages/compiler/src/babel-types/types/definitions.js)
|
package/index.d.ts
CHANGED
@@ -95,14 +95,12 @@ declare global {
|
|
95
95
|
| string;
|
96
96
|
|
97
97
|
/** Extract the return tag type from a renderBody. */
|
98
|
-
export type BodyReturnType<B> =
|
99
|
-
? Return
|
100
|
-
: never;
|
98
|
+
export type BodyReturnType<B> =
|
99
|
+
B extends Body<any, infer Return> ? Return : never;
|
101
100
|
|
102
101
|
/** Extract the tag parameter types received by a renderBody. */
|
103
|
-
export type BodyParameters<B> =
|
104
|
-
? Params
|
105
|
-
: never;
|
102
|
+
export type BodyParameters<B> =
|
103
|
+
B extends Body<infer Params, any> ? Params : never;
|
106
104
|
|
107
105
|
export class Component<Input = unknown, State = unknown>
|
108
106
|
implements Emitter
|