@marko/translator-default 5.22.0 → 5.22.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.
Files changed (46) hide show
  1. package/dist/cdata/index.js +3 -3
  2. package/dist/class.js +3 -3
  3. package/dist/comment/index.js +3 -3
  4. package/dist/declaration/index.js +3 -3
  5. package/dist/document-type/index.js +3 -3
  6. package/dist/index.js +12 -12
  7. package/dist/placeholder/index.js +3 -3
  8. package/dist/placeholder/index[html].js +9 -9
  9. package/dist/tag/attribute/directives/class.js +4 -3
  10. package/dist/tag/attribute/directives/index.js +2 -1
  11. package/dist/tag/attribute/directives/no-update-body-if.js +4 -3
  12. package/dist/tag/attribute/directives/no-update-body.js +2 -1
  13. package/dist/tag/attribute/directives/no-update-if.js +2 -1
  14. package/dist/tag/attribute/directives/no-update.js +2 -1
  15. package/dist/tag/attribute/directives/style.js +4 -3
  16. package/dist/tag/attribute/index.js +6 -6
  17. package/dist/tag/attribute/modifiers/index.js +2 -1
  18. package/dist/tag/attribute/modifiers/no-update.js +4 -3
  19. package/dist/tag/attribute/modifiers/scoped.js +4 -3
  20. package/dist/tag/custom-tag.js +10 -10
  21. package/dist/tag/dynamic-tag.js +2 -2
  22. package/dist/tag/index.js +4 -4
  23. package/dist/tag/native-tag.js +2 -2
  24. package/dist/tag/native-tag[html]/attributes.js +4 -4
  25. package/dist/tag/native-tag[html]/index.js +4 -4
  26. package/dist/tag/native-tag[vdom]/index.js +8 -8
  27. package/dist/tag/util.js +4 -4
  28. package/dist/taglib/core/conditional/translate-else.js +2 -2
  29. package/dist/taglib/core/index.js +140 -138
  30. package/dist/taglib/core/parse-class.js +4 -4
  31. package/dist/taglib/core/parse-export.js +4 -4
  32. package/dist/taglib/core/parse-import.js +4 -4
  33. package/dist/taglib/core/parse-module-code.js +2 -2
  34. package/dist/taglib/core/parse-static.js +2 -2
  35. package/dist/taglib/core/transform-style.js +2 -2
  36. package/dist/taglib/core/translate-await.js +4 -4
  37. package/dist/taglib/core/translate-for.js +4 -4
  38. package/dist/taglib/core/translate-include-content.js +2 -2
  39. package/dist/taglib/migrate/all-templates.js +2 -1
  40. package/dist/taglib/migrate/index.js +2 -1
  41. package/dist/util/add-dependencies.js +4 -4
  42. package/dist/util/get-component-files.js +2 -2
  43. package/dist/util/key-manager.js +4 -4
  44. package/dist/util/optimize-html-writes.js +5 -5
  45. package/dist/util/optimize-vdom-create.js +9 -9
  46. package/package.json +4 -4
@@ -5,8 +5,8 @@ function exit(path) {
5
5
  const { node } = path;
6
6
  const {
7
7
  attributes,
8
- body: { body, params } } =
9
- node;
8
+ body: { body, params }
9
+ } = node;
10
10
  const namePath = path.get("name");
11
11
  const ofAttr = findName(attributes, "of");
12
12
  const inAttr = findName(attributes, "in");
@@ -92,8 +92,8 @@ function exit(path) {
92
92
  allowedAttributes.push("from", "to", "step");
93
93
 
94
94
  const stepAttr = findName(attributes, "step") || {
95
- value: _compiler.types.numericLiteral(1) };
96
-
95
+ value: _compiler.types.numericLiteral(1)
96
+ };
97
97
  const stepValue = stepAttr ? stepAttr.value : _compiler.types.numericLiteral(1);
98
98
  const [indexParam] = params;
99
99
  const stepsName = path.scope.generateUidIdentifier("steps");
@@ -4,8 +4,8 @@ var _babelUtils = require("@marko/babel-utils");
4
4
 
5
5
  function enter(tag) {
6
6
  const {
7
- hub: { file } } =
8
- tag;
7
+ hub: { file }
8
+ } = tag;
9
9
  (0, _babelUtils.assertNoParams)(tag);
10
10
  (0, _babelUtils.assertNoAttributes)(tag);
11
11
 
@@ -6,4 +6,5 @@ var _withPreviousLocation = _interopRequireDefault(require("../../util/with-prev
6
6
  if (path.node.name === "data" && !path.scope.hasBinding("data")) {
7
7
  path.replaceWith((0, _withPreviousLocation.default)(_compiler.types.identifier("input"), path.node));
8
8
  }
9
- } };exports.default = _default;
9
+ }
10
+ };exports.default = _default;
@@ -1,4 +1,5 @@
1
1
  "use strict";exports.__esModule = true;exports.default = void 0;var migrateAllTemplates = _interopRequireWildcard(require("./all-templates"));function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function (nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}var _default =
2
2
  {
3
3
  "taglib-id": "marko-default-migrate",
4
- migrator: migrateAllTemplates };exports.default = _default;
4
+ migrator: migrateAllTemplates
5
+ };exports.default = _default;
@@ -127,8 +127,8 @@ var _babelUtils = require("@marko/babel-utils");var _default =
127
127
  s = s || new _magicString.default(file.code, { source: filename });
128
128
  map = s.snip(dep.startPos, dep.endPos).generateMap({
129
129
  source: filename,
130
- includeContent: true });
131
-
130
+ includeContent: true
131
+ });
132
132
 
133
133
  if (sourceMaps === "inline" || sourceMaps === "both") {
134
134
  code += dep.style ?
@@ -144,8 +144,8 @@ var _babelUtils = require("@marko/babel-utils");var _default =
144
144
  dep = resolveVirtualDependency(filename, {
145
145
  map,
146
146
  code,
147
- virtualPath });
148
-
147
+ virtualPath
148
+ });
149
149
  } else if (dep.startsWith("package:")) {
150
150
  continue;
151
151
  }
@@ -47,6 +47,6 @@ function getComponentFiles({ hub: { file } }) {
47
47
  styleFile,
48
48
  packageFile,
49
49
  componentFile,
50
- componentBrowserFile };
51
-
50
+ componentBrowserFile
51
+ };
52
52
  }
@@ -33,8 +33,8 @@ class KeyManager {
33
33
 
34
34
  nextKey() {
35
35
  return Object.assign(_compiler.types.stringLiteral(String(this._nextKey++)), {
36
- _isAutoKey: true });
37
-
36
+ _isAutoKey: true
37
+ });
38
38
  }
39
39
 
40
40
  resolveKey(path) {
@@ -76,8 +76,8 @@ class KeyManager {
76
76
  _compiler.types.binaryExpression("+", autoKey, parentKeyScope) :
77
77
  autoKey);
78
78
 
79
- }}
80
-
79
+ }
80
+ }
81
81
 
82
82
  function getParentKeyScope(path) {
83
83
  const parentLoopTag = path.findParent(_babelUtils.isLoopTag);
@@ -22,15 +22,15 @@ const mergeWriteCallsVisitor = {
22
22
  get("expression.arguments.0").
23
23
  replaceWith((0, _babelUtils.normalizeTemplateString)(quasis, ...expressions));
24
24
  }
25
- } };
26
-
25
+ }
26
+ };
27
27
 
28
28
  function optimizeHTMLWrites(path) {
29
29
  const {
30
30
  hub: {
31
- file: { markoOpts } } } =
32
-
33
- path;
31
+ file: { markoOpts }
32
+ }
33
+ } = path;
34
34
 
35
35
  if (markoOpts.optimize && markoOpts.output === "html") {
36
36
  path.traverse(mergeWriteCallsVisitor);
@@ -35,8 +35,8 @@ const mergeStaticCreateVisitor = {
35
35
  _compiler.types.memberExpression(state.currentRoot, _compiler.types.identifier("e")),
36
36
  writeArgs);
37
37
 
38
- } };
39
-
38
+ }
39
+ };
40
40
 
41
41
  const analyzeStaticVisitor = {
42
42
  MarkoText(path) {
@@ -96,14 +96,14 @@ const analyzeStaticVisitor = {
96
96
  every((t) => staticNodes.has(t.node));
97
97
 
98
98
  if (isStatic) staticNodes.add(path.node);
99
- } } };
100
-
101
-
99
+ }
100
+ }
101
+ };
102
102
 
103
103
  function optimizeStaticVDOM(path) {
104
104
  const {
105
- hub: { file } } =
106
- path;
105
+ hub: { file }
106
+ } = path;
107
107
 
108
108
  if (
109
109
  !shouldRun(file.markoOpts) ||
@@ -122,9 +122,9 @@ function optimizeStaticVDOM(path) {
122
122
  "marko/src/runtime/vdom/helpers/v-element.js",
123
123
  "marko_createElement"),
124
124
 
125
- writeArgs) };
126
-
125
+ writeArgs)
127
126
 
127
+ };
128
128
 
129
129
  path.traverse(mergeStaticCreateVisitor, state);
130
130
 
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@marko/translator-default",
3
3
  "description": "Translates Marko templates to the default Marko runtime.",
4
- "version": "5.22.0",
4
+ "version": "5.22.2",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.16.0",
9
9
  "@marko/babel-utils": "^5.21.3",
10
10
  "escape-string-regexp": "^4.0.0",
11
- "magic-string": "^0.25.7",
11
+ "magic-string": "^0.27.0",
12
12
  "self-closing-tags": "^1.0.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@marko/compiler": "^5.23.0",
16
- "marko": "^5.22.0"
15
+ "@marko/compiler": "^5.23.2",
16
+ "marko": "^5.22.2"
17
17
  },
18
18
  "files": [
19
19
  "dist"