@solidjs/web 2.0.0-rc.6 → 2.0.0-rc.8
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/{server.cjs → server.dev.js} +274 -272
- package/dist/server.js +119 -36
- package/dist/{dev.js → web.dev.js} +131 -399
- package/dist/web.js +78 -388
- package/dist/{web.cjs → web.observe.js} +174 -622
- package/frames/dist/client.dev.js +11 -3
- package/frames/dist/client.js +11 -3
- package/frames/dist/{server.cjs → server.dev.js} +375 -125
- package/frames/dist/server.js +253 -32
- package/frames/package.json +7 -15
- package/package.json +88 -251
- package/serialization/decode/package.json +3 -9
- package/serialization/dist/decode.js +18 -4
- package/serialization/dist/serialization.js +18 -4
- package/serialization/package.json +3 -9
- package/serialization/types/serializer-decode.d.ts +49 -2
- package/server-functions/dist/client.js +13 -14
- package/server-functions/dist/server.dev.js +359 -85
- package/server-functions/dist/server.js +352 -86
- package/server-functions/package.json +6 -24
- package/server-functions/rich-args/package.json +3 -9
- package/storage/package.json +3 -9
- package/types/client.d.ts +17 -3
- package/types/frames/frame-client.d.ts +1 -1
- package/types/frames/serializer-decode.d.ts +49 -2
- package/types/head.d.ts +3 -0
- package/types/index.d.ts +18 -7
- package/types/index.server.d.ts +31 -9
- package/types/render.d.ts +3 -1
- package/types/serializer-decode.d.ts +49 -2
- package/types/server-functions/flash.d.ts +12 -3
- package/types/server-functions/server.d.ts +50 -3
- package/types/server-mock.d.ts +43 -7
- package/types/server.d.ts +48 -6
- package/dist/dev.cjs +0 -2590
- package/frames/dist/client.cjs +0 -2035
- package/frames/dist/client.dev.cjs +0 -2055
- package/serialization/dist/decode.cjs +0 -141
- package/serialization/dist/serialization.cjs +0 -261
- package/serialization/types-cjs/index.d.cts +0 -101
- package/serialization/types-cjs/package.json +0 -3
- package/serialization/types-cjs/serializer-decode.d.cts +0 -172
- package/serialization/types-cjs/serializer.d.cts +0 -101
- package/server-functions/dist/client.cjs +0 -1070
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.cjs +0 -2133
- package/server-functions/dist/server.dev.cjs +0 -2153
- package/storage/dist/storage.cjs +0 -12
- package/storage/types-cjs/index.d.cts +0 -28
- package/storage/types-cjs/package.json +0 -3
- package/types/patch-driver.d.ts +0 -3
- package/types-cjs/client.d.cts +0 -200
- package/types-cjs/constants.d.cts +0 -20
- package/types-cjs/cookies.d.cts +0 -41
- package/types-cjs/frames/client.d.cts +0 -36
- package/types-cjs/frames/frame-client.d.cts +0 -370
- package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
- package/types-cjs/frames/frame-sink.d.cts +0 -92
- package/types-cjs/frames/frame-transport.d.cts +0 -189
- package/types-cjs/frames/serializer-decode.d.cts +0 -172
- package/types-cjs/frames/serializer.d.cts +0 -101
- package/types-cjs/frames/server.d.cts +0 -52
- package/types-cjs/head.d.cts +0 -16
- package/types-cjs/index.d.cts +0 -180
- package/types-cjs/index.server.d.cts +0 -125
- package/types-cjs/jsx-properties.d.cts +0 -93
- package/types-cjs/jsx.d.cts +0 -4146
- package/types-cjs/package.json +0 -3
- package/types-cjs/patch-driver.d.cts +0 -3
- package/types-cjs/reconcile.d.cts +0 -1
- package/types-cjs/render.d.cts +0 -4
- package/types-cjs/response.d.cts +0 -81
- package/types-cjs/serializer-decode.d.cts +0 -172
- package/types-cjs/serializer.d.cts +0 -101
- package/types-cjs/server-functions/client.d.cts +0 -184
- package/types-cjs/server-functions/flash.d.cts +0 -27
- package/types-cjs/server-functions/registry.d.cts +0 -100
- package/types-cjs/server-functions/rich-args.d.cts +0 -1
- package/types-cjs/server-functions/server.d.cts +0 -522
- package/types-cjs/server-functions/shared.d.cts +0 -283
- package/types-cjs/server-mock.d.cts +0 -301
- package/types-cjs/server.d.cts +0 -366
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo, sharedConfig, createRoot, inServerComponentScope, getOwner, ssrHandleError, creationStamp, runWithOwner, createComponent, omit, getNextChildId, onCleanup, getProjectionTrace } from 'solid-js';
|
|
1
|
+
import { createRenderEffect, createMemo, sharedConfig, createRoot, inServerComponentScope, getOwner, ssrHandleError, creationStamp, runWithOwner, createComponent, omit, getNextChildId, NotReadyError, onCleanup, getProjectionTrace } from 'solid-js';
|
|
2
2
|
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, ssrScope as scope, sharedConfig, untrack } from 'solid-js';
|
|
3
3
|
import { Feature, createStream, Serializer, getCrossReferenceHeader } from 'seroval';
|
|
4
4
|
import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
|
|
@@ -66,11 +66,12 @@ const syncOptions = {
|
|
|
66
66
|
sync: true
|
|
67
67
|
};
|
|
68
68
|
function effect(fn, effectFn, options) {
|
|
69
|
-
|
|
69
|
+
const nodeOptions = options ? {
|
|
70
70
|
sync: true,
|
|
71
71
|
...options,
|
|
72
72
|
transparent: !options.scope
|
|
73
|
-
} : transparentOptions
|
|
73
|
+
} : transparentOptions;
|
|
74
|
+
createRenderEffect(fn, effectFn, nodeOptions);
|
|
74
75
|
}
|
|
75
76
|
function memo(fn) {
|
|
76
77
|
return createMemo(() => fn(), syncOptions);
|
|
@@ -404,12 +405,24 @@ function classifyHeadTag(desc) {
|
|
|
404
405
|
resource: false
|
|
405
406
|
};
|
|
406
407
|
}
|
|
408
|
+
function qualifierValue(name, value) {
|
|
409
|
+
if (value == null || value === false) return null;
|
|
410
|
+
if (name === "imagesrcset" || name === "imagesizes") return typeof value === "string" && value !== "" ? value : null;
|
|
411
|
+
const v = value === true ? "" : String(value);
|
|
412
|
+
if (name === "as") return asciiLowerCase(v);
|
|
413
|
+
if (name !== "crossorigin") return v;
|
|
414
|
+
return v.length === 15 && v.toLowerCase() === "use-credentials" ? v.toLowerCase() : "anonymous";
|
|
415
|
+
}
|
|
416
|
+
function asciiLowerCase(value) {
|
|
417
|
+
return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
|
|
418
|
+
}
|
|
407
419
|
function resourceIdentity(tag, props) {
|
|
408
|
-
|
|
420
|
+
const url = String(props.href || props.src || "");
|
|
421
|
+
let id = "res:" + tag + ":" + (props.rel || "") + ":" + url.length + ":" + url;
|
|
409
422
|
for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
|
|
410
423
|
const q = RESOURCE_QUALIFIERS[i];
|
|
411
|
-
const value = props[q];
|
|
412
|
-
if (value
|
|
424
|
+
const value = qualifierValue(q, props[q]);
|
|
425
|
+
if (value !== null) id += ":" + q + "=" + value.length + ":" + value;
|
|
413
426
|
}
|
|
414
427
|
return id;
|
|
415
428
|
}
|
|
@@ -483,12 +496,20 @@ function resolveAssets(moduleUrl, manifest) {
|
|
|
483
496
|
if (e.preloads) {
|
|
484
497
|
for (let i = 0; i < e.preloads.length; i++) {
|
|
485
498
|
const link = e.preloads[i];
|
|
486
|
-
|
|
499
|
+
const href = link && typeof link.href === "string" && link.href;
|
|
500
|
+
const srcset = link && typeof link.imagesrcset === "string" && link.imagesrcset;
|
|
501
|
+
if (!href && !srcset) continue;
|
|
487
502
|
if (!preloads) preloads = [];
|
|
488
|
-
preloads.push({
|
|
503
|
+
if (href) preloads.push({
|
|
489
504
|
...link,
|
|
490
|
-
href: joinAssetPath(base,
|
|
491
|
-
});
|
|
505
|
+
href: joinAssetPath(base, href)
|
|
506
|
+
});else {
|
|
507
|
+
const {
|
|
508
|
+
href: bad,
|
|
509
|
+
...rest
|
|
510
|
+
} = link;
|
|
511
|
+
preloads.push(rest);
|
|
512
|
+
}
|
|
492
513
|
}
|
|
493
514
|
}
|
|
494
515
|
if (e.imports) for (let i = 0; i < e.imports.length; i++) walk(e.imports[i]);
|
|
@@ -620,9 +641,13 @@ function isCssUrl(url) {
|
|
|
620
641
|
const q = url.search(/[?#]/);
|
|
621
642
|
return (q === -1 ? url : url.slice(0, q)).endsWith(".css");
|
|
622
643
|
}
|
|
623
|
-
const
|
|
644
|
+
const RESPONSIVE_ATTRIBUTES = ["imagesrcset", "imagesizes"];
|
|
645
|
+
function isSetAttr(value) {
|
|
646
|
+
return value != null && value !== false && value !== "";
|
|
647
|
+
}
|
|
648
|
+
const PRELOAD_LINK_ATTRIBUTES = ["type", "crossorigin", "integrity", "referrerpolicy", "fetchpriority", "media", "imagesrcset", "imagesizes"];
|
|
624
649
|
function registerPreloadLink(tracking, headRegistry, link, nonce) {
|
|
625
|
-
if (!link || typeof link !== "object"
|
|
650
|
+
if (!link || typeof link !== "object") {
|
|
626
651
|
return null;
|
|
627
652
|
}
|
|
628
653
|
if (typeof link.as !== "string") {
|
|
@@ -643,13 +668,35 @@ function registerPreloadLink(tracking, headRegistry, link, nonce) {
|
|
|
643
668
|
default:
|
|
644
669
|
return null;
|
|
645
670
|
}
|
|
671
|
+
const responsive = as === "image";
|
|
672
|
+
let srcset = null;
|
|
673
|
+
let sizes = null;
|
|
674
|
+
if (responsive) {
|
|
675
|
+
for (const name of RESPONSIVE_ATTRIBUTES) {
|
|
676
|
+
const value = link[name];
|
|
677
|
+
if (!isSetAttr(value)) continue;
|
|
678
|
+
if (typeof value !== "string") {
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
if (name === "imagesrcset") srcset = value;else sizes = value;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
const href = typeof link.href === "string" && link.href ? link.href : null;
|
|
685
|
+
if (!href && !srcset) {
|
|
686
|
+
return null;
|
|
687
|
+
}
|
|
646
688
|
const props = {
|
|
647
|
-
rel: "preload"
|
|
648
|
-
href: link.href,
|
|
649
|
-
as
|
|
689
|
+
rel: "preload"
|
|
650
690
|
};
|
|
691
|
+
if (href) props.href = href;
|
|
692
|
+
props.as = as;
|
|
651
693
|
for (let i = 0; i < PRELOAD_LINK_ATTRIBUTES.length; i++) {
|
|
652
694
|
const name = PRELOAD_LINK_ATTRIBUTES[i];
|
|
695
|
+
if (RESPONSIVE_ATTRIBUTES.indexOf(name) !== -1) {
|
|
696
|
+
const value = name === "imagesrcset" ? srcset : sizes;
|
|
697
|
+
if (value !== null) props[name] = value;
|
|
698
|
+
continue;
|
|
699
|
+
}
|
|
653
700
|
const value = link[name];
|
|
654
701
|
if (value == null || value === false) continue;
|
|
655
702
|
props[name] = value === true ? "" : String(value);
|
|
@@ -1026,9 +1073,6 @@ function scriptNonce(nonce) {
|
|
|
1026
1073
|
function styleNonce(nonce) {
|
|
1027
1074
|
return destinationNonce(nonce, "style");
|
|
1028
1075
|
}
|
|
1029
|
-
function asciiLowerCase(value) {
|
|
1030
|
-
return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
|
|
1031
|
-
}
|
|
1032
1076
|
function hasNonceProp(props) {
|
|
1033
1077
|
for (const name in props) if (name.length === 5 && asciiLowerCase(name) === "nonce" && props[name] != null) return true;
|
|
1034
1078
|
return false;
|
|
@@ -1189,6 +1233,7 @@ function renderToStream(code, options = {}) {
|
|
|
1189
1233
|
onHead
|
|
1190
1234
|
} = options;
|
|
1191
1235
|
const nonce = normalizeNonce(options.nonce);
|
|
1236
|
+
const requestEvent = peekRequestEvent();
|
|
1192
1237
|
let dispose;
|
|
1193
1238
|
let dead = false;
|
|
1194
1239
|
const abandon = () => {
|
|
@@ -1290,6 +1335,7 @@ function renderToStream(code, options = {}) {
|
|
|
1290
1335
|
};
|
|
1291
1336
|
const onDone = () => {
|
|
1292
1337
|
writeTasks();
|
|
1338
|
+
lastBlockingSize = blockingPromises.size;
|
|
1293
1339
|
doShell();
|
|
1294
1340
|
onCompleteAll && onCompleteAll({
|
|
1295
1341
|
write(v) {
|
|
@@ -1679,9 +1725,9 @@ function renderToStream(code, options = {}) {
|
|
|
1679
1725
|
function doShell() {
|
|
1680
1726
|
if (shellCompleted) return;
|
|
1681
1727
|
sharedConfig.context = context;
|
|
1682
|
-
|
|
1728
|
+
if (blockingPromises.size !== lastBlockingSize) return;
|
|
1683
1729
|
if (!resolveRootHoles()) return;
|
|
1684
|
-
if (blockingPromises.size !==
|
|
1730
|
+
if (blockingPromises.size !== lastBlockingSize) return;
|
|
1685
1731
|
if (!headShellReady(headRegistry, p => blockingPromises.add(p))) return;
|
|
1686
1732
|
headStyles = new Set();
|
|
1687
1733
|
for (const url of tracking.emittedAssets) {
|
|
@@ -1709,7 +1755,7 @@ function renderToStream(code, options = {}) {
|
|
|
1709
1755
|
let lastBlockingSize = -1;
|
|
1710
1756
|
let lastRegistrySize = -1;
|
|
1711
1757
|
let drainTurn = 0;
|
|
1712
|
-
const scheduleFlush = fn => {
|
|
1758
|
+
const scheduleFlush = (fn, awaited) => {
|
|
1713
1759
|
const attempt = () => {
|
|
1714
1760
|
flushStubBatch();
|
|
1715
1761
|
if (registry.size !== lastRegistrySize || drainTurn++ < MIN_DRAIN_TURNS) {
|
|
@@ -1720,8 +1766,8 @@ function renderToStream(code, options = {}) {
|
|
|
1720
1766
|
}
|
|
1721
1767
|
fn();
|
|
1722
1768
|
};
|
|
1723
|
-
const progressed =
|
|
1724
|
-
lastBlockingSize =
|
|
1769
|
+
const progressed = awaited !== lastBlockingSize;
|
|
1770
|
+
lastBlockingSize = awaited;
|
|
1725
1771
|
lastRegistrySize = -1;
|
|
1726
1772
|
drainTurn = 0;
|
|
1727
1773
|
progressed ? queue(attempt) : setTimeout(attempt);
|
|
@@ -1738,7 +1784,7 @@ function renderToStream(code, options = {}) {
|
|
|
1738
1784
|
let resolve;
|
|
1739
1785
|
const p = new Promise(r => resolve = r);
|
|
1740
1786
|
function flush() {
|
|
1741
|
-
allSettled(blockingPromises).then(
|
|
1787
|
+
allSettled(blockingPromises).then(awaited => {
|
|
1742
1788
|
scheduleFlush(() => {
|
|
1743
1789
|
if (dead) return resolve();
|
|
1744
1790
|
try {
|
|
@@ -1776,7 +1822,7 @@ function renderToStream(code, options = {}) {
|
|
|
1776
1822
|
dispose();
|
|
1777
1823
|
writable.end();
|
|
1778
1824
|
} else flushEnd();
|
|
1779
|
-
});
|
|
1825
|
+
}, awaited);
|
|
1780
1826
|
});
|
|
1781
1827
|
}
|
|
1782
1828
|
flush();
|
|
@@ -1784,8 +1830,12 @@ function renderToStream(code, options = {}) {
|
|
|
1784
1830
|
};
|
|
1785
1831
|
return {
|
|
1786
1832
|
then(onFulfilled, onRejected) {
|
|
1833
|
+
const freezeHead = () => {
|
|
1834
|
+
if (requestEvent && requestEvent.response) commitResponseStub(requestEvent.response);
|
|
1835
|
+
};
|
|
1787
1836
|
const p = new Promise(resolve => {
|
|
1788
1837
|
function complete() {
|
|
1838
|
+
freezeHead();
|
|
1789
1839
|
dispose();
|
|
1790
1840
|
resolve(tmp);
|
|
1791
1841
|
}
|
|
@@ -1797,17 +1847,16 @@ function renderToStream(code, options = {}) {
|
|
|
1797
1847
|
};
|
|
1798
1848
|
} else onCompleteAll = complete;
|
|
1799
1849
|
function flush() {
|
|
1800
|
-
allSettled(blockingPromises).then(
|
|
1850
|
+
allSettled(blockingPromises).then(awaited => {
|
|
1801
1851
|
scheduleFlush(() => {
|
|
1802
1852
|
try {
|
|
1803
|
-
|
|
1804
|
-
if (!resolveRootHoles() || blockingPromises.size !== blockersBefore || !headShellReady(headRegistry, p => blockingPromises.add(p))) return flush();
|
|
1853
|
+
if (blockingPromises.size !== lastBlockingSize || !resolveRootHoles() || blockingPromises.size !== lastBlockingSize || !headShellReady(headRegistry, p => blockingPromises.add(p))) return flush();
|
|
1805
1854
|
} catch (err) {
|
|
1806
1855
|
failRender(err);
|
|
1807
1856
|
return resolve(tmp);
|
|
1808
1857
|
}
|
|
1809
1858
|
queue(flushEnd);
|
|
1810
|
-
});
|
|
1859
|
+
}, awaited);
|
|
1811
1860
|
});
|
|
1812
1861
|
}
|
|
1813
1862
|
flush();
|
|
@@ -1817,7 +1866,7 @@ function renderToStream(code, options = {}) {
|
|
|
1817
1866
|
pipe(w) {
|
|
1818
1867
|
claimConsumer("pipe");
|
|
1819
1868
|
function flush() {
|
|
1820
|
-
allSettled(blockingPromises).then(
|
|
1869
|
+
allSettled(blockingPromises).then(awaited => {
|
|
1821
1870
|
scheduleFlush(() => {
|
|
1822
1871
|
if (dead) return;
|
|
1823
1872
|
try {
|
|
@@ -1839,7 +1888,7 @@ function renderToStream(code, options = {}) {
|
|
|
1839
1888
|
dispose();
|
|
1840
1889
|
writable.end();
|
|
1841
1890
|
} else flushEnd();
|
|
1842
|
-
});
|
|
1891
|
+
}, awaited);
|
|
1843
1892
|
});
|
|
1844
1893
|
}
|
|
1845
1894
|
flush();
|
|
@@ -2548,12 +2597,18 @@ function ssrStyleProperty(name, value) {
|
|
|
2548
2597
|
}
|
|
2549
2598
|
function ssrElement(tag, props, children, needsId) {
|
|
2550
2599
|
const hk = needsId ? ssrHydrationKey() : "";
|
|
2551
|
-
if (
|
|
2600
|
+
if (typeof props === "function") props = props();
|
|
2601
|
+
if (props == null) props = {};
|
|
2552
2602
|
const skipChildren = VOID_ELEMENTS.test(tag);
|
|
2553
2603
|
const keys = Object.keys(props);
|
|
2554
2604
|
let result = `<${tag}${hk} `;
|
|
2555
2605
|
for (let i = 0; i < keys.length; i++) {
|
|
2556
2606
|
const prop = keys[i];
|
|
2607
|
+
if (tag === "textarea" && (prop === "value" || prop === "defaultValue")) {
|
|
2608
|
+
const value = props[prop];
|
|
2609
|
+
if (value !== null) children = escape(value);
|
|
2610
|
+
continue;
|
|
2611
|
+
}
|
|
2557
2612
|
if (ChildProperties.has(prop)) {
|
|
2558
2613
|
if (children === undefined && !skipChildren) children = tag === "script" || tag === "style" || prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
2559
2614
|
continue;
|
|
@@ -2723,10 +2778,13 @@ function escape(s, attr) {
|
|
|
2723
2778
|
if (!attr && Array.isArray(s)) {
|
|
2724
2779
|
const joined = tryJoinPlainSSRArray(s);
|
|
2725
2780
|
if (joined !== undefined) return joined;
|
|
2781
|
+
const src = s;
|
|
2726
2782
|
s = s.slice();
|
|
2727
2783
|
for (let i = 0; i < s.length; i++) s[i] = escape(s[i]);
|
|
2784
|
+
if (src.$slot) s.$slot = true;
|
|
2728
2785
|
return s;
|
|
2729
2786
|
}
|
|
2787
|
+
if (!attr && t === "function") return escapeLate(s);
|
|
2730
2788
|
if (attr) {
|
|
2731
2789
|
if (s == null || t === "boolean" || t === "number") return s;
|
|
2732
2790
|
return escape(String(s), attr);
|
|
@@ -2737,6 +2795,15 @@ function escape(s, attr) {
|
|
|
2737
2795
|
if (i < 0) return s;
|
|
2738
2796
|
return escapeSlow(s, attr, i);
|
|
2739
2797
|
}
|
|
2798
|
+
function escapeLate(fn) {
|
|
2799
|
+
if (fn.$esc) return fn;
|
|
2800
|
+
const w = () => escape(fn());
|
|
2801
|
+
w.$esc = true;
|
|
2802
|
+
if (fn.$lhSkip) w.$lhSkip = true;
|
|
2803
|
+
if (fn.$lhSuppress) w.$lhSuppress = true;
|
|
2804
|
+
if (fn.$lhBinding) w.$lhBinding = fn.$lhBinding;
|
|
2805
|
+
return w;
|
|
2806
|
+
}
|
|
2740
2807
|
const ESCAPE_CONTENT = /[&<]/;
|
|
2741
2808
|
const ESCAPE_ATTR = /[&"<]/;
|
|
2742
2809
|
function escapeSlow(s, attr, start) {
|
|
@@ -2837,7 +2904,7 @@ function allSettled(promises) {
|
|
|
2837
2904
|
let size = promises.size;
|
|
2838
2905
|
return Promise.allSettled(promises).then(() => {
|
|
2839
2906
|
if (promises.size !== size) return allSettled(promises);
|
|
2840
|
-
return;
|
|
2907
|
+
return size;
|
|
2841
2908
|
});
|
|
2842
2909
|
}
|
|
2843
2910
|
function assembleDocument(html, emittedAssets, preloadLinks, inlineStyles, scripts, nonce, headTags, onHead) {
|
|
@@ -3106,6 +3173,10 @@ const RequestContext = Symbol.for("solid.RequestContext");
|
|
|
3106
3173
|
function getRequestEvent() {
|
|
3107
3174
|
return globalThis[RequestContext] ? globalThis[RequestContext].getStore() || sharedConfig.context && sharedConfig.context.event || console.warn("RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls.") : undefined;
|
|
3108
3175
|
}
|
|
3176
|
+
function peekRequestEvent() {
|
|
3177
|
+
const store = globalThis[RequestContext];
|
|
3178
|
+
return store ? store.getStore() : undefined;
|
|
3179
|
+
}
|
|
3109
3180
|
function createResponseStub() {
|
|
3110
3181
|
return {
|
|
3111
3182
|
status: undefined,
|
|
@@ -3322,13 +3393,25 @@ function notSup() {
|
|
|
3322
3393
|
setContainerTraceResolver(getProjectionTrace);
|
|
3323
3394
|
const isServer = true;
|
|
3324
3395
|
const isDev = false;
|
|
3325
|
-
function dynamic(source) {
|
|
3396
|
+
function dynamic(source, options) {
|
|
3326
3397
|
const cached = createMemo(source, {
|
|
3327
3398
|
serialize: false
|
|
3328
3399
|
});
|
|
3400
|
+
const deferStream = !!options?.deferStream;
|
|
3329
3401
|
return props => {
|
|
3402
|
+
const ctx = sharedConfig.context;
|
|
3403
|
+
let gated = !deferStream || !ctx?.async;
|
|
3330
3404
|
return createMemo(() => {
|
|
3331
|
-
|
|
3405
|
+
let c;
|
|
3406
|
+
try {
|
|
3407
|
+
c = cached();
|
|
3408
|
+
} catch (err) {
|
|
3409
|
+
if (!gated && err instanceof NotReadyError) {
|
|
3410
|
+
gated = true;
|
|
3411
|
+
ctx.block(Promise.resolve(err.source).then(() => {}, () => {}));
|
|
3412
|
+
}
|
|
3413
|
+
throw err;
|
|
3414
|
+
}
|
|
3332
3415
|
if (c) {
|
|
3333
3416
|
if (typeof c === "function") return c(props);
|
|
3334
3417
|
if (typeof c === "string") {
|
|
@@ -3468,4 +3551,4 @@ function httpHeader(name, value, options) {
|
|
|
3468
3551
|
}
|
|
3469
3552
|
}
|
|
3470
3553
|
|
|
3471
|
-
export { CLAIMS_DOCUMENT, CLAIMS_STREAM, CLAIM_PROP, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, scriptNonce, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClaim, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrSelectValues, ssrStyle, ssrStyleProperty, notSup as style, styleNonce, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
|
3554
|
+
export { CLAIMS_DOCUMENT, CLAIMS_STREAM, CLAIM_PROP, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, scriptNonce, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClaim, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrSelectValues, ssrStyle, ssrStyleProperty, notSup as style, styleNonce, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|