@marko/runtime-tags 0.2.1 → 0.2.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.
- package/dist/debug/html.js +23 -9
- package/dist/debug/html.mjs +21 -8
- package/dist/html/writer.d.ts +3 -1
- package/dist/html.d.ts +1 -1
- package/dist/html.js +14 -8
- package/dist/html.mjs +12 -7
- package/package.json +1 -1
package/dist/debug/html.js
CHANGED
|
@@ -66,7 +66,8 @@ __export(html_exports, {
|
|
|
66
66
|
write: () => write,
|
|
67
67
|
writeEffect: () => writeEffect,
|
|
68
68
|
writeExistingScope: () => writeExistingScope,
|
|
69
|
-
writeScope: () => writeScope
|
|
69
|
+
writeScope: () => writeScope,
|
|
70
|
+
writeTrailers: () => writeTrailers
|
|
70
71
|
});
|
|
71
72
|
module.exports = __toCommonJS(html_exports);
|
|
72
73
|
|
|
@@ -1676,6 +1677,7 @@ var State2 = class {
|
|
|
1676
1677
|
hasMainRuntime = false;
|
|
1677
1678
|
hasReorderRuntime = false;
|
|
1678
1679
|
hasWrittenResume = false;
|
|
1680
|
+
trailerHTML = "";
|
|
1679
1681
|
serializer = new Serializer();
|
|
1680
1682
|
writeReorders = null;
|
|
1681
1683
|
scopes = /* @__PURE__ */ new Map();
|
|
@@ -1952,18 +1954,29 @@ function prepareChunk(chunk) {
|
|
|
1952
1954
|
head.scripts = scripts;
|
|
1953
1955
|
return head;
|
|
1954
1956
|
}
|
|
1955
|
-
function flushChunk(head) {
|
|
1957
|
+
function flushChunk(head, last) {
|
|
1958
|
+
const { boundary } = head;
|
|
1959
|
+
const { state } = boundary;
|
|
1956
1960
|
const { html, scripts } = head;
|
|
1957
|
-
const { $global: $global2 } =
|
|
1961
|
+
const { $global: $global2 } = state;
|
|
1958
1962
|
const { __flush__ } = $global2;
|
|
1959
|
-
|
|
1963
|
+
let result = html;
|
|
1960
1964
|
head.html = head.scripts = "";
|
|
1965
|
+
if (scripts) {
|
|
1966
|
+
result += ($global2.cspNonce ? "<script nonce=" + escapeAttrValue($global2.cspNonce + "") + ">" : "<script>") + scripts + "</script>";
|
|
1967
|
+
}
|
|
1961
1968
|
if (__flush__) {
|
|
1962
1969
|
$global2.__flush__ = void 0;
|
|
1963
|
-
|
|
1970
|
+
result = __flush__($global2, result);
|
|
1971
|
+
}
|
|
1972
|
+
if (last && state.trailerHTML) {
|
|
1973
|
+
result += state.trailerHTML;
|
|
1964
1974
|
}
|
|
1965
1975
|
return result;
|
|
1966
1976
|
}
|
|
1977
|
+
function writeTrailers(html) {
|
|
1978
|
+
$chunk.boundary.state.trailerHTML += html;
|
|
1979
|
+
}
|
|
1967
1980
|
function concatEffects(a, b) {
|
|
1968
1981
|
return a ? b ? a + "," + b : a : b;
|
|
1969
1982
|
}
|
|
@@ -2561,7 +2574,7 @@ var ServerRenderResult = class {
|
|
|
2561
2574
|
reject(boundary.signal.reason);
|
|
2562
2575
|
} else {
|
|
2563
2576
|
head = prepareChunk(head);
|
|
2564
|
-
if (boundary.done) resolve(flushChunk(head));
|
|
2577
|
+
if (boundary.done) resolve(flushChunk(head, true));
|
|
2565
2578
|
}
|
|
2566
2579
|
}
|
|
2567
2580
|
})();
|
|
@@ -2586,7 +2599,7 @@ var ServerRenderResult = class {
|
|
|
2586
2599
|
head = prepareChunk(head);
|
|
2587
2600
|
}
|
|
2588
2601
|
if (write2 || boundary.done) {
|
|
2589
|
-
const html = flushChunk(head);
|
|
2602
|
+
const html = flushChunk(head, boundary.done);
|
|
2590
2603
|
if (html) onWrite(html);
|
|
2591
2604
|
if (boundary.done) {
|
|
2592
2605
|
if (!tick2) offTick(onNext);
|
|
@@ -2607,7 +2620,7 @@ var ServerRenderResult = class {
|
|
|
2607
2620
|
if (!head) throw new Error("Cannot read from a consumed render result");
|
|
2608
2621
|
if (head.next) throw new Error("Cannot fork in sync mode");
|
|
2609
2622
|
this.#head = null;
|
|
2610
|
-
return flushChunk(prepareChunk(head));
|
|
2623
|
+
return flushChunk(prepareChunk(head), true);
|
|
2611
2624
|
}
|
|
2612
2625
|
};
|
|
2613
2626
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2658,5 +2671,6 @@ var ServerRenderResult = class {
|
|
|
2658
2671
|
write,
|
|
2659
2672
|
writeEffect,
|
|
2660
2673
|
writeExistingScope,
|
|
2661
|
-
writeScope
|
|
2674
|
+
writeScope,
|
|
2675
|
+
writeTrailers
|
|
2662
2676
|
});
|
package/dist/debug/html.mjs
CHANGED
|
@@ -1604,6 +1604,7 @@ var State2 = class {
|
|
|
1604
1604
|
hasMainRuntime = false;
|
|
1605
1605
|
hasReorderRuntime = false;
|
|
1606
1606
|
hasWrittenResume = false;
|
|
1607
|
+
trailerHTML = "";
|
|
1607
1608
|
serializer = new Serializer();
|
|
1608
1609
|
writeReorders = null;
|
|
1609
1610
|
scopes = /* @__PURE__ */ new Map();
|
|
@@ -1880,18 +1881,29 @@ function prepareChunk(chunk) {
|
|
|
1880
1881
|
head.scripts = scripts;
|
|
1881
1882
|
return head;
|
|
1882
1883
|
}
|
|
1883
|
-
function flushChunk(head) {
|
|
1884
|
+
function flushChunk(head, last) {
|
|
1885
|
+
const { boundary } = head;
|
|
1886
|
+
const { state } = boundary;
|
|
1884
1887
|
const { html, scripts } = head;
|
|
1885
|
-
const { $global: $global2 } =
|
|
1888
|
+
const { $global: $global2 } = state;
|
|
1886
1889
|
const { __flush__ } = $global2;
|
|
1887
|
-
|
|
1890
|
+
let result = html;
|
|
1888
1891
|
head.html = head.scripts = "";
|
|
1892
|
+
if (scripts) {
|
|
1893
|
+
result += ($global2.cspNonce ? "<script nonce=" + escapeAttrValue($global2.cspNonce + "") + ">" : "<script>") + scripts + "</script>";
|
|
1894
|
+
}
|
|
1889
1895
|
if (__flush__) {
|
|
1890
1896
|
$global2.__flush__ = void 0;
|
|
1891
|
-
|
|
1897
|
+
result = __flush__($global2, result);
|
|
1898
|
+
}
|
|
1899
|
+
if (last && state.trailerHTML) {
|
|
1900
|
+
result += state.trailerHTML;
|
|
1892
1901
|
}
|
|
1893
1902
|
return result;
|
|
1894
1903
|
}
|
|
1904
|
+
function writeTrailers(html) {
|
|
1905
|
+
$chunk.boundary.state.trailerHTML += html;
|
|
1906
|
+
}
|
|
1895
1907
|
function concatEffects(a, b) {
|
|
1896
1908
|
return a ? b ? a + "," + b : a : b;
|
|
1897
1909
|
}
|
|
@@ -2489,7 +2501,7 @@ var ServerRenderResult = class {
|
|
|
2489
2501
|
reject(boundary.signal.reason);
|
|
2490
2502
|
} else {
|
|
2491
2503
|
head = prepareChunk(head);
|
|
2492
|
-
if (boundary.done) resolve(flushChunk(head));
|
|
2504
|
+
if (boundary.done) resolve(flushChunk(head, true));
|
|
2493
2505
|
}
|
|
2494
2506
|
}
|
|
2495
2507
|
})();
|
|
@@ -2514,7 +2526,7 @@ var ServerRenderResult = class {
|
|
|
2514
2526
|
head = prepareChunk(head);
|
|
2515
2527
|
}
|
|
2516
2528
|
if (write2 || boundary.done) {
|
|
2517
|
-
const html = flushChunk(head);
|
|
2529
|
+
const html = flushChunk(head, boundary.done);
|
|
2518
2530
|
if (html) onWrite(html);
|
|
2519
2531
|
if (boundary.done) {
|
|
2520
2532
|
if (!tick2) offTick(onNext);
|
|
@@ -2535,7 +2547,7 @@ var ServerRenderResult = class {
|
|
|
2535
2547
|
if (!head) throw new Error("Cannot read from a consumed render result");
|
|
2536
2548
|
if (head.next) throw new Error("Cannot fork in sync mode");
|
|
2537
2549
|
this.#head = null;
|
|
2538
|
-
return flushChunk(prepareChunk(head));
|
|
2550
|
+
return flushChunk(prepareChunk(head), true);
|
|
2539
2551
|
}
|
|
2540
2552
|
};
|
|
2541
2553
|
export {
|
|
@@ -2585,5 +2597,6 @@ export {
|
|
|
2585
2597
|
write,
|
|
2586
2598
|
writeEffect,
|
|
2587
2599
|
writeExistingScope,
|
|
2588
|
-
writeScope
|
|
2600
|
+
writeScope,
|
|
2601
|
+
writeTrailers
|
|
2589
2602
|
};
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export declare class State {
|
|
|
56
56
|
hasMainRuntime: boolean;
|
|
57
57
|
hasReorderRuntime: boolean;
|
|
58
58
|
hasWrittenResume: boolean;
|
|
59
|
+
trailerHTML: string;
|
|
59
60
|
serializer: Serializer;
|
|
60
61
|
writeReorders: Chunk[] | null;
|
|
61
62
|
scopes: Map<number, PartialScope>;
|
|
@@ -104,7 +105,8 @@ export declare class Chunk {
|
|
|
104
105
|
render<T>(renderBody: (val: T) => void, val: T): Chunk;
|
|
105
106
|
}
|
|
106
107
|
export declare function prepareChunk(chunk: Chunk): Chunk;
|
|
107
|
-
export declare function flushChunk(head: Chunk): string;
|
|
108
|
+
export declare function flushChunk(head: Chunk, last: boolean): string;
|
|
109
|
+
export declare function writeTrailers(html: string): void;
|
|
108
110
|
type QueueCallback = (ticked: true) => void;
|
|
109
111
|
export declare function queueTick(cb: QueueCallback): void;
|
|
110
112
|
export declare function offTick(cb: QueueCallback): void;
|
package/dist/html.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { compat } from "./html/compat";
|
|
|
6
6
|
export { escapeScript, escapeStyle, escapeXML, toString } from "./html/content";
|
|
7
7
|
export { createRenderer, dynamicTagArgs, dynamicTagInput, } from "./html/dynamic-tag";
|
|
8
8
|
export { createTemplate } from "./html/template";
|
|
9
|
-
export { $global, ensureScopeWithId, fork, getScopeById, markResumeCleanup, markResumeControlEnd, markResumeControlSingleNodeEnd, markResumeNode, markResumeScopeStart, nextScopeId, nextTagId, nodeRef, peekNextScope, register, tryCatch, tryPlaceholder, write, writeEffect, writeExistingScope, writeScope, } from "./html/writer";
|
|
9
|
+
export { $global, ensureScopeWithId, fork, getScopeById, markResumeCleanup, markResumeControlEnd, markResumeControlSingleNodeEnd, markResumeNode, markResumeScopeStart, nextScopeId, nextTagId, nodeRef, peekNextScope, register, tryCatch, tryPlaceholder, write, writeEffect, writeExistingScope, writeScope, writeTrailers, } from "./html/writer";
|
package/dist/html.js
CHANGED
|
@@ -63,7 +63,8 @@ __export(html_exports, {
|
|
|
63
63
|
write: () => write,
|
|
64
64
|
writeEffect: () => writeEffect,
|
|
65
65
|
writeExistingScope: () => writeExistingScope,
|
|
66
|
-
writeScope: () => writeScope
|
|
66
|
+
writeScope: () => writeScope,
|
|
67
|
+
writeTrailers: () => writeTrailers
|
|
67
68
|
});
|
|
68
69
|
module.exports = __toCommonJS(html_exports);
|
|
69
70
|
|
|
@@ -1119,6 +1120,7 @@ var State2 = class {
|
|
|
1119
1120
|
hasMainRuntime = !1;
|
|
1120
1121
|
hasReorderRuntime = !1;
|
|
1121
1122
|
hasWrittenResume = !1;
|
|
1123
|
+
trailerHTML = "";
|
|
1122
1124
|
serializer = new Serializer();
|
|
1123
1125
|
writeReorders = null;
|
|
1124
1126
|
scopes = /* @__PURE__ */ new Map();
|
|
@@ -1272,9 +1274,12 @@ function prepareChunk(chunk) {
|
|
|
1272
1274
|
}
|
|
1273
1275
|
return hasWalk && (scripts = concatScripts(scripts, runtimePrefix + ".w()")), head.html = html, head.scripts = scripts, head;
|
|
1274
1276
|
}
|
|
1275
|
-
function flushChunk(head) {
|
|
1276
|
-
let { html, scripts } = head, { $global: $global2 } =
|
|
1277
|
-
return head.html = head.scripts = "",
|
|
1277
|
+
function flushChunk(head, last) {
|
|
1278
|
+
let { boundary } = head, { state } = boundary, { html, scripts } = head, { $global: $global2 } = state, { __flush__ } = $global2, result = html;
|
|
1279
|
+
return head.html = head.scripts = "", scripts && (result += ($global2.cspNonce ? "<script nonce=" + escapeAttrValue($global2.cspNonce + "") + ">" : "<script>") + scripts + "</script>"), __flush__ && ($global2.__flush__ = void 0, result = __flush__($global2, result)), last && state.trailerHTML && (result += state.trailerHTML), result;
|
|
1280
|
+
}
|
|
1281
|
+
function writeTrailers(html) {
|
|
1282
|
+
$chunk.boundary.state.trailerHTML += html;
|
|
1278
1283
|
}
|
|
1279
1284
|
function concatEffects(a, b) {
|
|
1280
1285
|
return a ? b ? a + "," + b : a : b;
|
|
@@ -1689,7 +1694,7 @@ var ServerRenderResult = class {
|
|
|
1689
1694
|
return reject(new Error("Cannot read from a consumed render result"));
|
|
1690
1695
|
let { boundary } = head;
|
|
1691
1696
|
(boundary.onNext = () => {
|
|
1692
|
-
boundary.done && (boundary.signal.aborted ? reject(boundary.signal.reason) : (head = prepareChunk(head), boundary.done && resolve(flushChunk(head))));
|
|
1697
|
+
boundary.done && (boundary.signal.aborted ? reject(boundary.signal.reason) : (head = prepareChunk(head), boundary.done && resolve(flushChunk(head, !0))));
|
|
1693
1698
|
})();
|
|
1694
1699
|
});
|
|
1695
1700
|
}
|
|
@@ -1708,7 +1713,7 @@ var ServerRenderResult = class {
|
|
|
1708
1713
|
head = prepareChunk(head);
|
|
1709
1714
|
}
|
|
1710
1715
|
if (write2 || boundary.done) {
|
|
1711
|
-
let html = flushChunk(head);
|
|
1716
|
+
let html = flushChunk(head, boundary.done);
|
|
1712
1717
|
html && onWrite(html), boundary.done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
|
1713
1718
|
} else tick2 && (tick2 = !1, queueTick(onNext));
|
|
1714
1719
|
};
|
|
@@ -1718,7 +1723,7 @@ var ServerRenderResult = class {
|
|
|
1718
1723
|
let head = this.#head;
|
|
1719
1724
|
if (!head) throw new Error("Cannot read from a consumed render result");
|
|
1720
1725
|
if (head.next) throw new Error("Cannot fork in sync mode");
|
|
1721
|
-
return this.#head = null, flushChunk(prepareChunk(head));
|
|
1726
|
+
return this.#head = null, flushChunk(prepareChunk(head), !0);
|
|
1722
1727
|
}
|
|
1723
1728
|
};
|
|
1724
1729
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1769,5 +1774,6 @@ var ServerRenderResult = class {
|
|
|
1769
1774
|
write,
|
|
1770
1775
|
writeEffect,
|
|
1771
1776
|
writeExistingScope,
|
|
1772
|
-
writeScope
|
|
1777
|
+
writeScope,
|
|
1778
|
+
writeTrailers
|
|
1773
1779
|
});
|
package/dist/html.mjs
CHANGED
|
@@ -1050,6 +1050,7 @@ var State2 = class {
|
|
|
1050
1050
|
hasMainRuntime = !1;
|
|
1051
1051
|
hasReorderRuntime = !1;
|
|
1052
1052
|
hasWrittenResume = !1;
|
|
1053
|
+
trailerHTML = "";
|
|
1053
1054
|
serializer = new Serializer();
|
|
1054
1055
|
writeReorders = null;
|
|
1055
1056
|
scopes = /* @__PURE__ */ new Map();
|
|
@@ -1203,9 +1204,12 @@ function prepareChunk(chunk) {
|
|
|
1203
1204
|
}
|
|
1204
1205
|
return hasWalk && (scripts = concatScripts(scripts, runtimePrefix + ".w()")), head.html = html, head.scripts = scripts, head;
|
|
1205
1206
|
}
|
|
1206
|
-
function flushChunk(head) {
|
|
1207
|
-
let { html, scripts } = head, { $global: $global2 } =
|
|
1208
|
-
return head.html = head.scripts = "",
|
|
1207
|
+
function flushChunk(head, last) {
|
|
1208
|
+
let { boundary } = head, { state } = boundary, { html, scripts } = head, { $global: $global2 } = state, { __flush__ } = $global2, result = html;
|
|
1209
|
+
return head.html = head.scripts = "", scripts && (result += ($global2.cspNonce ? "<script nonce=" + escapeAttrValue($global2.cspNonce + "") + ">" : "<script>") + scripts + "</script>"), __flush__ && ($global2.__flush__ = void 0, result = __flush__($global2, result)), last && state.trailerHTML && (result += state.trailerHTML), result;
|
|
1210
|
+
}
|
|
1211
|
+
function writeTrailers(html) {
|
|
1212
|
+
$chunk.boundary.state.trailerHTML += html;
|
|
1209
1213
|
}
|
|
1210
1214
|
function concatEffects(a, b) {
|
|
1211
1215
|
return a ? b ? a + "," + b : a : b;
|
|
@@ -1620,7 +1624,7 @@ var ServerRenderResult = class {
|
|
|
1620
1624
|
return reject(new Error("Cannot read from a consumed render result"));
|
|
1621
1625
|
let { boundary } = head;
|
|
1622
1626
|
(boundary.onNext = () => {
|
|
1623
|
-
boundary.done && (boundary.signal.aborted ? reject(boundary.signal.reason) : (head = prepareChunk(head), boundary.done && resolve(flushChunk(head))));
|
|
1627
|
+
boundary.done && (boundary.signal.aborted ? reject(boundary.signal.reason) : (head = prepareChunk(head), boundary.done && resolve(flushChunk(head, !0))));
|
|
1624
1628
|
})();
|
|
1625
1629
|
});
|
|
1626
1630
|
}
|
|
@@ -1639,7 +1643,7 @@ var ServerRenderResult = class {
|
|
|
1639
1643
|
head = prepareChunk(head);
|
|
1640
1644
|
}
|
|
1641
1645
|
if (write2 || boundary.done) {
|
|
1642
|
-
let html = flushChunk(head);
|
|
1646
|
+
let html = flushChunk(head, boundary.done);
|
|
1643
1647
|
html && onWrite(html), boundary.done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
|
1644
1648
|
} else tick2 && (tick2 = !1, queueTick(onNext));
|
|
1645
1649
|
};
|
|
@@ -1649,7 +1653,7 @@ var ServerRenderResult = class {
|
|
|
1649
1653
|
let head = this.#head;
|
|
1650
1654
|
if (!head) throw new Error("Cannot read from a consumed render result");
|
|
1651
1655
|
if (head.next) throw new Error("Cannot fork in sync mode");
|
|
1652
|
-
return this.#head = null, flushChunk(prepareChunk(head));
|
|
1656
|
+
return this.#head = null, flushChunk(prepareChunk(head), !0);
|
|
1653
1657
|
}
|
|
1654
1658
|
};
|
|
1655
1659
|
export {
|
|
@@ -1699,5 +1703,6 @@ export {
|
|
|
1699
1703
|
write,
|
|
1700
1704
|
writeEffect,
|
|
1701
1705
|
writeExistingScope,
|
|
1702
|
-
writeScope
|
|
1706
|
+
writeScope,
|
|
1707
|
+
writeTrailers
|
|
1703
1708
|
};
|