marko 5.33.8 → 5.33.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core-tags/core/await/AsyncValue.js +21 -21
- package/dist/core-tags/core/await/renderer.js +11 -11
- package/dist/core-tags/core/await/reorderer-renderer.js +3 -3
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +4 -4
- package/dist/node_modules/@internal/components-beginComponent/index.js +11 -11
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +45 -45
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +3 -3
- package/dist/node_modules/@internal/components-endComponent/index.js +3 -3
- package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
- package/dist/node_modules/@internal/components-entry/index.js +16 -16
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +6 -6
- package/dist/node_modules/@internal/components-registry/index-browser.js +46 -46
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +20 -20
- package/dist/node_modules/@internal/components-util/index.js +10 -10
- package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +7 -7
- package/dist/node_modules/@internal/preserve-tag/index.js +5 -5
- package/dist/node_modules/@internal/set-immediate/index-browser.js +4 -2
- package/dist/node_modules/@internal/set-immediate/index-worker.js +31 -2
- package/dist/node_modules/@internal/set-immediate/index.js +3 -2
- package/dist/node_modules/@internal/set-immediate/queueMicrotask.js +8 -0
- package/dist/runtime/RenderResult.js +8 -8
- package/dist/runtime/components/Component.js +145 -145
- package/dist/runtime/components/ComponentDef.js +28 -28
- package/dist/runtime/components/ComponentsContext.js +15 -15
- 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 +26 -26
- package/dist/runtime/components/attach-detach.js +8 -8
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +5 -5
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +16 -16
- package/dist/runtime/components/legacy/dependencies/index.js +7 -7
- package/dist/runtime/components/legacy/renderer-legacy.js +43 -43
- package/dist/runtime/components/renderer.js +36 -36
- 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/class-value.js +2 -5
- package/dist/runtime/helpers/dynamic-tag.js +16 -16
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/helpers/style-value.js +3 -3
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +21 -21
- package/dist/runtime/helpers/tags-compat/runtime-html.js +8 -8
- package/dist/runtime/html/AsyncStream.js +31 -28
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/StringWriter.js +1 -1
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +4 -4
- package/dist/runtime/html/helpers/data-marko.js +6 -6
- package/dist/runtime/html/helpers/escape-quotes.js +2 -2
- 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 +2 -2
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +96 -96
- package/dist/runtime/vdom/VComponent.js +5 -5
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +55 -51
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +22 -22
- package/dist/runtime/vdom/VText.js +4 -4
- package/dist/runtime/vdom/helpers/const-element.js +3 -3
- package/dist/runtime/vdom/hot-reload.js +19 -19
- package/dist/runtime/vdom/index.js +2 -2
- 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 +68 -68
- package/dist/runtime/vdom/vdom.js +12 -12
- package/package.json +3 -3
- package/src/core-tags/core/await/AsyncValue.js +1 -1
- package/src/node_modules/@internal/components-registry/index-browser.js +2 -2
- package/src/node_modules/@internal/set-immediate/index-browser.js +2 -0
- package/src/node_modules/@internal/set-immediate/index-worker.js +31 -2
- package/src/node_modules/@internal/set-immediate/index.js +1 -0
- package/src/node_modules/@internal/set-immediate/queueMicrotask.js +8 -0
- package/src/runtime/helpers/class-value.js +2 -5
- package/src/runtime/helpers/style-value.js +2 -2
- package/src/runtime/html/AsyncStream.js +4 -1
- package/src/runtime/vdom/VElement.js +15 -11
- package/src/runtime/vdom/hot-reload.js +2 -2
- package/dist/runtime/queueMicrotask.js +0 -14
- package/src/runtime/queueMicrotask.js +0 -14
@@ -1,29 +1,29 @@
|
|
1
1
|
"use strict";
|
2
2
|
var componentsUtil = require("@internal/components-util");
|
3
|
-
var existingComponentLookup = componentsUtil.
|
4
|
-
var destroyNodeRecursive = componentsUtil.
|
3
|
+
var existingComponentLookup = componentsUtil._k_;
|
4
|
+
var destroyNodeRecursive = componentsUtil._Q_;
|
5
5
|
var addComponentRootToKeyedElements =
|
6
|
-
componentsUtil.
|
7
|
-
var normalizeComponentKey = componentsUtil.
|
6
|
+
componentsUtil._l_;
|
7
|
+
var normalizeComponentKey = componentsUtil._T_;
|
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").bw_;
|
12
12
|
var fragment = require("./fragment");
|
13
13
|
var helpers = require("./helpers");
|
14
14
|
var virtualizeElement = VElement.cf_;
|
15
15
|
var morphAttrs = VElement.cg_;
|
16
|
-
var keysByDOMNode = domData.
|
17
|
-
var componentByDOMNode = domData.
|
18
|
-
var vElementByDOMNode = domData.
|
19
|
-
var detachedByDOMNode = domData.
|
16
|
+
var keysByDOMNode = domData._I_;
|
17
|
+
var componentByDOMNode = domData._n_;
|
18
|
+
var vElementByDOMNode = domData._J_;
|
19
|
+
var detachedByDOMNode = domData.aU_;
|
20
20
|
|
21
|
-
var insertBefore = helpers.
|
22
|
-
var insertAfter = helpers.
|
21
|
+
var insertBefore = helpers.bd_;
|
22
|
+
var insertAfter = helpers.be_;
|
23
23
|
var nextSibling = helpers.ck_;
|
24
|
-
var firstChild = helpers.
|
25
|
-
var removeChild = helpers.
|
26
|
-
var createFragmentNode = fragment.
|
24
|
+
var firstChild = helpers.az_;
|
25
|
+
var removeChild = helpers.bf_;
|
26
|
+
var createFragmentNode = fragment._j_;
|
27
27
|
var beginFragmentNode = fragment.cp_;
|
28
28
|
|
29
29
|
var ELEMENT_NODE = 1;
|
@@ -42,7 +42,7 @@ function isAutoKey(key) {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
function compareNodeNames(fromEl, toEl) {
|
45
|
-
return fromEl.
|
45
|
+
return fromEl.cb_ === toEl.cb_;
|
46
46
|
}
|
47
47
|
|
48
48
|
function caseInsensitiveCompare(a, b) {
|
@@ -51,7 +51,7 @@ function caseInsensitiveCompare(a, b) {
|
|
51
51
|
|
52
52
|
function onNodeAdded(node, componentsContext) {
|
53
53
|
if (node.nodeType === ELEMENT_NODE) {
|
54
|
-
eventDelegation.
|
54
|
+
eventDelegation.aT_(node, componentsContext);
|
55
55
|
}
|
56
56
|
}
|
57
57
|
|
@@ -61,8 +61,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
61
61
|
var keySequences = Object.create(null);
|
62
62
|
|
63
63
|
if (componentsContext) {
|
64
|
-
globalComponentsContext = componentsContext.
|
65
|
-
isHydrate = globalComponentsContext.
|
64
|
+
globalComponentsContext = componentsContext.p_;
|
65
|
+
isHydrate = globalComponentsContext._Y_;
|
66
66
|
}
|
67
67
|
|
68
68
|
function insertVirtualNodeBefore(
|
@@ -73,21 +73,21 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
73
73
|
ownerComponent,
|
74
74
|
parentComponent)
|
75
75
|
{
|
76
|
-
var realNode = vNode.
|
76
|
+
var realNode = vNode.bm_(host, parentEl.namespaceURI);
|
77
77
|
insertBefore(realNode, referenceEl, parentEl);
|
78
78
|
|
79
79
|
if (
|
80
|
-
vNode.
|
81
|
-
vNode.
|
80
|
+
vNode.bW_ === ELEMENT_NODE ||
|
81
|
+
vNode.bW_ === FRAGMENT_NODE)
|
82
82
|
{
|
83
83
|
if (key) {
|
84
84
|
keysByDOMNode.set(realNode, key);
|
85
|
-
(isAutoKey(key) ? parentComponent : ownerComponent).
|
85
|
+
(isAutoKey(key) ? parentComponent : ownerComponent).K_[
|
86
86
|
key] =
|
87
87
|
realNode;
|
88
88
|
}
|
89
89
|
|
90
|
-
if (vNode.
|
90
|
+
if (vNode.cb_ !== "textarea") {
|
91
91
|
morphChildren(realNode, vNode, parentComponent);
|
92
92
|
}
|
93
93
|
|
@@ -104,7 +104,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
104
104
|
ownerComponent,
|
105
105
|
parentComponent)
|
106
106
|
{
|
107
|
-
var rootNode = component.
|
107
|
+
var rootNode = component._C_ = insertBefore(
|
108
108
|
createFragmentNode(),
|
109
109
|
referenceNode,
|
110
110
|
referenceNodeParentEl
|
@@ -114,7 +114,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
114
114
|
if (key && ownerComponent) {
|
115
115
|
key = normalizeComponentKey(key, parentComponent.id);
|
116
116
|
addComponentRootToKeyedElements(
|
117
|
-
ownerComponent.
|
117
|
+
ownerComponent.K_,
|
118
118
|
key,
|
119
119
|
rootNode,
|
120
120
|
component.id
|
@@ -126,7 +126,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
126
126
|
}
|
127
127
|
|
128
128
|
function morphComponent(component, vComponent) {
|
129
|
-
morphChildren(component.
|
129
|
+
morphChildren(component._C_, vComponent, component);
|
130
130
|
}
|
131
131
|
|
132
132
|
var detachedNodes = [];
|
@@ -147,7 +147,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
147
147
|
|
148
148
|
function morphChildren(fromNode, toNode, parentComponent) {
|
149
149
|
var curFromNodeChild = firstChild(fromNode);
|
150
|
-
var curToNodeChild = toNode.
|
150
|
+
var curToNodeChild = toNode.az_;
|
151
151
|
|
152
152
|
var curToNodeKey;
|
153
153
|
var curFromNodeKey;
|
@@ -162,26 +162,26 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
162
162
|
|
163
163
|
outer: while (curToNodeChild) {
|
164
164
|
toNextSibling = curToNodeChild.ck_;
|
165
|
-
curToNodeType = curToNodeChild.
|
166
|
-
curToNodeKey = curToNodeChild.
|
165
|
+
curToNodeType = curToNodeChild.bW_;
|
166
|
+
curToNodeKey = curToNodeChild.bV_;
|
167
167
|
|
168
168
|
// Skip <!doctype>
|
169
169
|
if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {
|
170
170
|
curFromNodeChild = nextSibling(curFromNodeChild);
|
171
171
|
}
|
172
172
|
|
173
|
-
var ownerComponent = curToNodeChild.
|
173
|
+
var ownerComponent = curToNodeChild._L_ || parentComponent;
|
174
174
|
var referenceComponent;
|
175
175
|
|
176
176
|
if (curToNodeType === COMPONENT_NODE) {
|
177
|
-
var component = curToNodeChild.
|
177
|
+
var component = curToNodeChild.s_;
|
178
178
|
if (
|
179
179
|
(matchingFromComponent = existingComponentLookup[component.id]) ===
|
180
180
|
undefined)
|
181
181
|
{
|
182
182
|
if (isHydrate) {
|
183
183
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
184
|
-
component.
|
184
|
+
component._C_ = rootNode;
|
185
185
|
componentByDOMNode.set(rootNode, component);
|
186
186
|
|
187
187
|
if (ownerComponent && curToNodeKey) {
|
@@ -190,7 +190,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
190
190
|
parentComponent.id
|
191
191
|
);
|
192
192
|
addComponentRootToKeyedElements(
|
193
|
-
ownerComponent.
|
193
|
+
ownerComponent.K_,
|
194
194
|
curToNodeKey,
|
195
195
|
rootNode,
|
196
196
|
component.id
|
@@ -214,17 +214,17 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
214
214
|
);
|
215
215
|
}
|
216
216
|
} else {
|
217
|
-
if (matchingFromComponent.
|
217
|
+
if (matchingFromComponent._C_ !== curFromNodeChild) {
|
218
218
|
if (
|
219
219
|
curFromNodeChild && (
|
220
220
|
fromComponent = componentByDOMNode.get(curFromNodeChild)) &&
|
221
|
-
globalComponentsContext.
|
221
|
+
globalComponentsContext.q_[
|
222
222
|
fromComponent.id] ===
|
223
223
|
undefined)
|
224
224
|
{
|
225
225
|
// The component associated with the current real DOM node was not rendered
|
226
226
|
// so we should just remove it out of the real DOM by destroying it
|
227
|
-
curFromNodeChild = nextSibling(fromComponent.
|
227
|
+
curFromNodeChild = nextSibling(fromComponent._C_);
|
228
228
|
destroyComponent(fromComponent);
|
229
229
|
continue;
|
230
230
|
}
|
@@ -232,7 +232,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
232
232
|
// We need to move the existing component into
|
233
233
|
// the correct location
|
234
234
|
insertBefore(
|
235
|
-
matchingFromComponent.
|
235
|
+
matchingFromComponent._C_,
|
236
236
|
curFromNodeChild,
|
237
237
|
fromNode
|
238
238
|
);
|
@@ -241,7 +241,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
241
241
|
curFromNodeChild && nextSibling(curFromNodeChild);
|
242
242
|
}
|
243
243
|
|
244
|
-
if (!curToNodeChild.
|
244
|
+
if (!curToNodeChild.ac_) {
|
245
245
|
morphComponent(component, curToNodeChild);
|
246
246
|
}
|
247
247
|
}
|
@@ -266,7 +266,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
266
266
|
// up elements
|
267
267
|
curToNodeKey = (
|
268
268
|
keySequences[referenceComponent.id] || (
|
269
|
-
keySequences[referenceComponent.id] = new KeySequence())).
|
269
|
+
keySequences[referenceComponent.id] = new KeySequence())).aL_(
|
270
270
|
curToNodeKey);
|
271
271
|
|
272
272
|
if (curFromNodeChild) {
|
@@ -277,12 +277,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
277
277
|
|
278
278
|
if (curFromNodeKey === curToNodeKey) {
|
279
279
|
// Elements line up. Now we just have to make sure they are compatible
|
280
|
-
if (!curToNodeChild.
|
280
|
+
if (!curToNodeChild.ac_) {
|
281
281
|
// We just skip over the fromNode if it is preserved
|
282
282
|
|
283
283
|
if (
|
284
284
|
curVFromNodeChild &&
|
285
|
-
curToNodeType === curVFromNodeChild.
|
285
|
+
curToNodeType === curVFromNodeChild.bW_ && (
|
286
286
|
curToNodeType !== ELEMENT_NODE ||
|
287
287
|
compareNodeNames(curToNodeChild, curVFromNodeChild)))
|
288
288
|
{
|
@@ -316,7 +316,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
316
316
|
}
|
317
317
|
}
|
318
318
|
} else {
|
319
|
-
matchingFromEl = referenceComponent.
|
319
|
+
matchingFromEl = referenceComponent.K_[curToNodeKey];
|
320
320
|
if (
|
321
321
|
matchingFromEl === undefined ||
|
322
322
|
matchingFromEl === curFromNodeChild)
|
@@ -324,19 +324,19 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
324
324
|
if (isHydrate && curFromNodeChild) {
|
325
325
|
if (
|
326
326
|
curFromNodeChild.nodeType === ELEMENT_NODE && (
|
327
|
-
curToNodeChild.
|
327
|
+
curToNodeChild.ac_ ||
|
328
328
|
caseInsensitiveCompare(
|
329
329
|
curFromNodeChild.nodeName,
|
330
|
-
curToNodeChild.
|
330
|
+
curToNodeChild.cb_ || ""
|
331
331
|
)))
|
332
332
|
{
|
333
333
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
334
|
-
curVFromNodeChild.
|
334
|
+
curVFromNodeChild.cb_ = curToNodeChild.cb_;
|
335
335
|
keysByDOMNode.set(curFromNodeChild, curToNodeKey);
|
336
|
-
referenceComponent.
|
336
|
+
referenceComponent.K_[curToNodeKey] =
|
337
337
|
curFromNodeChild;
|
338
338
|
|
339
|
-
if (curToNodeChild.
|
339
|
+
if (curToNodeChild.ac_) {
|
340
340
|
vElementByDOMNode.set(curFromNodeChild, curVFromNodeChild);
|
341
341
|
} else {
|
342
342
|
morphEl(
|
@@ -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.bW_ === FRAGMENT_NODE &&
|
355
355
|
curFromNodeChild.nodeType === COMMENT_NODE)
|
356
356
|
{
|
357
357
|
var content = curFromNodeChild.nodeValue;
|
@@ -384,11 +384,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
384
384
|
);
|
385
385
|
keysByDOMNode.set(fragment, curToNodeKey);
|
386
386
|
vElementByDOMNode.set(fragment, curToNodeChild);
|
387
|
-
referenceComponent.
|
387
|
+
referenceComponent.K_[curToNodeKey] = fragment;
|
388
388
|
removeChild(curFromNodeChild);
|
389
389
|
removeChild(endNode);
|
390
390
|
|
391
|
-
if (!curToNodeChild.
|
391
|
+
if (!curToNodeChild.ac_) {
|
392
392
|
morphChildren(fragment, curToNodeChild, parentComponent);
|
393
393
|
}
|
394
394
|
|
@@ -413,12 +413,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
413
413
|
detachedByDOMNode.set(matchingFromEl, undefined);
|
414
414
|
}
|
415
415
|
|
416
|
-
if (!curToNodeChild.
|
416
|
+
if (!curToNodeChild.ac_) {
|
417
417
|
curVFromNodeChild = vElementByDOMNode.get(matchingFromEl);
|
418
418
|
|
419
419
|
if (
|
420
420
|
curVFromNodeChild &&
|
421
|
-
curToNodeType === curVFromNodeChild.
|
421
|
+
curToNodeType === curVFromNodeChild.bW_ && (
|
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.bV_ === curFromNodeKey)
|
440
440
|
{
|
441
441
|
// Single element swap
|
442
442
|
|
@@ -527,7 +527,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
527
527
|
curFromNodeChild = fromNextSibling;
|
528
528
|
|
529
529
|
if (
|
530
|
-
!globalComponentsContext.
|
530
|
+
!globalComponentsContext.q_[fromComponent.id])
|
531
531
|
{
|
532
532
|
destroyComponent(fromComponent);
|
533
533
|
}
|
@@ -549,18 +549,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
549
549
|
|
550
550
|
if (
|
551
551
|
caseInsensitiveCompare(
|
552
|
-
curVFromNodeChild.
|
553
|
-
curToNodeChild.
|
552
|
+
curVFromNodeChild.cb_,
|
553
|
+
curToNodeChild.cb_
|
554
554
|
))
|
555
555
|
{
|
556
|
-
curVFromNodeChild.
|
556
|
+
curVFromNodeChild.cb_ = curToNodeChild.cb_;
|
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.bV_) {
|
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;
|
@@ -654,7 +654,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
654
654
|
if (fromComponent = componentByDOMNode.get(curFromNodeChild)) {
|
655
655
|
curFromNodeChild = fromNextSibling;
|
656
656
|
if (
|
657
|
-
!globalComponentsContext.
|
657
|
+
!globalComponentsContext.q_[fromComponent.id])
|
658
658
|
{
|
659
659
|
destroyComponent(fromComponent);
|
660
660
|
}
|
@@ -670,7 +670,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
670
670
|
referenceComponent = parentComponent;
|
671
671
|
} else {
|
672
672
|
referenceComponent =
|
673
|
-
curVFromNodeChild && curVFromNodeChild.
|
673
|
+
curVFromNodeChild && curVFromNodeChild._L_;
|
674
674
|
}
|
675
675
|
|
676
676
|
detachNode(curFromNodeChild, fromNode, referenceComponent);
|
@@ -681,23 +681,23 @@ 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.cb_;
|
685
|
+
var constId = toEl.cd_;
|
686
686
|
vElementByDOMNode.set(fromEl, toEl);
|
687
687
|
|
688
|
-
if (constId !== undefined && vFromEl.
|
688
|
+
if (constId !== undefined && vFromEl.cd_ === constId) {
|
689
689
|
return;
|
690
690
|
}
|
691
691
|
|
692
692
|
morphAttrs(fromEl, vFromEl, toEl);
|
693
693
|
|
694
|
-
if (toEl.
|
694
|
+
if (toEl.ab_) {
|
695
695
|
return;
|
696
696
|
}
|
697
697
|
|
698
698
|
if (nodeName === "textarea") {
|
699
|
-
if (toEl.
|
700
|
-
fromEl.value = toEl.
|
699
|
+
if (toEl.cc_ !== vFromEl.cc_) {
|
700
|
+
fromEl.value = toEl.cc_;
|
701
701
|
}
|
702
702
|
} else {
|
703
703
|
morphChildren(fromEl, toEl, parentComponent);
|
@@ -709,7 +709,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
709
709
|
|
710
710
|
|
711
711
|
|
712
|
-
morphChildren(fromNode, toNode, toNode.
|
712
|
+
morphChildren(fromNode, toNode, toNode.s_);
|
713
713
|
|
714
714
|
detachedNodes.forEach(function (node) {
|
715
715
|
var detachedFromComponent = detachedByDOMNode.get(node);
|
@@ -726,7 +726,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
726
726
|
detachedFromComponent !== true && detachedFromComponent
|
727
727
|
);
|
728
728
|
|
729
|
-
if (eventDelegation.
|
729
|
+
if (eventDelegation.am_(node) != false) {
|
730
730
|
removeChild(node);
|
731
731
|
}
|
732
732
|
}
|
@@ -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.bN_(virtualize(curChild, ownerComponent));
|
15
15
|
curChild = curChild.nextSibling;
|
16
16
|
}
|
17
17
|
}
|
@@ -38,7 +38,7 @@ function virtualizeHTML(html, ownerComponent) {
|
|
38
38
|
var curChild = parseHTML(html);
|
39
39
|
|
40
40
|
while (curChild) {
|
41
|
-
vdomFragment.
|
41
|
+
vdomFragment.bN_(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.bN_(vdomNode || new VText(value.toString()));
|
69
|
+
return this.ce_();
|
70
70
|
};
|
71
71
|
|
72
|
-
Node_prototype.
|
73
|
-
return this.
|
72
|
+
Node_prototype.bS_ = function () {
|
73
|
+
return this.bN_(new VDocumentFragment());
|
74
74
|
};
|
75
75
|
|
76
|
-
exports.
|
77
|
-
exports.
|
78
|
-
exports.
|
79
|
-
exports.
|
80
|
-
exports.
|
76
|
+
exports.bx_ = VDocumentFragment;
|
77
|
+
exports.bw_ = VElement;
|
78
|
+
exports.by_ = VText;
|
79
|
+
exports.bz_ = VComponent;
|
80
|
+
exports.bA_ = VFragment;
|
81
81
|
exports.cf_ = virtualize;
|
82
|
-
exports.
|
82
|
+
exports.bB_ = virtualizeHTML;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.33.
|
3
|
+
"version": "5.33.10",
|
4
4
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
5
5
|
"keywords": [
|
6
6
|
"front-end",
|
@@ -64,8 +64,8 @@
|
|
64
64
|
"build": "babel ./src --out-dir ./dist --extensions .js --copy-files --config-file ../../babel.config.js --env-name=production"
|
65
65
|
},
|
66
66
|
"dependencies": {
|
67
|
-
"@marko/compiler": "^5.35.
|
68
|
-
"@marko/translator-default": "^5.32.
|
67
|
+
"@marko/compiler": "^5.35.8",
|
68
|
+
"@marko/translator-default": "^5.32.9",
|
69
69
|
"app-module-path": "^2.2.0",
|
70
70
|
"argly": "^1.2.0",
|
71
71
|
"browser-refresh-client": "1.1.4",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
var complain = "MARKO_DEBUG" && require("complain");
|
2
|
+
var setImmediate = require("@internal/set-immediate").___setImmediate;
|
2
3
|
var warp10Finalize = require("warp10/finalize");
|
3
|
-
var queueMicrotask = require("../../../runtime/queueMicrotask");
|
4
4
|
var defineComponent = require("../../../runtime/components/defineComponent");
|
5
5
|
var eventDelegation = require("../../../runtime/components/event-delegation");
|
6
6
|
var createFragmentNode =
|
@@ -39,7 +39,7 @@ function register(type, def) {
|
|
39
39
|
|
40
40
|
if (pendingForType) {
|
41
41
|
delete pendingDefs[type];
|
42
|
-
|
42
|
+
setImmediate(function () {
|
43
43
|
pendingForType.forEach(function (args) {
|
44
44
|
tryHydrateComponent(args[0], args[1], args[2], args[3])();
|
45
45
|
});
|
@@ -1,2 +1,31 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
var queueMicrotask = require("./queueMicrotask");
|
2
|
+
var count = 0;
|
3
|
+
var queue = new Set();
|
4
|
+
function noop() {}
|
5
|
+
|
6
|
+
exports.___setImmediate = function setImmediate(cb) {
|
7
|
+
queue.add(cb);
|
8
|
+
if (!count) {
|
9
|
+
queueMicrotaskInternal(noop);
|
10
|
+
}
|
11
|
+
return cb;
|
12
|
+
};
|
13
|
+
|
14
|
+
exports.___clearImmediate = function clearImmediate(id) {
|
15
|
+
queue.delete(id);
|
16
|
+
};
|
17
|
+
|
18
|
+
exports.___queueMicrotask = queueMicrotaskInternal;
|
19
|
+
|
20
|
+
function queueMicrotaskInternal(cb) {
|
21
|
+
count++;
|
22
|
+
queueMicrotask(function () {
|
23
|
+
if (--count === 0 && queue.size) {
|
24
|
+
for (const fn of queue) {
|
25
|
+
queueMicrotask(fn);
|
26
|
+
}
|
27
|
+
queue = new Set();
|
28
|
+
}
|
29
|
+
cb();
|
30
|
+
});
|
31
|
+
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module.exports = function classHelper(arg) {
|
4
4
|
switch (typeof arg) {
|
5
5
|
case "string":
|
6
|
-
return arg ||
|
6
|
+
return arg || undefined;
|
7
7
|
case "object":
|
8
8
|
var result = "";
|
9
9
|
var sep = "";
|
@@ -25,9 +25,6 @@ module.exports = function classHelper(arg) {
|
|
25
25
|
}
|
26
26
|
}
|
27
27
|
|
28
|
-
return result ||
|
29
|
-
|
30
|
-
default:
|
31
|
-
return null;
|
28
|
+
return result || undefined;
|
32
29
|
}
|
33
30
|
};
|
@@ -7,7 +7,7 @@ var changeCase = require("./_change-case");
|
|
7
7
|
*/
|
8
8
|
module.exports = function styleHelper(style) {
|
9
9
|
if (!style) {
|
10
|
-
return
|
10
|
+
return;
|
11
11
|
}
|
12
12
|
|
13
13
|
var type = typeof style;
|
@@ -38,7 +38,7 @@ module.exports = function styleHelper(style) {
|
|
38
38
|
}
|
39
39
|
}
|
40
40
|
|
41
|
-
return styles ||
|
41
|
+
return styles || undefined;
|
42
42
|
}
|
43
43
|
|
44
44
|
return style;
|
@@ -10,6 +10,7 @@ var escapeXmlHelper = require("./helpers/escape-xml");
|
|
10
10
|
var StringWriter = require("./StringWriter");
|
11
11
|
var escapeXmlOrNullish = escapeXmlHelper.x;
|
12
12
|
var escapeXmlString = escapeXmlHelper.___escapeXML;
|
13
|
+
var missingSetTimeout = typeof setTimeout !== "function";
|
13
14
|
|
14
15
|
function noop() {}
|
15
16
|
|
@@ -293,7 +294,9 @@ var proto = (AsyncStream.prototype = {
|
|
293
294
|
}
|
294
295
|
}
|
295
296
|
|
296
|
-
if (
|
297
|
+
if (missingSetTimeout) {
|
298
|
+
timeout = 0;
|
299
|
+
} else if (timeout == null) {
|
297
300
|
timeout = AsyncStream.DEFAULT_TIMEOUT;
|
298
301
|
}
|
299
302
|
|
@@ -204,14 +204,6 @@ VElement.prototype = {
|
|
204
204
|
|
205
205
|
return el;
|
206
206
|
},
|
207
|
-
|
208
|
-
___hasAttribute: function (name) {
|
209
|
-
// We don't care about the namespaces since the there
|
210
|
-
// is no chance that attributes with the same name will have
|
211
|
-
// different namespaces
|
212
|
-
var value = this.___attributes[name];
|
213
|
-
return value != null && value !== false;
|
214
|
-
},
|
215
207
|
};
|
216
208
|
|
217
209
|
inherit(VElement, VNode);
|
@@ -303,13 +295,25 @@ VElement.___morphAttrs = function (fromEl, vFromEl, toEl) {
|
|
303
295
|
|
304
296
|
if (toFlags & FLAG_SIMPLE_ATTRS && fromFlags & FLAG_SIMPLE_ATTRS) {
|
305
297
|
if (oldAttrs["class"] !== (attrValue = attrs["class"])) {
|
306
|
-
|
298
|
+
if (attrValue) {
|
299
|
+
fromEl.className = attrValue;
|
300
|
+
} else {
|
301
|
+
fromEl.removeAttribute("class");
|
302
|
+
}
|
307
303
|
}
|
308
304
|
if (oldAttrs.id !== (attrValue = attrs.id)) {
|
309
|
-
|
305
|
+
if (attrValue) {
|
306
|
+
fromEl.id = attrValue;
|
307
|
+
} else {
|
308
|
+
fromEl.removeAttribute("id");
|
309
|
+
}
|
310
310
|
}
|
311
311
|
if (oldAttrs.style !== (attrValue = attrs.style)) {
|
312
|
-
|
312
|
+
if (attrValue) {
|
313
|
+
fromEl.style.cssText = attrValue;
|
314
|
+
} else {
|
315
|
+
fromEl.removeAttribute("style");
|
316
|
+
}
|
313
317
|
}
|
314
318
|
return;
|
315
319
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
var registry = require("@internal/components-registry");
|
2
|
+
var setImmediate = require("@internal/set-immediate").___setImmediate;
|
2
3
|
var updateManager = require("../components/update-manager");
|
3
|
-
var queueMicrotask = require("../queueMicrotask");
|
4
4
|
var runtime = require(".");
|
5
5
|
|
6
6
|
var createTemplate = runtime.t;
|
@@ -27,7 +27,7 @@ exports.t = runtime.t = function (typeName) {
|
|
27
27
|
if (instances.size) {
|
28
28
|
if (!queue) {
|
29
29
|
queue = [];
|
30
|
-
|
30
|
+
setImmediate(batchUpdate);
|
31
31
|
}
|
32
32
|
|
33
33
|
queue.push(function () {
|