marko 5.33.4 → 5.33.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/runtime/helpers/tags-compat/dom-debug.js +1 -1
  2. package/dist/runtime/helpers/tags-compat/dom-debug.mjs +2 -2
  3. package/dist/runtime/helpers/tags-compat/dom.js +1 -1
  4. package/dist/runtime/helpers/tags-compat/dom.mjs +2 -2
  5. package/dist/runtime/helpers/tags-compat/html-debug.mjs +1 -1
  6. package/dist/runtime/helpers/tags-compat/html.mjs +1 -1
  7. package/dist/runtime/helpers/tags-compat/runtime-dom.js +38 -85
  8. package/dist/runtime/helpers/tags-compat/runtime-html.js +4 -4
  9. package/dist/runtime/html/AsyncStream.js +12 -12
  10. package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
  11. package/dist/runtime/html/helpers/attr.js +3 -3
  12. package/dist/runtime/html/helpers/data-marko.js +1 -1
  13. package/dist/runtime/html/helpers/escape-quotes.js +1 -1
  14. package/dist/runtime/html/helpers/escape-xml.js +1 -1
  15. package/dist/runtime/renderable.js +3 -3
  16. package/dist/runtime/vdom/AsyncVDOMBuilder.js +67 -67
  17. package/dist/runtime/vdom/VComponent.js +3 -3
  18. package/dist/runtime/vdom/VDocumentFragment.js +7 -7
  19. package/dist/runtime/vdom/VElement.js +35 -35
  20. package/dist/runtime/vdom/VFragment.js +5 -5
  21. package/dist/runtime/vdom/VNode.js +30 -30
  22. package/dist/runtime/vdom/VText.js +8 -8
  23. package/dist/runtime/vdom/helpers/const-element.js +3 -3
  24. package/dist/runtime/vdom/hot-reload.js +2 -2
  25. package/dist/runtime/vdom/morphdom/fragment.js +3 -3
  26. package/dist/runtime/vdom/morphdom/helpers.js +1 -1
  27. package/dist/runtime/vdom/morphdom/index.js +31 -31
  28. package/dist/runtime/vdom/vdom.js +14 -14
  29. package/package.json +2 -2
  30. package/src/runtime/helpers/tags-compat/dom-debug.js +1 -1
  31. package/src/runtime/helpers/tags-compat/dom-debug.mjs +2 -2
  32. package/src/runtime/helpers/tags-compat/dom.js +1 -1
  33. package/src/runtime/helpers/tags-compat/dom.mjs +2 -2
  34. package/src/runtime/helpers/tags-compat/html-debug.mjs +1 -1
  35. package/src/runtime/helpers/tags-compat/html.mjs +1 -1
  36. package/src/runtime/helpers/tags-compat/runtime-dom.js +37 -84
  37. package/src/runtime/helpers/tags-compat/runtime-html.js +1 -1
@@ -2,21 +2,21 @@
2
2
  var VNode = require("./VNode");
3
3
 
4
4
  function VText(value, ownerComponent) {
5
- this.c__(-1 /* no children */, ownerComponent);
6
- this.ct_ = value;
5
+ this.bT_(-1 /* no children */, ownerComponent);
6
+ this.cm_ = value;
7
7
  }
8
8
 
9
9
  VText.prototype = {
10
- cs_: true,
10
+ cl_: true,
11
11
 
12
- cb_: 3,
12
+ bV_: 3,
13
13
 
14
- bo_: function (host) {
15
- return (host.ownerDocument || host).createTextNode(this.ct_);
14
+ bl_: function (host) {
15
+ return (host.ownerDocument || host).createTextNode(this.cm_);
16
16
  },
17
17
 
18
- bU_: function () {
19
- return new VText(this.ct_);
18
+ bN_: function () {
19
+ return new VText(this.cm_);
20
20
  }
21
21
  };
22
22
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var VElement = require("../vdom").bC_;
3
+ var VElement = require("../vdom").bv_;
4
4
  var i = 0;
5
5
 
6
6
  module.exports = function (tagName, attrs, childCount) {
@@ -13,12 +13,12 @@ function ConstVElement(tagName, attrs, childCount) {
13
13
 
14
14
  ConstVElement.prototype = Object.create(VElement.prototype);
15
15
  ConstVElement.prototype.e = function (tagName, attrs, childCount) {
16
- var child = this.bT_(
16
+ var child = this.bM_(
17
17
  new ConstVElement(tagName, attrs, childCount)
18
18
  );
19
19
 
20
20
  if (childCount === 0) {
21
- return this.ck_();
21
+ return this.cd_();
22
22
  } else {
23
23
  return child;
24
24
  }
@@ -44,7 +44,7 @@ exports.t = runtime.t = function (typeName) {
44
44
  instance.P_(input, out);
45
45
  };
46
46
 
47
- instance.cu_ = true;
47
+ instance.cn_ = true;
48
48
  instance.am_();
49
49
  instance._t_ = false;
50
50
 
@@ -78,7 +78,7 @@ registry._C_ = function (typeName, id) {
78
78
  if (instances) {
79
79
  instances.add(instance);
80
80
  instance.once("destroy", function () {
81
- if (!instance.cu_) {
81
+ if (!instance.cn_) {
82
82
  instances.delete(instance);
83
83
  }
84
84
  });
@@ -80,8 +80,8 @@ function createFragmentNode(startNode, nextNode, parentNode) {
80
80
 
81
81
  function beginFragmentNode(startNode, parentNode) {
82
82
  var fragment = createFragmentNode(startNode, null, parentNode);
83
- fragment.cv_ = function (nextNode) {
84
- fragment.cv_ = null;
83
+ fragment.co_ = function (nextNode) {
84
+ fragment.co_ = null;
85
85
  insertBefore(
86
86
  fragment.endNode,
87
87
  nextNode,
@@ -92,4 +92,4 @@ function beginFragmentNode(startNode, parentNode) {
92
92
  }
93
93
 
94
94
  exports._h_ = createFragmentNode;
95
- exports.cw_ = beginFragmentNode;
95
+ exports.cp_ = beginFragmentNode;
@@ -37,6 +37,6 @@ function removeChild(node) {
37
37
 
38
38
  exports.bc_ = insertBefore;
39
39
  exports.bd_ = insertAfter;
40
- exports.cr_ = nextSibling;
40
+ exports.ck_ = nextSibling;
41
41
  exports.ay_ = firstChild;
42
42
  exports.be_ = removeChild;
@@ -8,11 +8,11 @@ var normalizeComponentKey = componentsUtil._R_;
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").bC_;
11
+ var VElement = require("../vdom").bv_;
12
12
  var fragment = require("./fragment");
13
13
  var helpers = require("./helpers");
14
- var virtualizeElement = VElement.cm_;
15
- var morphAttrs = VElement.cn_;
14
+ var virtualizeElement = VElement.cf_;
15
+ var morphAttrs = VElement.cg_;
16
16
  var keysByDOMNode = domData._G_;
17
17
  var componentByDOMNode = domData._l_;
18
18
  var vElementByDOMNode = domData._H_;
@@ -20,11 +20,11 @@ var detachedByDOMNode = domData.aT_;
20
20
 
21
21
  var insertBefore = helpers.bc_;
22
22
  var insertAfter = helpers.bd_;
23
- var nextSibling = helpers.cr_;
23
+ var nextSibling = helpers.ck_;
24
24
  var firstChild = helpers.ay_;
25
25
  var removeChild = helpers.be_;
26
26
  var createFragmentNode = fragment._h_;
27
- var beginFragmentNode = fragment.cw_;
27
+ var beginFragmentNode = fragment.cp_;
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.ch_ === toEl.ch_;
45
+ return fromEl.ca_ === toEl.ca_;
46
46
  }
47
47
 
48
48
  function caseInsensitiveCompare(a, b) {
@@ -73,12 +73,12 @@ function morphdom(fromNode, toNode, host, componentsContext) {
73
73
  ownerComponent,
74
74
  parentComponent)
75
75
  {
76
- var realNode = vNode.bo_(host, parentEl.namespaceURI);
76
+ var realNode = vNode.bl_(host, parentEl.namespaceURI);
77
77
  insertBefore(realNode, referenceEl, parentEl);
78
78
 
79
79
  if (
80
- vNode.cb_ === ELEMENT_NODE ||
81
- vNode.cb_ === FRAGMENT_NODE)
80
+ vNode.bV_ === ELEMENT_NODE ||
81
+ vNode.bV_ === 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.ch_ !== "textarea") {
90
+ if (vNode.ca_ !== "textarea") {
91
91
  morphChildren(realNode, vNode, parentComponent);
92
92
  }
93
93
 
@@ -161,9 +161,9 @@ function morphdom(fromNode, toNode, host, componentsContext) {
161
161
  var fromComponent;
162
162
 
163
163
  outer: while (curToNodeChild) {
164
- toNextSibling = curToNodeChild.cr_;
165
- curToNodeType = curToNodeChild.cb_;
166
- curToNodeKey = curToNodeChild.ca_;
164
+ toNextSibling = curToNodeChild.ck_;
165
+ curToNodeType = curToNodeChild.bV_;
166
+ curToNodeKey = curToNodeChild.bU_;
167
167
 
168
168
  // Skip <!doctype>
169
169
  if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {
@@ -282,7 +282,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
282
282
 
283
283
  if (
284
284
  curVFromNodeChild &&
285
- curToNodeType === curVFromNodeChild.cb_ && (
285
+ curToNodeType === curVFromNodeChild.bV_ && (
286
286
  curToNodeType !== ELEMENT_NODE ||
287
287
  compareNodeNames(curToNodeChild, curVFromNodeChild)))
288
288
  {
@@ -327,11 +327,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
327
327
  curToNodeChild.aa_ ||
328
328
  caseInsensitiveCompare(
329
329
  curFromNodeChild.nodeName,
330
- curToNodeChild.ch_ || ""
330
+ curToNodeChild.ca_ || ""
331
331
  )))
332
332
  {
333
333
  curVFromNodeChild = virtualizeElement(curFromNodeChild);
334
- curVFromNodeChild.ch_ = curToNodeChild.ch_;
334
+ curVFromNodeChild.ca_ = curToNodeChild.ca_;
335
335
  keysByDOMNode.set(curFromNodeChild, curToNodeKey);
336
336
  referenceComponent.J_[curToNodeKey] =
337
337
  curFromNodeChild;
@@ -351,7 +351,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
351
351
  curFromNodeChild = fromNextSibling;
352
352
  continue;
353
353
  } else if (
354
- curToNodeChild.cb_ === FRAGMENT_NODE &&
354
+ curToNodeChild.bV_ === FRAGMENT_NODE &&
355
355
  curFromNodeChild.nodeType === COMMENT_NODE)
356
356
  {
357
357
  var content = curFromNodeChild.nodeValue;
@@ -418,7 +418,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
418
418
 
419
419
  if (
420
420
  curVFromNodeChild &&
421
- curToNodeType === curVFromNodeChild.cb_ && (
421
+ curToNodeType === curVFromNodeChild.bV_ && (
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.ca_ === curFromNodeKey)
439
+ toNextSibling.bU_ === curFromNodeKey)
440
440
  {
441
441
  // Single element swap
442
442
 
@@ -549,18 +549,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
549
549
 
550
550
  if (
551
551
  caseInsensitiveCompare(
552
- curVFromNodeChild.ch_,
553
- curToNodeChild.ch_
552
+ curVFromNodeChild.ca_,
553
+ curToNodeChild.ca_
554
554
  ))
555
555
  {
556
- curVFromNodeChild.ch_ = curToNodeChild.ch_;
556
+ curVFromNodeChild.ca_ = curToNodeChild.ca_;
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.ca_) {
563
+ } else if (curFromNodeKey = curVFromNodeChild.bU_) {
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;
@@ -587,7 +587,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
587
587
  {
588
588
  // Both nodes being compared are Text or Comment nodes
589
589
  isCompatible = true;
590
- var curToNodeValue = curToNodeChild.ct_;
590
+ var curToNodeValue = curToNodeChild.cm_;
591
591
  var curFromNodeValue = curFromNodeChild.nodeValue;
592
592
  if (curFromNodeValue !== curToNodeValue) {
593
593
  if (
@@ -638,10 +638,10 @@ function morphdom(fromNode, toNode, host, componentsContext) {
638
638
  }
639
639
 
640
640
  // We have processed all of the "to nodes".
641
- if (fromNode.cv_) {
641
+ if (fromNode.co_) {
642
642
  // If we are in an unfinished fragment, we have reached the end of the nodes
643
643
  // we were matching up and need to end the fragment
644
- fromNode.cv_(curFromNodeChild);
644
+ fromNode.co_(curFromNodeChild);
645
645
  } else {
646
646
  // If curFromNodeChild is non-null then we still have some from nodes
647
647
  // left over that need to be removed
@@ -681,11 +681,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
681
681
  }
682
682
 
683
683
  function morphEl(fromEl, vFromEl, toEl, parentComponent) {
684
- var nodeName = toEl.ch_;
685
- var constId = toEl.cj_;
684
+ var nodeName = toEl.ca_;
685
+ var constId = toEl.cc_;
686
686
  vElementByDOMNode.set(fromEl, toEl);
687
687
 
688
- if (constId !== undefined && vFromEl.cj_ === constId) {
688
+ if (constId !== undefined && vFromEl.cc_ === constId) {
689
689
  return;
690
690
  }
691
691
 
@@ -696,8 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
696
696
  }
697
697
 
698
698
  if (nodeName === "textarea") {
699
- if (toEl.ci_ !== vFromEl.ci_) {
700
- fromEl.value = toEl.ci_;
699
+ if (toEl.cb_ !== vFromEl.cb_) {
700
+ fromEl.value = toEl.cb_;
701
701
  }
702
702
  } else {
703
703
  morphChildren(fromEl, toEl, parentComponent);
@@ -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.bT_(virtualize(curChild, ownerComponent));
14
+ vdomParent.bM_(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.cm_(node, virtualizeChildNodes, ownerComponent);
22
+ return VElement.cf_(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.bT_(virtualize(curChild, ownerComponent));
41
+ vdomFragment.bM_(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.bT_(vdomNode || new VText(value.toString()));
69
- return this.ck_();
68
+ this.bM_(vdomNode || new VText(value.toString()));
69
+ return this.cd_();
70
70
  };
71
71
 
72
- Node_prototype.bY_ = function () {
73
- return this.bT_(new VDocumentFragment());
72
+ Node_prototype.bR_ = function () {
73
+ return this.bM_(new VDocumentFragment());
74
74
  };
75
75
 
76
- exports.bD_ = VDocumentFragment;
77
- exports.bC_ = VElement;
78
- exports.bE_ = VText;
79
- exports.bF_ = VComponent;
80
- exports.bG_ = VFragment;
81
- exports.cm_ = virtualize;
82
- exports.bH_ = virtualizeHTML;
76
+ exports.bw_ = VDocumentFragment;
77
+ exports.bv_ = VElement;
78
+ exports.bx_ = VText;
79
+ exports.by_ = VComponent;
80
+ exports.bz_ = VFragment;
81
+ exports.cf_ = virtualize;
82
+ exports.bA_ = virtualizeHTML;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.33.4",
3
+ "version": "5.33.6",
4
4
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
5
5
  "keywords": [
6
6
  "front-end",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@marko/compiler": "^5.35.4",
68
- "@marko/translator-default": "^5.32.3",
68
+ "@marko/translator-default": "^5.32.4",
69
69
  "app-module-path": "^2.2.0",
70
70
  "argly": "^1.2.0",
71
71
  "browser-refresh-client": "1.1.4",
@@ -1 +1 @@
1
- require("./runtime-dom.js").p(require("@marko/runtime-tags/debug/dom"));
1
+ require("./runtime-dom.js").p(require("@marko/runtime-tags/debug/dom").compat);
@@ -1,3 +1,3 @@
1
- import api from "@marko/runtime-tags/debug/dom";
1
+ import { compat } from "@marko/runtime-tags/debug/dom";
2
2
  import { p } from "./runtime-dom.js";
3
- p(api);
3
+ p(compat);
@@ -1 +1 @@
1
- require("./runtime-dom.js").p(require("@marko/runtime-tags/dom"));
1
+ require("./runtime-dom.js").p(require("@marko/runtime-tags/dom").compat);
@@ -1,3 +1,3 @@
1
- import api from "@marko/runtime-tags/dom";
1
+ import { compat } from "@marko/runtime-tags/dom";
2
2
  import { p } from "./runtime-dom.js";
3
- p(api);
3
+ p(compat);
@@ -1,3 +1,3 @@
1
- import api from "@marko/runtime-tags/debug/html";
1
+ import * as api from "@marko/runtime-tags/debug/html";
2
2
  import { p } from "./runtime-html.js";
3
3
  export const s = p(api);
@@ -1,3 +1,3 @@
1
- import api from "@marko/runtime-tags/html";
1
+ import * as api from "@marko/runtime-tags/html";
2
2
  import { p } from "./runtime-html.js";
3
3
  export const s = p(api);
@@ -10,71 +10,40 @@ const morphdom = require("../../vdom/morphdom");
10
10
  const { ___createFragmentNode } = require("../../vdom/morphdom/fragment");
11
11
  const dynamicTag = require("../dynamic-tag");
12
12
 
13
- exports.p = function ({
14
- prepare,
15
- runEffects,
16
- patchConditionals,
17
- createScopeWithRenderer,
18
- queueEffect,
19
- scopeLookup,
20
- getRegisteredWithScope,
21
- register,
22
- }) {
13
+ exports.p = function (domCompat) {
23
14
  dynamicTag.___runtimeCompat = function tagsToVdom(
24
- tagsRenderer,
15
+ renderer,
25
16
  renderBody,
26
17
  args,
27
18
  ) {
28
- if (
29
- tagsRenderer
30
- ? tagsRenderer.___clone === undefined
31
- : !Array.isArray(renderBody) && renderBody?.___clone === undefined
32
- )
33
- return tagsRenderer;
19
+ const tagsRenderer = domCompat.resolveRenderer(renderer || renderBody);
34
20
 
35
- return (input, out) =>
36
- TagsCompat(
37
- { i: args ? args : input, r: tagsRenderer || renderBody },
38
- out,
39
- );
21
+ if (tagsRenderer) {
22
+ return (input, out) =>
23
+ TagsCompat({ i: args ? args : input, r: tagsRenderer }, out);
24
+ }
25
+
26
+ return renderer;
40
27
  };
41
28
 
42
29
  const TagsCompatId = "tags-compat";
43
30
  const TagsCompat = createRenderer(
44
31
  function (_, out, componentDef, component) {
45
- let existing = false;
46
32
  const isHydrate =
47
33
  ___getComponentsContext(out).___globalContext.___isHydrate;
48
34
  const input = Array.isArray(_.i) ? _.i : [_.i];
49
- const tagsRenderer = resolveRegistered(_.r);
50
- const args = tagsRenderer.___args;
35
+ const tagsRenderer = domCompat.resolveRenderer(_.r);
36
+ const newNode = domCompat.render(
37
+ isHydrate,
38
+ out,
39
+ component,
40
+ tagsRenderer,
41
+ input,
42
+ );
51
43
 
52
- component.effects = prepare(() => {
53
- if (isHydrate) {
54
- const scopeId = out.global.componentIdToScopeId[component.id];
55
- component.scope = scopeLookup[scopeId];
56
- }
57
- if (!component.scope) {
58
- component.scope = createScopeWithRenderer(
59
- tagsRenderer /* out.global as context */,
60
- );
61
- for (const signal of tagsRenderer.___closureSignals) {
62
- signal(component.scope, true);
63
- }
64
- } else {
65
- args && args(component.scope, input, 1);
66
- existing = true;
67
- }
68
- args && args(component.scope, input);
69
- });
70
- out.bf(out.___assignedKey, component, existing);
71
- if (!existing) {
72
- out.node({
73
- ___actualize: () =>
74
- component.scope.___startNode === component.scope.___endNode
75
- ? component.scope.___startNode
76
- : component.scope.___startNode.parentNode,
77
- });
44
+ out.bf(out.___assignedKey, component, !newNode);
45
+ if (newNode) {
46
+ out.node({ ___actualize: () => newNode });
78
47
  }
79
48
  out.ef();
80
49
  },
@@ -94,12 +63,8 @@ exports.p = function ({
94
63
  _: TagsCompat,
95
64
  Component: defineComponent(
96
65
  {
97
- onMount() {
98
- runEffects(this.effects);
99
- },
100
- onUpdate() {
101
- runEffects(this.effects);
102
- },
66
+ onMount: domCompat.runComponentEffects,
67
+ onUpdate: domCompat.runComponentEffects,
103
68
  },
104
69
  TagsCompat,
105
70
  ),
@@ -114,7 +79,7 @@ exports.p = function ({
114
79
 
115
80
  const rendererCache = new WeakMap();
116
81
 
117
- patchConditionals((conditional) => (...args) => {
82
+ domCompat.patchConditionals((conditional) => (...args) => {
118
83
  const signal = conditional(...args);
119
84
  const hasAttrs = args.length > 1;
120
85
  return (scope, renderer, clean) => {
@@ -124,17 +89,14 @@ exports.p = function ({
124
89
 
125
90
  function create5to6Renderer(renderer, hasAttrs) {
126
91
  let newRenderer = renderer;
127
- if (renderer) {
92
+ if (renderer && typeof renderer !== "string") {
128
93
  const rendererFromAnywhere =
129
94
  renderer._ ||
130
95
  renderer.render ||
131
96
  (renderer.renderer && renderer.renderer.renderer) ||
132
97
  renderer.renderer;
133
- const isMarko6 = rendererFromAnywhere
134
- ? rendererFromAnywhere.___clone
135
- : renderer.___clone;
136
98
 
137
- if (typeof renderer !== "string" && !isMarko6) {
99
+ if (!domCompat.isRenderer(rendererFromAnywhere || renderer)) {
138
100
  newRenderer = rendererCache.get(renderer);
139
101
  if (!newRenderer) {
140
102
  const { Component } = renderer;
@@ -145,29 +107,28 @@ exports.p = function ({
145
107
  scopeId,
146
108
  ) {
147
109
  for (const customEvent of customEvents) {
148
- customEvent[1] = resolveRegistered(customEvent[1]);
110
+ customEvent[1] = domCompat.resolveRenderer(customEvent[1]);
149
111
  }
150
112
 
151
113
  setCustomEvents.call(this, customEvents, scopeId);
152
114
  };
153
115
  }
154
- newRenderer = {
155
- ___setup(scope) {
116
+ newRenderer = domCompat.createRenderer(
117
+ (scope) => {
156
118
  if (!hasAttrs) {
157
119
  renderAndMorph(scope, rendererFromAnywhere, renderer, {});
158
120
  }
159
121
  },
160
- ___clone() {
122
+ () => {
161
123
  const realFragment = document.createDocumentFragment();
162
124
  ___createFragmentNode(null, null, realFragment);
163
125
  return realFragment;
164
126
  },
165
- ___hasUserEffects: 1,
166
- ___args(scope, input, clean) {
127
+ (scope, input, clean) => {
167
128
  if (clean) return;
168
129
  renderAndMorph(scope, rendererFromAnywhere, renderer, input);
169
130
  },
170
- };
131
+ );
171
132
  rendererCache.set(renderer, newRenderer);
172
133
  }
173
134
  }
@@ -175,18 +136,18 @@ exports.p = function ({
175
136
  return newRenderer;
176
137
  }
177
138
 
178
- register("@marko/tags-compat-5-to-6", create5to6Renderer);
139
+ domCompat.register("@marko/tags-compat-5-to-6", create5to6Renderer);
179
140
 
180
141
  function renderAndMorph(scope, renderer, renderBody, input) {
181
142
  const out = defaultCreateOut();
182
- let rootNode = scope.___startNode.fragment;
143
+ let host = domCompat.getStartNode(scope);
144
+ let rootNode = host.fragment;
183
145
  if (!rootNode) {
184
146
  const component = (scope.marko5Component = ___componentLookup[scope.m5c]);
185
147
  rootNode = component.___rootNode;
186
- scope.___startNode = rootNode.startNode;
187
- scope.___endNode = rootNode.endNode;
148
+ host = rootNode.startNode;
149
+ domCompat.setScopeNodes(host, rootNode.endNode);
188
150
  }
189
- const host = scope.___startNode;
190
151
  const existingComponent = scope.marko5Component;
191
152
  const componentsContext = ___getComponentsContext(out);
192
153
  const globalComponentsContext = componentsContext.___globalContext;
@@ -215,7 +176,7 @@ exports.p = function ({
215
176
  RenderBodyComponent({ renderBody, args: input }, out);
216
177
  }
217
178
 
218
- queueEffect(scope, () => {
179
+ domCompat.queueEffect(scope, () => {
219
180
  const targetNode = out.___getOutput().___firstChild;
220
181
  morphdom(rootNode, targetNode, host, componentsContext);
221
182
  const componentDefs = componentsContext.___initComponents(
@@ -267,12 +228,4 @@ exports.p = function ({
267
228
  _: RenderBodyComponent,
268
229
  Component: defineComponent({}, RenderBodyComponent),
269
230
  }));
270
-
271
- function resolveRegistered(renderer) {
272
- if (!Array.isArray(renderer)) return renderer;
273
-
274
- const [registerId, scopeId] = renderer;
275
- const scope = scopeLookup[scopeId];
276
- return getRegisteredWithScope(registerId, scope);
277
- }
278
231
  };
@@ -94,7 +94,7 @@ exports.p = function (tagsAPI) {
94
94
  const out = defaultCreateOut();
95
95
  let customEvents;
96
96
 
97
- out.global.streamData = tagsAPI.$_streamData;
97
+ out.global.streamData = tagsAPI.getStreamData();
98
98
 
99
99
  if (renderer5) {
100
100
  const normalizedInput = {};