marko 5.35.6 → 5.35.8
Sign up to get free protection for your applications and to get access to all the features.
- 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/of-fallback.js +4 -0
- 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 +3 -3
- 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/of-fallback.js +4 -0
- 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,30 +1,30 @@
|
|
1
1
|
"use strict";
|
2
2
|
var componentsUtil = require("@internal/components-util");
|
3
|
-
var existingComponentLookup = componentsUtil.
|
4
|
-
var destroyNodeRecursive = componentsUtil.
|
3
|
+
var existingComponentLookup = componentsUtil._l_;
|
4
|
+
var destroyNodeRecursive = componentsUtil._R_;
|
5
5
|
var addComponentRootToKeyedElements =
|
6
|
-
componentsUtil.
|
7
|
-
var normalizeComponentKey = componentsUtil.
|
6
|
+
componentsUtil._m_;
|
7
|
+
var normalizeComponentKey = componentsUtil._U_;
|
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").bz_;
|
12
12
|
var fragment = require("./fragment");
|
13
13
|
var helpers = require("./helpers");
|
14
|
-
var virtualizeElement = VElement.
|
15
|
-
var morphAttrs = VElement.
|
16
|
-
var keysByDOMNode = domData.
|
17
|
-
var componentByDOMNode = domData.
|
18
|
-
var vElementByDOMNode = domData.
|
19
|
-
var detachedByDOMNode = domData.
|
20
|
-
|
21
|
-
var insertBefore = helpers.
|
22
|
-
var insertAfter = helpers.
|
23
|
-
var nextSibling = helpers.
|
24
|
-
var firstChild = helpers.
|
25
|
-
var removeChild = helpers.
|
26
|
-
var createFragmentNode = fragment.
|
27
|
-
var beginFragmentNode = fragment.
|
14
|
+
var virtualizeElement = VElement.ci_;
|
15
|
+
var morphAttrs = VElement.cj_;
|
16
|
+
var keysByDOMNode = domData._n_;
|
17
|
+
var componentByDOMNode = domData._p_;
|
18
|
+
var vElementByDOMNode = domData._K_;
|
19
|
+
var detachedByDOMNode = domData.aW_;
|
20
|
+
|
21
|
+
var insertBefore = helpers.bf_;
|
22
|
+
var insertAfter = helpers.bg_;
|
23
|
+
var nextSibling = helpers.cn_;
|
24
|
+
var firstChild = helpers.aA_;
|
25
|
+
var removeChild = helpers.bh_;
|
26
|
+
var createFragmentNode = fragment._k_;
|
27
|
+
var beginFragmentNode = fragment.cs_;
|
28
28
|
|
29
29
|
var ELEMENT_NODE = 1;
|
30
30
|
var TEXT_NODE = 3;
|
@@ -42,7 +42,7 @@ function isAutoKey(key) {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
function compareNodeNames(fromEl, toEl) {
|
45
|
-
return fromEl.
|
45
|
+
return fromEl.ce_ === toEl.ce_;
|
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.aV_(node, componentsContext);
|
55
55
|
}
|
56
56
|
}
|
57
57
|
|
@@ -62,7 +62,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
62
62
|
|
63
63
|
if (componentsContext) {
|
64
64
|
globalComponentsContext = componentsContext.p_;
|
65
|
-
isHydrate = globalComponentsContext.
|
65
|
+
isHydrate = globalComponentsContext._Z_;
|
66
66
|
}
|
67
67
|
|
68
68
|
function insertVirtualNodeBefore(
|
@@ -73,12 +73,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
73
73
|
ownerComponent,
|
74
74
|
parentComponent)
|
75
75
|
{
|
76
|
-
var realNode = vNode.
|
76
|
+
var realNode = vNode.bo_(host, parentEl.namespaceURI);
|
77
77
|
insertBefore(realNode, referenceEl, parentEl);
|
78
78
|
|
79
79
|
if (
|
80
|
-
vNode.
|
81
|
-
vNode.
|
80
|
+
vNode.bZ_ === ELEMENT_NODE ||
|
81
|
+
vNode.bZ_ === FRAGMENT_NODE)
|
82
82
|
{
|
83
83
|
if (key) {
|
84
84
|
keysByDOMNode.set(realNode, key);
|
@@ -87,7 +87,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
87
87
|
realNode;
|
88
88
|
}
|
89
89
|
|
90
|
-
if (vNode.
|
90
|
+
if (vNode.ce_ !== "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._E_ = insertBefore(
|
108
108
|
createFragmentNode(),
|
109
109
|
referenceNode,
|
110
110
|
referenceNodeParentEl
|
@@ -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._E_, 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.aA_;
|
151
151
|
|
152
152
|
var curToNodeKey;
|
153
153
|
var curFromNodeKey;
|
@@ -161,16 +161,16 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
161
161
|
var fromComponent;
|
162
162
|
|
163
163
|
outer: while (curToNodeChild) {
|
164
|
-
toNextSibling = curToNodeChild.
|
165
|
-
curToNodeType = curToNodeChild.
|
166
|
-
curToNodeKey = curToNodeChild.
|
164
|
+
toNextSibling = curToNodeChild.cn_;
|
165
|
+
curToNodeType = curToNodeChild.bZ_;
|
166
|
+
curToNodeKey = curToNodeChild.bY_;
|
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._M_ || parentComponent;
|
174
174
|
var referenceComponent;
|
175
175
|
|
176
176
|
if (curToNodeType === COMPONENT_NODE) {
|
@@ -181,7 +181,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
181
181
|
{
|
182
182
|
if (isHydrate) {
|
183
183
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
184
|
-
component.
|
184
|
+
component._E_ = rootNode;
|
185
185
|
componentByDOMNode.set(rootNode, component);
|
186
186
|
|
187
187
|
if (ownerComponent && curToNodeKey) {
|
@@ -214,7 +214,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
214
214
|
);
|
215
215
|
}
|
216
216
|
} else {
|
217
|
-
if (matchingFromComponent.
|
217
|
+
if (matchingFromComponent._E_ !== curFromNodeChild) {
|
218
218
|
if (
|
219
219
|
curFromNodeChild && (
|
220
220
|
fromComponent = componentByDOMNode.get(curFromNodeChild)) &&
|
@@ -224,7 +224,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
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._E_);
|
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._E_,
|
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.ad_) {
|
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())).aN_(
|
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.ad_) {
|
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.bZ_ && (
|
286
286
|
curToNodeType !== ELEMENT_NODE ||
|
287
287
|
compareNodeNames(curToNodeChild, curVFromNodeChild)))
|
288
288
|
{
|
@@ -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.ad_ ||
|
328
328
|
caseInsensitiveCompare(
|
329
329
|
curFromNodeChild.nodeName,
|
330
|
-
curToNodeChild.
|
330
|
+
curToNodeChild.ce_ || ""
|
331
331
|
)))
|
332
332
|
{
|
333
333
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
334
|
-
curVFromNodeChild.
|
334
|
+
curVFromNodeChild.ce_ = curToNodeChild.ce_;
|
335
335
|
keysByDOMNode.set(curFromNodeChild, curToNodeKey);
|
336
336
|
referenceComponent.K_[curToNodeKey] =
|
337
337
|
curFromNodeChild;
|
338
338
|
|
339
|
-
if (curToNodeChild.
|
339
|
+
if (curToNodeChild.ad_) {
|
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.bZ_ === FRAGMENT_NODE &&
|
355
355
|
curFromNodeChild.nodeType === COMMENT_NODE)
|
356
356
|
{
|
357
357
|
var content = curFromNodeChild.nodeValue;
|
@@ -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;
|
@@ -388,7 +387,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
388
387
|
removeChild(curFromNodeChild);
|
389
388
|
removeChild(endNode);
|
390
389
|
|
391
|
-
if (!curToNodeChild.
|
390
|
+
if (!curToNodeChild.ad_) {
|
392
391
|
morphChildren(fragment, curToNodeChild, parentComponent);
|
393
392
|
}
|
394
393
|
|
@@ -413,12 +412,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
413
412
|
detachedByDOMNode.set(matchingFromEl, undefined);
|
414
413
|
}
|
415
414
|
|
416
|
-
if (!curToNodeChild.
|
415
|
+
if (!curToNodeChild.ad_) {
|
417
416
|
curVFromNodeChild = vElementByDOMNode.get(matchingFromEl);
|
418
417
|
|
419
418
|
if (
|
420
419
|
curVFromNodeChild &&
|
421
|
-
curToNodeType === curVFromNodeChild.
|
420
|
+
curToNodeType === curVFromNodeChild.bZ_ && (
|
422
421
|
curToNodeType !== ELEMENT_NODE ||
|
423
422
|
compareNodeNames(curVFromNodeChild, curToNodeChild)))
|
424
423
|
{
|
@@ -436,7 +435,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
436
435
|
|
437
436
|
if (
|
438
437
|
toNextSibling &&
|
439
|
-
toNextSibling.
|
438
|
+
toNextSibling.bY_ === curFromNodeKey)
|
440
439
|
{
|
441
440
|
// Single element swap
|
442
441
|
|
@@ -549,18 +548,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
549
548
|
|
550
549
|
if (
|
551
550
|
caseInsensitiveCompare(
|
552
|
-
curVFromNodeChild.
|
553
|
-
curToNodeChild.
|
551
|
+
curVFromNodeChild.ce_,
|
552
|
+
curToNodeChild.ce_
|
554
553
|
))
|
555
554
|
{
|
556
|
-
curVFromNodeChild.
|
555
|
+
curVFromNodeChild.ce_ = curToNodeChild.ce_;
|
557
556
|
}
|
558
557
|
} else {
|
559
558
|
// Skip over nodes that don't look like ours...
|
560
559
|
curFromNodeChild = fromNextSibling;
|
561
560
|
continue;
|
562
561
|
}
|
563
|
-
} else if (curFromNodeKey = curVFromNodeChild.
|
562
|
+
} else if (curFromNodeKey = curVFromNodeChild.bY_) {
|
564
563
|
// We have a keyed element here but our target VDOM node
|
565
564
|
// is not keyed so this not doesn't belong
|
566
565
|
isCompatible = false;
|
@@ -587,18 +586,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
587
586
|
{
|
588
587
|
// Both nodes being compared are Text or Comment nodes
|
589
588
|
isCompatible = true;
|
590
|
-
var curToNodeValue = curToNodeChild.
|
589
|
+
var curToNodeValue = curToNodeChild.cp_;
|
591
590
|
var curFromNodeValue = curFromNodeChild.nodeValue;
|
592
591
|
if (curFromNodeValue !== curToNodeValue) {
|
593
592
|
if (
|
594
593
|
isHydrate &&
|
595
594
|
toNextSibling &&
|
596
595
|
curFromNodeType === TEXT_NODE &&
|
597
|
-
toNextSibling.
|
596
|
+
toNextSibling.bZ_ === TEXT_NODE &&
|
598
597
|
curFromNodeValue.startsWith(curToNodeValue) &&
|
599
598
|
curFromNodeValue.
|
600
599
|
slice(curToNodeValue.length).
|
601
|
-
startsWith(toNextSibling.
|
600
|
+
startsWith(toNextSibling.cp_))
|
602
601
|
{
|
603
602
|
// In hydrate mode we can use splitText to more efficiently handle
|
604
603
|
// adjacent text vdom nodes that were merged.
|
@@ -643,10 +642,10 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
643
642
|
}
|
644
643
|
|
645
644
|
// We have processed all of the "to nodes".
|
646
|
-
if (fromNode.
|
645
|
+
if (fromNode.cr_) {
|
647
646
|
// If we are in an unfinished fragment, we have reached the end of the nodes
|
648
647
|
// we were matching up and need to end the fragment
|
649
|
-
fromNode.
|
648
|
+
fromNode.cr_(curFromNodeChild);
|
650
649
|
} else {
|
651
650
|
// If curFromNodeChild is non-null then we still have some from nodes
|
652
651
|
// left over that need to be removed
|
@@ -675,7 +674,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
675
674
|
referenceComponent = parentComponent;
|
676
675
|
} else {
|
677
676
|
referenceComponent =
|
678
|
-
curVFromNodeChild && curVFromNodeChild.
|
677
|
+
curVFromNodeChild && curVFromNodeChild._M_;
|
679
678
|
}
|
680
679
|
|
681
680
|
detachNode(curFromNodeChild, fromNode, referenceComponent);
|
@@ -686,23 +685,23 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
686
685
|
}
|
687
686
|
|
688
687
|
function morphEl(fromEl, vFromEl, toEl, parentComponent) {
|
689
|
-
var nodeName = toEl.
|
690
|
-
var constId = toEl.
|
688
|
+
var nodeName = toEl.ce_;
|
689
|
+
var constId = toEl.cg_;
|
691
690
|
vElementByDOMNode.set(fromEl, toEl);
|
692
691
|
|
693
|
-
if (constId !== undefined && vFromEl.
|
692
|
+
if (constId !== undefined && vFromEl.cg_ === constId) {
|
694
693
|
return;
|
695
694
|
}
|
696
695
|
|
697
696
|
morphAttrs(fromEl, vFromEl, toEl);
|
698
697
|
|
699
|
-
if (toEl.
|
698
|
+
if (toEl.ac_) {
|
700
699
|
return;
|
701
700
|
}
|
702
701
|
|
703
702
|
if (nodeName === "textarea") {
|
704
|
-
if (toEl.
|
705
|
-
fromEl.value = toEl.
|
703
|
+
if (toEl.cf_ !== vFromEl.cf_) {
|
704
|
+
fromEl.value = toEl.cf_;
|
706
705
|
}
|
707
706
|
} else {
|
708
707
|
morphChildren(fromEl, toEl, parentComponent);
|
@@ -731,7 +730,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
731
730
|
detachedFromComponent !== true && detachedFromComponent
|
732
731
|
);
|
733
732
|
|
734
|
-
if (eventDelegation.
|
733
|
+
if (eventDelegation.an_(node) != false) {
|
735
734
|
removeChild(node);
|
736
735
|
}
|
737
736
|
}
|
@@ -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.bQ_(virtualize(curChild, ownerComponent));
|
15
15
|
curChild = curChild.nextSibling;
|
16
16
|
}
|
17
17
|
}
|
@@ -19,7 +19,7 @@ function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
|
19
19
|
function virtualize(node, ownerComponent) {
|
20
20
|
switch (node.nodeType) {
|
21
21
|
case 1:
|
22
|
-
return VElement.
|
22
|
+
return VElement.ci_(node, virtualizeChildNodes, ownerComponent);
|
23
23
|
case 3:
|
24
24
|
return new VText(node.nodeValue, ownerComponent);
|
25
25
|
case 11:
|
@@ -38,7 +38,7 @@ function virtualizeHTML(html, ownerComponent) {
|
|
38
38
|
var curChild = parseHTML(html);
|
39
39
|
|
40
40
|
while (curChild) {
|
41
|
-
vdomFragment.
|
41
|
+
vdomFragment.bQ_(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.bQ_(vdomNode || new VText(value.toString()));
|
69
|
+
return this.ch_();
|
70
70
|
};
|
71
71
|
|
72
|
-
Node_prototype.
|
73
|
-
return this.
|
72
|
+
Node_prototype.bV_ = function () {
|
73
|
+
return this.bQ_(new VDocumentFragment());
|
74
74
|
};
|
75
75
|
|
76
|
-
exports.
|
77
|
-
exports.
|
78
|
-
exports.
|
79
|
-
exports.
|
80
|
-
exports.
|
81
|
-
exports.
|
82
|
-
exports.
|
76
|
+
exports.bA_ = VDocumentFragment;
|
77
|
+
exports.bz_ = VElement;
|
78
|
+
exports.bB_ = VText;
|
79
|
+
exports.bC_ = VComponent;
|
80
|
+
exports.bD_ = VFragment;
|
81
|
+
exports.ci_ = virtualize;
|
82
|
+
exports.bE_ = virtualizeHTML;
|
package/dist/taglib/index.js
CHANGED
package/index.d.ts
CHANGED
@@ -7,7 +7,6 @@ declare module "*.marko" {
|
|
7
7
|
|
8
8
|
declare global {
|
9
9
|
namespace NodeJS {
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
11
10
|
interface ReadableStream {}
|
12
11
|
}
|
13
12
|
|
@@ -79,11 +78,9 @@ declare global {
|
|
79
78
|
}
|
80
79
|
|
81
80
|
/** Body content created from by a component, typically held in an object with a renderBody property. */
|
82
|
-
|
81
|
+
|
83
82
|
export interface Body<
|
84
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
85
83
|
in Params extends readonly any[] = [],
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
87
84
|
out Return = void,
|
88
85
|
> {}
|
89
86
|
|
@@ -214,7 +211,6 @@ declare global {
|
|
214
211
|
}
|
215
212
|
|
216
213
|
/** The top level api for a Marko Template. */
|
217
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
218
214
|
export abstract class Template<Input = unknown, Return = unknown> {
|
219
215
|
/** Creates a Marko compatible output stream. */
|
220
216
|
createOut(): Out;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.35.
|
3
|
+
"version": "5.35.8",
|
4
4
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
5
5
|
"keywords": [
|
6
6
|
"front-end",
|
@@ -66,7 +66,7 @@
|
|
66
66
|
},
|
67
67
|
"dependencies": {
|
68
68
|
"@marko/compiler": "^5.37.4",
|
69
|
-
"@marko/translator-default": "^6.0.
|
69
|
+
"@marko/translator-default": "^6.0.6",
|
70
70
|
"app-module-path": "^2.2.0",
|
71
71
|
"argly": "^1.2.0",
|
72
72
|
"browser-refresh-client": "1.1.4",
|
@@ -74,7 +74,7 @@
|
|
74
74
|
"csstype": "^3.1.3",
|
75
75
|
"events-light": "^1.0.5",
|
76
76
|
"listener-tracker": "^2.0.0",
|
77
|
-
"minimatch": "^
|
77
|
+
"minimatch": "^10.0.1",
|
78
78
|
"raptor-util": "^3.2.0",
|
79
79
|
"resolve-from": "^5.0.0",
|
80
80
|
"self-closing-tags": "^1.0.1",
|
package/src/compiler/index.js
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
var ok = require("assert").ok;
|
4
4
|
var fs = require("fs");
|
5
|
+
|
6
|
+
// eslint-disable-next-line no-constant-binary-expression
|
5
7
|
var complain = "MARKO_DEBUG" && require("complain");
|
6
8
|
var compiler = require("@marko/compiler");
|
7
9
|
var extend = require("raptor-util/extend");
|
@@ -8,8 +8,9 @@ var req = require("@internal/require");
|
|
8
8
|
var registry = require("@internal/components-registry");
|
9
9
|
var jQuery = require("../../../runtime/components/legacy/jquery");
|
10
10
|
var ready = require("../../../runtime/components/legacy/ready");
|
11
|
-
|
11
|
+
// eslint-disable-next-line no-constant-binary-expression
|
12
12
|
var complain = "MARKO_DEBUG" && require("complain");
|
13
|
+
var hasHowOwnProperty = {}.hasOwnProperty;
|
13
14
|
var stateToJSONDef = {
|
14
15
|
enumerable: false,
|
15
16
|
value: function returnSelf() {
|
@@ -55,7 +56,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
55
56
|
// Inherit from Component if they didn't already
|
56
57
|
ComponentClass.prototype = Object.create(BaseComponent.prototype);
|
57
58
|
for (var propName in proto) {
|
58
|
-
if (
|
59
|
+
if (hasOwnProperty.call(proto, propName)) {
|
59
60
|
ComponentClass.prototype[propName] = proto[propName];
|
60
61
|
}
|
61
62
|
}
|
@@ -190,6 +191,7 @@ module.exports = function defineWidget(def, renderer) {
|
|
190
191
|
};
|
191
192
|
|
192
193
|
function modernMountOrUpdate() {
|
194
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
193
195
|
var self = this;
|
194
196
|
var el = this.___keyedElements["@_wbind"];
|
195
197
|
var prevEl = this.___currentLegacyBindEl;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var warp10 = require("warp10");
|
4
|
-
var
|
4
|
+
var w10ToJSON = require("../../../runtime/helpers/serialize-noop").___toJSON;
|
5
5
|
var safeJSONRegExp = /<\/|\u2028|\u2029/g;
|
6
6
|
var IGNORE_GLOBAL_TYPES = new Set(["undefined", "function", "symbol"]);
|
7
7
|
var DEFAULT_RUNTIME_ID = "M";
|
@@ -136,7 +136,7 @@ function addComponentsFromContext(componentsContext, componentsToHydrate) {
|
|
136
136
|
}
|
137
137
|
}
|
138
138
|
|
139
|
-
if (typeof renderBody === "function" && renderBody.toJSON
|
139
|
+
if (typeof renderBody === "function" && renderBody.toJSON === w10ToJSON) {
|
140
140
|
flags |= FLAG_HAS_RENDER_BODY;
|
141
141
|
renderBody = input.renderBody = undefined;
|
142
142
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
// eslint-disable-next-line no-constant-binary-expression
|
1
2
|
var complain = "MARKO_DEBUG" && require("complain");
|
2
3
|
var setImmediate = require("@internal/set-immediate").___setImmediate;
|
3
4
|
var warp10Finalize = require("warp10/finalize");
|
@@ -124,7 +125,7 @@ function getComponentClass(typeName, isLegacy) {
|
|
124
125
|
.replace(/^[^a-z$_]/i, "_$&")
|
125
126
|
.replace(/[^0-9a-z$_]+/gi, "_");
|
126
127
|
className = className[0].toUpperCase() + className.slice(1);
|
127
|
-
|
128
|
+
|
128
129
|
var OldComponentClass = ComponentClass;
|
129
130
|
ComponentClass = {
|
130
131
|
[className]: function (id, doc) {
|
@@ -449,7 +450,7 @@ function initServerRendered(renderedComponents, host) {
|
|
449
450
|
}
|
450
451
|
}
|
451
452
|
|
452
|
-
var prefix = renderedComponents.p || "";
|
453
|
+
var prefix = renderedComponents.p || "s";
|
453
454
|
var meta = serverRenderedMeta[prefix];
|
454
455
|
var isLast = renderedComponents.l;
|
455
456
|
|
@@ -470,8 +471,11 @@ function initServerRendered(renderedComponents, host) {
|
|
470
471
|
indexServerComponentBoundaries(host, runtimeId);
|
471
472
|
eventDelegation.___init(host);
|
472
473
|
|
473
|
-
if (
|
474
|
-
meta.___globals =
|
474
|
+
if (!meta.___globals) {
|
475
|
+
meta.___globals = Object.assign({
|
476
|
+
runtimeId: runtimeId,
|
477
|
+
componentIdPrefix: prefix,
|
478
|
+
}, renderedComponents.g);
|
475
479
|
}
|
476
480
|
|
477
481
|
if (renderedComponents.t) {
|