marko 5.37.53 → 5.37.55

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.
@@ -13,11 +13,22 @@ exports.p = function (htmlCompat) {
13
13
  const writersByGlobal = new WeakMap();
14
14
  const isMarko6 = (fn) => htmlCompat.isTagsAPI(fn);
15
15
  const isMarko5 = (fn) => !isMarko6(fn);
16
- const writeClassAPIResultToTagsAPI = (result) => {
17
- const { writer } = result.out._state;
16
+ const writeClassAPIResultToTagsAPI = ({ out }) => {
17
+ const { writer } = out._state;
18
18
  htmlCompat.write(writer._content);
19
19
  htmlCompat.writeScript(writer._script);
20
20
  writer._content = writer._scripts = "";
21
+
22
+ if (out.b_) {
23
+ let writers = writersByGlobal.get(out.global);
24
+ if (!writers) {
25
+ writersByGlobal.set(
26
+ out.global,
27
+ writers = { classAPI: [], tagsAPI: [] }
28
+ );
29
+ }
30
+ __(out.b_, writers.classAPI);
31
+ }
21
32
  };
22
33
  const flushScripts = ($global, flushDefs) => {
23
34
  const writers = writersByGlobal.get($global);
@@ -158,11 +169,6 @@ exports.p = function (htmlCompat) {
158
169
  const out = defaultCreateOut($global);
159
170
  const branchId = htmlCompat.nextScopeId();
160
171
 
161
- let writers = writersByGlobal.get($global);
162
- if (!writers) {
163
- writersByGlobal.set($global, writers = { classAPI: [], tagsAPI: [] });
164
- }
165
-
166
172
  if (renderer5) {
167
173
  const componentsContext = T_(out);
168
174
  const originalInput = input;
@@ -201,12 +207,6 @@ exports.p = function (htmlCompat) {
201
207
 
202
208
  let async;
203
209
  out.once("finish", (result) => {
204
- if (result.out.b_) {
205
- __(
206
- result.out.b_,
207
- writers.classAPI
208
- );
209
- }
210
210
  if (!async) {
211
211
  async = false;
212
212
  writeClassAPIResultToTagsAPI(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.37.53",
3
+ "version": "5.37.55",
4
4
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
5
5
  "keywords": [
6
6
  "front-end",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@babel/runtime": "^7.28.2",
73
- "@marko/compiler": "^5.39.34",
73
+ "@marko/compiler": "^5.39.35",
74
74
  "app-module-path": "^2.2.0",
75
75
  "argly": "^1.2.0",
76
76
  "browser-refresh-client": "1.1.4",
@@ -13,11 +13,22 @@ exports.p = function (htmlCompat) {
13
13
  const writersByGlobal = new WeakMap();
14
14
  const isMarko6 = (fn) => htmlCompat.isTagsAPI(fn);
15
15
  const isMarko5 = (fn) => !isMarko6(fn);
16
- const writeClassAPIResultToTagsAPI = (result) => {
17
- const { writer } = result.out._state;
16
+ const writeClassAPIResultToTagsAPI = ({ out }) => {
17
+ const { writer } = out._state;
18
18
  htmlCompat.write(writer._content);
19
19
  htmlCompat.writeScript(writer._script);
20
20
  writer._content = writer._scripts = "";
21
+
22
+ if (out.___components) {
23
+ let writers = writersByGlobal.get(out.global);
24
+ if (!writers) {
25
+ writersByGlobal.set(
26
+ out.global,
27
+ (writers = { classAPI: [], tagsAPI: [] }),
28
+ );
29
+ }
30
+ ___addComponentsFromContext(out.___components, writers.classAPI);
31
+ }
21
32
  };
22
33
  const flushScripts = ($global, flushDefs) => {
23
34
  const writers = writersByGlobal.get($global);
@@ -158,11 +169,6 @@ exports.p = function (htmlCompat) {
158
169
  const out = defaultCreateOut($global);
159
170
  const branchId = htmlCompat.nextScopeId();
160
171
 
161
- let writers = writersByGlobal.get($global);
162
- if (!writers) {
163
- writersByGlobal.set($global, (writers = { classAPI: [], tagsAPI: [] }));
164
- }
165
-
166
172
  if (renderer5) {
167
173
  const componentsContext = ___getComponentsContext(out);
168
174
  const originalInput = input;
@@ -201,12 +207,6 @@ exports.p = function (htmlCompat) {
201
207
 
202
208
  let async;
203
209
  out.once("finish", (result) => {
204
- if (result.out.___components) {
205
- ___addComponentsFromContext(
206
- result.out.___components,
207
- writers.classAPI,
208
- );
209
- }
210
210
  if (!async) {
211
211
  async = false;
212
212
  writeClassAPIResultToTagsAPI(result);