marko 5.39.46 → 5.39.47

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.
@@ -68,29 +68,32 @@ runtimeId)
68
68
  };
69
69
 
70
70
  // Its importer passes the bundler's resolver, so it resolves on a page of either
71
- // API, whichever page entry rendered.
71
+ // API, whichever page entry rendered. Only its tag renders it, reading the template
72
+ // as it renders: an import cycle may not have evaluated that module yet.
72
73
  exports.withLoadAssets = function withLoadAssets(
73
74
  typeId,
74
- template,
75
+ getTemplate,
75
76
  assetFlush,
76
77
  triggers)
77
78
  {
78
- return createFacade(template, function (input, out) {
79
- var key = out.ad_;
80
- var def = out.ac_;
79
+ return {
80
+ _: function (input, out) {
81
+ var key = out.ad_;
82
+ var def = out.ac_;
81
83
 
82
- if (willRerender(def)) {
83
- out.bf(key + "s", def.s_, true);
84
- writeLoadAsset(out, typeId, assetFlush, triggers);
85
- out.ef();
86
- out.bf(key, def.s_, true);
87
- template._(input, out);
88
- out.ef();
89
- } else {
90
- writeLoadAsset(out, typeId, assetFlush, triggers);
91
- template._(input, out);
84
+ if (willRerender(def)) {
85
+ out.bf(key + "s", def.s_, true);
86
+ writeLoadAsset(out, typeId, assetFlush, triggers);
87
+ out.ef();
88
+ out.bf(key, def.s_, true);
89
+ getTemplate()._(input, out);
90
+ out.ef();
91
+ } else {
92
+ writeLoadAsset(out, typeId, assetFlush, triggers);
93
+ getTemplate()._(input, out);
94
+ }
92
95
  }
93
- });
96
+ };
94
97
  };
95
98
 
96
99
  // Within Tags content the Tags writer places it apart from what a `@catch` drops,
@@ -143,7 +143,7 @@ function translateLoadTag(path, tagName, relativePath) {
143
143
  );
144
144
  loadArgs = [
145
145
  _compiler.types.stringLiteral(childFile.metadata.marko.id),
146
- _compiler.types.identifier(tagName),
146
+ _compiler.types.arrowFunctionExpression([], _compiler.types.identifier(tagName)),
147
147
  (0, _babelUtils.importNamed)(file, linkAssets.runtime, "flush", "marko_asset_flush")];
148
148
 
149
149
  if (triggers) loadArgs.push(_compiler.types.valueToNode(triggers));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.39.46",
3
+ "version": "5.39.47",
4
4
  "private": false,
5
5
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
6
6
  "keywords": [
@@ -67,8 +67,8 @@
67
67
  },
68
68
  "types": "index.d.ts",
69
69
  "dependencies": {
70
- "@marko/compiler": "^5.42.8",
71
- "@marko/runtime-tags": "^6.4.5",
70
+ "@marko/compiler": "^5.42.13",
71
+ "@marko/runtime-tags": "^6.4.7",
72
72
  "app-module-path": "^2.2.0",
73
73
  "argly": "^1.2.0",
74
74
  "browser-refresh-client": "1.1.4",
@@ -84,7 +84,7 @@
84
84
  "warp10": "^2.1.0"
85
85
  },
86
86
  "devDependencies": {
87
- "marko": "5.39.46"
87
+ "marko": "5.39.47"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=22"
@@ -68,29 +68,32 @@ exports.withPageAssets = function withPageAssets(
68
68
  };
69
69
 
70
70
  // Its importer passes the bundler's resolver, so it resolves on a page of either
71
- // API, whichever page entry rendered.
71
+ // API, whichever page entry rendered. Only its tag renders it, reading the template
72
+ // as it renders: an import cycle may not have evaluated that module yet.
72
73
  exports.withLoadAssets = function withLoadAssets(
73
74
  typeId,
74
- template,
75
+ getTemplate,
75
76
  assetFlush,
76
77
  triggers,
77
78
  ) {
78
- return createFacade(template, function (input, out) {
79
- var key = out.___assignedKey;
80
- var def = out.___assignedComponentDef;
79
+ return {
80
+ _: function (input, out) {
81
+ var key = out.___assignedKey;
82
+ var def = out.___assignedComponentDef;
81
83
 
82
- if (willRerender(def)) {
83
- out.bf(key + "s", def.___component, true);
84
- writeLoadAsset(out, typeId, assetFlush, triggers);
85
- out.ef();
86
- out.bf(key, def.___component, true);
87
- template._(input, out);
88
- out.ef();
89
- } else {
90
- writeLoadAsset(out, typeId, assetFlush, triggers);
91
- template._(input, out);
92
- }
93
- });
84
+ if (willRerender(def)) {
85
+ out.bf(key + "s", def.___component, true);
86
+ writeLoadAsset(out, typeId, assetFlush, triggers);
87
+ out.ef();
88
+ out.bf(key, def.___component, true);
89
+ getTemplate()._(input, out);
90
+ out.ef();
91
+ } else {
92
+ writeLoadAsset(out, typeId, assetFlush, triggers);
93
+ getTemplate()._(input, out);
94
+ }
95
+ },
96
+ };
94
97
  };
95
98
 
96
99
  // Within Tags content the Tags writer places it apart from what a `@catch` drops,
@@ -143,7 +143,7 @@ export function translateLoadTag(path, tagName, relativePath) {
143
143
  );
144
144
  loadArgs = [
145
145
  t.stringLiteral(childFile.metadata.marko.id),
146
- t.identifier(tagName),
146
+ t.arrowFunctionExpression([], t.identifier(tagName)),
147
147
  importNamed(file, linkAssets.runtime, "flush", "marko_asset_flush"),
148
148
  ];
149
149
  if (triggers) loadArgs.push(t.valueToNode(triggers));