@marko/runtime-tags 6.0.103 → 6.0.104
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/debug/html.js +32 -27
- package/dist/debug/html.mjs +32 -27
- package/dist/html/writer.d.ts +6 -1
- package/dist/html.js +25 -16
- package/dist/html.mjs +25 -16
- package/package.json +1 -1
package/dist/debug/html.js
CHANGED
|
@@ -2454,9 +2454,11 @@ var Boundary = class extends AbortController {
|
|
|
2454
2454
|
}
|
|
2455
2455
|
onNext = NOOP;
|
|
2456
2456
|
count = 0;
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2457
|
+
flush() {
|
|
2458
|
+
if (!this.signal.aborted) {
|
|
2459
|
+
flushSerializer(this);
|
|
2460
|
+
}
|
|
2461
|
+
return this.count ? 1 /* continue */ : this.signal.aborted ? 2 /* aborted */ : 0 /* complete */;
|
|
2460
2462
|
}
|
|
2461
2463
|
startAsync() {
|
|
2462
2464
|
if (!this.signal.aborted) {
|
|
@@ -3262,7 +3264,7 @@ var compat = {
|
|
|
3262
3264
|
},
|
|
3263
3265
|
flushScript($global2) {
|
|
3264
3266
|
const boundary = new Boundary(this.ensureState($global2));
|
|
3265
|
-
if (
|
|
3267
|
+
if (boundary.flush() === 1 /* continue */) {
|
|
3266
3268
|
throw new Error(
|
|
3267
3269
|
"Cannot serialize promise across tags/class compat layer."
|
|
3268
3270
|
);
|
|
@@ -3508,11 +3510,14 @@ var ServerRendered = class {
|
|
|
3508
3510
|
}
|
|
3509
3511
|
const { boundary } = head;
|
|
3510
3512
|
(boundary.onNext = () => {
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3513
|
+
switch (!boundary.count && boundary.flush()) {
|
|
3514
|
+
case 2 /* aborted */:
|
|
3515
|
+
boundary.onNext = NOOP3;
|
|
3516
|
+
reject(boundary.signal.reason);
|
|
3517
|
+
break;
|
|
3518
|
+
case 0 /* complete */:
|
|
3519
|
+
resolve(head.consume().flushHTML());
|
|
3520
|
+
break;
|
|
3516
3521
|
}
|
|
3517
3522
|
})();
|
|
3518
3523
|
});
|
|
@@ -3527,25 +3532,23 @@ var ServerRendered = class {
|
|
|
3527
3532
|
}
|
|
3528
3533
|
const { boundary } = head;
|
|
3529
3534
|
const onNext = boundary.onNext = (write) => {
|
|
3530
|
-
|
|
3535
|
+
const status = boundary.flush();
|
|
3536
|
+
if (status === 2 /* aborted */) {
|
|
3531
3537
|
if (!tick2) offTick(onNext);
|
|
3532
3538
|
boundary.onNext = NOOP3;
|
|
3533
3539
|
onAbort(boundary.signal.reason);
|
|
3534
|
-
} else {
|
|
3535
|
-
const
|
|
3536
|
-
if (
|
|
3537
|
-
|
|
3538
|
-
if (
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
} else {
|
|
3543
|
-
tick2 = true;
|
|
3544
|
-
}
|
|
3545
|
-
} else if (tick2) {
|
|
3546
|
-
tick2 = false;
|
|
3547
|
-
queueTick(onNext);
|
|
3540
|
+
} else if (write || status === 0 /* complete */) {
|
|
3541
|
+
const html = (head = head.consume()).flushHTML();
|
|
3542
|
+
if (html) onWrite(html);
|
|
3543
|
+
if (status === 0 /* complete */) {
|
|
3544
|
+
if (!tick2) offTick(onNext);
|
|
3545
|
+
onClose();
|
|
3546
|
+
} else {
|
|
3547
|
+
tick2 = true;
|
|
3548
3548
|
}
|
|
3549
|
+
} else if (tick2) {
|
|
3550
|
+
tick2 = false;
|
|
3551
|
+
queueTick(onNext);
|
|
3549
3552
|
}
|
|
3550
3553
|
};
|
|
3551
3554
|
onNext();
|
|
@@ -3556,10 +3559,12 @@ var ServerRendered = class {
|
|
|
3556
3559
|
this.#head = null;
|
|
3557
3560
|
if (!head) throw new Error("Cannot read from a consumed render result");
|
|
3558
3561
|
const { boundary } = head;
|
|
3559
|
-
|
|
3560
|
-
|
|
3562
|
+
switch (boundary.flush()) {
|
|
3563
|
+
case 2 /* aborted */:
|
|
3564
|
+
throw boundary.signal.reason;
|
|
3565
|
+
case 1 /* continue */:
|
|
3566
|
+
throw new Error("Cannot consume asynchronous render with 'toString'");
|
|
3561
3567
|
}
|
|
3562
|
-
if (boundary.signal.aborted) throw boundary.signal.reason;
|
|
3563
3568
|
return head.consume().flushHTML();
|
|
3564
3569
|
}
|
|
3565
3570
|
};
|
package/dist/debug/html.mjs
CHANGED
|
@@ -2362,9 +2362,11 @@ var Boundary = class extends AbortController {
|
|
|
2362
2362
|
}
|
|
2363
2363
|
onNext = NOOP;
|
|
2364
2364
|
count = 0;
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2365
|
+
flush() {
|
|
2366
|
+
if (!this.signal.aborted) {
|
|
2367
|
+
flushSerializer(this);
|
|
2368
|
+
}
|
|
2369
|
+
return this.count ? 1 /* continue */ : this.signal.aborted ? 2 /* aborted */ : 0 /* complete */;
|
|
2368
2370
|
}
|
|
2369
2371
|
startAsync() {
|
|
2370
2372
|
if (!this.signal.aborted) {
|
|
@@ -3170,7 +3172,7 @@ var compat = {
|
|
|
3170
3172
|
},
|
|
3171
3173
|
flushScript($global2) {
|
|
3172
3174
|
const boundary = new Boundary(this.ensureState($global2));
|
|
3173
|
-
if (
|
|
3175
|
+
if (boundary.flush() === 1 /* continue */) {
|
|
3174
3176
|
throw new Error(
|
|
3175
3177
|
"Cannot serialize promise across tags/class compat layer."
|
|
3176
3178
|
);
|
|
@@ -3416,11 +3418,14 @@ var ServerRendered = class {
|
|
|
3416
3418
|
}
|
|
3417
3419
|
const { boundary } = head;
|
|
3418
3420
|
(boundary.onNext = () => {
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3421
|
+
switch (!boundary.count && boundary.flush()) {
|
|
3422
|
+
case 2 /* aborted */:
|
|
3423
|
+
boundary.onNext = NOOP3;
|
|
3424
|
+
reject(boundary.signal.reason);
|
|
3425
|
+
break;
|
|
3426
|
+
case 0 /* complete */:
|
|
3427
|
+
resolve(head.consume().flushHTML());
|
|
3428
|
+
break;
|
|
3424
3429
|
}
|
|
3425
3430
|
})();
|
|
3426
3431
|
});
|
|
@@ -3435,25 +3440,23 @@ var ServerRendered = class {
|
|
|
3435
3440
|
}
|
|
3436
3441
|
const { boundary } = head;
|
|
3437
3442
|
const onNext = boundary.onNext = (write) => {
|
|
3438
|
-
|
|
3443
|
+
const status = boundary.flush();
|
|
3444
|
+
if (status === 2 /* aborted */) {
|
|
3439
3445
|
if (!tick2) offTick(onNext);
|
|
3440
3446
|
boundary.onNext = NOOP3;
|
|
3441
3447
|
onAbort(boundary.signal.reason);
|
|
3442
|
-
} else {
|
|
3443
|
-
const
|
|
3444
|
-
if (
|
|
3445
|
-
|
|
3446
|
-
if (
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
} else {
|
|
3451
|
-
tick2 = true;
|
|
3452
|
-
}
|
|
3453
|
-
} else if (tick2) {
|
|
3454
|
-
tick2 = false;
|
|
3455
|
-
queueTick(onNext);
|
|
3448
|
+
} else if (write || status === 0 /* complete */) {
|
|
3449
|
+
const html = (head = head.consume()).flushHTML();
|
|
3450
|
+
if (html) onWrite(html);
|
|
3451
|
+
if (status === 0 /* complete */) {
|
|
3452
|
+
if (!tick2) offTick(onNext);
|
|
3453
|
+
onClose();
|
|
3454
|
+
} else {
|
|
3455
|
+
tick2 = true;
|
|
3456
3456
|
}
|
|
3457
|
+
} else if (tick2) {
|
|
3458
|
+
tick2 = false;
|
|
3459
|
+
queueTick(onNext);
|
|
3457
3460
|
}
|
|
3458
3461
|
};
|
|
3459
3462
|
onNext();
|
|
@@ -3464,10 +3467,12 @@ var ServerRendered = class {
|
|
|
3464
3467
|
this.#head = null;
|
|
3465
3468
|
if (!head) throw new Error("Cannot read from a consumed render result");
|
|
3466
3469
|
const { boundary } = head;
|
|
3467
|
-
|
|
3468
|
-
|
|
3470
|
+
switch (boundary.flush()) {
|
|
3471
|
+
case 2 /* aborted */:
|
|
3472
|
+
throw boundary.signal.reason;
|
|
3473
|
+
case 1 /* continue */:
|
|
3474
|
+
throw new Error("Cannot consume asynchronous render with 'toString'");
|
|
3469
3475
|
}
|
|
3470
|
-
if (boundary.signal.aborted) throw boundary.signal.reason;
|
|
3471
3476
|
return head.consume().flushHTML();
|
|
3472
3477
|
}
|
|
3473
3478
|
};
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -98,12 +98,17 @@ export declare class State {
|
|
|
98
98
|
nextReorderId(): string;
|
|
99
99
|
mark(code: ResumeSymbol | Mark, str: string): string;
|
|
100
100
|
}
|
|
101
|
+
export declare enum FlushStatus {
|
|
102
|
+
complete = 0,
|
|
103
|
+
continue = 1,
|
|
104
|
+
aborted = 2
|
|
105
|
+
}
|
|
101
106
|
export declare class Boundary extends AbortController {
|
|
102
107
|
state: State;
|
|
103
108
|
onNext: () => void;
|
|
104
109
|
count: number;
|
|
105
110
|
constructor(state: State, parent?: AbortSignal);
|
|
106
|
-
|
|
111
|
+
flush(): FlushStatus;
|
|
107
112
|
startAsync(): void;
|
|
108
113
|
endAsync(chunk?: Chunk): void;
|
|
109
114
|
}
|
package/dist/html.js
CHANGED
|
@@ -1539,7 +1539,8 @@ var State2 = class {
|
|
|
1539
1539
|
mark(code, str) {
|
|
1540
1540
|
return "<!--" + this.commentPrefix + code + str + "-->";
|
|
1541
1541
|
}
|
|
1542
|
-
}
|
|
1542
|
+
};
|
|
1543
|
+
var Boundary = class extends AbortController {
|
|
1543
1544
|
constructor(state, parent) {
|
|
1544
1545
|
super();
|
|
1545
1546
|
this.state = state;
|
|
@@ -1551,8 +1552,8 @@ var State2 = class {
|
|
|
1551
1552
|
}
|
|
1552
1553
|
onNext = NOOP;
|
|
1553
1554
|
count = 0;
|
|
1554
|
-
|
|
1555
|
-
return flushSerializer(this),
|
|
1555
|
+
flush() {
|
|
1556
|
+
return this.signal.aborted || flushSerializer(this), this.count ? 1 /* continue */ : this.signal.aborted ? 2 /* aborted */ : 0 /* complete */;
|
|
1556
1557
|
}
|
|
1557
1558
|
startAsync() {
|
|
1558
1559
|
this.signal.aborted || this.count++;
|
|
@@ -2079,7 +2080,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
|
2079
2080
|
},
|
|
2080
2081
|
flushScript($global2) {
|
|
2081
2082
|
let boundary = new Boundary(this.ensureState($global2));
|
|
2082
|
-
if (
|
|
2083
|
+
if (boundary.flush() === 1 /* continue */)
|
|
2083
2084
|
throw new Error(
|
|
2084
2085
|
"Cannot serialize promise across tags/class compat layer."
|
|
2085
2086
|
);
|
|
@@ -2236,7 +2237,14 @@ var ServerRendered = class {
|
|
|
2236
2237
|
return reject(new Error("Cannot read from a consumed render result"));
|
|
2237
2238
|
let { boundary } = head;
|
|
2238
2239
|
(boundary.onNext = () => {
|
|
2239
|
-
|
|
2240
|
+
switch (!boundary.count && boundary.flush()) {
|
|
2241
|
+
case 2 /* aborted */:
|
|
2242
|
+
boundary.onNext = NOOP3, reject(boundary.signal.reason);
|
|
2243
|
+
break;
|
|
2244
|
+
case 0 /* complete */:
|
|
2245
|
+
resolve(head.consume().flushHTML());
|
|
2246
|
+
break;
|
|
2247
|
+
}
|
|
2240
2248
|
})();
|
|
2241
2249
|
});
|
|
2242
2250
|
}
|
|
@@ -2247,15 +2255,13 @@ var ServerRendered = class {
|
|
|
2247
2255
|
return;
|
|
2248
2256
|
}
|
|
2249
2257
|
let { boundary } = head, onNext = boundary.onNext = (write) => {
|
|
2250
|
-
|
|
2258
|
+
let status = boundary.flush();
|
|
2259
|
+
if (status === 2 /* aborted */)
|
|
2251
2260
|
tick2 || offTick(onNext), boundary.onNext = NOOP3, onAbort(boundary.signal.reason);
|
|
2252
|
-
else {
|
|
2253
|
-
let
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
html && onWrite(html), done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
|
2257
|
-
} else tick2 && (tick2 = !1, queueTick(onNext));
|
|
2258
|
-
}
|
|
2261
|
+
else if (write || status === 0 /* complete */) {
|
|
2262
|
+
let html = (head = head.consume()).flushHTML();
|
|
2263
|
+
html && onWrite(html), status === 0 /* complete */ ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
|
2264
|
+
} else tick2 && (tick2 = !1, queueTick(onNext));
|
|
2259
2265
|
};
|
|
2260
2266
|
return onNext(), boundary;
|
|
2261
2267
|
}
|
|
@@ -2263,9 +2269,12 @@ var ServerRendered = class {
|
|
|
2263
2269
|
let head = this.#head;
|
|
2264
2270
|
if (this.#head = null, !head) throw new Error("Cannot read from a consumed render result");
|
|
2265
2271
|
let { boundary } = head;
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2272
|
+
switch (boundary.flush()) {
|
|
2273
|
+
case 2 /* aborted */:
|
|
2274
|
+
throw boundary.signal.reason;
|
|
2275
|
+
case 1 /* continue */:
|
|
2276
|
+
throw new Error("Cannot consume asynchronous render with 'toString'");
|
|
2277
|
+
}
|
|
2269
2278
|
return head.consume().flushHTML();
|
|
2270
2279
|
}
|
|
2271
2280
|
};
|
package/dist/html.mjs
CHANGED
|
@@ -1450,7 +1450,8 @@ var State2 = class {
|
|
|
1450
1450
|
mark(code, str) {
|
|
1451
1451
|
return "<!--" + this.commentPrefix + code + str + "-->";
|
|
1452
1452
|
}
|
|
1453
|
-
}
|
|
1453
|
+
};
|
|
1454
|
+
var Boundary = class extends AbortController {
|
|
1454
1455
|
constructor(state, parent) {
|
|
1455
1456
|
super();
|
|
1456
1457
|
this.state = state;
|
|
@@ -1462,8 +1463,8 @@ var State2 = class {
|
|
|
1462
1463
|
}
|
|
1463
1464
|
onNext = NOOP;
|
|
1464
1465
|
count = 0;
|
|
1465
|
-
|
|
1466
|
-
return flushSerializer(this),
|
|
1466
|
+
flush() {
|
|
1467
|
+
return this.signal.aborted || flushSerializer(this), this.count ? 1 /* continue */ : this.signal.aborted ? 2 /* aborted */ : 0 /* complete */;
|
|
1467
1468
|
}
|
|
1468
1469
|
startAsync() {
|
|
1469
1470
|
this.signal.aborted || this.count++;
|
|
@@ -1990,7 +1991,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
|
1990
1991
|
},
|
|
1991
1992
|
flushScript($global2) {
|
|
1992
1993
|
let boundary = new Boundary(this.ensureState($global2));
|
|
1993
|
-
if (
|
|
1994
|
+
if (boundary.flush() === 1 /* continue */)
|
|
1994
1995
|
throw new Error(
|
|
1995
1996
|
"Cannot serialize promise across tags/class compat layer."
|
|
1996
1997
|
);
|
|
@@ -2147,7 +2148,14 @@ var ServerRendered = class {
|
|
|
2147
2148
|
return reject(new Error("Cannot read from a consumed render result"));
|
|
2148
2149
|
let { boundary } = head;
|
|
2149
2150
|
(boundary.onNext = () => {
|
|
2150
|
-
|
|
2151
|
+
switch (!boundary.count && boundary.flush()) {
|
|
2152
|
+
case 2 /* aborted */:
|
|
2153
|
+
boundary.onNext = NOOP3, reject(boundary.signal.reason);
|
|
2154
|
+
break;
|
|
2155
|
+
case 0 /* complete */:
|
|
2156
|
+
resolve(head.consume().flushHTML());
|
|
2157
|
+
break;
|
|
2158
|
+
}
|
|
2151
2159
|
})();
|
|
2152
2160
|
});
|
|
2153
2161
|
}
|
|
@@ -2158,15 +2166,13 @@ var ServerRendered = class {
|
|
|
2158
2166
|
return;
|
|
2159
2167
|
}
|
|
2160
2168
|
let { boundary } = head, onNext = boundary.onNext = (write) => {
|
|
2161
|
-
|
|
2169
|
+
let status = boundary.flush();
|
|
2170
|
+
if (status === 2 /* aborted */)
|
|
2162
2171
|
tick2 || offTick(onNext), boundary.onNext = NOOP3, onAbort(boundary.signal.reason);
|
|
2163
|
-
else {
|
|
2164
|
-
let
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
html && onWrite(html), done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
|
2168
|
-
} else tick2 && (tick2 = !1, queueTick(onNext));
|
|
2169
|
-
}
|
|
2172
|
+
else if (write || status === 0 /* complete */) {
|
|
2173
|
+
let html = (head = head.consume()).flushHTML();
|
|
2174
|
+
html && onWrite(html), status === 0 /* complete */ ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
|
2175
|
+
} else tick2 && (tick2 = !1, queueTick(onNext));
|
|
2170
2176
|
};
|
|
2171
2177
|
return onNext(), boundary;
|
|
2172
2178
|
}
|
|
@@ -2174,9 +2180,12 @@ var ServerRendered = class {
|
|
|
2174
2180
|
let head = this.#head;
|
|
2175
2181
|
if (this.#head = null, !head) throw new Error("Cannot read from a consumed render result");
|
|
2176
2182
|
let { boundary } = head;
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2183
|
+
switch (boundary.flush()) {
|
|
2184
|
+
case 2 /* aborted */:
|
|
2185
|
+
throw boundary.signal.reason;
|
|
2186
|
+
case 1 /* continue */:
|
|
2187
|
+
throw new Error("Cannot consume asynchronous render with 'toString'");
|
|
2188
|
+
}
|
|
2180
2189
|
return head.consume().flushHTML();
|
|
2181
2190
|
}
|
|
2182
2191
|
};
|