marko 5.33.1 → 5.33.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/runtime/helpers/tags-compat-dom.js +22 -11
- package/dist/runtime/helpers/tags-compat-html.js +14 -9
- package/dist/runtime/vdom/VElement.js +1 -1
- package/dist/runtime/vdom/VNode.js +1 -2
- package/dist/runtime/vdom/morphdom/index.js +2 -4
- package/package.json +1 -1
- package/src/runtime/helpers/tags-compat-dom.js +24 -13
- package/src/runtime/helpers/tags-compat-html.js +14 -9
- package/src/runtime/vdom/VElement.js +1 -1
- package/src/runtime/vdom/VNode.js +1 -2
- package/src/runtime/vdom/morphdom/index.js +2 -4
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
1
|
+
"use strict";const { _i_ } = require("@internal/components-util");
|
2
|
+
const { R_ } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const {
|
5
5
|
prepare,
|
@@ -14,13 +14,13 @@ const {
|
|
14
14
|
// eslint-disable-next-line no-constant-condition
|
15
15
|
"@marko/runtime-tags/dom"
|
16
16
|
);
|
17
|
-
const { _i_ } = require("@internal/components-util");
|
18
17
|
const defineComponent = require("../components/defineComponent");
|
19
18
|
const { r: registerComponent } = require("../components/registry");
|
20
19
|
const createRenderer = require("../components/renderer");
|
21
20
|
const defaultCreateOut = require("../createOut");
|
22
21
|
const morphdom = require("../vdom/morphdom");
|
23
|
-
const
|
22
|
+
const { _h_ } = require("../vdom/morphdom/fragment");
|
23
|
+
const dynamicTag = require("./dynamic-tag");
|
24
24
|
|
25
25
|
dynamicTag.bk_ = function tagsToVdom(
|
26
26
|
tagsRenderer,
|
@@ -43,7 +43,7 @@ const TagsCompat = createRenderer(
|
|
43
43
|
function (_, out, componentDef, component) {
|
44
44
|
let existing = false;
|
45
45
|
const isHydrate =
|
46
|
-
|
46
|
+
R_(out).o_._W_;
|
47
47
|
const input = Array.isArray(_.i) ? _.i : [_.i];
|
48
48
|
const tagsRenderer = resolveRegistered(_.r);
|
49
49
|
const args = tagsRenderer.bm_;
|
@@ -77,9 +77,14 @@ const TagsCompat = createRenderer(
|
|
77
77
|
}
|
78
78
|
out.ef();
|
79
79
|
},
|
80
|
+
// eslint-disable-next-line no-constant-condition
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
80
86
|
{
|
81
|
-
t: TagsCompatId
|
82
|
-
d: "MARKO_DEBUG"
|
87
|
+
t: TagsCompatId
|
83
88
|
},
|
84
89
|
{}
|
85
90
|
);
|
@@ -153,7 +158,7 @@ function create5to6Renderer(renderer, hasAttrs) {
|
|
153
158
|
},
|
154
159
|
bl_() {
|
155
160
|
const realFragment = document.createDocumentFragment();
|
156
|
-
|
161
|
+
_h_(null, null, realFragment);
|
157
162
|
return realFragment;
|
158
163
|
},
|
159
164
|
bs_: 1,
|
@@ -182,7 +187,7 @@ function renderAndMorph(scope, renderer, renderBody, input) {
|
|
182
187
|
}
|
183
188
|
const host = scope.bp_;
|
184
189
|
const existingComponent = scope.marko5Component;
|
185
|
-
const componentsContext =
|
190
|
+
const componentsContext = R_(out);
|
186
191
|
const globalComponentsContext = componentsContext.o_;
|
187
192
|
let customEvents;
|
188
193
|
globalComponentsContext.ax_ = existingComponent;
|
@@ -243,10 +248,16 @@ const RenderBodyComponent = createRenderer(
|
|
243
248
|
"0"
|
244
249
|
);
|
245
250
|
},
|
251
|
+
// eslint-disable-next-line no-constant-condition
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
246
258
|
{
|
247
259
|
t: RenderBodyComponentId,
|
248
|
-
i: true
|
249
|
-
d: "MARKO_DEBUG"
|
260
|
+
i: true
|
250
261
|
},
|
251
262
|
{}
|
252
263
|
);
|
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
1
|
+
"use strict";const initComponentsTag = require("../../core-tags/components/init-components-tag");
|
2
|
+
const { R_ } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const tagsAPI = require(
|
5
5
|
// eslint-disable-next-line no-constant-condition
|
@@ -28,7 +28,7 @@ const FN_TO_JSON = function () {
|
|
28
28
|
};
|
29
29
|
|
30
30
|
const isMarko6 = (fn) => !!fn.bt_;
|
31
|
-
const isMarko5 = (fn) => !fn.bt_;
|
31
|
+
const isMarko5 = (fn) => !fn.bt_;
|
32
32
|
|
33
33
|
dynamicTag5.bk_ = function tagsToVdom(
|
34
34
|
tagsRenderer,
|
@@ -68,9 +68,14 @@ const TagsCompat = createRenderer(
|
|
68
68
|
renderFn(out.beginAsync(), input, {}, streamData);
|
69
69
|
out.ef();
|
70
70
|
},
|
71
|
+
// eslint-disable-next-line no-constant-condition
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
71
77
|
{
|
72
|
-
t: TagsCompatId
|
73
|
-
d: "MARKO_DEBUG"
|
78
|
+
t: TagsCompatId
|
74
79
|
},
|
75
80
|
{}
|
76
81
|
);
|
@@ -115,7 +120,7 @@ patchDynamicTag(
|
|
115
120
|
renderBody5(out, input, ...args);
|
116
121
|
}
|
117
122
|
|
118
|
-
const componentsContext =
|
123
|
+
const componentsContext = R_(out);
|
119
124
|
const component = componentsContext.b_[0];
|
120
125
|
if (component) {
|
121
126
|
component.r_.U_ = customEvents;
|
@@ -124,7 +129,7 @@ patchDynamicTag(
|
|
124
129
|
});
|
125
130
|
}
|
126
131
|
|
127
|
-
(
|
132
|
+
initComponentsTag({}, out);
|
128
133
|
|
129
134
|
let async;
|
130
135
|
out.once("finish", (result) => {
|
@@ -154,7 +159,7 @@ function dummyCreate5to6Renderer() {}
|
|
154
159
|
|
155
160
|
register(dummyCreate5to6Renderer, "@marko/tags-compat-5-to-6");
|
156
161
|
|
157
|
-
function serialized5to6(renderer, id) {
|
162
|
+
exports.serialized5to6 = function serialized5to6(renderer, id) {
|
158
163
|
const dummyRenderer = () => {};
|
159
164
|
register(dummyRenderer, id);
|
160
165
|
return makeSerializable(renderer, (s) =>
|
@@ -164,4 +169,4 @@ function serialized5to6(renderer, id) {
|
|
164
169
|
value(dummyRenderer).
|
165
170
|
code(",!0)")
|
166
171
|
);
|
167
|
-
}
|
172
|
+
};
|
@@ -696,10 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
696
696
|
}
|
697
697
|
|
698
698
|
if (nodeName === "textarea") {
|
699
|
-
|
700
|
-
|
701
|
-
if (oldValue !== newValue) {
|
702
|
-
fromEl.value = newValue;
|
699
|
+
if (toEl.ci_ !== vFromEl.ci_) {
|
700
|
+
fromEl.value = toEl.ci_;
|
703
701
|
}
|
704
702
|
} else {
|
705
703
|
morphChildren(fromEl, toEl, parentComponent);
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
const { ___componentLookup } = require("@internal/components-util");
|
2
|
+
const { ___getComponentsContext } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const {
|
5
5
|
prepare,
|
@@ -14,15 +14,15 @@ const {
|
|
14
14
|
// eslint-disable-next-line no-constant-condition
|
15
15
|
"MARKO_DEBUG" ? "@marko/runtime-tags/debug/dom" : "@marko/runtime-tags/dom",
|
16
16
|
);
|
17
|
-
const { ___componentLookup } = require("@internal/components-util");
|
18
17
|
const defineComponent = require("../components/defineComponent");
|
19
18
|
const { r: registerComponent } = require("../components/registry");
|
20
19
|
const createRenderer = require("../components/renderer");
|
21
20
|
const defaultCreateOut = require("../createOut");
|
22
21
|
const morphdom = require("../vdom/morphdom");
|
22
|
+
const { ___createFragmentNode } = require("../vdom/morphdom/fragment");
|
23
23
|
const dynamicTag = require("./dynamic-tag");
|
24
24
|
|
25
|
-
|
25
|
+
dynamicTag.___runtimeCompat = function tagsToVdom(
|
26
26
|
tagsRenderer,
|
27
27
|
renderBody,
|
28
28
|
args,
|
@@ -77,10 +77,15 @@ const TagsCompat = createRenderer(
|
|
77
77
|
}
|
78
78
|
out.ef();
|
79
79
|
},
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
// eslint-disable-next-line no-constant-condition
|
81
|
+
"MARKO_DEBUG"
|
82
|
+
? {
|
83
|
+
t: TagsCompatId,
|
84
|
+
d: true,
|
85
|
+
}
|
86
|
+
: {
|
87
|
+
t: TagsCompatId,
|
88
|
+
},
|
84
89
|
{},
|
85
90
|
);
|
86
91
|
|
@@ -243,11 +248,17 @@ const RenderBodyComponent = createRenderer(
|
|
243
248
|
"0",
|
244
249
|
);
|
245
250
|
},
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
+
// eslint-disable-next-line no-constant-condition
|
252
|
+
"MARKO_DEBUG"
|
253
|
+
? {
|
254
|
+
t: RenderBodyComponentId,
|
255
|
+
i: true,
|
256
|
+
d: true,
|
257
|
+
}
|
258
|
+
: {
|
259
|
+
t: RenderBodyComponentId,
|
260
|
+
i: true,
|
261
|
+
},
|
251
262
|
{},
|
252
263
|
);
|
253
264
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
const initComponentsTag = require("../../core-tags/components/init-components-tag");
|
2
|
+
const { ___getComponentsContext } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const tagsAPI = require(
|
5
5
|
// eslint-disable-next-line no-constant-condition
|
@@ -30,7 +30,7 @@ const FN_TO_JSON = function () {
|
|
30
30
|
const isMarko6 = (fn) => !!fn.___isTagsAPI;
|
31
31
|
const isMarko5 = (fn) => !fn.___isTagsAPI;
|
32
32
|
|
33
|
-
|
33
|
+
dynamicTag5.___runtimeCompat = function tagsToVdom(
|
34
34
|
tagsRenderer,
|
35
35
|
renderBody,
|
36
36
|
args,
|
@@ -68,10 +68,15 @@ const TagsCompat = createRenderer(
|
|
68
68
|
renderFn(out.beginAsync(), input, {}, streamData);
|
69
69
|
out.ef();
|
70
70
|
},
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
// eslint-disable-next-line no-constant-condition
|
72
|
+
"MARKO_DEBUG"
|
73
|
+
? {
|
74
|
+
t: TagsCompatId,
|
75
|
+
d: true,
|
76
|
+
}
|
77
|
+
: {
|
78
|
+
t: TagsCompatId,
|
79
|
+
},
|
75
80
|
{},
|
76
81
|
);
|
77
82
|
|
@@ -154,7 +159,7 @@ function dummyCreate5to6Renderer() {}
|
|
154
159
|
|
155
160
|
register(dummyCreate5to6Renderer, "@marko/tags-compat-5-to-6");
|
156
161
|
|
157
|
-
|
162
|
+
exports.serialized5to6 = function serialized5to6(renderer, id) {
|
158
163
|
const dummyRenderer = () => {};
|
159
164
|
register(dummyRenderer, id);
|
160
165
|
return makeSerializable(renderer, (s) =>
|
@@ -164,4 +169,4 @@ export function serialized5to6(renderer, id) {
|
|
164
169
|
.value(dummyRenderer)
|
165
170
|
.code(",!0)"),
|
166
171
|
);
|
167
|
-
}
|
172
|
+
};
|
@@ -116,7 +116,7 @@ function VElement(
|
|
116
116
|
this.___attributes = attrs || EMPTY_OBJECT;
|
117
117
|
this.___properties = props || EMPTY_OBJECT;
|
118
118
|
this.___nodeName = tagName;
|
119
|
-
this.___valueInternal =
|
119
|
+
this.___valueInternal = "";
|
120
120
|
this.___constId = constId;
|
121
121
|
this.___preserve = false;
|
122
122
|
this.___preserveBody = false;
|
@@ -50,8 +50,7 @@ VNode.prototype = {
|
|
50
50
|
|
51
51
|
if (this.___nodeName === "textarea") {
|
52
52
|
if (child.___Text) {
|
53
|
-
|
54
|
-
this.___valueInternal = (this.___valueInternal || "") + childValue;
|
53
|
+
this.___valueInternal += child.___nodeValue;
|
55
54
|
} else {
|
56
55
|
throw TypeError();
|
57
56
|
}
|
@@ -696,10 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
696
696
|
}
|
697
697
|
|
698
698
|
if (nodeName === "textarea") {
|
699
|
-
|
700
|
-
|
701
|
-
if (oldValue !== newValue) {
|
702
|
-
fromEl.value = newValue;
|
699
|
+
if (toEl.___valueInternal !== vFromEl.___valueInternal) {
|
700
|
+
fromEl.value = toEl.___valueInternal;
|
703
701
|
}
|
704
702
|
} else {
|
705
703
|
morphChildren(fromEl, toEl, parentComponent);
|