marko 5.35.7 → 5.35.9
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/bin/markoc.js +0 -2
- package/dist/compiler/index.js +2 -0
- package/dist/core-tags/core/await/AsyncValue.js +1 -0
- package/dist/core-tags/core/await/renderer.js +1 -0
- package/dist/node-require/hot-reload.js +1 -3
- package/dist/node-require/index.js +1 -1
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +4 -2
- package/dist/node_modules/@internal/components-entry/index.js +13 -13
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +4 -3
- package/dist/node_modules/@internal/components-registry/index-browser.js +40 -36
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +16 -16
- package/dist/node_modules/@internal/components-util/index.js +7 -7
- package/dist/node_modules/@internal/create-readable/index-browser.js +2 -2
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +5 -5
- package/dist/node_modules/@internal/preserve-tag/index.js +1 -1
- package/dist/node_modules/@internal/require/index-webpack.js +1 -0
- package/dist/node_modules/@internal/set-immediate/index-browser.js +1 -1
- package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -2
- package/dist/node_modules/@internal/set-immediate/index.js +2 -2
- package/dist/runtime/RenderResult.js +4 -3
- package/dist/runtime/components/Component.js +107 -106
- package/dist/runtime/components/ComponentDef.js +25 -25
- package/dist/runtime/components/ComponentsContext.js +6 -6
- package/dist/runtime/components/GlobalComponentsContext.js +3 -3
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +8 -7
- package/dist/runtime/components/State.js +20 -24
- package/dist/runtime/components/attach-detach.js +7 -7
- package/dist/runtime/components/defineComponent.js +0 -1
- package/dist/runtime/components/dom-data.js +5 -5
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +14 -13
- package/dist/runtime/components/legacy/dependencies/index.js +9 -10
- package/dist/runtime/components/legacy/jquery.js +1 -0
- package/dist/runtime/components/legacy/renderer-legacy.js +33 -32
- package/dist/runtime/components/renderer.js +29 -29
- package/dist/runtime/components/update-manager.js +4 -4
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +5 -5
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +18 -13
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/helpers/serialize-noop.js +5 -0
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/helpers/tags-compat/dom-debug.mjs +1 -0
- package/dist/runtime/helpers/tags-compat/dom.mjs +1 -0
- package/dist/runtime/helpers/tags-compat/html-debug.js +1 -1
- package/dist/runtime/helpers/tags-compat/html-debug.mjs +3 -2
- package/dist/runtime/helpers/tags-compat/html.js +3 -1
- package/dist/runtime/helpers/tags-compat/html.mjs +3 -2
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +38 -35
- package/dist/runtime/helpers/tags-compat/runtime-html.js +24 -65
- package/dist/runtime/html/AsyncStream.js +25 -24
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +4 -3
- package/dist/runtime/html/helpers/attrs.js +1 -0
- package/dist/runtime/html/helpers/data-marko.js +2 -3
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/helpers/merge-attrs.js +1 -0
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +86 -85
- package/dist/runtime/vdom/VComponent.js +4 -4
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +41 -42
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +34 -35
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/attrs.js +1 -0
- package/dist/runtime/vdom/helpers/const-element.js +3 -3
- package/dist/runtime/vdom/hot-reload.js +14 -14
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +5 -5
- package/dist/runtime/vdom/morphdom/helpers.js +5 -5
- package/dist/runtime/vdom/morphdom/index.js +67 -68
- package/dist/runtime/vdom/vdom.js +14 -14
- package/dist/taglib/index.js +1 -0
- package/index.d.ts +1 -5
- package/package.json +4 -4
- package/src/compiler/index.js +2 -0
- package/src/core-tags/core/await/AsyncValue.js +1 -0
- package/src/core-tags/core/await/renderer.js +1 -0
- package/src/node-require/hot-reload.js +0 -2
- package/src/node-require/index.js +1 -1
- package/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +4 -2
- package/src/node_modules/@internal/components-entry/index.js +2 -2
- package/src/node_modules/@internal/components-entry-legacy/index-browser.js +1 -0
- package/src/node_modules/@internal/components-registry/index-browser.js +8 -4
- package/src/node_modules/@internal/components-util/index-browser.js +1 -1
- package/src/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/src/node_modules/@internal/require/index-webpack.js +1 -0
- package/src/runtime/RenderResult.js +1 -0
- package/src/runtime/components/Component.js +2 -1
- package/src/runtime/components/ComponentDef.js +4 -4
- package/src/runtime/components/ServerComponent.js +1 -0
- package/src/runtime/components/State.js +6 -10
- package/src/runtime/components/defineComponent.js +0 -1
- package/src/runtime/components/legacy/defineRenderer-legacy.js +1 -0
- package/src/runtime/components/legacy/dependencies/index.js +0 -1
- package/src/runtime/components/legacy/jquery.js +1 -0
- package/src/runtime/components/legacy/renderer-legacy.js +1 -0
- package/src/runtime/helpers/dynamic-tag.js +11 -6
- package/src/runtime/helpers/serialize-noop.js +5 -0
- package/src/runtime/helpers/tags-compat/dom-debug.mjs +1 -0
- package/src/runtime/helpers/tags-compat/dom.mjs +1 -0
- package/src/runtime/helpers/tags-compat/html-debug.js +1 -1
- package/src/runtime/helpers/tags-compat/html-debug.mjs +3 -2
- package/src/runtime/helpers/tags-compat/html.js +3 -1
- package/src/runtime/helpers/tags-compat/html.mjs +3 -2
- package/src/runtime/helpers/tags-compat/runtime-dom.js +23 -20
- package/src/runtime/helpers/tags-compat/runtime-html.js +18 -59
- package/src/runtime/html/AsyncStream.js +1 -0
- package/src/runtime/html/helpers/attr.js +1 -0
- package/src/runtime/html/helpers/attrs.js +1 -0
- package/src/runtime/html/helpers/data-marko.js +0 -1
- package/src/runtime/html/helpers/merge-attrs.js +1 -0
- package/src/runtime/vdom/AsyncVDOMBuilder.js +1 -0
- package/src/runtime/vdom/VElement.js +1 -2
- package/src/runtime/vdom/VNode.js +0 -1
- package/src/runtime/vdom/helpers/attrs.js +1 -0
- package/src/runtime/vdom/morphdom/index.js +0 -1
- package/src/taglib/index.js +1 -0
- package/tags-html.d.ts +7 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* jshint newcap:false */
|
|
3
2
|
|
|
3
|
+
// eslint-disable-next-line no-constant-binary-expression
|
|
4
4
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
5
5
|
var EventEmitter = require("events-light");
|
|
6
6
|
var SubscriptionTracker = require("listener-tracker");
|
|
@@ -513,6 +513,7 @@ Component.prototype = componentProto = {
|
|
|
513
513
|
},
|
|
514
514
|
|
|
515
515
|
___scheduleRerender: function () {
|
|
516
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
516
517
|
var self = this;
|
|
517
518
|
var renderer = self.___renderer;
|
|
518
519
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// eslint-disable-next-line no-constant-binary-expression
|
|
2
3
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
3
4
|
var extend = require("raptor-util/extend");
|
|
4
|
-
var w10Noop = require("warp10/constants").NOOP;
|
|
5
5
|
var componentUtil = require("@internal/components-util");
|
|
6
|
+
var w10NOOP = require("../helpers/serialize-noop").___noop;
|
|
6
7
|
var attachBubblingEvent = componentUtil.___attachBubblingEvent;
|
|
7
8
|
var addDelegatedEventHandler =
|
|
8
9
|
require("./event-delegation").___addDelegatedEventHandler;
|
|
@@ -98,7 +99,7 @@ ComponentDef.___deserialize = function (o, types, global, registry) {
|
|
|
98
99
|
var componentProps = extra.w || EMPTY_OBJECT;
|
|
99
100
|
var flags = extra.f;
|
|
100
101
|
var isLegacy = flags & FLAG_IS_LEGACY;
|
|
101
|
-
var renderBody = flags & FLAG_HAS_RENDER_BODY ?
|
|
102
|
+
var renderBody = flags & FLAG_HAS_RENDER_BODY ? w10NOOP : extra.r;
|
|
102
103
|
|
|
103
104
|
var component =
|
|
104
105
|
typeName /* legacy */ &&
|
|
@@ -107,6 +108,7 @@ ComponentDef.___deserialize = function (o, types, global, registry) {
|
|
|
107
108
|
// Prevent newly created component from being queued for update since we area
|
|
108
109
|
// just building it from the server info
|
|
109
110
|
component.___updateQueued = true;
|
|
111
|
+
component.___global = global;
|
|
110
112
|
|
|
111
113
|
if (isLegacy) {
|
|
112
114
|
component.widgetConfig = componentProps;
|
|
@@ -156,8 +158,6 @@ ComponentDef.___deserialize = function (o, types, global, registry) {
|
|
|
156
158
|
component.___setCustomEvents(customEvents, scope);
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
component.___global = global;
|
|
160
|
-
|
|
161
161
|
return {
|
|
162
162
|
id: id,
|
|
163
163
|
___component: component,
|
|
@@ -28,23 +28,19 @@ function State(component) {
|
|
|
28
28
|
|
|
29
29
|
State.prototype = {
|
|
30
30
|
___reset: function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
self.___changes = null;
|
|
36
|
-
self.___forced = null;
|
|
31
|
+
this.___dirty = false;
|
|
32
|
+
this.___old = null;
|
|
33
|
+
this.___changes = null;
|
|
34
|
+
this.___forced = null;
|
|
37
35
|
},
|
|
38
36
|
|
|
39
37
|
___replace: function (newState) {
|
|
40
|
-
var state = this;
|
|
41
38
|
var key;
|
|
42
|
-
|
|
43
39
|
var rawState = this.___raw;
|
|
44
40
|
|
|
45
41
|
for (key in rawState) {
|
|
46
42
|
if (!(key in newState)) {
|
|
47
|
-
|
|
43
|
+
this.___set(
|
|
48
44
|
key,
|
|
49
45
|
undefined,
|
|
50
46
|
false /* ensure:false */,
|
|
@@ -54,7 +50,7 @@ State.prototype = {
|
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
for (key in newState) {
|
|
57
|
-
|
|
53
|
+
this.___set(
|
|
58
54
|
key,
|
|
59
55
|
newState[key],
|
|
60
56
|
true /* ensure:true */,
|
|
@@ -44,7 +44,6 @@ function attachDepsAndComponentsToTemplate(target, context) {
|
|
|
44
44
|
var components = (target.___components = {});
|
|
45
45
|
|
|
46
46
|
if (!template.meta) {
|
|
47
|
-
// eslint-disable-next-line no-console
|
|
48
47
|
console.warn("Metadata not set for template at ", template.path);
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
@@ -9,6 +9,7 @@ exports.patchComponent = function (jQuery, proto, delayThrow) {
|
|
|
9
9
|
|
|
10
10
|
(proto || require("../Component").prototype).$ = function jqueryProxy(arg) {
|
|
11
11
|
var args = arguments;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
12
13
|
var self = this;
|
|
13
14
|
|
|
14
15
|
if (!(jQuery || (jQuery = window.$))) {
|
|
@@ -8,6 +8,7 @@ var componentLookup = componentsUtil.___componentLookup;
|
|
|
8
8
|
var modernRenderer = require("../renderer");
|
|
9
9
|
var resolveComponentKey = modernRenderer.___resolveComponentKey;
|
|
10
10
|
var trackAsyncComponents = modernRenderer.___trackAsyncComponents;
|
|
11
|
+
// eslint-disable-next-line no-constant-binary-expression
|
|
11
12
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
12
13
|
|
|
13
14
|
function createRendererFunc(templateRenderFunc, componentProps) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line no-constant-binary-expression
|
|
3
4
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
4
|
-
var w10NOOP = require("warp10/constants").NOOP;
|
|
5
5
|
var ComponentDef = require("../components/ComponentDef");
|
|
6
6
|
var ComponentsContext = require("../components/ComponentsContext");
|
|
7
|
+
var serializeNOOP = require("../helpers/serialize-noop");
|
|
8
|
+
var w10NOOP = serializeNOOP.___noop;
|
|
9
|
+
var w10ToJSON = serializeNOOP.___toJSON;
|
|
7
10
|
var changeCase = require("./_change-case");
|
|
8
11
|
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
|
9
|
-
var RENDER_BODY_TO_JSON = function () {
|
|
10
|
-
return w10NOOP;
|
|
11
|
-
};
|
|
12
12
|
|
|
13
13
|
var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
|
14
14
|
// var FLAG_HAS_RENDER_BODY = 2;
|
|
@@ -80,7 +80,12 @@ module.exports = function dynamicTag(
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
if (dynamicTag.___runtimeCompat) {
|
|
83
|
-
renderer = dynamicTag.___runtimeCompat(
|
|
83
|
+
renderer = dynamicTag.___runtimeCompat(
|
|
84
|
+
renderer,
|
|
85
|
+
render,
|
|
86
|
+
args,
|
|
87
|
+
out.global,
|
|
88
|
+
);
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
if (renderer) {
|
|
@@ -113,7 +118,7 @@ module.exports = function dynamicTag(
|
|
|
113
118
|
parentComponentDef.id + "-" + parentComponentDef.___nextKey(key),
|
|
114
119
|
globalContext,
|
|
115
120
|
);
|
|
116
|
-
render.toJSON =
|
|
121
|
+
render.toJSON = w10ToJSON;
|
|
117
122
|
|
|
118
123
|
if (args) {
|
|
119
124
|
render.apply(null, [out].concat(args, attrs));
|
|
@@ -15,12 +15,17 @@ exports.p = function (domCompat) {
|
|
|
15
15
|
renderer,
|
|
16
16
|
renderBody,
|
|
17
17
|
args,
|
|
18
|
+
global,
|
|
18
19
|
) {
|
|
19
|
-
const tagsRenderer = domCompat.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const tagsRenderer = domCompat.resolveRegistered(
|
|
21
|
+
renderer || renderBody,
|
|
22
|
+
global,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
if (tagsRenderer && domCompat.isRenderer(tagsRenderer)) {
|
|
26
|
+
return (input, out) => {
|
|
27
|
+
return TagsCompat({ i: args ? args : input, r: tagsRenderer }, out);
|
|
28
|
+
};
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
return renderer;
|
|
@@ -29,17 +34,9 @@ exports.p = function (domCompat) {
|
|
|
29
34
|
const TagsCompatId = "tags-compat";
|
|
30
35
|
const TagsCompat = createRenderer(
|
|
31
36
|
function (_, out, componentDef, component) {
|
|
32
|
-
const isHydrate =
|
|
33
|
-
___getComponentsContext(out).___globalContext.___isHydrate;
|
|
34
37
|
const input = Array.isArray(_.i) ? _.i : [_.i];
|
|
35
|
-
const tagsRenderer = domCompat.
|
|
36
|
-
const newNode = domCompat.render(
|
|
37
|
-
isHydrate,
|
|
38
|
-
out,
|
|
39
|
-
component,
|
|
40
|
-
tagsRenderer,
|
|
41
|
-
input,
|
|
42
|
-
);
|
|
38
|
+
const tagsRenderer = domCompat.resolveRegistered(_.r, global);
|
|
39
|
+
const newNode = domCompat.render(out, component, tagsRenderer, input);
|
|
43
40
|
|
|
44
41
|
out.bf(out.___assignedKey, component, !newNode);
|
|
45
42
|
if (newNode) {
|
|
@@ -111,8 +108,12 @@ exports.p = function (domCompat) {
|
|
|
111
108
|
customEvents,
|
|
112
109
|
scopeId,
|
|
113
110
|
) {
|
|
111
|
+
const global = this.___global;
|
|
114
112
|
for (const customEvent of customEvents) {
|
|
115
|
-
customEvent[1] = domCompat.
|
|
113
|
+
customEvent[1] = domCompat.resolveRegistered(
|
|
114
|
+
customEvent[1],
|
|
115
|
+
global,
|
|
116
|
+
);
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
setCustomEvents.call(this, customEvents, scopeId);
|
|
@@ -141,19 +142,21 @@ exports.p = function (domCompat) {
|
|
|
141
142
|
return newRenderer;
|
|
142
143
|
}
|
|
143
144
|
|
|
144
|
-
domCompat.
|
|
145
|
+
domCompat.registerRenderer(create5to6Renderer);
|
|
146
|
+
domCompat.init();
|
|
145
147
|
|
|
146
148
|
function renderAndMorph(scope, renderer, renderBody, input) {
|
|
147
149
|
const out = defaultCreateOut();
|
|
148
150
|
let host = domCompat.getStartNode(scope);
|
|
149
151
|
let rootNode = host.fragment;
|
|
150
152
|
if (!rootNode) {
|
|
151
|
-
const component = (scope.
|
|
153
|
+
const component = (scope.___marko5Component =
|
|
154
|
+
___componentLookup[scope.m5c]);
|
|
152
155
|
rootNode = component.___rootNode;
|
|
153
156
|
host = rootNode.startNode;
|
|
154
157
|
domCompat.setScopeNodes(host, rootNode.endNode);
|
|
155
158
|
}
|
|
156
|
-
const existingComponent = scope.
|
|
159
|
+
const existingComponent = scope.___marko5Component;
|
|
157
160
|
const componentsContext = ___getComponentsContext(out);
|
|
158
161
|
const globalComponentsContext = componentsContext.___globalContext;
|
|
159
162
|
let customEvents;
|
|
@@ -191,7 +194,7 @@ exports.p = function (domCompat) {
|
|
|
191
194
|
component.___rootNode = rootNode;
|
|
192
195
|
component.___input = input[0];
|
|
193
196
|
component.___customEvents = customEvents;
|
|
194
|
-
scope.
|
|
197
|
+
scope.___marko5Component = component;
|
|
195
198
|
});
|
|
196
199
|
}
|
|
197
200
|
|
|
@@ -6,37 +6,28 @@ const createRenderer = require("../../components/renderer");
|
|
|
6
6
|
const defaultCreateOut = require("../../createOut");
|
|
7
7
|
const dynamicTag5 = require("../dynamic-tag");
|
|
8
8
|
|
|
9
|
-
exports.p = function (
|
|
10
|
-
const {
|
|
11
|
-
patchDynamicTag,
|
|
12
|
-
createRenderFn,
|
|
13
|
-
fork,
|
|
14
|
-
write,
|
|
15
|
-
serializerRegister,
|
|
16
|
-
writeScope,
|
|
17
|
-
nextScopeId,
|
|
18
|
-
getRegistryInfo,
|
|
19
|
-
} = tagsAPI;
|
|
20
|
-
const FN_TO_JSON = function () {
|
|
21
|
-
// TODO: this should instead return an object that contains getRegistryInfo
|
|
22
|
-
// then in the dom-compat, handle that object to lookup the function in the registry
|
|
23
|
-
// (we also need to do this for events)
|
|
24
|
-
return getRegistryInfo(this);
|
|
25
|
-
};
|
|
26
|
-
|
|
9
|
+
exports.p = function (htmlCompat) {
|
|
27
10
|
const isMarko6 = (fn) => !!fn.___isTagsAPI;
|
|
28
11
|
const isMarko5 = (fn) => !fn.___isTagsAPI;
|
|
12
|
+
const writeHTML = (result) => {
|
|
13
|
+
const state = result.out._state;
|
|
14
|
+
const writer = state.writer;
|
|
15
|
+
state.events.emit("___toString", writer);
|
|
16
|
+
htmlCompat.writeScript(writer._scripts);
|
|
17
|
+
htmlCompat.write(writer._content);
|
|
18
|
+
};
|
|
29
19
|
|
|
30
20
|
dynamicTag5.___runtimeCompat = function tagsToVdom(
|
|
31
21
|
tagsRenderer,
|
|
32
22
|
renderBody,
|
|
33
23
|
args,
|
|
34
24
|
) {
|
|
35
|
-
if (tagsRenderer ? isMarko5(tagsRenderer) : isMarko5(renderBody))
|
|
25
|
+
if (tagsRenderer ? isMarko5(tagsRenderer) : isMarko5(renderBody)) {
|
|
36
26
|
return tagsRenderer;
|
|
27
|
+
}
|
|
37
28
|
|
|
38
29
|
if (!tagsRenderer && renderBody) {
|
|
39
|
-
renderBody.toJSON =
|
|
30
|
+
renderBody.toJSON = htmlCompat.toJSON;
|
|
40
31
|
}
|
|
41
32
|
|
|
42
33
|
return (input, out) =>
|
|
@@ -53,29 +44,9 @@ exports.p = function (tagsAPI) {
|
|
|
53
44
|
function (_, out, componentDef, component) {
|
|
54
45
|
const input = _.i;
|
|
55
46
|
const tagsRenderer = _.r;
|
|
56
|
-
const renderFn = createRenderFn(tagsRenderer);
|
|
57
47
|
const willRerender = componentDef._wrr;
|
|
58
|
-
const $global = out.global;
|
|
59
|
-
const streamData = ($global.streamData = $global.streamData || {});
|
|
60
|
-
|
|
61
|
-
if (willRerender) {
|
|
62
|
-
$global.serializedGlobals = $global.serializedGlobals || {};
|
|
63
|
-
$global.serializedGlobals.componentIdToScopeId = true;
|
|
64
|
-
$global.componentIdToScopeId = $global.componentIdToScopeId || {};
|
|
65
|
-
$global.componentIdToScopeId[component.id] = streamData.scopeId || 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
48
|
out.bf(out.___assignedKey, component, willRerender);
|
|
69
|
-
|
|
70
|
-
out.beginAsync(),
|
|
71
|
-
input,
|
|
72
|
-
{
|
|
73
|
-
...$global,
|
|
74
|
-
componentIdToScopeId: undefined,
|
|
75
|
-
streamData: undefined,
|
|
76
|
-
},
|
|
77
|
-
streamData,
|
|
78
|
-
);
|
|
49
|
+
htmlCompat.render(tagsRenderer, willRerender, out, component, input);
|
|
79
50
|
out.ef();
|
|
80
51
|
},
|
|
81
52
|
// eslint-disable-next-line no-constant-condition
|
|
@@ -92,7 +63,7 @@ exports.p = function (tagsAPI) {
|
|
|
92
63
|
{},
|
|
93
64
|
);
|
|
94
65
|
|
|
95
|
-
patchDynamicTag(
|
|
66
|
+
htmlCompat.patchDynamicTag(
|
|
96
67
|
function getRenderer(tag) {
|
|
97
68
|
const renderer = tag._ || tag.renderBody || tag;
|
|
98
69
|
if (isMarko6(renderer)) return renderer;
|
|
@@ -108,8 +79,6 @@ exports.p = function (tagsAPI) {
|
|
|
108
79
|
const out = defaultCreateOut();
|
|
109
80
|
let customEvents;
|
|
110
81
|
|
|
111
|
-
out.global.streamData = tagsAPI.getStreamData();
|
|
112
|
-
|
|
113
82
|
if (renderer5) {
|
|
114
83
|
const normalizedInput = {};
|
|
115
84
|
|
|
@@ -122,7 +91,7 @@ exports.p = function (tagsAPI) {
|
|
|
122
91
|
(c === "-" ? "" : c.toLowerCase()) + key.slice(3),
|
|
123
92
|
value,
|
|
124
93
|
]);
|
|
125
|
-
value.toJSON =
|
|
94
|
+
value.toJSON = htmlCompat.toJSON;
|
|
126
95
|
} else {
|
|
127
96
|
normalizedInput[key] = input[key];
|
|
128
97
|
}
|
|
@@ -136,9 +105,7 @@ exports.p = function (tagsAPI) {
|
|
|
136
105
|
const component = componentsContext.___components[0];
|
|
137
106
|
if (component) {
|
|
138
107
|
component.___component.___customEvents = customEvents;
|
|
139
|
-
|
|
140
|
-
m5c: component.id,
|
|
141
|
-
});
|
|
108
|
+
htmlCompat.writeSetScopeForComponent(component.id);
|
|
142
109
|
}
|
|
143
110
|
|
|
144
111
|
initComponentsTag({}, out);
|
|
@@ -147,7 +114,7 @@ exports.p = function (tagsAPI) {
|
|
|
147
114
|
out.once("finish", (result) => {
|
|
148
115
|
if (!async) {
|
|
149
116
|
async = false;
|
|
150
|
-
|
|
117
|
+
writeHTML(result);
|
|
151
118
|
}
|
|
152
119
|
});
|
|
153
120
|
|
|
@@ -155,9 +122,7 @@ exports.p = function (tagsAPI) {
|
|
|
155
122
|
|
|
156
123
|
if (async !== false) {
|
|
157
124
|
async = true;
|
|
158
|
-
fork(out,
|
|
159
|
-
write(result.toString());
|
|
160
|
-
});
|
|
125
|
+
htmlCompat.fork(out, writeHTML);
|
|
161
126
|
}
|
|
162
127
|
};
|
|
163
128
|
},
|
|
@@ -167,11 +132,5 @@ exports.p = function (tagsAPI) {
|
|
|
167
132
|
},
|
|
168
133
|
);
|
|
169
134
|
|
|
170
|
-
return
|
|
171
|
-
return serializerRegister(
|
|
172
|
-
"@marko/tags-compat-5-to-6",
|
|
173
|
-
renderer,
|
|
174
|
-
serializerRegister(id, () => {}),
|
|
175
|
-
);
|
|
176
|
-
};
|
|
135
|
+
return htmlCompat.registerRenderer;
|
|
177
136
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
|
4
4
|
var escapeDoubleQuotes = escapeQuoteHelpers.___escapeDoubleQuotes;
|
|
5
5
|
var escapeSingleQuotes = escapeQuoteHelpers.___escapeSingleQuotes;
|
|
6
|
+
// eslint-disable-next-line no-constant-binary-expression
|
|
6
7
|
var complain = "MARKO_DEBUG" && require("complain");
|
|
7
8
|
|
|
8
9
|
module.exports = maybeEmptyAttr;
|
|
@@ -15,7 +15,6 @@ module.exports = function dataMarko(out, componentDef, props, key) {
|
|
|
15
15
|
|
|
16
16
|
if (willNotRerender) {
|
|
17
17
|
if (props) {
|
|
18
|
-
// eslint-disable-next-line no-unused-vars
|
|
19
18
|
for (var _ in props) {
|
|
20
19
|
result +=
|
|
21
20
|
" data-marko='" + escapeSingleQuotes(JSON.stringify(props)) + "'";
|
|
@@ -418,6 +418,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
|
|
|
418
418
|
},
|
|
419
419
|
|
|
420
420
|
then: function (fn, fnErr) {
|
|
421
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
421
422
|
var out = this;
|
|
422
423
|
var promise = new Promise(function (resolve, reject) {
|
|
423
424
|
out.on("error", reject).on(EVENT_FINISH, function (result) {
|
|
@@ -360,7 +360,6 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
360
360
|
var depth = 0;
|
|
361
361
|
var nodeValue;
|
|
362
362
|
|
|
363
|
-
// eslint-disable-next-line no-constant-condition
|
|
364
363
|
while (true) {
|
|
365
364
|
if (endNode.nodeType === COMMENT_NODE) {
|
|
366
365
|
nodeValue = endNode.nodeValue;
|