@marko/compiler 5.33.1 → 5.33.3

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.
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ function configure(newConfig) {
23
23
 
24
24
  async function compile(src, filename, config) {
25
25
  const markoConfig = loadMarkoConfig(config);
26
- const babelConfig = loadBabelConfig(filename, markoConfig);
26
+ const babelConfig = await loadBabelConfig(filename, markoConfig);
27
27
  const babelResult = await babel.transformAsync(src, babelConfig);
28
28
  scheduleDefaultClear(markoConfig);
29
29
  return buildResult(src, filename, markoConfig.errorRecovery, babelResult);
@@ -31,7 +31,7 @@ async function compile(src, filename, config) {
31
31
 
32
32
  function compileSync(src, filename, config) {
33
33
  const markoConfig = loadMarkoConfig(config);
34
- const babelConfig = loadBabelConfig(filename, markoConfig);
34
+ const babelConfig = loadBabelConfigSync(filename, markoConfig);
35
35
  const babelResult = babel.transformSync(src, babelConfig);
36
36
  scheduleDefaultClear(markoConfig);
37
37
  return buildResult(src, filename, markoConfig.errorRecovery, babelResult);
@@ -73,7 +73,21 @@ function loadMarkoConfig(config) {
73
73
  return markoConfig;
74
74
  }
75
75
 
76
- function loadBabelConfig(filename, { babelConfig, ...markoConfig }) {
76
+ async function loadBabelConfig(filename, config) {
77
+ const baseBabelConfig = getBaseBabelConfig(filename, config);
78
+ return isTranslatedOutput(config.output) ?
79
+ (await babel.loadPartialConfigAsync(baseBabelConfig)).options :
80
+ baseBabelConfig;
81
+ }
82
+
83
+ function loadBabelConfigSync(filename, config) {
84
+ const baseBabelConfig = getBaseBabelConfig(filename, config);
85
+ return isTranslatedOutput(config.output) ?
86
+ babel.loadPartialConfigSync(baseBabelConfig).options :
87
+ baseBabelConfig;
88
+ }
89
+
90
+ function getBaseBabelConfig(filename, { babelConfig, ...markoConfig }) {
77
91
  const isTranslated = isTranslatedOutput(markoConfig.output);
78
92
  const requiredPlugins = [
79
93
  [_babelPlugin.default, markoConfig],
@@ -111,8 +125,6 @@ function loadBabelConfig(filename, { babelConfig, ...markoConfig }) {
111
125
  if (markoConfig.modules === "cjs") {
112
126
  baseBabelConfig.plugins.push([_pluginTransformModulesCommonjs.default, { loose: true }]);
113
127
  }
114
-
115
- return babel.loadPartialConfig(baseBabelConfig).options;
116
128
  }
117
129
 
118
130
  return baseBabelConfig;
@@ -500,16 +500,13 @@ class TagLoader {
500
500
 
501
501
  nestedTag.name = nestedTagName;
502
502
  tag.addNestedTag(nestedTag);
503
-
504
- if (!nestedTag.isRepeated) {
505
- let attr = loaders.loadAttributeFromProps(
503
+ tag.addAttribute(
504
+ loaders.loadAttributeFromProps(
506
505
  nestedTag.targetProperty,
507
- { type: "object" },
506
+ { type: "expression" },
508
507
  dependencyChain
509
- );
510
-
511
- tag.addAttribute(attr);
512
- }
508
+ )
509
+ );
513
510
  }
514
511
  }
515
512
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.33.1",
3
+ "version": "5.33.3",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",
@@ -61,7 +61,7 @@
61
61
  "strip-json-comments": "^3.1.1"
62
62
  },
63
63
  "devDependencies": {
64
- "@marko/translator-default": "^5.31.1"
64
+ "@marko/translator-default": "^5.31.3"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"