@solidjs/web 2.0.0-rc.8 → 2.0.0-rc.9
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.dev.js +626 -125
- package/dist/server.js +433 -95
- package/dist/server.observe.js +3980 -0
- package/dist/web.dev.js +208 -60
- package/dist/web.js +175 -58
- package/dist/web.observe.js +175 -58
- package/frames/dist/client.dev.js +103 -4
- package/frames/dist/client.js +5 -2
- package/frames/dist/client.observe.js +2123 -0
- package/frames/dist/server.dev.js +521 -79
- package/frames/dist/server.js +352 -52
- package/frames/dist/server.observe.js +4946 -0
- package/frames/package.json +12 -0
- package/package.json +87 -3
- package/server-functions/dist/client.dev.js +1102 -0
- package/server-functions/dist/client.js +74 -69
- package/server-functions/dist/client.observe.js +1102 -0
- package/server-functions/dist/server.dev.js +402 -31
- package/server-functions/dist/server.js +339 -30
- package/server-functions/dist/server.observe.js +2726 -0
- package/server-functions/package.json +12 -0
- package/types/client.d.ts +22 -1
- package/types/diagnostics.d.ts +24 -0
- package/types/frames/frame-transport.d.ts +1 -1
- package/types/index.d.ts +25 -15
- package/types/index.server.d.ts +35 -8
- package/types/jsx.d.ts +15 -4
- package/types/observe.d.ts +294 -0
- package/types/response.d.ts +18 -0
- package/types/server-functions/client.d.ts +32 -22
- package/types/server-functions/server.d.ts +28 -37
- package/types/server-functions/shared.d.ts +39 -9
- package/types/server-mock.d.ts +26 -4
- package/types/server-observe.d.ts +39 -0
- package/types/server.d.ts +104 -5
- package/types/trace.d.ts +79 -0
package/dist/web.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo, sharedConfig, enableHydration, $PROXY, untrack, runWithOwner, createRoot, flatten, flush,
|
|
1
|
+
import { createRenderEffect, createMemo, sharedConfig, enableHydration, $PROXY, untrack, runWithOwner, createRoot, getOwner, ROOT_ERROR_HOOK, flatten, flush, createComponent, omit, createOwner, createSignal, onCleanup, createEffect } from 'solid-js';
|
|
2
2
|
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
3
|
+
import { sourceKeys, SOURCE_PROXY, hasStaticKeys, resolvedTable, viewOf, OmitView, sourceHas, SOURCE_OMIT, sourceGet, SOURCE_MEMO, SOURCE_PLAIN } from 'solid-js/internal';
|
|
3
4
|
|
|
4
5
|
const DOMWithState = {
|
|
5
6
|
INPUT: {
|
|
@@ -348,6 +349,7 @@ const waitAsset = promise => {
|
|
|
348
349
|
}
|
|
349
350
|
gate();
|
|
350
351
|
};
|
|
352
|
+
const EVENT_KEY = "_$$";
|
|
351
353
|
const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
|
|
352
354
|
const $$EVENT_TUPLE = Symbol();
|
|
353
355
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -362,12 +364,14 @@ function HydrationScript(_props) {
|
|
|
362
364
|
return null;
|
|
363
365
|
}
|
|
364
366
|
const getRequestEvent = voidFn;
|
|
367
|
+
const getTraceContext = voidFn;
|
|
365
368
|
function render(code, element, init, options = {}) {
|
|
366
369
|
let disposer;
|
|
367
370
|
registerDelegatedRoot(element);
|
|
368
371
|
try {
|
|
369
372
|
createRoot(dispose => {
|
|
370
373
|
disposer = dispose;
|
|
374
|
+
if (options.onError) getOwner()[ROOT_ERROR_HOOK] = options.onError;
|
|
371
375
|
if (element === document) {
|
|
372
376
|
const tree = code();
|
|
373
377
|
effect(() => flatten(tree), () => {});
|
|
@@ -563,7 +567,7 @@ function className(node, value, prev) {
|
|
|
563
567
|
}
|
|
564
568
|
function addEvent(node, name, handler, delegate) {
|
|
565
569
|
if (delegate) {
|
|
566
|
-
const key =
|
|
570
|
+
const key = EVENT_KEY + name;
|
|
567
571
|
let data;
|
|
568
572
|
if (Array.isArray(handler)) {
|
|
569
573
|
data = handler[1];
|
|
@@ -626,7 +630,7 @@ function readShallow(value) {
|
|
|
626
630
|
if (value === null || typeof value !== "object") return value;
|
|
627
631
|
if (Array.isArray(value)) return value.map(readShallow);
|
|
628
632
|
if (value[$PROXY] !== value) return value;
|
|
629
|
-
const keys =
|
|
633
|
+
const keys = sourceKeys(value, SOURCE_PROXY);
|
|
630
634
|
const out = {};
|
|
631
635
|
for (let i = 0; i < keys.length; i++) {
|
|
632
636
|
const k = keys[i];
|
|
@@ -634,46 +638,107 @@ function readShallow(value) {
|
|
|
634
638
|
}
|
|
635
639
|
return out;
|
|
636
640
|
}
|
|
637
|
-
function ownKeys(o) {
|
|
638
|
-
return o[$PROXY] === o ? Reflect.ownKeys(o) : Object.keys(o);
|
|
639
|
-
}
|
|
640
641
|
function setStyleProperty(node, name, value) {
|
|
641
642
|
if (isHydrating(node)) return;
|
|
642
643
|
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
643
644
|
}
|
|
644
|
-
function spread(node, props, skipChildren) {
|
|
645
|
+
function spread(node, props, skipChildren, skip) {
|
|
645
646
|
const prevProps = {};
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
647
|
+
const apply = newProps => {
|
|
648
|
+
const r = newProps.ref;
|
|
649
|
+
if (r !== prevProps.ref && (typeof r === "function" || Array.isArray(r))) ref(() => r, node);
|
|
650
|
+
assign(node, newProps, true, prevProps, true);
|
|
651
|
+
};
|
|
652
|
+
if (Array.isArray(props)) {
|
|
653
|
+
if (!skipChildren && !(skip !== undefined && skip("children"))) insert(node, () => {
|
|
654
|
+
for (let i = props.length - 1; i >= 0; i--) {
|
|
655
|
+
const s = resolveSource(props[i]);
|
|
656
|
+
if (s != null && entryHas(s, "children")) return entryGet(s, "children");
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
effect(() => collectSources({}, props, undefined, skip), apply);
|
|
660
|
+
return prevProps;
|
|
661
|
+
}
|
|
662
|
+
if (!skipChildren && !(skip !== undefined && skip("children"))) {
|
|
663
|
+
if (typeof props !== "function" && props != null && hasStaticKeys(props)) {
|
|
664
|
+
const desc = Object.getOwnPropertyDescriptor(props, "children");
|
|
665
|
+
if (desc !== undefined) {
|
|
666
|
+
if (desc.get === undefined) insert(node, desc.value);else insert(node, () => props.children);
|
|
667
|
+
}
|
|
668
|
+
} else insert(node, () => {
|
|
669
|
+
const source = resolveSource(props);
|
|
670
|
+
return source != null && entryHas(source, "children") ? entryGet(source, "children") : undefined;
|
|
671
|
+
});
|
|
672
|
+
}
|
|
656
673
|
effect(() => {
|
|
657
|
-
const source =
|
|
674
|
+
const source = resolveSource(props);
|
|
658
675
|
const newProps = {};
|
|
659
|
-
const
|
|
660
|
-
if (
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
} else collectProps(newProps, source);
|
|
676
|
+
const table = resolvedTable(source);
|
|
677
|
+
if (table !== undefined) return collectTable(newProps, table, skip);
|
|
678
|
+
if (source != null) {
|
|
679
|
+
const view = viewOf(source);
|
|
680
|
+
if (view instanceof OmitView) collectProps(newProps, view, SOURCE_OMIT, skip);else if (view !== undefined) collectSources(newProps, view.sources, view.kinds, skip);else collectProps(newProps, source, $PROXY in source ? SOURCE_PROXY : SOURCE_PLAIN, skip);
|
|
681
|
+
}
|
|
667
682
|
return newProps;
|
|
668
|
-
},
|
|
683
|
+
}, apply);
|
|
669
684
|
return prevProps;
|
|
670
685
|
}
|
|
671
|
-
function
|
|
672
|
-
const
|
|
673
|
-
|
|
686
|
+
function collectTable(out, table, skip) {
|
|
687
|
+
for (const [prop, leaf] of table) {
|
|
688
|
+
if (typeof prop !== "string" || prop === "children") continue;
|
|
689
|
+
if (skip !== undefined && skip(prop)) continue;
|
|
690
|
+
const v = leaf[prop];
|
|
691
|
+
out[prop] = prop === "style" || prop === "class" ? readShallow(v) : v;
|
|
692
|
+
}
|
|
693
|
+
return out;
|
|
694
|
+
}
|
|
695
|
+
function resolveSource(s) {
|
|
696
|
+
return typeof s === "function" ? s() : s;
|
|
697
|
+
}
|
|
698
|
+
function entryHas(s, key) {
|
|
699
|
+
const view = viewOf(s);
|
|
700
|
+
return view instanceof OmitView ? sourceHas(view, SOURCE_OMIT, key) : key in s;
|
|
701
|
+
}
|
|
702
|
+
function entryGet(s, key) {
|
|
703
|
+
const view = viewOf(s);
|
|
704
|
+
return view instanceof OmitView ? sourceGet(view, SOURCE_OMIT, key) : s[key];
|
|
705
|
+
}
|
|
706
|
+
function collectSources(out, sources, kinds, skip) {
|
|
707
|
+
const resolved = [];
|
|
708
|
+
const resolvedKinds = [];
|
|
709
|
+
for (let i = 0; i < sources.length; i++) pushEntry(resolved, resolvedKinds, sources[i], kinds !== undefined ? kinds[i] : SOURCE_MEMO);
|
|
710
|
+
for (let i = 0; i < resolved.length; i++) collectProps(out, resolved[i], resolvedKinds[i], skip, resolved, resolvedKinds, i + 1);
|
|
711
|
+
return out;
|
|
712
|
+
}
|
|
713
|
+
function pushEntry(resolved, kinds, s, kind) {
|
|
714
|
+
if (kind !== SOURCE_MEMO) {
|
|
715
|
+
resolved.push(s);
|
|
716
|
+
kinds.push(kind);
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
s = resolveSource(s);
|
|
720
|
+
if (s == null) return;
|
|
721
|
+
const view = viewOf(s);
|
|
722
|
+
if (view instanceof OmitView) {
|
|
723
|
+
resolved.push(view);
|
|
724
|
+
kinds.push(SOURCE_OMIT);
|
|
725
|
+
} else if (view !== undefined) {
|
|
726
|
+
const f = view.sources,
|
|
727
|
+
k = view.kinds;
|
|
728
|
+
for (let j = 0; j < f.length; j++) pushEntry(resolved, kinds, f[j], k[j]);
|
|
729
|
+
} else {
|
|
730
|
+
resolved.push(s);
|
|
731
|
+
kinds.push($PROXY in s ? SOURCE_PROXY : SOURCE_PLAIN);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function collectProps(out, s, kind, skip, later, laterKinds, from) {
|
|
735
|
+
const keys = sourceKeys(s, kind);
|
|
736
|
+
outer: for (let i = 0; i < keys.length; i++) {
|
|
674
737
|
const prop = keys[i];
|
|
675
|
-
if (typeof prop !== "string" || prop === "children"
|
|
676
|
-
|
|
738
|
+
if (typeof prop !== "string" || prop === "children") continue;
|
|
739
|
+
if (skip !== undefined && skip(prop)) continue;
|
|
740
|
+
if (later !== undefined) for (let j = from; j < later.length; j++) if (sourceHas(later[j], laterKinds[j], prop)) continue outer;
|
|
741
|
+
const v = sourceGet(s, kind, prop);
|
|
677
742
|
out[prop] = prop === "style" || prop === "class" ? readShallow(v) : v;
|
|
678
743
|
}
|
|
679
744
|
}
|
|
@@ -706,8 +771,7 @@ function installHydrationRuntime() {
|
|
|
706
771
|
hydrationRt = {
|
|
707
772
|
claimInitial(parent, multi, initial) {
|
|
708
773
|
if (isHydrating(parent)) {
|
|
709
|
-
if (!multi && initial === undefined && parent) initial =
|
|
710
|
-
if (Array.isArray(initial)) stripTextSeparators(initial);
|
|
774
|
+
if (!multi && initial === undefined && parent) initial = claimChildNodes(parent);else if (Array.isArray(initial)) stripTextSeparators(initial);
|
|
711
775
|
}
|
|
712
776
|
return initial;
|
|
713
777
|
},
|
|
@@ -731,7 +795,7 @@ function installHydrationRuntime() {
|
|
|
731
795
|
nodes.unshift(node);
|
|
732
796
|
node = node.previousSibling;
|
|
733
797
|
}
|
|
734
|
-
} else
|
|
798
|
+
} else return claimChildNodes(parent);
|
|
735
799
|
return stripTextSeparators(nodes);
|
|
736
800
|
},
|
|
737
801
|
dedupEvent(e) {
|
|
@@ -744,19 +808,36 @@ function stripTextSeparators(nodes) {
|
|
|
744
808
|
for (let i = 0; i < nodes.length; i++) {
|
|
745
809
|
const node = nodes[i],
|
|
746
810
|
t = node.nodeType;
|
|
747
|
-
if (t === 8) {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
if (v.startsWith("pl-")) continue;
|
|
754
|
-
} else if (t === 1 && node.localName === "template" && node.id.startsWith("pl-")) continue;
|
|
811
|
+
if (t === 8 && node.nodeValue === "!$") {
|
|
812
|
+
node.remove();
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
if (isPlaceholderScaffolding(node, t)) continue;
|
|
755
816
|
nodes[j++] = node;
|
|
756
817
|
}
|
|
757
818
|
nodes.length = j;
|
|
758
819
|
return nodes;
|
|
759
820
|
}
|
|
821
|
+
function claimChildNodes(parent) {
|
|
822
|
+
const live = parent.childNodes;
|
|
823
|
+
const out = [];
|
|
824
|
+
for (let i = 0, n = live.length; i < n; i++) {
|
|
825
|
+
const node = live[i],
|
|
826
|
+
t = node.nodeType;
|
|
827
|
+
if (t === 8 && node.nodeValue === "!$") {
|
|
828
|
+
node.remove();
|
|
829
|
+
i--;
|
|
830
|
+
n--;
|
|
831
|
+
continue;
|
|
832
|
+
}
|
|
833
|
+
if (isPlaceholderScaffolding(node, t)) continue;
|
|
834
|
+
out.push(node);
|
|
835
|
+
}
|
|
836
|
+
return out;
|
|
837
|
+
}
|
|
838
|
+
function isPlaceholderScaffolding(node, t) {
|
|
839
|
+
return t === 8 ? node.nodeValue.startsWith("pl-") : t === 1 && node.localName === "template" && node.id.startsWith("pl-");
|
|
840
|
+
}
|
|
760
841
|
function insert(parent, accessor, marker, initial, options) {
|
|
761
842
|
const multi = marker !== undefined;
|
|
762
843
|
const host = options && options.host;
|
|
@@ -1419,6 +1500,7 @@ function runHydrationEvents() {
|
|
|
1419
1500
|
}
|
|
1420
1501
|
function isHydrating(node) {
|
|
1421
1502
|
if (!sharedConfig.hydrating) return false;
|
|
1503
|
+
if (sharedConfig.isClaiming && !sharedConfig.isClaiming()) return false;
|
|
1422
1504
|
if (!node || node.isConnected) return true;
|
|
1423
1505
|
const roots = sharedConfig.claimRoots;
|
|
1424
1506
|
if (roots) {
|
|
@@ -1498,7 +1580,7 @@ function eventHandler(e, container, state) {
|
|
|
1498
1580
|
if (owner && owner === resumeNode) return;
|
|
1499
1581
|
e[$$EVENT_OWNER] = owner || true;
|
|
1500
1582
|
let node = resumeNode || e.target;
|
|
1501
|
-
const key =
|
|
1583
|
+
const key = EVENT_KEY + e.type;
|
|
1502
1584
|
const oriTarget = e.target;
|
|
1503
1585
|
const boundary = owner || container || e.currentTarget;
|
|
1504
1586
|
const retarget = value => Object.defineProperty(e, "target", {
|
|
@@ -1699,16 +1781,25 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
1699
1781
|
}
|
|
1700
1782
|
function gatherHydratable(element, root) {
|
|
1701
1783
|
const templates = element.querySelectorAll(`*[_hk]`);
|
|
1784
|
+
const frames = root ? null : element.querySelectorAll("[data-fid]");
|
|
1785
|
+
const frameCount = frames ? frames.length : 0;
|
|
1786
|
+
const registry = sharedConfig.registry;
|
|
1702
1787
|
for (let i = 0; i < templates.length; i++) {
|
|
1703
1788
|
const node = templates[i];
|
|
1704
1789
|
const key = node.getAttribute("_hk");
|
|
1705
1790
|
if (root) {
|
|
1706
1791
|
if (!key.startsWith(root)) continue;
|
|
1707
|
-
} else {
|
|
1708
|
-
|
|
1709
|
-
|
|
1792
|
+
} else if (frameCount !== 0) {
|
|
1793
|
+
let inFrame = false;
|
|
1794
|
+
for (let j = 0; j < frameCount; j++) {
|
|
1795
|
+
if (frames[j].contains(node)) {
|
|
1796
|
+
inFrame = true;
|
|
1797
|
+
break;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
if (inFrame) continue;
|
|
1710
1801
|
}
|
|
1711
|
-
if (!
|
|
1802
|
+
if (!registry.has(key)) registry.set(key, node);
|
|
1712
1803
|
}
|
|
1713
1804
|
}
|
|
1714
1805
|
function getHydrationKey() {
|
|
@@ -1716,6 +1807,7 @@ function getHydrationKey() {
|
|
|
1716
1807
|
}
|
|
1717
1808
|
const RequestContext = Symbol();
|
|
1718
1809
|
|
|
1810
|
+
function configureServerErrors(_config) {}
|
|
1719
1811
|
function throwInBrowser(func) {
|
|
1720
1812
|
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
1721
1813
|
console.error(err);
|
|
@@ -1745,14 +1837,14 @@ function composeMiddleware(middlewares) {
|
|
|
1745
1837
|
throwInBrowser(composeMiddleware);
|
|
1746
1838
|
}
|
|
1747
1839
|
function ssr(template, ...nodes) {}
|
|
1748
|
-
function ssrElement(name, props, children, needsId) {}
|
|
1840
|
+
function ssrElement(name, props, children, needsId, skip) {}
|
|
1749
1841
|
function ssrClassName(value) {}
|
|
1750
1842
|
function ssrStyle(value) {}
|
|
1751
1843
|
function ssrStyleProperty(name, value) {}
|
|
1752
1844
|
function ssrAttribute(key, value) {}
|
|
1753
1845
|
function ssrGroup(fn, n) {}
|
|
1754
1846
|
function ssrHydrationKey() {}
|
|
1755
|
-
function resolveSSRNode(node, result, top) {}
|
|
1847
|
+
function resolveSSRNode(node, result, top, nested) {}
|
|
1756
1848
|
function escape(s, attr) {}
|
|
1757
1849
|
|
|
1758
1850
|
const ENVELOPE = Symbol.for("solid.ResponseEnvelope");
|
|
@@ -1789,6 +1881,7 @@ function isSafeError(value) {
|
|
|
1789
1881
|
return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
|
|
1790
1882
|
}
|
|
1791
1883
|
const REVALIDATE_HEADER = "X-Revalidate";
|
|
1884
|
+
const REVALIDATE_ALL = "*";
|
|
1792
1885
|
const RESPONSE_HEADER_VALUE_LIMIT = 4096;
|
|
1793
1886
|
function initWithRevalidate(init = {}) {
|
|
1794
1887
|
const resolved = typeof init === "number" ? {
|
|
@@ -1811,7 +1904,11 @@ function initWithRevalidate(init = {}) {
|
|
|
1811
1904
|
headers = new Headers(responseInit.headers);
|
|
1812
1905
|
}
|
|
1813
1906
|
if (revalidate !== undefined) {
|
|
1814
|
-
const
|
|
1907
|
+
const list = Array.isArray(revalidate) ? revalidate : [revalidate];
|
|
1908
|
+
if (list.length > 1 && list.includes(REVALIDATE_ALL)) {
|
|
1909
|
+
throw new TypeError(`revalidate names "${REVALIDATE_ALL}" alongside other keys; "${REVALIDATE_ALL}" already ` + `means every entry and stands alone — pass revalidate: "${REVALIDATE_ALL}" or the named keys.`);
|
|
1910
|
+
}
|
|
1911
|
+
const keys = list.join(",");
|
|
1815
1912
|
if (keys.length > RESPONSE_HEADER_VALUE_LIMIT) {
|
|
1816
1913
|
throw new TypeError(`revalidate names ${keys.length} characters of cache keys; past ` + `${RESPONSE_HEADER_VALUE_LIMIT} the ${REVALIDATE_HEADER} header would overflow ` + `receivers (an 8 KiB proxy buffer holds the whole header block) and the response ` + `dies at the socket after the mutation committed. Split the invalidation across ` + `calls or use coarser keys — a dropped key would be a silently stale cache, so ` + `the runtime refuses rather than trims.`);
|
|
1817
1914
|
}
|
|
@@ -1933,7 +2030,8 @@ const COMPONENT_BINDING = Symbol.for("solid.component-binding");
|
|
|
1933
2030
|
function bindingOf(value) {
|
|
1934
2031
|
return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
|
|
1935
2032
|
}
|
|
1936
|
-
function dynamic(source,
|
|
2033
|
+
function dynamic(source, options) {
|
|
2034
|
+
if (options?.static) return staticDynamic(untrack(source));
|
|
1937
2035
|
let latest = 0;
|
|
1938
2036
|
const sites = new Set();
|
|
1939
2037
|
let deliveredAddress;
|
|
@@ -1974,19 +2072,38 @@ function dynamic(source, _options) {
|
|
|
1974
2072
|
return untrack(() => component(props));
|
|
1975
2073
|
}
|
|
1976
2074
|
case "string":
|
|
1977
|
-
|
|
1978
|
-
spread(el, props);
|
|
1979
|
-
return el;
|
|
2075
|
+
return staticElement(component, props);
|
|
1980
2076
|
}
|
|
1981
2077
|
});
|
|
1982
2078
|
};
|
|
1983
2079
|
}
|
|
2080
|
+
function staticDynamic(component) {
|
|
2081
|
+
if (typeof component === "function") {
|
|
2082
|
+
const binding = bindingOf(component);
|
|
2083
|
+
if (binding) {
|
|
2084
|
+
const address = () => binding.address;
|
|
2085
|
+
return props => untrack(() => binding.component(props, address));
|
|
2086
|
+
}
|
|
2087
|
+
return props => untrack(() => component(props));
|
|
2088
|
+
}
|
|
2089
|
+
if (typeof component === "string") return props => staticElement(component, props);
|
|
2090
|
+
return () => undefined;
|
|
2091
|
+
}
|
|
2092
|
+
function staticElement(tag, props) {
|
|
2093
|
+
const hydrating = sharedConfig.hydrating;
|
|
2094
|
+
const el = hydrating ? getNextElement() : createElement(tag, untrack(() => props.is), untrack(() => props.xmlns));
|
|
2095
|
+
spread(el, props);
|
|
2096
|
+
if (hydrating) runHydrationEvents();
|
|
2097
|
+
return el;
|
|
2098
|
+
}
|
|
1984
2099
|
function Dynamic(props) {
|
|
1985
2100
|
const Comp = dynamic(() => props.component);
|
|
1986
2101
|
return createComponent(Comp, omit(props, "component"));
|
|
1987
2102
|
}
|
|
1988
|
-
function createElement(tagName, is = undefined) {
|
|
1989
|
-
return
|
|
2103
|
+
function createElement(tagName, is = undefined, xmlns = undefined) {
|
|
2104
|
+
return xmlns ? document.createElementNS(xmlns, tagName, {
|
|
2105
|
+
is
|
|
2106
|
+
}) : SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
1990
2107
|
is
|
|
1991
2108
|
});
|
|
1992
2109
|
}
|
|
@@ -2018,4 +2135,4 @@ _moduleUrl) {
|
|
|
2018
2135
|
function httpStatus(_code, _text) {}
|
|
2019
2136
|
function httpHeader(_name, _value, _options) {}
|
|
2020
2137
|
|
|
2021
|
-
export { 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, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle, ssrStyleProperty, style, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
|
2138
|
+
export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_ALL, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, configureServerErrors, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle, ssrStyleProperty, style, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|