marko 4.26.3 → 4.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. package/README.md +1 -1
  2. package/bin/markoc.js +15 -15
  3. package/dist/compiler/ast/CustomTag.js +2 -2
  4. package/dist/core-tags/components/TransformHelper/handleLegacyBind.js +0 -4
  5. package/dist/core-tags/core/await/renderer.js +0 -4
  6. package/dist/core-tags/migrate/all-tags/body-only-if.js +0 -1
  7. package/dist/core-tags/migrate/all-tags/control-flow-directives.js +0 -1
  8. package/dist/core-tags/migrate/all-tags/dynamic-attributes.js +1 -2
  9. package/dist/core-tags/migrate/all-tags/include-directive.js +0 -2
  10. package/dist/core-tags/migrate/all-tags/legacy-nested-tag.js +0 -2
  11. package/dist/core-tags/migrate/all-tags/marko-init.js +0 -2
  12. package/dist/core-tags/migrate/all-tags/modifier-key.js +0 -2
  13. package/dist/core-tags/migrate/all-tags/ref.js +1 -3
  14. package/dist/core-tags/migrate/all-tags/w-bind.js +0 -2
  15. package/dist/core-tags/migrate/all-tags/w-body.js +0 -2
  16. package/dist/core-tags/migrate/all-tags/w-config.js +0 -2
  17. package/dist/core-tags/migrate/all-tags/w-for.js +0 -3
  18. package/dist/core-tags/migrate/all-tags/w-id.js +1 -4
  19. package/dist/core-tags/migrate/all-tags/w-on.js +1 -4
  20. package/dist/core-tags/migrate/all-tags/w-preserve-attrs.js +0 -2
  21. package/dist/core-tags/migrate/all-tags/w-preserve.js +1 -3
  22. package/dist/core-tags/migrate/all-tags/widget-in-attrs.js +2 -11
  23. package/dist/core-tags/migrate/all-templates/non-standard-template-literals.js +0 -4
  24. package/dist/core-tags/migrate/all-templates/render-calls.js +0 -2
  25. package/dist/core-tags/migrate/assign-tag.js +0 -2
  26. package/dist/core-tags/migrate/async-fragment-tag.js +0 -2
  27. package/dist/core-tags/migrate/async-fragments-tag.js +0 -2
  28. package/dist/core-tags/migrate/await-tag.js +0 -7
  29. package/dist/core-tags/migrate/class-tag.js +0 -2
  30. package/dist/core-tags/migrate/component-globals-tag.js +0 -2
  31. package/dist/core-tags/migrate/for-tag.js +0 -2
  32. package/dist/core-tags/migrate/include-tag.js +0 -1
  33. package/dist/core-tags/migrate/invoke-tag.js +0 -2
  34. package/dist/core-tags/migrate/layout-placeholder-tag.js +0 -1
  35. package/dist/core-tags/migrate/layout-put-tag.js +0 -1
  36. package/dist/core-tags/migrate/layout-use-tag.js +0 -1
  37. package/dist/core-tags/migrate/macro-body-tag.js +0 -2
  38. package/dist/core-tags/migrate/macro-tag.js +0 -2
  39. package/dist/core-tags/migrate/unless-tag.js +0 -1
  40. package/dist/core-tags/migrate/var-tag.js +0 -2
  41. package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +0 -10
  42. package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +0 -4
  43. package/dist/runtime/RenderResult.js +0 -3
  44. package/dist/runtime/components/Component.js +0 -6
  45. package/dist/runtime/components/ComponentDef.js +0 -3
  46. package/dist/runtime/components/ServerComponent.js +0 -4
  47. package/dist/runtime/components/legacy/defineComponent-legacy.js +0 -3
  48. package/dist/runtime/components/legacy/defineRenderer-legacy.js +1 -6
  49. package/dist/runtime/components/legacy/index.js +3 -1
  50. package/dist/runtime/helpers/for-of.js +3 -1
  51. package/dist/runtime/html/helpers/attr.js +0 -4
  52. package/dist/runtime/html/helpers/attrs.js +0 -2
  53. package/dist/runtime/html/helpers/merge-attrs.js +0 -3
  54. package/dist/runtime/vdom/VElement.js +0 -3
  55. package/dist/runtime/vdom/helpers/attrs.js +0 -2
  56. package/dist/taglib/taglib-loader/loadTagFromProps.js +15 -0
  57. package/docs/10-awesome-marko-features.md +1 -1
  58. package/docs/body-content.md +3 -3
  59. package/docs/class-components.md +6 -6
  60. package/docs/express.md +1 -1
  61. package/docs/fastify.md +4 -4
  62. package/docs/hapi.md +3 -3
  63. package/docs/http.md +1 -1
  64. package/docs/huncwot.md +1 -1
  65. package/docs/installing.md +2 -2
  66. package/docs/koa.md +2 -2
  67. package/docs/lasso.md +1 -1
  68. package/docs/marko-4-upgrade.md +1 -1
  69. package/docs/marko-v4.md +4 -4
  70. package/docs/marko-vs-react.md +2 -2
  71. package/docs/rendering.md +6 -6
  72. package/docs/server-side-rendering.md +3 -3
  73. package/docs/webpack.md +16 -16
  74. package/docs/why-is-marko-fast.md +3 -3
  75. package/package.json +1 -1
  76. package/src/compiler/Builder.js +13 -13
  77. package/src/compiler/CodeGenerator.js +2 -2
  78. package/src/compiler/CodeWriter.js +1 -1
  79. package/src/compiler/CompileContext.js +30 -30
  80. package/src/compiler/Compiler.js +3 -3
  81. package/src/compiler/HtmlJsParser.js +4 -4
  82. package/src/compiler/Migrator.js +2 -2
  83. package/src/compiler/Normalizer.js +5 -5
  84. package/src/compiler/Parser.js +11 -11
  85. package/src/compiler/Walker.js +1 -1
  86. package/src/compiler/ast/ArrayExpression.js +1 -1
  87. package/src/compiler/ast/BinaryExpression.js +1 -1
  88. package/src/compiler/ast/ConditionalExpression.js +1 -1
  89. package/src/compiler/ast/CustomTag.js +14 -14
  90. package/src/compiler/ast/Declaration.js +2 -2
  91. package/src/compiler/ast/DocumentType.js +2 -2
  92. package/src/compiler/ast/ForEach.js +1 -1
  93. package/src/compiler/ast/ForEachProp.js +1 -1
  94. package/src/compiler/ast/ForRange.js +1 -1
  95. package/src/compiler/ast/HtmlAttribute/html/generateCode.js +4 -4
  96. package/src/compiler/ast/HtmlAttribute/vdom/generateCode.js +2 -2
  97. package/src/compiler/ast/HtmlAttributeCollection.js +3 -3
  98. package/src/compiler/ast/HtmlComment.js +1 -1
  99. package/src/compiler/ast/HtmlElement/html/EndTag.js +1 -1
  100. package/src/compiler/ast/HtmlElement/html/StartTag.js +3 -3
  101. package/src/compiler/ast/HtmlElement/html/generateCode.js +5 -5
  102. package/src/compiler/ast/HtmlElement/index.js +1 -1
  103. package/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js +1 -1
  104. package/src/compiler/ast/HtmlElement/vdom/generateCode.js +3 -3
  105. package/src/compiler/ast/If.js +1 -1
  106. package/src/compiler/ast/LogicalExpression.js +1 -1
  107. package/src/compiler/ast/MemberExpression.js +1 -1
  108. package/src/compiler/ast/NewExpression.js +1 -1
  109. package/src/compiler/ast/Node.js +4 -4
  110. package/src/compiler/ast/ObjectExpression.js +2 -2
  111. package/src/compiler/ast/Property.js +1 -1
  112. package/src/compiler/ast/SequenceExpression.js +1 -1
  113. package/src/compiler/ast/TemplateLiteral.js +1 -1
  114. package/src/compiler/ast/TemplateRoot.js +3 -3
  115. package/src/compiler/ast/Text/index.js +1 -1
  116. package/src/compiler/ast/UnaryExpression.js +1 -1
  117. package/src/compiler/ast/UpdateExpression.js +1 -1
  118. package/src/compiler/config.js +1 -1
  119. package/src/compiler/index.js +5 -5
  120. package/src/compiler/modules.js +2 -2
  121. package/src/compiler/util/UniqueVars.js +4 -4
  122. package/src/compiler/util/convertRawJavaScriptAst.js +1 -1
  123. package/src/compiler/util/javaScriptReservedWords.js +1 -1
  124. package/src/compiler/util/macros.js +1 -1
  125. package/src/compiler/util/mergeProps.js +3 -3
  126. package/src/compiler/util/parseJavaScriptArgs.js +1 -1
  127. package/src/compiler/util/parseJavaScriptParams.js +1 -1
  128. package/src/compiler/util/parseRawJavaScriptAst.js +1 -1
  129. package/src/compiler/util/removeComments.js +6 -6
  130. package/src/compiler/util/tokenizer.js +3 -3
  131. package/src/compiler/util/vdom/VDOMOptimizer.js +2 -2
  132. package/src/core-tags/cache/cached-fragment-tag.js +2 -2
  133. package/src/core-tags/cache/default-cache-manager.js +2 -2
  134. package/src/core-tags/components/TransformHelper/ComponentArgsCompiler.js +3 -3
  135. package/src/core-tags/components/TransformHelper/assignComponentId.js +3 -3
  136. package/src/core-tags/components/TransformHelper/convertToComponent.js +4 -4
  137. package/src/core-tags/components/TransformHelper/getComponentFiles.js +1 -1
  138. package/src/core-tags/components/TransformHelper/handleComponentEvents.js +3 -3
  139. package/src/core-tags/components/TransformHelper/handleComponentPreserve.js +7 -7
  140. package/src/core-tags/components/TransformHelper/handleLegacyBind.js +2 -8
  141. package/src/core-tags/components/TransformHelper/handleRootNodes.js +14 -14
  142. package/src/core-tags/components/TransformHelper/handleScopedAttrs.js +1 -1
  143. package/src/core-tags/components/TransformHelper/index.js +1 -1
  144. package/src/core-tags/components/component-tag.js +1 -1
  145. package/src/core-tags/components/components-transformer.js +2 -2
  146. package/src/core-tags/components/util/generateRegisterComponentCode.js +2 -2
  147. package/src/core-tags/components/widget-types-tag.js +2 -2
  148. package/src/core-tags/core/await/AsyncValue.js +1 -1
  149. package/src/core-tags/core/await/renderer.js +3 -12
  150. package/src/core-tags/core/await/reorderer-renderer.js +1 -1
  151. package/src/core-tags/core/core-transformer.js +5 -5
  152. package/src/core-tags/core/html-comment-tag.js +1 -1
  153. package/src/core-tags/core/import-tag.js +1 -1
  154. package/src/core-tags/core/util/parseImport.js +8 -8
  155. package/src/core-tags/html/normalize-script-text.js +1 -1
  156. package/src/core-tags/migrate/all-tags/body-only-if.js +4 -5
  157. package/src/core-tags/migrate/all-tags/control-flow-directives.js +2 -5
  158. package/src/core-tags/migrate/all-tags/dynamic-attributes.js +1 -4
  159. package/src/core-tags/migrate/all-tags/include-directive.js +0 -4
  160. package/src/core-tags/migrate/all-tags/index.js +2 -2
  161. package/src/core-tags/migrate/all-tags/legacy-nested-tag.js +0 -5
  162. package/src/core-tags/migrate/all-tags/marko-init.js +2 -8
  163. package/src/core-tags/migrate/all-tags/modifier-key.js +1 -7
  164. package/src/core-tags/migrate/all-tags/params.js +1 -1
  165. package/src/core-tags/migrate/all-tags/ref.js +1 -5
  166. package/src/core-tags/migrate/all-tags/w-bind.js +8 -12
  167. package/src/core-tags/migrate/all-tags/w-body.js +3 -7
  168. package/src/core-tags/migrate/all-tags/w-config.js +1 -5
  169. package/src/core-tags/migrate/all-tags/w-for.js +1 -8
  170. package/src/core-tags/migrate/all-tags/w-id.js +1 -8
  171. package/src/core-tags/migrate/all-tags/w-on.js +2 -9
  172. package/src/core-tags/migrate/all-tags/w-preserve-attrs.js +1 -5
  173. package/src/core-tags/migrate/all-tags/w-preserve.js +3 -7
  174. package/src/core-tags/migrate/all-tags/widget-in-attrs.js +4 -17
  175. package/src/core-tags/migrate/all-templates/index.js +2 -2
  176. package/src/core-tags/migrate/all-templates/non-standard-template-literals.js +6 -12
  177. package/src/core-tags/migrate/all-templates/render-calls.js +4 -8
  178. package/src/core-tags/migrate/all-templates/widget-data-is-state.js +2 -2
  179. package/src/core-tags/migrate/all-templates/widget-get-template-data.js +2 -2
  180. package/src/core-tags/migrate/assign-tag.js +2 -6
  181. package/src/core-tags/migrate/async-fragment-tag.js +2 -6
  182. package/src/core-tags/migrate/async-fragments-tag.js +0 -4
  183. package/src/core-tags/migrate/await-tag.js +8 -23
  184. package/src/core-tags/migrate/class-tag.js +0 -4
  185. package/src/core-tags/migrate/component-globals-tag.js +0 -4
  186. package/src/core-tags/migrate/for-tag.js +12 -16
  187. package/src/core-tags/migrate/include-tag.js +2 -5
  188. package/src/core-tags/migrate/invoke-tag.js +2 -6
  189. package/src/core-tags/migrate/layout-placeholder-tag.js +0 -3
  190. package/src/core-tags/migrate/layout-put-tag.js +0 -3
  191. package/src/core-tags/migrate/layout-use-tag.js +0 -3
  192. package/src/core-tags/migrate/macro-body-tag.js +0 -5
  193. package/src/core-tags/migrate/macro-tag.js +5 -10
  194. package/src/core-tags/migrate/unless-tag.js +0 -3
  195. package/src/core-tags/migrate/util/addIdScopedAttr.js +1 -1
  196. package/src/core-tags/migrate/util/import-tag.js +6 -6
  197. package/src/core-tags/migrate/util/parseFor.js +20 -20
  198. package/src/core-tags/migrate/util/renderCallToDynamicTag.js +7 -7
  199. package/src/core-tags/migrate/var-tag.js +4 -8
  200. package/src/express.js +1 -1
  201. package/src/hot-reload.js +3 -3
  202. package/src/node-require/index.js +1 -1
  203. package/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +4 -55
  204. package/src/node_modules/@internal/components-entry-legacy/index-browser.js +0 -10
  205. package/src/runtime/RenderResult.js +3 -16
  206. package/src/runtime/components/Component.js +2 -23
  207. package/src/runtime/components/ComponentDef.js +2 -8
  208. package/src/runtime/components/ComponentsContext.js +1 -1
  209. package/src/runtime/components/ServerComponent.js +0 -6
  210. package/src/runtime/components/State.js +2 -2
  211. package/src/runtime/components/attach-detach.js +1 -1
  212. package/src/runtime/components/dom-data.js +1 -1
  213. package/src/runtime/components/legacy/defineComponent-legacy.js +0 -5
  214. package/src/runtime/components/legacy/defineRenderer-legacy.js +1 -16
  215. package/src/runtime/components/legacy/dependencies/index.js +10 -10
  216. package/src/runtime/components/legacy/index.js +5 -0
  217. package/src/runtime/components/legacy/renderer-legacy.js +1 -1
  218. package/src/runtime/components/update-manager.js +1 -1
  219. package/src/runtime/dom-insert.js +1 -1
  220. package/src/runtime/helpers/_weak-map.js +1 -1
  221. package/src/runtime/helpers/bind-component.js +1 -1
  222. package/src/runtime/helpers/for-of.js +1 -6
  223. package/src/runtime/html/AsyncStream.js +5 -5
  224. package/src/runtime/html/BufferedWriter.js +1 -1
  225. package/src/runtime/html/StringWriter.js +1 -1
  226. package/src/runtime/html/helpers/attr.js +0 -9
  227. package/src/runtime/html/helpers/attrs.js +0 -6
  228. package/src/runtime/html/helpers/merge-attrs.js +0 -8
  229. package/src/runtime/html/index.js +1 -1
  230. package/src/runtime/renderable.js +1 -1
  231. package/src/runtime/vdom/AsyncVDOMBuilder.js +2 -2
  232. package/src/runtime/vdom/VComment.js +1 -1
  233. package/src/runtime/vdom/VComponent.js +1 -1
  234. package/src/runtime/vdom/VDocumentFragment.js +1 -1
  235. package/src/runtime/vdom/VElement.js +4 -11
  236. package/src/runtime/vdom/VFragment.js +1 -1
  237. package/src/runtime/vdom/VNode.js +1 -1
  238. package/src/runtime/vdom/VText.js +1 -1
  239. package/src/runtime/vdom/helpers/attrs.js +0 -7
  240. package/src/runtime/vdom/index.js +1 -1
  241. package/src/runtime/vdom/morphdom/fragment.js +1 -1
  242. package/src/runtime/vdom/morphdom/specialElHandlers.js +1 -1
  243. package/src/taglib/taglib-finder/index.js +5 -5
  244. package/src/taglib/taglib-loader/Tag.js +8 -8
  245. package/src/taglib/taglib-loader/Taglib.js +1 -1
  246. package/src/taglib/taglib-loader/loadAttributeFromProps.js +1 -1
  247. package/src/taglib/taglib-loader/loadTagFromProps.js +29 -14
  248. package/src/taglib/taglib-loader/loadTaglibFromProps.js +9 -9
  249. package/src/taglib/taglib-loader/scanTagsDir.js +6 -6
  250. package/src/taglib/taglib-lookup/TaglibLookup.js +8 -8
@@ -11,7 +11,7 @@ function getRootDeps(template, context) {
11
11
  attachDepsAndComponentsToTemplate(template, context);
12
12
 
13
13
  var deps = (template.___depsArray = Object.keys(template.___deps).map(
14
- key => template.___deps[key]
14
+ (key) => template.___deps[key]
15
15
  ));
16
16
  var initModule = getInitModule(template.path, template.___components);
17
17
 
@@ -20,7 +20,7 @@ function getRootDeps(template, context) {
20
20
  deps.push({
21
21
  type: "require",
22
22
  path: require.resolve("../../boot"),
23
- run: true
23
+ run: true,
24
24
  });
25
25
 
26
26
  // these dependencies should be last
@@ -59,7 +59,7 @@ function attachDepsAndComponentsToTemplate(target, context) {
59
59
  var root = nodePath.dirname(template.path);
60
60
 
61
61
  if (meta.deps) {
62
- meta.deps.forEach(dep => {
62
+ meta.deps.forEach((dep) => {
63
63
  dep = resolveDep(dep, root, context);
64
64
  deps[dep.virtualPath || dep.path] = dep;
65
65
  });
@@ -69,12 +69,12 @@ function attachDepsAndComponentsToTemplate(target, context) {
69
69
  var resolveFrom = (context && context.resolveFrom) || defaultResolveFrom;
70
70
  components[meta.id] = {
71
71
  id: meta.id,
72
- path: resolveFrom(root, meta.component)
72
+ path: resolveFrom(root, meta.component),
73
73
  };
74
74
  }
75
75
 
76
76
  if (meta.tags) {
77
- meta.tags.forEach(tagPath => {
77
+ meta.tags.forEach((tagPath) => {
78
78
  var resolveFrom = context.resolveFrom || defaultResolveFrom;
79
79
  var tag = resolveFrom(root, tagPath);
80
80
  var ext = nodePath.extname(tag);
@@ -100,13 +100,13 @@ function getInitModule(path, components) {
100
100
  var module = null;
101
101
 
102
102
  if (components) {
103
- components = Object.keys(components).map(key => components[key]);
103
+ components = Object.keys(components).map((key) => components[key]);
104
104
 
105
105
  if (components.length) {
106
106
  var root = nodePath.dirname(path);
107
107
  var virtualPath = path + ".init.js";
108
108
  var registrations = components.map(
109
- component =>
109
+ (component) =>
110
110
  `components.register('${component.id}', require('.${
111
111
  nodePath.sep
112
112
  }${nodePath.relative(root, component.path)}'));`
@@ -128,8 +128,8 @@ function getInitModule(path, components) {
128
128
  } else {
129
129
  return code;
130
130
  }
131
- }
132
- }
131
+ },
132
+ },
133
133
  };
134
134
  }
135
135
  }
@@ -167,7 +167,7 @@ function parseDependencyString(string) {
167
167
  var match = /^(?:([\w-]+)(?::\s*|\s+))?(.*?(?:\.(\w+))?)$/.exec(string);
168
168
  return {
169
169
  type: match[1] || match[3],
170
- path: match[2]
170
+ path: match[2],
171
171
  };
172
172
  }
173
173
 
@@ -1 +1,6 @@
1
+ // eslint-disable-next-line no-constant-condition
2
+ if ("MARKO_DEBUG") {
3
+ require("complain")("marko-widgets is deprecated. When upgrading to Marko 5 ensure marko-widgets@8 is installed for compatibility.");
4
+ }
5
+
1
6
  module.exports = require("@internal/components-entry-legacy");
@@ -103,7 +103,7 @@ function createRendererFunc(templateRenderFunc, componentProps) {
103
103
  isFakeComponent = true;
104
104
  component = {
105
105
  id: id,
106
- ___keyedElements: {}
106
+ ___keyedElements: {},
107
107
  };
108
108
  } else {
109
109
  component.___updateQueued = true;
@@ -54,7 +54,7 @@ function batchUpdate(func) {
54
54
  // batched update completes we invoke the "afterUpdate"
55
55
  // event listeners.
56
56
  var batch = {
57
- ___queue: null
57
+ ___queue: null,
58
58
  };
59
59
 
60
60
  batchStack.push(batch);
@@ -72,6 +72,6 @@ module.exports = function (target, getEl, afterInsert) {
72
72
  var el = getEl(this, referenceEl);
73
73
  insertAfter(el, referenceEl, referenceEl.parentNode);
74
74
  return afterInsert(this, referenceEl);
75
- }
75
+ },
76
76
  });
77
77
  };
@@ -10,6 +10,6 @@ module.exports =
10
10
  },
11
11
  set: function (ref, value) {
12
12
  ref[id] = value;
13
- }
13
+ },
14
14
  };
15
15
  };
@@ -12,7 +12,7 @@ module.exports = function (componentProps) {
12
12
  return function bindComponent(renderBody, out) {
13
13
  renderer(
14
14
  {
15
- $renderBody: renderBody
15
+ $renderBody: renderBody,
16
16
  },
17
17
  out
18
18
  );
@@ -9,12 +9,7 @@ module.exports = function forOf(array, callback) {
9
9
  var i;
10
10
 
11
11
  if (array == null) {
12
- // eslint-disable-next-line no-constant-condition
13
- if ("MARKO_DEBUG") {
14
- complain(
15
- "Passing a non iterable to a <for> loop is deprecated. Prefer to use an <if> around the loop instead."
16
- );
17
- }
12
+ // ignore
18
13
  } else if (Array.isArray(array)) {
19
14
  for (i = 0; i < array.length; i++) {
20
15
  callback(array[i], i, array);
@@ -23,7 +23,7 @@ var voidWriter = {
23
23
  },
24
24
  toString: function () {
25
25
  return "";
26
- }
26
+ },
27
27
  };
28
28
 
29
29
  function State(root, stream, writer, events) {
@@ -237,7 +237,7 @@ var proto = (AsyncStream.prototype = {
237
237
  writer: newStream, // Legacy
238
238
  parentWriter: this, // Legacy
239
239
  out: newStream,
240
- parentOut: this
240
+ parentOut: this,
241
241
  });
242
242
 
243
243
  return newStream;
@@ -498,7 +498,7 @@ var proto = (AsyncStream.prototype = {
498
498
  newOut.on("error", this.emit.bind(this, "error"));
499
499
  this._state.events.emit("beginDetachedAsync", {
500
500
  out: newOut,
501
- parentOut: this
501
+ parentOut: this,
502
502
  });
503
503
  return newOut;
504
504
  },
@@ -655,7 +655,7 @@ var proto = (AsyncStream.prototype = {
655
655
  this.___assignedComponentDef = componentDef;
656
656
  this.___assignedKey = key;
657
657
  this.___assignedCustomEvents = customEvents;
658
- }
658
+ },
659
659
  });
660
660
 
661
661
  // alias:
@@ -669,6 +669,6 @@ function getNonMarkoStack(error) {
669
669
  .toString()
670
670
  .split("\n")
671
671
  .slice(1)
672
- .filter(line => !/\/node_modules\/marko\//.test(line))
672
+ .filter((line) => !/\/node_modules\/marko\//.test(line))
673
673
  .join("\n");
674
674
  }
@@ -30,7 +30,7 @@ BufferedWriter.prototype = Object.assign(
30
30
  if (!this._wrapped.isTTY) {
31
31
  this._wrapped.end();
32
32
  }
33
- }
33
+ },
34
34
  },
35
35
  StringWriter.prototype
36
36
  );
@@ -67,7 +67,7 @@ StringWriter.prototype = {
67
67
  str += `<script${nonceAttr}>${this._scripts}</script>`;
68
68
  }
69
69
  return str;
70
- }
70
+ },
71
71
  };
72
72
 
73
73
  module.exports = StringWriter;
@@ -3,7 +3,6 @@
3
3
  var escapeQuoteHelpers = require("./escape-quotes");
4
4
  var escapeDoubleQuotes = escapeQuoteHelpers.___escapeDoubleQuotes;
5
5
  var escapeSingleQuotes = escapeQuoteHelpers.___escapeSingleQuotes;
6
- var complain = "MARKO_DEBUG" && require("complain");
7
6
 
8
7
  module.exports = maybeEmptyAttr;
9
8
 
@@ -30,14 +29,6 @@ function notEmptyAttr(name, value) {
30
29
  switch (value.toString) {
31
30
  case Object.prototype.toString:
32
31
  case Array.prototype.toString:
33
- // eslint-disable-next-line no-constant-condition
34
- if ("MARKO_DEBUG") {
35
- complain(
36
- "Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead.",
37
- { locationIndex: 2 }
38
- );
39
- }
40
-
41
32
  return " " + name + singleQuote(JSON.stringify(value), 2);
42
33
  case RegExp.prototype.toString:
43
34
  return " " + name + guessQuotes(value.source);
@@ -12,12 +12,6 @@ module.exports = function attrs(arg) {
12
12
  }
13
13
  return result;
14
14
  case "string":
15
- // eslint-disable-next-line no-constant-condition
16
- if ("MARKO_DEBUG") {
17
- complain(
18
- "Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value"
19
- );
20
- }
21
15
  return arg;
22
16
  default:
23
17
  return "";
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var complain = "MARKO_DEBUG" && require("complain");
4
3
  var dynamicAttrHelper = require("./_dynamic-attr");
5
4
 
6
5
  /**
@@ -13,13 +12,6 @@ module.exports = function mergeAttrs() {
13
12
  for (var i = arguments.length, last = i - 1; i--; ) {
14
13
  var source = arguments[i];
15
14
  if (typeof source === "string") {
16
- // eslint-disable-next-line no-constant-condition
17
- if ("MARKO_DEBUG") {
18
- complain(
19
- "Passing a string as dynamic attributes ('<div ${string}>' or '<div ...string>') is deprecated, use an object instead."
20
- );
21
- }
22
-
23
15
  if (source[0] !== " ") {
24
16
  result += " " + source;
25
17
  } else {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  globalThis.Marko = {
4
- Component: function () {}
4
+ Component: function () {},
5
5
  };
6
6
 
7
7
  /**
@@ -140,6 +140,6 @@ module.exports = function (target, renderer) {
140
140
  globalData.template = globalData.template || this;
141
141
 
142
142
  return safeRender(render, finalData, finalOut, shouldEnd);
143
- }
143
+ },
144
144
  });
145
145
  };
@@ -293,7 +293,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
293
293
 
294
294
  state.___events.emit("beginAsync", {
295
295
  out: asyncOut,
296
- parentOut: this
296
+ parentOut: this,
297
297
  });
298
298
 
299
299
  return asyncOut;
@@ -443,7 +443,7 @@ var proto = (AsyncVDOMBuilder.prototype = {
443
443
  this.___assignedComponentDef = componentDef;
444
444
  this.___assignedKey = key;
445
445
  this.___assignedCustomEvents = customEvents;
446
- }
446
+ },
447
447
  });
448
448
 
449
449
  proto.e = proto.element;
@@ -16,7 +16,7 @@ VComment.prototype = {
16
16
 
17
17
  ___cloneNode: function () {
18
18
  return new VComment(this.___nodeValue);
19
- }
19
+ },
20
20
  };
21
21
 
22
22
  inherit(VComment, VNode);
@@ -9,7 +9,7 @@ function VComponent(component, key, ownerComponent, preserve) {
9
9
  }
10
10
 
11
11
  VComponent.prototype = {
12
- ___nodeType: 2
12
+ ___nodeType: 2,
13
13
  };
14
14
 
15
15
  inherit(VComponent, VNode);
@@ -24,7 +24,7 @@ VDocumentFragment.prototype = {
24
24
 
25
25
  ___actualize: function (host) {
26
26
  return (host.ownerDocument || host).createDocumentFragment();
27
- }
27
+ },
28
28
  };
29
29
 
30
30
  inherit(VDocumentFragment, VNode);
@@ -1,6 +1,5 @@
1
1
  /* jshint newcap:false */
2
2
 
3
- var complain = "MARKO_DEBUG" && require("complain");
4
3
  var domData = require("../components/dom-data");
5
4
  var componentsUtil = require("@internal/components-util");
6
5
  var vElementByDOMNode = domData.___vElementByDOMNode;
@@ -15,7 +14,7 @@ var NS_MATH = "http://www.w3.org/1998/Math/MathML";
15
14
  var NS_SVG = "http://www.w3.org/2000/svg";
16
15
  var DEFAULT_NS = {
17
16
  svg: NS_SVG,
18
- math: NS_MATH
17
+ math: NS_MATH,
19
18
  };
20
19
 
21
20
  var FLAG_SIMPLE_ATTRS = 1;
@@ -34,12 +33,6 @@ function convertAttrValue(type, value) {
34
33
  switch (value.toString) {
35
34
  case Object.prototype.toString:
36
35
  case Array.prototype.toString:
37
- // eslint-disable-next-line no-constant-condition
38
- if ("MARKO_DEBUG") {
39
- complain(
40
- "Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead."
41
- );
42
- }
43
36
  return JSON.stringify(value);
44
37
  case RegExp.prototype.toString:
45
38
  return value.source;
@@ -212,7 +205,7 @@ VElement.prototype = {
212
205
  // different namespaces
213
206
  var value = this.___attributes[name];
214
207
  return value != null && value !== false;
215
- }
208
+ },
216
209
  };
217
210
 
218
211
  inherit(VElement, VNode);
@@ -224,7 +217,7 @@ var proto = (VElementClone.prototype = VElement.prototype);
224
217
  get: function () {
225
218
  var value = this.___attributes[name];
226
219
  return value !== false && value != null;
227
- }
220
+ },
228
221
  });
229
222
  });
230
223
 
@@ -240,7 +233,7 @@ defineProperty(proto, "___value", {
240
233
  this.___attributes.type === "radio"
241
234
  ? "on"
242
235
  : "";
243
- }
236
+ },
244
237
  });
245
238
 
246
239
  VElement.___removePreservedAttributes = function (attrs) {
@@ -18,7 +18,7 @@ VFragment.prototype = {
18
18
  keysByDOMNode.set(fragment, this.___key);
19
19
  vElementByDOMNode.set(fragment, this);
20
20
  return fragment;
21
- }
21
+ },
22
22
  };
23
23
 
24
24
  inherit(VFragment, VNode);
@@ -80,7 +80,7 @@ VNode.prototype = {
80
80
  } else {
81
81
  return this;
82
82
  }
83
- }
83
+ },
84
84
 
85
85
  // ,toJSON: function() {
86
86
  // var clone = Object.assign({
@@ -17,7 +17,7 @@ VText.prototype = {
17
17
 
18
18
  ___cloneNode: function () {
19
19
  return new VText(this.___nodeValue);
20
- }
20
+ },
21
21
  };
22
22
 
23
23
  inherit(VText, VNode);
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var complain = "MARKO_DEBUG" && require("complain");
4
3
  var classHelper = require("../../helpers/class-value");
5
4
  var styleHelper = require("../../helpers/style-value");
6
5
  var parseHTML = require("../parse-html");
@@ -10,12 +9,6 @@ var parseHTML = require("../parse-html");
10
9
  */
11
10
  module.exports = function (attributes) {
12
11
  if (typeof attributes === "string") {
13
- // eslint-disable-next-line no-constant-condition
14
- if ("MARKO_DEBUG") {
15
- complain(
16
- "Passing a string as a dynamic attribute value is deprecated - More details: https://github.com/marko-js/marko/wiki/Deprecation:-String-as-dynamic-attribute-value"
17
- );
18
- }
19
12
  return parseAttrs(attributes);
20
13
  }
21
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  typeof window === "object" &&
4
4
  (window.Marko = {
5
- Component: function () {}
5
+ Component: function () {},
6
6
  });
7
7
 
8
8
  /**
@@ -55,7 +55,7 @@ var fragmentPrototype = {
55
55
  this.nodes.forEach(function (node) {
56
56
  this.detachedContainer.appendChild(node);
57
57
  }, this);
58
- }
58
+ },
59
59
  };
60
60
 
61
61
  function createFragmentNode(startNode, nextNode, parentNode) {
@@ -100,7 +100,7 @@ SpecialElHandlers.prototype = {
100
100
  fromEl.selectedIndex = selected;
101
101
  }
102
102
  }
103
- }
103
+ },
104
104
  };
105
105
 
106
106
  module.exports = new SpecialElHandlers();
@@ -36,19 +36,19 @@ function getAllDependencyNames(pkg) {
36
36
  var map = {};
37
37
 
38
38
  if (pkg.dependencies) {
39
- Object.keys(pkg.dependencies).forEach(name => {
39
+ Object.keys(pkg.dependencies).forEach((name) => {
40
40
  map[name] = true;
41
41
  });
42
42
  }
43
43
 
44
44
  if (pkg.peerDependencies) {
45
- Object.keys(pkg.peerDependencies).forEach(name => {
45
+ Object.keys(pkg.peerDependencies).forEach((name) => {
46
46
  map[name] = true;
47
47
  });
48
48
  }
49
49
 
50
50
  if (pkg.devDependencies) {
51
- Object.keys(pkg.devDependencies).forEach(name => {
51
+ Object.keys(pkg.devDependencies).forEach((name) => {
52
52
  map[name] = true;
53
53
  });
54
54
  }
@@ -75,7 +75,7 @@ function find(dirname, registeredTaglibs) {
75
75
  added[taglib.id] = true;
76
76
  found.push(taglib);
77
77
  },
78
- foundTaglibPackages: {}
78
+ foundTaglibPackages: {},
79
79
  };
80
80
 
81
81
  var rootDirname = process.cwd(); // Don't search up past this directory
@@ -119,7 +119,7 @@ function find(dirname, registeredTaglibs) {
119
119
 
120
120
  if (rootPkg) {
121
121
  // Now look for `marko.json` from installed packages
122
- getAllDependencyNames(rootPkg).forEach(name => {
122
+ getAllDependencyNames(rootPkg).forEach((name) => {
123
123
  if (!excludedPackages[name]) {
124
124
  let taglibPath = resolveFrom(rootPkg.__dirname, name + "/marko.json");
125
125
  if (taglibPath) {
@@ -98,24 +98,24 @@ class Tag {
98
98
  attr.filePath = this.filePath;
99
99
  if (attr.name === "key" && !this.isCoreTag()) {
100
100
  complain("@key property is deprecated", {
101
- location: this.filePath
101
+ location: this.filePath,
102
102
  });
103
103
  }
104
104
  //
105
105
  if (attr.setFlag && attr.setFlag !== "hasComponentEvents") {
106
106
  complain(`${attr.name} - : set-flag property is deprecated`, {
107
- location: this.filePath
107
+ location: this.filePath,
108
108
  });
109
109
  }
110
110
  if (attr.type === "template") {
111
111
  complain(`${attr.name} - attribute template type is deprecated`, {
112
- location: this.filePath
112
+ location: this.filePath,
113
113
  });
114
114
  }
115
115
 
116
116
  if (attr.type === "path") {
117
117
  complain(`${attr.name} - attribute path type is deprecated`, {
118
- location: this.filePath
118
+ location: this.filePath,
119
119
  });
120
120
  }
121
121
  }
@@ -137,7 +137,7 @@ class Tag {
137
137
  complain(
138
138
  'The default "targetProperty" for "@*" attribute definitions is changing from "*" to "null" (merged in with the rest of the input) in a future Marko release. In order to avoid an issue upgrading, please explicitly define the "targetProperty".',
139
139
  {
140
- location: this.filePath
140
+ location: this.filePath,
141
141
  }
142
142
  );
143
143
  attr.targetProperty = "*";
@@ -186,13 +186,13 @@ class Tag {
186
186
  */
187
187
  addNestedVariable(nestedVariable) {
188
188
  complain("addNestedVariable is deprecated. Use tag parameters instead.", {
189
- location: this.filePath
189
+ location: this.filePath,
190
190
  });
191
191
 
192
192
  if (!this.nestedVariables) {
193
193
  this.nestedVariables = {
194
194
  __noMerge: true,
195
- vars: []
195
+ vars: [],
196
196
  };
197
197
  }
198
198
 
@@ -220,7 +220,7 @@ class Tag {
220
220
  this.bodyFunction = {
221
221
  __noMerge: true,
222
222
  name: name,
223
- params: params
223
+ params: params,
224
224
  };
225
225
  }
226
226
  /**
@@ -109,7 +109,7 @@ class Taglib {
109
109
  textTransformers: this.textTransformers,
110
110
  attributes: this.attributes,
111
111
  patternAttributes: this.patternAttributes,
112
- imports: this.imports
112
+ imports: this.imports,
113
113
  };
114
114
  }
115
115
  }
@@ -22,7 +22,7 @@ class AttrLoader {
22
22
  attrProps = {};
23
23
  } else if (typeof attrProps === "string") {
24
24
  attrProps = {
25
- type: attrProps
25
+ type: attrProps,
26
26
  };
27
27
  } else {
28
28
  assert.ok(typeof attrProps === "object", 'Invalid "attrProps"');