marko 5.33.0 → 5.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- "use strict";exports.__esModule = true;exports.default = void 0;var _ComponentsContext = require("../components/ComponentsContext");
2
- var _fragment = require("../vdom/morphdom/fragment");
1
+ "use strict";const { _i_ } = require("@internal/components-util");
2
+ const { R_ } = require("../components/ComponentsContext");
3
3
 
4
4
  const {
5
5
  prepare,
@@ -14,13 +14,13 @@ const {
14
14
  // eslint-disable-next-line no-constant-condition
15
15
  "@marko/runtime-tags/dom"
16
16
  );
17
- const { _i_ } = require("@internal/components-util");
18
17
  const defineComponent = require("../components/defineComponent");
19
18
  const { r: registerComponent } = require("../components/registry");
20
19
  const createRenderer = require("../components/renderer");
21
20
  const defaultCreateOut = require("../createOut");
22
21
  const morphdom = require("../vdom/morphdom");
23
- const dynamicTag = require("./dynamic-tag");var _default = exports.default =
22
+ const { _h_ } = require("../vdom/morphdom/fragment");
23
+ const dynamicTag = require("./dynamic-tag");
24
24
 
25
25
  dynamicTag.bk_ = function tagsToVdom(
26
26
  tagsRenderer,
@@ -43,7 +43,7 @@ const TagsCompat = createRenderer(
43
43
  function (_, out, componentDef, component) {
44
44
  let existing = false;
45
45
  const isHydrate =
46
- (0, _ComponentsContext.R_)(out).o_._W_;
46
+ R_(out).o_._W_;
47
47
  const input = Array.isArray(_.i) ? _.i : [_.i];
48
48
  const tagsRenderer = resolveRegistered(_.r);
49
49
  const args = tagsRenderer.bm_;
@@ -153,7 +153,7 @@ function create5to6Renderer(renderer, hasAttrs) {
153
153
  },
154
154
  bl_() {
155
155
  const realFragment = document.createDocumentFragment();
156
- (0, _fragment._h_)(null, null, realFragment);
156
+ _h_(null, null, realFragment);
157
157
  return realFragment;
158
158
  },
159
159
  bs_: 1,
@@ -182,7 +182,7 @@ function renderAndMorph(scope, renderer, renderBody, input) {
182
182
  }
183
183
  const host = scope.bp_;
184
184
  const existingComponent = scope.marko5Component;
185
- const componentsContext = (0, _ComponentsContext.R_)(out);
185
+ const componentsContext = R_(out);
186
186
  const globalComponentsContext = componentsContext.o_;
187
187
  let customEvents;
188
188
  globalComponentsContext.ax_ = existingComponent;
@@ -1,5 +1,5 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.default = void 0;exports.serialized5to6 = serialized5to6;var _initComponentsTag = _interopRequireDefault(require("../../core-tags/components/init-components-tag"));
2
- var _ComponentsContext = require("../components/ComponentsContext");
1
+ "use strict";const initComponentsTag = require("../../core-tags/components/init-components-tag");
2
+ const { R_ } = require("../components/ComponentsContext");
3
3
 
4
4
  const tagsAPI = require(
5
5
  // eslint-disable-next-line no-constant-condition
@@ -28,7 +28,7 @@ const FN_TO_JSON = function () {
28
28
  };
29
29
 
30
30
  const isMarko6 = (fn) => !!fn.bt_;
31
- const isMarko5 = (fn) => !fn.bt_;var _default = exports.default =
31
+ const isMarko5 = (fn) => !fn.bt_;
32
32
 
33
33
  dynamicTag5.bk_ = function tagsToVdom(
34
34
  tagsRenderer,
@@ -115,7 +115,7 @@ patchDynamicTag(
115
115
  renderBody5(out, input, ...args);
116
116
  }
117
117
 
118
- const componentsContext = (0, _ComponentsContext.R_)(out);
118
+ const componentsContext = R_(out);
119
119
  const component = componentsContext.b_[0];
120
120
  if (component) {
121
121
  component.r_.U_ = customEvents;
@@ -124,7 +124,7 @@ patchDynamicTag(
124
124
  });
125
125
  }
126
126
 
127
- (0, _initComponentsTag.default)({}, out);
127
+ initComponentsTag({}, out);
128
128
 
129
129
  let async;
130
130
  out.once("finish", (result) => {
@@ -154,7 +154,7 @@ function dummyCreate5to6Renderer() {}
154
154
 
155
155
  register(dummyCreate5to6Renderer, "@marko/tags-compat-5-to-6");
156
156
 
157
- function serialized5to6(renderer, id) {
157
+ exports.serialized5to6 = function serialized5to6(renderer, id) {
158
158
  const dummyRenderer = () => {};
159
159
  register(dummyRenderer, id);
160
160
  return makeSerializable(renderer, (s) =>
@@ -164,4 +164,4 @@ function serialized5to6(renderer, id) {
164
164
  value(dummyRenderer).
165
165
  code(",!0)")
166
166
  );
167
- }
167
+ };
@@ -116,7 +116,7 @@ props)
116
116
  this.cg_ = attrs || EMPTY_OBJECT;
117
117
  this._L_ = props || EMPTY_OBJECT;
118
118
  this.ch_ = tagName;
119
- this.ci_ = null;
119
+ this.ci_ = "";
120
120
  this.cj_ = constId;
121
121
  this.aa_ = false;
122
122
  this.a__ = false;
@@ -50,8 +50,7 @@ VNode.prototype = {
50
50
 
51
51
  if (this.ch_ === "textarea") {
52
52
  if (child.cs_) {
53
- var childValue = child.ct_;
54
- this.ci_ = (this.ci_ || "") + childValue;
53
+ this.ci_ += child.ct_;
55
54
  } else {
56
55
  throw TypeError();
57
56
  }
@@ -696,10 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
696
696
  }
697
697
 
698
698
  if (nodeName === "textarea") {
699
- var newValue = toEl.ci_ || "";
700
- var oldValue = vFromEl.ci_ || "";
701
- if (oldValue !== newValue) {
702
- fromEl.value = newValue;
699
+ if (toEl.ci_ !== vFromEl.ci_) {
700
+ fromEl.value = toEl.ci_;
703
701
  }
704
702
  } else {
705
703
  morphChildren(fromEl, toEl, parentComponent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.33.0",
3
+ "version": "5.33.2",
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 --copy-files --config-file ../../babel.config.js --env-name=production"
65
65
  },
66
66
  "dependencies": {
67
- "@marko/compiler": "^5.35.0",
68
- "@marko/translator-default": "^5.32.0",
67
+ "@marko/compiler": "^5.35.1",
68
+ "@marko/translator-default": "^5.32.1",
69
69
  "app-module-path": "^2.2.0",
70
70
  "argly": "^1.2.0",
71
71
  "browser-refresh-client": "1.1.4",
@@ -1,5 +1,5 @@
1
- import { ___getComponentsContext } from "../components/ComponentsContext";
2
- import { ___createFragmentNode } from "../vdom/morphdom/fragment";
1
+ const { ___componentLookup } = require("@internal/components-util");
2
+ const { ___getComponentsContext } = require("../components/ComponentsContext");
3
3
 
4
4
  const {
5
5
  prepare,
@@ -14,15 +14,15 @@ const {
14
14
  // eslint-disable-next-line no-constant-condition
15
15
  "MARKO_DEBUG" ? "@marko/runtime-tags/debug/dom" : "@marko/runtime-tags/dom",
16
16
  );
17
- const { ___componentLookup } = require("@internal/components-util");
18
17
  const defineComponent = require("../components/defineComponent");
19
18
  const { r: registerComponent } = require("../components/registry");
20
19
  const createRenderer = require("../components/renderer");
21
20
  const defaultCreateOut = require("../createOut");
22
21
  const morphdom = require("../vdom/morphdom");
22
+ const { ___createFragmentNode } = require("../vdom/morphdom/fragment");
23
23
  const dynamicTag = require("./dynamic-tag");
24
24
 
25
- export default dynamicTag.___runtimeCompat = function tagsToVdom(
25
+ dynamicTag.___runtimeCompat = function tagsToVdom(
26
26
  tagsRenderer,
27
27
  renderBody,
28
28
  args,
@@ -1,5 +1,5 @@
1
- import initComponentsTag from "../../core-tags/components/init-components-tag";
2
- import { ___getComponentsContext } from "../components/ComponentsContext";
1
+ const initComponentsTag = require("../../core-tags/components/init-components-tag");
2
+ const { ___getComponentsContext } = require("../components/ComponentsContext");
3
3
 
4
4
  const tagsAPI = require(
5
5
  // eslint-disable-next-line no-constant-condition
@@ -30,7 +30,7 @@ const FN_TO_JSON = function () {
30
30
  const isMarko6 = (fn) => !!fn.___isTagsAPI;
31
31
  const isMarko5 = (fn) => !fn.___isTagsAPI;
32
32
 
33
- export default dynamicTag5.___runtimeCompat = function tagsToVdom(
33
+ dynamicTag5.___runtimeCompat = function tagsToVdom(
34
34
  tagsRenderer,
35
35
  renderBody,
36
36
  args,
@@ -154,7 +154,7 @@ function dummyCreate5to6Renderer() {}
154
154
 
155
155
  register(dummyCreate5to6Renderer, "@marko/tags-compat-5-to-6");
156
156
 
157
- export function serialized5to6(renderer, id) {
157
+ exports.serialized5to6 = function serialized5to6(renderer, id) {
158
158
  const dummyRenderer = () => {};
159
159
  register(dummyRenderer, id);
160
160
  return makeSerializable(renderer, (s) =>
@@ -164,4 +164,4 @@ export function serialized5to6(renderer, id) {
164
164
  .value(dummyRenderer)
165
165
  .code(",!0)"),
166
166
  );
167
- }
167
+ };
@@ -116,7 +116,7 @@ function VElement(
116
116
  this.___attributes = attrs || EMPTY_OBJECT;
117
117
  this.___properties = props || EMPTY_OBJECT;
118
118
  this.___nodeName = tagName;
119
- this.___valueInternal = null;
119
+ this.___valueInternal = "";
120
120
  this.___constId = constId;
121
121
  this.___preserve = false;
122
122
  this.___preserveBody = false;
@@ -50,8 +50,7 @@ VNode.prototype = {
50
50
 
51
51
  if (this.___nodeName === "textarea") {
52
52
  if (child.___Text) {
53
- var childValue = child.___nodeValue;
54
- this.___valueInternal = (this.___valueInternal || "") + childValue;
53
+ this.___valueInternal += child.___nodeValue;
55
54
  } else {
56
55
  throw TypeError();
57
56
  }
@@ -696,10 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
696
696
  }
697
697
 
698
698
  if (nodeName === "textarea") {
699
- var newValue = toEl.___valueInternal || "";
700
- var oldValue = vFromEl.___valueInternal || "";
701
- if (oldValue !== newValue) {
702
- fromEl.value = newValue;
699
+ if (toEl.___valueInternal !== vFromEl.___valueInternal) {
700
+ fromEl.value = toEl.___valueInternal;
703
701
  }
704
702
  } else {
705
703
  morphChildren(fromEl, toEl, parentComponent);