marko 5.37.45 → 5.37.46
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/tags-compat/runtime-dom.js +24 -30
- package/dist/runtime/helpers/tags-compat/runtime-html.js +3 -1
- package/dist/runtime/html/AsyncStream.js +8 -8
- 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 +6 -6
- package/dist/runtime/vdom/VElement.js +30 -30
- 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/package.json +1 -1
- package/src/runtime/helpers/tags-compat/runtime-dom.js +20 -26
- package/src/runtime/helpers/tags-compat/runtime-html.js +3 -1
@@ -9,6 +9,8 @@ const defaultCreateOut = require("../../createOut");
|
|
9
9
|
const morphdom = require("../../vdom/morphdom");
|
10
10
|
const { ___createFragmentNode } = require("../../vdom/morphdom/fragment");
|
11
11
|
const dynamicTag = require("../dynamic-tag");
|
12
|
+
const Component = require("../../components/Component");
|
13
|
+
const noopRenderer = require("../serialize-noop").___noop;
|
12
14
|
|
13
15
|
exports.p = function (domCompat) {
|
14
16
|
dynamicTag.___runtimeCompat = function tagsToVdom(
|
@@ -31,6 +33,19 @@ exports.p = function (domCompat) {
|
|
31
33
|
return renderer;
|
32
34
|
};
|
33
35
|
|
36
|
+
Component.prototype.___setCustomEventsOriginal =
|
37
|
+
Component.prototype.___setCustomEvents;
|
38
|
+
Component.prototype.___setCustomEvents = function (customEvents, scopeId) {
|
39
|
+
for (const customEvent of customEvents) {
|
40
|
+
customEvent[1] = domCompat.resolveRegistered(
|
41
|
+
customEvent[1],
|
42
|
+
this.___global,
|
43
|
+
);
|
44
|
+
}
|
45
|
+
|
46
|
+
this.___setCustomEventsOriginal(customEvents, scopeId);
|
47
|
+
};
|
48
|
+
|
34
49
|
const TagsCompatId = "tags-compat";
|
35
50
|
const TagsCompat = createRenderer(
|
36
51
|
function (_, out, componentDef, component) {
|
@@ -68,13 +83,6 @@ exports.p = function (domCompat) {
|
|
68
83
|
),
|
69
84
|
}));
|
70
85
|
|
71
|
-
// (
|
72
|
-
// nodeAccessor: Accessor,
|
73
|
-
// dynamicTagAttrs?: IntersectionSignal,
|
74
|
-
// intersection?: IntersectionSignal,
|
75
|
-
// valueWithIntersection?: ValueSignal
|
76
|
-
// )
|
77
|
-
|
78
86
|
const rendererCache = new WeakMap();
|
79
87
|
|
80
88
|
domCompat.patchDynamicTag((dynamicTag) => (...args) => {
|
@@ -87,6 +95,10 @@ exports.p = function (domCompat) {
|
|
87
95
|
function create5to6Renderer(renderer) {
|
88
96
|
let newRenderer = renderer;
|
89
97
|
if (renderer && typeof renderer !== "string") {
|
98
|
+
if (renderer === noopRenderer) {
|
99
|
+
return noopRenderer;
|
100
|
+
}
|
101
|
+
|
90
102
|
const rendererFromAnywhere =
|
91
103
|
renderer._ ||
|
92
104
|
renderer.render ||
|
@@ -96,24 +108,6 @@ exports.p = function (domCompat) {
|
|
96
108
|
if (!domCompat.isRenderer(rendererFromAnywhere || renderer)) {
|
97
109
|
newRenderer = rendererCache.get(renderer);
|
98
110
|
if (!newRenderer) {
|
99
|
-
const { Component } = renderer;
|
100
|
-
if (Component) {
|
101
|
-
const setCustomEvents = Component.prototype.___setCustomEvents;
|
102
|
-
Component.prototype.___setCustomEvents = function (
|
103
|
-
customEvents,
|
104
|
-
scopeId,
|
105
|
-
) {
|
106
|
-
const global = this.___global;
|
107
|
-
for (const customEvent of customEvents) {
|
108
|
-
customEvent[1] = domCompat.resolveRegistered(
|
109
|
-
customEvent[1],
|
110
|
-
global,
|
111
|
-
);
|
112
|
-
}
|
113
|
-
|
114
|
-
setCustomEvents.call(this, customEvents, scopeId);
|
115
|
-
};
|
116
|
-
}
|
117
111
|
newRenderer = domCompat.createRenderer(
|
118
112
|
(scope, input) =>
|
119
113
|
renderAndMorph(scope, rendererFromAnywhere, renderer, input),
|
@@ -127,7 +121,7 @@ exports.p = function (domCompat) {
|
|
127
121
|
}
|
128
122
|
|
129
123
|
domCompat.registerRenderer(create5to6Renderer);
|
130
|
-
domCompat.init(
|
124
|
+
domCompat.init(noopRenderer);
|
131
125
|
|
132
126
|
function renderAndMorph(scope, renderer, renderBody, input) {
|
133
127
|
const out = defaultCreateOut();
|
@@ -79,7 +79,9 @@ exports.p = function (htmlCompat) {
|
|
79
79
|
}
|
80
80
|
return (input, ...args) => {
|
81
81
|
const out = defaultCreateOut(htmlCompat.$global());
|
82
|
+
const branchId = htmlCompat.peekNextScopeId();
|
82
83
|
let customEvents;
|
84
|
+
htmlCompat.nextScopeId();
|
83
85
|
|
84
86
|
if (renderer5) {
|
85
87
|
const normalizedInput = {};
|
@@ -107,7 +109,7 @@ exports.p = function (htmlCompat) {
|
|
107
109
|
const component = componentsContext.___components[0];
|
108
110
|
if (component) {
|
109
111
|
component.___component.___customEvents = customEvents;
|
110
|
-
htmlCompat.writeSetScopeForComponent(component.id);
|
112
|
+
htmlCompat.writeSetScopeForComponent(branchId, component.id);
|
111
113
|
}
|
112
114
|
|
113
115
|
initComponentsTag({}, out);
|