marko 5.21.4 → 5.21.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core-tags/core/await/reorderer-renderer.js +26 -6
- package/dist/runtime/RenderResult.js +7 -7
- package/dist/runtime/components/Component.js +129 -129
- package/dist/runtime/components/ComponentDef.js +25 -25
- package/dist/runtime/components/ComponentsContext.js +8 -8
- package/dist/runtime/components/GlobalComponentsContext.js +4 -4
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +13 -13
- package/dist/runtime/components/State.js +25 -25
- package/dist/runtime/components/attach-detach.js +8 -8
- package/dist/runtime/components/beginComponent/index-browser.js +2 -2
- package/dist/runtime/components/beginComponent/index.js +7 -7
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +3 -3
- package/dist/runtime/components/endComponent/index.js +2 -2
- package/dist/runtime/components/entry/index-browser.js +4 -4
- package/dist/runtime/components/entry/index.js +15 -15
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/init-components/index-browser.js +34 -34
- package/dist/runtime/components/registry/index-browser.js +7 -7
- package/dist/runtime/components/registry/index.js +2 -2
- package/dist/runtime/components/renderer.js +26 -26
- package/dist/runtime/components/update-manager.js +10 -10
- package/dist/runtime/components/util/index-browser.js +17 -17
- package/dist/runtime/components/util/index.js +9 -9
- 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 +7 -7
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/html/AsyncStream.js +20 -20
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/StringWriter.js +1 -1
- package/dist/runtime/html/helpers/attr.js +1 -1
- package/dist/runtime/html/helpers/data-marko.js +4 -4
- 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/props-script.js +1 -1
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +4 -4
- package/dist/runtime/setImmediate/index-browser.js +1 -1
- package/dist/runtime/setImmediate/index-worker.js +2 -2
- package/dist/runtime/setImmediate/index.js +2 -2
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +28 -28
- package/dist/runtime/vdom/VDocumentFragment.js +1 -1
- package/dist/runtime/vdom/VElement.js +11 -11
- package/dist/runtime/vdom/VFragment.js +3 -3
- package/dist/runtime/vdom/VNode.js +4 -4
- package/dist/runtime/vdom/hot-reload.js +15 -15
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +2 -2
- package/dist/runtime/vdom/morphdom/helpers.js +4 -4
- package/dist/runtime/vdom/morphdom/index.js +28 -28
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +1 -1
- package/package.json +2 -2
- package/src/core-tags/core/await/reorderer-renderer.js +27 -7
@@ -5,7 +5,7 @@ var registry = require("../components/registry");
|
|
5
5
|
var updateManager = require("../components/update-manager");
|
6
6
|
|
7
7
|
var createTemplate = runtime.t;
|
8
|
-
var createComponent = registry.
|
8
|
+
var createComponent = registry._Q_;
|
9
9
|
var registered = {};
|
10
10
|
var queue;
|
11
11
|
|
@@ -31,36 +31,36 @@ runtime.t = function (typeName) {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
queue.push(function () {
|
34
|
-
var newProto = registry.
|
34
|
+
var newProto = registry.aw_(typeName).prototype;
|
35
35
|
instances.forEach(function (instance) {
|
36
36
|
if (hasLifecycleChanged(instance.__proto__, newProto)) {
|
37
|
-
var startNode = instance.
|
38
|
-
var endNode = instance.
|
37
|
+
var startNode = instance.L_.startNode;
|
38
|
+
var endNode = instance.L_.endNode;
|
39
39
|
var parentNode = startNode.parentNode;
|
40
40
|
var curNode;
|
41
41
|
|
42
42
|
instance.bY_ = true;
|
43
|
-
instance._a_();
|
44
43
|
instance._b_();
|
44
|
+
instance._c_();
|
45
45
|
|
46
|
-
if (instance.
|
47
|
-
instance.
|
48
|
-
instance.
|
46
|
+
if (instance.M_) {
|
47
|
+
instance.M_.removeAllListeners();
|
48
|
+
instance.M_ = null;
|
49
49
|
}
|
50
50
|
|
51
51
|
while ((curNode = startNode.nextSibling) !== endNode) {
|
52
|
-
util.
|
52
|
+
util.E_(curNode);
|
53
53
|
parentNode.removeChild(curNode);
|
54
54
|
}
|
55
55
|
|
56
56
|
instance.bY_ = false;
|
57
|
-
instance.
|
57
|
+
instance.S_ = false;
|
58
58
|
}
|
59
59
|
|
60
60
|
instance.__proto__ = newProto;
|
61
|
-
instance.
|
62
|
-
instance.
|
63
|
-
afterInsert(instance.
|
61
|
+
instance._q_(
|
62
|
+
instance.R_, false).
|
63
|
+
afterInsert(instance.Y_);
|
64
64
|
});
|
65
65
|
});
|
66
66
|
}
|
@@ -74,7 +74,7 @@ runtime.t = function (typeName) {
|
|
74
74
|
}
|
75
75
|
};
|
76
76
|
|
77
|
-
registry.
|
77
|
+
registry._Q_ = function (typeName, id) {
|
78
78
|
var template = registered[typeName];
|
79
79
|
var instance = createComponent(typeName, id);
|
80
80
|
|
@@ -108,7 +108,7 @@ function hasLifecycleChanged(oldProto, newProto) {
|
|
108
108
|
}
|
109
109
|
|
110
110
|
function batchUpdate() {
|
111
|
-
updateManager.
|
111
|
+
updateManager._p_(function () {
|
112
112
|
var pending = queue;
|
113
113
|
queue = undefined;
|
114
114
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use strict";var helpers = require("./helpers");
|
2
|
-
var insertBefore = helpers.
|
2
|
+
var insertBefore = helpers.aH_;
|
3
3
|
|
4
4
|
var fragmentPrototype = {
|
5
5
|
nodeType: 12,
|
@@ -91,5 +91,5 @@ function beginFragmentNode(startNode, parentNode) {
|
|
91
91
|
return fragment;
|
92
92
|
}
|
93
93
|
|
94
|
-
exports.
|
94
|
+
exports.ap_ = createFragmentNode;
|
95
95
|
exports.c__ = beginFragmentNode;
|
@@ -35,8 +35,8 @@ function removeChild(node) {
|
|
35
35
|
node.parentNode.removeChild(node);
|
36
36
|
}
|
37
37
|
|
38
|
-
exports.
|
39
|
-
exports.
|
38
|
+
exports.aH_ = insertBefore;
|
39
|
+
exports.aI_ = insertAfter;
|
40
40
|
exports.bT_ = nextSibling;
|
41
|
-
exports.
|
42
|
-
exports.
|
41
|
+
exports._s_ = firstChild;
|
42
|
+
exports.aJ_ = removeChild;
|
@@ -2,11 +2,11 @@
|
|
2
2
|
var specialElHandlers = require("./specialElHandlers");
|
3
3
|
var KeySequence = require("../../components/KeySequence");
|
4
4
|
var componentsUtil = require("../../components/util");
|
5
|
-
var existingComponentLookup = componentsUtil.
|
6
|
-
var destroyNodeRecursive = componentsUtil.
|
5
|
+
var existingComponentLookup = componentsUtil.D_;
|
6
|
+
var destroyNodeRecursive = componentsUtil.E_;
|
7
7
|
var addComponentRootToKeyedElements =
|
8
|
-
componentsUtil.
|
9
|
-
var normalizeComponentKey = componentsUtil.
|
8
|
+
componentsUtil.aq_;
|
9
|
+
var normalizeComponentKey = componentsUtil.aF_;
|
10
10
|
var VElement = require("../vdom").bb_;
|
11
11
|
var virtualizeElement = VElement.bO_;
|
12
12
|
var morphAttrs = VElement.bP_;
|
@@ -14,17 +14,17 @@ var eventDelegation = require("../../components/event-delegation");
|
|
14
14
|
var fragment = require("./fragment");
|
15
15
|
var helpers = require("./helpers");
|
16
16
|
var domData = require("../../components/dom-data");
|
17
|
-
var keysByDOMNode = domData.
|
18
|
-
var componentByDOMNode = domData.
|
19
|
-
var vElementByDOMNode = domData.
|
20
|
-
var detachedByDOMNode = domData.
|
17
|
+
var keysByDOMNode = domData.ah_;
|
18
|
+
var componentByDOMNode = domData.F_;
|
19
|
+
var vElementByDOMNode = domData.af_;
|
20
|
+
var detachedByDOMNode = domData.ag_;
|
21
21
|
|
22
|
-
var insertBefore = helpers.
|
23
|
-
var insertAfter = helpers.
|
22
|
+
var insertBefore = helpers.aH_;
|
23
|
+
var insertAfter = helpers.aI_;
|
24
24
|
var nextSibling = helpers.bT_;
|
25
|
-
var firstChild = helpers.
|
26
|
-
var removeChild = helpers.
|
27
|
-
var createFragmentNode = fragment.
|
25
|
+
var firstChild = helpers._s_;
|
26
|
+
var removeChild = helpers.aJ_;
|
27
|
+
var createFragmentNode = fragment.ap_;
|
28
28
|
var beginFragmentNode = fragment.c__;
|
29
29
|
|
30
30
|
var ELEMENT_NODE = 1;
|
@@ -52,7 +52,7 @@ function caseInsensitiveCompare(a, b) {
|
|
52
52
|
|
53
53
|
function onNodeAdded(node, componentsContext) {
|
54
54
|
if (node.nodeType === ELEMENT_NODE) {
|
55
|
-
eventDelegation.
|
55
|
+
eventDelegation.ac_(node, componentsContext);
|
56
56
|
}
|
57
57
|
}
|
58
58
|
|
@@ -105,7 +105,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
105
105
|
ownerComponent,
|
106
106
|
parentComponent)
|
107
107
|
{
|
108
|
-
var rootNode = component.
|
108
|
+
var rootNode = component.L_ = insertBefore(
|
109
109
|
createFragmentNode(),
|
110
110
|
referenceNode,
|
111
111
|
referenceNodeParentEl);
|
@@ -127,7 +127,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
127
127
|
}
|
128
128
|
|
129
129
|
function morphComponent(component, vComponent) {
|
130
|
-
morphChildren(component.
|
130
|
+
morphChildren(component.L_, vComponent, component);
|
131
131
|
}
|
132
132
|
|
133
133
|
var detachedNodes = [];
|
@@ -148,7 +148,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
148
148
|
|
149
149
|
function morphChildren(fromNode, toNode, parentComponent) {
|
150
150
|
var curFromNodeChild = firstChild(fromNode);
|
151
|
-
var curToNodeChild = toNode.
|
151
|
+
var curToNodeChild = toNode._s_;
|
152
152
|
|
153
153
|
var curToNodeKey;
|
154
154
|
var curFromNodeKey;
|
@@ -171,7 +171,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
171
171
|
curFromNodeChild = nextSibling(curFromNodeChild);
|
172
172
|
}
|
173
173
|
|
174
|
-
var ownerComponent = curToNodeChild.
|
174
|
+
var ownerComponent = curToNodeChild.aC_ || parentComponent;
|
175
175
|
var referenceComponent;
|
176
176
|
|
177
177
|
if (curToNodeType === COMPONENT_NODE) {
|
@@ -182,7 +182,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
182
182
|
{
|
183
183
|
if (isHydrate === true) {
|
184
184
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
185
|
-
component.
|
185
|
+
component.L_ = rootNode;
|
186
186
|
componentByDOMNode.set(rootNode, component);
|
187
187
|
|
188
188
|
if (ownerComponent && curToNodeKey) {
|
@@ -215,17 +215,17 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
215
215
|
|
216
216
|
}
|
217
217
|
} else {
|
218
|
-
if (matchingFromComponent.
|
218
|
+
if (matchingFromComponent.L_ !== curFromNodeChild) {
|
219
219
|
if (
|
220
220
|
curFromNodeChild && (
|
221
221
|
fromComponent = componentByDOMNode.get(curFromNodeChild)) &&
|
222
|
-
globalComponentsContext.
|
222
|
+
globalComponentsContext._V_[
|
223
223
|
fromComponent.id] ===
|
224
224
|
undefined)
|
225
225
|
{
|
226
226
|
// The component associated with the current real DOM node was not rendered
|
227
227
|
// so we should just remove it out of the real DOM by destroying it
|
228
|
-
curFromNodeChild = nextSibling(fromComponent.
|
228
|
+
curFromNodeChild = nextSibling(fromComponent.L_);
|
229
229
|
destroyComponent(fromComponent);
|
230
230
|
continue;
|
231
231
|
}
|
@@ -233,7 +233,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
233
233
|
// We need to move the existing component into
|
234
234
|
// the correct location
|
235
235
|
insertBefore(
|
236
|
-
matchingFromComponent.
|
236
|
+
matchingFromComponent.L_,
|
237
237
|
curFromNodeChild,
|
238
238
|
fromNode);
|
239
239
|
|
@@ -267,7 +267,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
267
267
|
// up elements
|
268
268
|
curToNodeKey = (
|
269
269
|
keySequences[referenceComponent.id] || (
|
270
|
-
keySequences[referenceComponent.id] = new KeySequence())).
|
270
|
+
keySequences[referenceComponent.id] = new KeySequence()))._M_(
|
271
271
|
curToNodeKey);
|
272
272
|
|
273
273
|
if (curFromNodeChild) {
|
@@ -502,7 +502,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
502
502
|
curFromNodeChild = fromNextSibling;
|
503
503
|
|
504
504
|
if (
|
505
|
-
!globalComponentsContext.
|
505
|
+
!globalComponentsContext._V_[fromComponent.id])
|
506
506
|
{
|
507
507
|
destroyComponent(fromComponent);
|
508
508
|
}
|
@@ -626,7 +626,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
626
626
|
if (fromComponent = componentByDOMNode.get(curFromNodeChild)) {
|
627
627
|
curFromNodeChild = fromNextSibling;
|
628
628
|
if (
|
629
|
-
!globalComponentsContext.
|
629
|
+
!globalComponentsContext._V_[fromComponent.id])
|
630
630
|
{
|
631
631
|
destroyComponent(fromComponent);
|
632
632
|
}
|
@@ -642,7 +642,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
642
642
|
referenceComponent = parentComponent;
|
643
643
|
} else {
|
644
644
|
referenceComponent =
|
645
|
-
curVFromNodeChild && curVFromNodeChild.
|
645
|
+
curVFromNodeChild && curVFromNodeChild.aC_;
|
646
646
|
}
|
647
647
|
|
648
648
|
detachNode(curFromNodeChild, fromNode, referenceComponent);
|
@@ -698,7 +698,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
698
698
|
detachedFromComponent !== true && detachedFromComponent);
|
699
699
|
|
700
700
|
|
701
|
-
if (eventDelegation.
|
701
|
+
if (eventDelegation._a_(node) != false) {
|
702
702
|
removeChild(node);
|
703
703
|
}
|
704
704
|
}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.21.
|
3
|
+
"version": "5.21.7",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
6
6
|
"dependencies": {
|
7
|
-
"@marko/compiler": "^5.
|
7
|
+
"@marko/compiler": "^5.22.4",
|
8
8
|
"@marko/translator-default": "^5.21.3",
|
9
9
|
"app-module-path": "^2.2.0",
|
10
10
|
"argly": "^1.2.0",
|
@@ -1,5 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var escapeDoubleQuotes =
|
4
|
+
require("../../../runtime/html/helpers/escape-quotes").___escapeDoubleQuotes;
|
5
|
+
|
3
6
|
module.exports = function (input, out) {
|
4
7
|
// We cannot call beginSync() when using renderSync(). In this case we will
|
5
8
|
// ignore the await-reorderer tag.
|
@@ -54,13 +57,30 @@ module.exports = function (input, out) {
|
|
54
57
|
global._afRuntime = true;
|
55
58
|
}
|
56
59
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
if (global.cspNonce) {
|
61
|
+
asyncOut.write(
|
62
|
+
'<style nonce="' +
|
63
|
+
escapeDoubleQuotes(global.cspNonce) +
|
64
|
+
'">' +
|
65
|
+
"#af" +
|
66
|
+
awaitInfo.id +
|
67
|
+
"{display:none;}" +
|
68
|
+
"</style>" +
|
69
|
+
'<div id="af' +
|
70
|
+
awaitInfo.id +
|
71
|
+
'">' +
|
72
|
+
result.toString() +
|
73
|
+
"</div>"
|
74
|
+
);
|
75
|
+
} else {
|
76
|
+
asyncOut.write(
|
77
|
+
'<div id="af' +
|
78
|
+
awaitInfo.id +
|
79
|
+
'" style="display:none">' +
|
80
|
+
result.toString() +
|
81
|
+
"</div>"
|
82
|
+
);
|
83
|
+
}
|
64
84
|
|
65
85
|
asyncOut.script(
|
66
86
|
"$af(" +
|