@solidjs/web 2.0.0-rc.7 → 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 +638 -124
- package/dist/server.js +445 -94
- package/dist/{server.dev.cjs → server.observe.js} +602 -416
- package/dist/web.dev.js +229 -49
- package/dist/web.js +194 -46
- package/dist/{web.cjs → web.observe.js} +290 -275
- package/frames/dist/client.dev.js +103 -4
- package/frames/dist/client.js +5 -2
- package/frames/dist/{client.dev.cjs → client.observe.js} +139 -79
- package/frames/dist/server.dev.js +540 -79
- package/frames/dist/server.js +371 -52
- package/frames/dist/{server.cjs → server.observe.js} +544 -140
- package/frames/package.json +15 -21
- package/package.json +145 -294
- package/serialization/decode/package.json +3 -9
- package/serialization/package.json +3 -9
- package/serialization/types/serializer-decode.d.ts +49 -2
- package/server-functions/dist/{client.cjs → client.dev.js} +140 -107
- package/server-functions/dist/client.js +74 -69
- package/server-functions/dist/client.observe.js +1102 -0
- package/server-functions/dist/server.dev.js +430 -41
- package/server-functions/dist/server.js +367 -40
- package/server-functions/dist/{server.cjs → server.observe.js} +430 -85
- package/server-functions/package.json +15 -21
- package/server-functions/rich-args/package.json +3 -9
- package/storage/package.json +3 -9
- package/types/client.d.ts +39 -1
- package/types/diagnostics.d.ts +24 -0
- package/types/frames/frame-transport.d.ts +1 -1
- package/types/frames/serializer-decode.d.ts +49 -2
- 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/serializer-decode.d.ts +49 -2
- package/types/server-functions/client.d.ts +32 -22
- package/types/server-functions/server.d.ts +55 -41
- 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 +105 -6
- package/types/trace.d.ts +79 -0
- package/dist/server.cjs +0 -3708
- package/dist/web.dev.cjs +0 -2285
- package/frames/dist/client.cjs +0 -2043
- package/frames/dist/server.dev.cjs +0 -4584
- package/serialization/dist/decode.cjs +0 -155
- package/serialization/dist/serialization.cjs +0 -275
- 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/rich-args.cjs +0 -11
- package/server-functions/dist/server.dev.cjs +0 -2409
- 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-cjs/client.d.cts +0 -197
- 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 -19
- package/types-cjs/index.d.cts +0 -191
- package/types-cjs/index.server.d.cts +0 -147
- 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/reconcile.d.cts +0 -1
- package/types-cjs/render.d.cts +0 -6
- 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 -36
- 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 -546
- package/types-cjs/server-functions/shared.d.cts +0 -283
- package/types-cjs/server-mock.d.cts +0 -337
- package/types-cjs/server.d.cts +0 -408
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { createRenderEffect, createMemo, sharedConfig, enableHydration, $PROXY, untrack, runWithOwner, createRoot, getOwner, ROOT_ERROR_HOOK, flatten, flush, OBSERVE, createComponent, omit, createOwner, createSignal, onCleanup, createEffect } from 'solid-js';
|
|
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';
|
|
4
4
|
|
|
5
5
|
const DOMWithState = {
|
|
6
6
|
INPUT: {
|
|
@@ -64,10 +64,10 @@ function effect(fn, effectFn, options) {
|
|
|
64
64
|
...options,
|
|
65
65
|
transparent: !options.scope
|
|
66
66
|
} : transparentOptions;
|
|
67
|
-
|
|
67
|
+
createRenderEffect(fn, effectFn, nodeOptions);
|
|
68
68
|
}
|
|
69
69
|
function memo(fn) {
|
|
70
|
-
return
|
|
70
|
+
return createMemo(() => fn(), syncOptions);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
function reconcileArrays(parentNode, a, b, marker) {
|
|
@@ -342,13 +342,14 @@ const assetGates = new WeakMap();
|
|
|
342
342
|
const waitAsset = promise => {
|
|
343
343
|
let gate = assetGates.get(promise);
|
|
344
344
|
if (!gate) {
|
|
345
|
-
|
|
346
|
-
gate =
|
|
345
|
+
runWithOwner(null, () => {
|
|
346
|
+
gate = createMemo(() => promise);
|
|
347
347
|
});
|
|
348
348
|
assetGates.set(promise, gate);
|
|
349
349
|
}
|
|
350
350
|
gate();
|
|
351
351
|
};
|
|
352
|
+
const EVENT_KEY = "_$$";
|
|
352
353
|
const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
|
|
353
354
|
const $$EVENT_TUPLE = Symbol();
|
|
354
355
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -363,15 +364,17 @@ function HydrationScript(_props) {
|
|
|
363
364
|
return null;
|
|
364
365
|
}
|
|
365
366
|
const getRequestEvent = voidFn;
|
|
367
|
+
const getTraceContext = voidFn;
|
|
366
368
|
function render(code, element, init, options = {}) {
|
|
367
369
|
let disposer;
|
|
368
370
|
registerDelegatedRoot(element);
|
|
369
371
|
try {
|
|
370
|
-
|
|
372
|
+
createRoot(dispose => {
|
|
371
373
|
disposer = dispose;
|
|
374
|
+
if (options.onError) getOwner()[ROOT_ERROR_HOOK] = options.onError;
|
|
372
375
|
if (element === document) {
|
|
373
376
|
const tree = code();
|
|
374
|
-
effect(() =>
|
|
377
|
+
effect(() => flatten(tree), () => {});
|
|
375
378
|
} else {
|
|
376
379
|
const tree = code();
|
|
377
380
|
insert(element, () => tree, element.firstChild ? null : undefined, init, {
|
|
@@ -382,7 +385,7 @@ function render(code, element, init, options = {}) {
|
|
|
382
385
|
}, {
|
|
383
386
|
id: options.renderId
|
|
384
387
|
});
|
|
385
|
-
|
|
388
|
+
flush();
|
|
386
389
|
} catch (err) {
|
|
387
390
|
if (disposer) disposer();
|
|
388
391
|
unregisterDelegatedRoot(element);
|
|
@@ -445,10 +448,27 @@ function unregisterDelegatedContainer(container, owner = container) {
|
|
|
445
448
|
}
|
|
446
449
|
function attachDelegatedEvent(name, container, state) {
|
|
447
450
|
if (state.handlers.has(name)) return;
|
|
448
|
-
const handler = e => eventHandler(e, container, state);
|
|
451
|
+
const handler = e => dispatchAsInteraction(e, () => eventHandler(e, container, state)) ;
|
|
449
452
|
state.handlers.set(name, handler);
|
|
450
453
|
container.addEventListener(name, handler);
|
|
451
454
|
}
|
|
455
|
+
function describeEventTarget(target) {
|
|
456
|
+
if (!target || typeof target.tagName !== "string") return undefined;
|
|
457
|
+
const tag = target.tagName.toLowerCase();
|
|
458
|
+
let out = tag;
|
|
459
|
+
if (target.id) out += `#${target.id}`;else if (typeof target.name === "string" && target.name) out += `[name=${target.name}]`;
|
|
460
|
+
if (tag !== "input" && tag !== "textarea" && tag !== "select") {
|
|
461
|
+
const text = (target.textContent || "").trim().replace(/\s+/g, " ");
|
|
462
|
+
if (text) out += ` "${text.length > 30 ? text.slice(0, 29) + "…" : text}"`;
|
|
463
|
+
}
|
|
464
|
+
return out;
|
|
465
|
+
}
|
|
466
|
+
function dispatchAsInteraction(e, fn) {
|
|
467
|
+
return OBSERVE.attribution.withInteraction({
|
|
468
|
+
type: e.type,
|
|
469
|
+
target: describeEventTarget(e.target)
|
|
470
|
+
}, fn);
|
|
471
|
+
}
|
|
452
472
|
function getDelegatedRoot(node) {
|
|
453
473
|
while (node) {
|
|
454
474
|
if (delegatedContainers.get(node)?.roots) return node;
|
|
@@ -564,7 +584,7 @@ function className(node, value, prev) {
|
|
|
564
584
|
}
|
|
565
585
|
function addEvent(node, name, handler, delegate) {
|
|
566
586
|
if (delegate) {
|
|
567
|
-
const key =
|
|
587
|
+
const key = EVENT_KEY + name;
|
|
568
588
|
let data;
|
|
569
589
|
if (Array.isArray(handler)) {
|
|
570
590
|
data = handler[1];
|
|
@@ -575,11 +595,16 @@ function addEvent(node, name, handler, delegate) {
|
|
|
575
595
|
}
|
|
576
596
|
if (Array.isArray(handler)) {
|
|
577
597
|
const handlerFn = handler[0];
|
|
578
|
-
const listener = e => handlerFn.call(node, handler[1], e);
|
|
598
|
+
const listener = e => dispatchAsInteraction(e, () => handlerFn.call(node, handler[1], e)) ;
|
|
579
599
|
listener[$$EVENT_TUPLE] = handler;
|
|
580
600
|
node.addEventListener(name, listener);
|
|
581
601
|
return listener;
|
|
582
602
|
}
|
|
603
|
+
if (typeof handler === "function") {
|
|
604
|
+
const listener = e => dispatchAsInteraction(e, () => handler.call(node, e));
|
|
605
|
+
node.addEventListener(name, listener);
|
|
606
|
+
return listener;
|
|
607
|
+
}
|
|
583
608
|
node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
584
609
|
return handler;
|
|
585
610
|
}
|
|
@@ -623,34 +648,122 @@ function style(node, value, prev) {
|
|
|
623
648
|
}
|
|
624
649
|
}
|
|
625
650
|
}
|
|
651
|
+
function readShallow(value) {
|
|
652
|
+
if (value === null || typeof value !== "object") return value;
|
|
653
|
+
if (Array.isArray(value)) return value.map(readShallow);
|
|
654
|
+
if (value[$PROXY] !== value) return value;
|
|
655
|
+
const keys = sourceKeys(value, SOURCE_PROXY);
|
|
656
|
+
const out = {};
|
|
657
|
+
for (let i = 0; i < keys.length; i++) {
|
|
658
|
+
const k = keys[i];
|
|
659
|
+
if (typeof k === "string") out[k] = value[k];
|
|
660
|
+
}
|
|
661
|
+
return out;
|
|
662
|
+
}
|
|
626
663
|
function setStyleProperty(node, name, value) {
|
|
627
664
|
if (isHydrating(node)) return;
|
|
628
665
|
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
629
666
|
}
|
|
630
|
-
function spread(node, props, skipChildren) {
|
|
667
|
+
function spread(node, props, skipChildren, skip) {
|
|
631
668
|
const prevProps = {};
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
669
|
+
const apply = newProps => {
|
|
670
|
+
const r = newProps.ref;
|
|
671
|
+
if (r !== prevProps.ref && (typeof r === "function" || Array.isArray(r))) ref(() => r, node);
|
|
672
|
+
assign(node, newProps, true, prevProps, true);
|
|
673
|
+
};
|
|
674
|
+
if (Array.isArray(props)) {
|
|
675
|
+
if (!skipChildren && !(skip !== undefined && skip("children"))) insert(node, () => {
|
|
676
|
+
for (let i = props.length - 1; i >= 0; i--) {
|
|
677
|
+
const s = resolveSource(props[i]);
|
|
678
|
+
if (s != null && entryHas(s, "children")) return entryGet(s, "children");
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
effect(() => collectSources({}, props, undefined, skip), apply);
|
|
682
|
+
return prevProps;
|
|
683
|
+
}
|
|
684
|
+
if (!skipChildren && !(skip !== undefined && skip("children"))) {
|
|
685
|
+
if (typeof props !== "function" && props != null && hasStaticKeys(props)) {
|
|
686
|
+
const desc = Object.getOwnPropertyDescriptor(props, "children");
|
|
687
|
+
if (desc !== undefined) {
|
|
688
|
+
if (desc.get === undefined) insert(node, desc.value);else insert(node, () => props.children);
|
|
689
|
+
}
|
|
690
|
+
} else insert(node, () => {
|
|
691
|
+
const source = resolveSource(props);
|
|
692
|
+
return source != null && entryHas(source, "children") ? entryGet(source, "children") : undefined;
|
|
693
|
+
});
|
|
694
|
+
}
|
|
642
695
|
effect(() => {
|
|
643
|
-
const source =
|
|
696
|
+
const source = resolveSource(props);
|
|
644
697
|
const newProps = {};
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
698
|
+
const table = resolvedTable(source);
|
|
699
|
+
if (table !== undefined) return collectTable(newProps, table, skip);
|
|
700
|
+
if (source != null) {
|
|
701
|
+
const view = viewOf(source);
|
|
702
|
+
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);
|
|
649
703
|
}
|
|
650
704
|
return newProps;
|
|
651
|
-
},
|
|
705
|
+
}, apply);
|
|
652
706
|
return prevProps;
|
|
653
707
|
}
|
|
708
|
+
function collectTable(out, table, skip) {
|
|
709
|
+
for (const [prop, leaf] of table) {
|
|
710
|
+
if (typeof prop !== "string" || prop === "children") continue;
|
|
711
|
+
if (skip !== undefined && skip(prop)) continue;
|
|
712
|
+
const v = leaf[prop];
|
|
713
|
+
out[prop] = prop === "style" || prop === "class" ? readShallow(v) : v;
|
|
714
|
+
}
|
|
715
|
+
return out;
|
|
716
|
+
}
|
|
717
|
+
function resolveSource(s) {
|
|
718
|
+
return typeof s === "function" ? s() : s;
|
|
719
|
+
}
|
|
720
|
+
function entryHas(s, key) {
|
|
721
|
+
const view = viewOf(s);
|
|
722
|
+
return view instanceof OmitView ? sourceHas(view, SOURCE_OMIT, key) : key in s;
|
|
723
|
+
}
|
|
724
|
+
function entryGet(s, key) {
|
|
725
|
+
const view = viewOf(s);
|
|
726
|
+
return view instanceof OmitView ? sourceGet(view, SOURCE_OMIT, key) : s[key];
|
|
727
|
+
}
|
|
728
|
+
function collectSources(out, sources, kinds, skip) {
|
|
729
|
+
const resolved = [];
|
|
730
|
+
const resolvedKinds = [];
|
|
731
|
+
for (let i = 0; i < sources.length; i++) pushEntry(resolved, resolvedKinds, sources[i], kinds !== undefined ? kinds[i] : SOURCE_MEMO);
|
|
732
|
+
for (let i = 0; i < resolved.length; i++) collectProps(out, resolved[i], resolvedKinds[i], skip, resolved, resolvedKinds, i + 1);
|
|
733
|
+
return out;
|
|
734
|
+
}
|
|
735
|
+
function pushEntry(resolved, kinds, s, kind) {
|
|
736
|
+
if (kind !== SOURCE_MEMO) {
|
|
737
|
+
resolved.push(s);
|
|
738
|
+
kinds.push(kind);
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
s = resolveSource(s);
|
|
742
|
+
if (s == null) return;
|
|
743
|
+
const view = viewOf(s);
|
|
744
|
+
if (view instanceof OmitView) {
|
|
745
|
+
resolved.push(view);
|
|
746
|
+
kinds.push(SOURCE_OMIT);
|
|
747
|
+
} else if (view !== undefined) {
|
|
748
|
+
const f = view.sources,
|
|
749
|
+
k = view.kinds;
|
|
750
|
+
for (let j = 0; j < f.length; j++) pushEntry(resolved, kinds, f[j], k[j]);
|
|
751
|
+
} else {
|
|
752
|
+
resolved.push(s);
|
|
753
|
+
kinds.push($PROXY in s ? SOURCE_PROXY : SOURCE_PLAIN);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
function collectProps(out, s, kind, skip, later, laterKinds, from) {
|
|
757
|
+
const keys = sourceKeys(s, kind);
|
|
758
|
+
outer: for (let i = 0; i < keys.length; i++) {
|
|
759
|
+
const prop = keys[i];
|
|
760
|
+
if (typeof prop !== "string" || prop === "children") continue;
|
|
761
|
+
if (skip !== undefined && skip(prop)) continue;
|
|
762
|
+
if (later !== undefined) for (let j = from; j < later.length; j++) if (sourceHas(later[j], laterKinds[j], prop)) continue outer;
|
|
763
|
+
const v = sourceGet(s, kind, prop);
|
|
764
|
+
out[prop] = prop === "style" || prop === "class" ? readShallow(v) : v;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
654
767
|
function dynamicProperty(props, key) {
|
|
655
768
|
const src = props[key];
|
|
656
769
|
Object.defineProperty(props, key, {
|
|
@@ -665,8 +778,8 @@ function applyRef(r, element) {
|
|
|
665
778
|
Array.isArray(r) ? r.flat(Infinity).forEach(f => f && f(element)) : r(element);
|
|
666
779
|
}
|
|
667
780
|
function ref(fn, element) {
|
|
668
|
-
const resolved =
|
|
669
|
-
|
|
781
|
+
const resolved = untrack(fn);
|
|
782
|
+
runWithOwner(null, () => applyRef(resolved, element));
|
|
670
783
|
}
|
|
671
784
|
function scope(fn) {
|
|
672
785
|
fn.$s = true;
|
|
@@ -680,13 +793,12 @@ function installHydrationRuntime() {
|
|
|
680
793
|
hydrationRt = {
|
|
681
794
|
claimInitial(parent, multi, initial) {
|
|
682
795
|
if (isHydrating(parent)) {
|
|
683
|
-
if (!multi && initial === undefined && parent) initial =
|
|
684
|
-
if (Array.isArray(initial)) stripTextSeparators(initial);
|
|
796
|
+
if (!multi && initial === undefined && parent) initial = claimChildNodes(parent);else if (Array.isArray(initial)) stripTextSeparators(initial);
|
|
685
797
|
}
|
|
686
798
|
return initial;
|
|
687
799
|
},
|
|
688
800
|
reclaimRegion(current, parent, marker) {
|
|
689
|
-
if (!
|
|
801
|
+
if (!sharedConfig.hydrating || !current || !parent.isConnected) return current;
|
|
690
802
|
const first = Array.isArray(current) ? current[0] : current;
|
|
691
803
|
if (!first || !first.nodeType || first.isConnected) return current;
|
|
692
804
|
let nodes;
|
|
@@ -705,11 +817,11 @@ function installHydrationRuntime() {
|
|
|
705
817
|
nodes.unshift(node);
|
|
706
818
|
node = node.previousSibling;
|
|
707
819
|
}
|
|
708
|
-
} else
|
|
820
|
+
} else return claimChildNodes(parent);
|
|
709
821
|
return stripTextSeparators(nodes);
|
|
710
822
|
},
|
|
711
823
|
dedupEvent(e) {
|
|
712
|
-
return !!(
|
|
824
|
+
return !!(sharedConfig.registry && sharedConfig.events && sharedConfig.events.find(([el, ev]) => ev === e));
|
|
713
825
|
}
|
|
714
826
|
};
|
|
715
827
|
}
|
|
@@ -718,19 +830,36 @@ function stripTextSeparators(nodes) {
|
|
|
718
830
|
for (let i = 0; i < nodes.length; i++) {
|
|
719
831
|
const node = nodes[i],
|
|
720
832
|
t = node.nodeType;
|
|
721
|
-
if (t === 8) {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
if (v.startsWith("pl-")) continue;
|
|
728
|
-
} else if (t === 1 && node.localName === "template" && node.id.startsWith("pl-")) continue;
|
|
833
|
+
if (t === 8 && node.nodeValue === "!$") {
|
|
834
|
+
node.remove();
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
if (isPlaceholderScaffolding(node, t)) continue;
|
|
729
838
|
nodes[j++] = node;
|
|
730
839
|
}
|
|
731
840
|
nodes.length = j;
|
|
732
841
|
return nodes;
|
|
733
842
|
}
|
|
843
|
+
function claimChildNodes(parent) {
|
|
844
|
+
const live = parent.childNodes;
|
|
845
|
+
const out = [];
|
|
846
|
+
for (let i = 0, n = live.length; i < n; i++) {
|
|
847
|
+
const node = live[i],
|
|
848
|
+
t = node.nodeType;
|
|
849
|
+
if (t === 8 && node.nodeValue === "!$") {
|
|
850
|
+
node.remove();
|
|
851
|
+
i--;
|
|
852
|
+
n--;
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
if (isPlaceholderScaffolding(node, t)) continue;
|
|
856
|
+
out.push(node);
|
|
857
|
+
}
|
|
858
|
+
return out;
|
|
859
|
+
}
|
|
860
|
+
function isPlaceholderScaffolding(node, t) {
|
|
861
|
+
return t === 8 ? node.nodeValue.startsWith("pl-") : t === 1 && node.localName === "template" && node.id.startsWith("pl-");
|
|
862
|
+
}
|
|
734
863
|
function insert(parent, accessor, marker, initial, options) {
|
|
735
864
|
const multi = marker !== undefined;
|
|
736
865
|
const host = options && options.host;
|
|
@@ -1021,7 +1150,7 @@ function scheduleHeadApply() {
|
|
|
1021
1150
|
queueMicrotask(flushHeadRegistry);
|
|
1022
1151
|
}
|
|
1023
1152
|
function flushHeadRegistry() {
|
|
1024
|
-
if (
|
|
1153
|
+
if (sharedConfig.hydrating) {
|
|
1025
1154
|
setTimeout(flushHeadRegistry, 0);
|
|
1026
1155
|
return;
|
|
1027
1156
|
}
|
|
@@ -1214,7 +1343,7 @@ function loadModuleAssets(mapping) {
|
|
|
1214
1343
|
return pending.length ? Promise.all(pending).then(() => {}) : undefined;
|
|
1215
1344
|
}
|
|
1216
1345
|
function hydrate(code, element, options = {}) {
|
|
1217
|
-
|
|
1346
|
+
enableHydration();
|
|
1218
1347
|
installHydrationRuntime();
|
|
1219
1348
|
if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);
|
|
1220
1349
|
const head = (element.nodeType === 9 ? element : element.ownerDocument).head;
|
|
@@ -1229,13 +1358,13 @@ function hydrate(code, element, options = {}) {
|
|
|
1229
1358
|
options.renderId ||= "";
|
|
1230
1359
|
if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
|
|
1231
1360
|
if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1361
|
+
sharedConfig.completed = globalThis._$HY.completed;
|
|
1362
|
+
sharedConfig.events = globalThis._$HY.events;
|
|
1363
|
+
sharedConfig.load = id => globalThis._$HY.r[id];
|
|
1364
|
+
sharedConfig.has = id => id in globalThis._$HY.r;
|
|
1365
|
+
sharedConfig.gather = root => gatherHydratable(element, root);
|
|
1366
|
+
sharedConfig.loadModuleAssets = loadModuleAssets;
|
|
1367
|
+
sharedConfig.cleanupFragment = id => {
|
|
1239
1368
|
const tpl = document.getElementById("pl-" + id);
|
|
1240
1369
|
if (tpl) {
|
|
1241
1370
|
let node = tpl.nextSibling;
|
|
@@ -1251,37 +1380,41 @@ function hydrate(code, element, options = {}) {
|
|
|
1251
1380
|
tpl.remove();
|
|
1252
1381
|
}
|
|
1253
1382
|
};
|
|
1254
|
-
|
|
1255
|
-
if (!
|
|
1256
|
-
|
|
1257
|
-
if (
|
|
1258
|
-
registry:
|
|
1259
|
-
gather:
|
|
1383
|
+
sharedConfig.registry = new Map();
|
|
1384
|
+
if (!sharedConfig.boundaryScopes) sharedConfig.boundaryScopes = new Map();
|
|
1385
|
+
sharedConfig.captureBoundaryScope = id => {
|
|
1386
|
+
if (sharedConfig.registry) sharedConfig.boundaryScopes.set(id, {
|
|
1387
|
+
registry: sharedConfig.registry,
|
|
1388
|
+
gather: sharedConfig.gather
|
|
1260
1389
|
});
|
|
1261
1390
|
};
|
|
1262
|
-
|
|
1391
|
+
sharedConfig.hydrating = true;
|
|
1263
1392
|
const hyr = globalThis._$HY.r;
|
|
1264
1393
|
const rootMapping = hyr && (hyr[options.renderId + "_assets"] || hyr["_assets"]);
|
|
1265
1394
|
if (rootMapping && typeof rootMapping === "object") {
|
|
1266
1395
|
const p = loadModuleAssets(rootMapping);
|
|
1267
1396
|
if (p) {
|
|
1268
1397
|
gatherHydratable(element, options.renderId);
|
|
1269
|
-
const registry =
|
|
1270
|
-
const gather =
|
|
1398
|
+
const registry = sharedConfig.registry;
|
|
1399
|
+
const gather = sharedConfig.gather;
|
|
1271
1400
|
let disposer;
|
|
1272
1401
|
p.then(() => {
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1402
|
+
sharedConfig.registry = registry;
|
|
1403
|
+
sharedConfig.gather = gather;
|
|
1404
|
+
sharedConfig.hydrating = true;
|
|
1276
1405
|
try {
|
|
1277
1406
|
disposer = render(code, element, [...element.childNodes], options);
|
|
1278
1407
|
} finally {
|
|
1279
|
-
|
|
1408
|
+
sharedConfig.hydrating = false;
|
|
1280
1409
|
}
|
|
1281
1410
|
}, err => {
|
|
1411
|
+
sharedConfig.hydrating = false;
|
|
1412
|
+
sharedConfig.registry = undefined;
|
|
1413
|
+
if (element.nodeType === 9) {
|
|
1414
|
+
(globalThis.reportError || console.error)(err);
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1282
1417
|
console.error("Hydration module preload failed, falling back to client render:", err);
|
|
1283
|
-
solidJs.sharedConfig.hydrating = false;
|
|
1284
|
-
solidJs.sharedConfig.registry = undefined;
|
|
1285
1418
|
disposer = render(code, element, [...element.childNodes], options);
|
|
1286
1419
|
});
|
|
1287
1420
|
return () => disposer && disposer();
|
|
@@ -1291,21 +1424,21 @@ function hydrate(code, element, options = {}) {
|
|
|
1291
1424
|
gatherHydratable(element, options.renderId);
|
|
1292
1425
|
return render(code, element, [...element.childNodes], options);
|
|
1293
1426
|
} finally {
|
|
1294
|
-
|
|
1427
|
+
sharedConfig.hydrating = false;
|
|
1295
1428
|
}
|
|
1296
1429
|
}
|
|
1297
1430
|
function getNextElement(template) {
|
|
1298
1431
|
let node,
|
|
1299
1432
|
key,
|
|
1300
1433
|
hydrating = isHydrating();
|
|
1301
|
-
if (!hydrating || !(node =
|
|
1434
|
+
if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
1302
1435
|
if (!template) {
|
|
1303
1436
|
throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);
|
|
1304
1437
|
}
|
|
1305
1438
|
return template(true);
|
|
1306
1439
|
}
|
|
1307
|
-
if (
|
|
1308
|
-
|
|
1440
|
+
if (sharedConfig.completed) sharedConfig.completed.add(node);
|
|
1441
|
+
sharedConfig.registry.delete(key);
|
|
1309
1442
|
return node;
|
|
1310
1443
|
}
|
|
1311
1444
|
function getNextMatch(el, nodeName) {
|
|
@@ -1340,12 +1473,12 @@ function getNextSibling(node, expectedTag) {
|
|
|
1340
1473
|
return sibling;
|
|
1341
1474
|
}
|
|
1342
1475
|
function runHydrationEvents() {
|
|
1343
|
-
if (
|
|
1476
|
+
if (sharedConfig.events && !sharedConfig.events.queued) {
|
|
1344
1477
|
queueMicrotask(() => {
|
|
1345
1478
|
const {
|
|
1346
1479
|
completed,
|
|
1347
1480
|
events
|
|
1348
|
-
} =
|
|
1481
|
+
} = sharedConfig;
|
|
1349
1482
|
if (!events) return;
|
|
1350
1483
|
events.queued = false;
|
|
1351
1484
|
while (events.length) {
|
|
@@ -1379,18 +1512,19 @@ function runHydrationEvents() {
|
|
|
1379
1512
|
for (let i = 0; i < matches.length; i++) eventHandler(e, matches[i].container, matches[i].state);
|
|
1380
1513
|
} else if (matchContainer) eventHandler(e, matchContainer, matchState);
|
|
1381
1514
|
}
|
|
1382
|
-
if (
|
|
1383
|
-
|
|
1384
|
-
|
|
1515
|
+
if (sharedConfig.done) {
|
|
1516
|
+
sharedConfig.events = _$HY.events = null;
|
|
1517
|
+
sharedConfig.completed = _$HY.completed = null;
|
|
1385
1518
|
}
|
|
1386
1519
|
});
|
|
1387
|
-
|
|
1520
|
+
sharedConfig.events.queued = true;
|
|
1388
1521
|
}
|
|
1389
1522
|
}
|
|
1390
1523
|
function isHydrating(node) {
|
|
1391
|
-
if (!
|
|
1524
|
+
if (!sharedConfig.hydrating) return false;
|
|
1525
|
+
if (sharedConfig.isClaiming && !sharedConfig.isClaiming()) return false;
|
|
1392
1526
|
if (!node || node.isConnected) return true;
|
|
1393
|
-
const roots =
|
|
1527
|
+
const roots = sharedConfig.claimRoots;
|
|
1394
1528
|
if (roots) {
|
|
1395
1529
|
for (let i = 0; i < roots.length; i++) {
|
|
1396
1530
|
if (roots[i].contains(node)) return true;
|
|
@@ -1468,7 +1602,7 @@ function eventHandler(e, container, state) {
|
|
|
1468
1602
|
if (owner && owner === resumeNode) return;
|
|
1469
1603
|
e[$$EVENT_OWNER] = owner || true;
|
|
1470
1604
|
let node = resumeNode || e.target;
|
|
1471
|
-
const key =
|
|
1605
|
+
const key = EVENT_KEY + e.type;
|
|
1472
1606
|
const oriTarget = e.target;
|
|
1473
1607
|
const boundary = owner || container || e.currentTarget;
|
|
1474
1608
|
const retarget = value => Object.defineProperty(e, "target", {
|
|
@@ -1592,13 +1726,13 @@ function insertExpression(parent, value, current, marker) {
|
|
|
1592
1726
|
return value;
|
|
1593
1727
|
}
|
|
1594
1728
|
function normalize(value, current, multi, doNotUnwrap) {
|
|
1595
|
-
value =
|
|
1729
|
+
value = flatten(value, {
|
|
1596
1730
|
skipNonRendered: true,
|
|
1597
1731
|
doNotUnwrap
|
|
1598
1732
|
});
|
|
1599
1733
|
if (doNotUnwrap && typeof value === "function") return value;
|
|
1600
1734
|
if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
|
|
1601
|
-
if (
|
|
1735
|
+
if (sharedConfig.hydrating && Array.isArray(value)) {
|
|
1602
1736
|
for (let i = 0, len = value.length; i < len; i++) {
|
|
1603
1737
|
const item = value[i],
|
|
1604
1738
|
prev = current && current[i],
|
|
@@ -1669,23 +1803,33 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
1669
1803
|
}
|
|
1670
1804
|
function gatherHydratable(element, root) {
|
|
1671
1805
|
const templates = element.querySelectorAll(`*[_hk]`);
|
|
1806
|
+
const frames = root ? null : element.querySelectorAll("[data-fid]");
|
|
1807
|
+
const frameCount = frames ? frames.length : 0;
|
|
1808
|
+
const registry = sharedConfig.registry;
|
|
1672
1809
|
for (let i = 0; i < templates.length; i++) {
|
|
1673
1810
|
const node = templates[i];
|
|
1674
1811
|
const key = node.getAttribute("_hk");
|
|
1675
1812
|
if (root) {
|
|
1676
1813
|
if (!key.startsWith(root)) continue;
|
|
1677
|
-
} else {
|
|
1678
|
-
|
|
1679
|
-
|
|
1814
|
+
} else if (frameCount !== 0) {
|
|
1815
|
+
let inFrame = false;
|
|
1816
|
+
for (let j = 0; j < frameCount; j++) {
|
|
1817
|
+
if (frames[j].contains(node)) {
|
|
1818
|
+
inFrame = true;
|
|
1819
|
+
break;
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
if (inFrame) continue;
|
|
1680
1823
|
}
|
|
1681
|
-
if (!
|
|
1824
|
+
if (!registry.has(key)) registry.set(key, node);
|
|
1682
1825
|
}
|
|
1683
1826
|
}
|
|
1684
1827
|
function getHydrationKey() {
|
|
1685
|
-
return
|
|
1828
|
+
return sharedConfig.getNextContextId();
|
|
1686
1829
|
}
|
|
1687
1830
|
const RequestContext = Symbol();
|
|
1688
1831
|
|
|
1832
|
+
function configureServerErrors(_config) {}
|
|
1689
1833
|
function throwInBrowser(func) {
|
|
1690
1834
|
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
1691
1835
|
console.error(err);
|
|
@@ -1715,14 +1859,14 @@ function composeMiddleware(middlewares) {
|
|
|
1715
1859
|
throwInBrowser(composeMiddleware);
|
|
1716
1860
|
}
|
|
1717
1861
|
function ssr(template, ...nodes) {}
|
|
1718
|
-
function ssrElement(name, props, children, needsId) {}
|
|
1862
|
+
function ssrElement(name, props, children, needsId, skip) {}
|
|
1719
1863
|
function ssrClassName(value) {}
|
|
1720
1864
|
function ssrStyle(value) {}
|
|
1721
1865
|
function ssrStyleProperty(name, value) {}
|
|
1722
1866
|
function ssrAttribute(key, value) {}
|
|
1723
1867
|
function ssrGroup(fn, n) {}
|
|
1724
1868
|
function ssrHydrationKey() {}
|
|
1725
|
-
function resolveSSRNode(node, result, top) {}
|
|
1869
|
+
function resolveSSRNode(node, result, top, nested) {}
|
|
1726
1870
|
function escape(s, attr) {}
|
|
1727
1871
|
|
|
1728
1872
|
const ENVELOPE = Symbol.for("solid.ResponseEnvelope");
|
|
@@ -1759,6 +1903,7 @@ function isSafeError(value) {
|
|
|
1759
1903
|
return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
|
|
1760
1904
|
}
|
|
1761
1905
|
const REVALIDATE_HEADER = "X-Revalidate";
|
|
1906
|
+
const REVALIDATE_ALL = "*";
|
|
1762
1907
|
const RESPONSE_HEADER_VALUE_LIMIT = 4096;
|
|
1763
1908
|
function initWithRevalidate(init = {}) {
|
|
1764
1909
|
const resolved = typeof init === "number" ? {
|
|
@@ -1781,7 +1926,11 @@ function initWithRevalidate(init = {}) {
|
|
|
1781
1926
|
headers = new Headers(responseInit.headers);
|
|
1782
1927
|
}
|
|
1783
1928
|
if (revalidate !== undefined) {
|
|
1784
|
-
const
|
|
1929
|
+
const list = Array.isArray(revalidate) ? revalidate : [revalidate];
|
|
1930
|
+
if (list.length > 1 && list.includes(REVALIDATE_ALL)) {
|
|
1931
|
+
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.`);
|
|
1932
|
+
}
|
|
1933
|
+
const keys = list.join(",");
|
|
1785
1934
|
if (keys.length > RESPONSE_HEADER_VALUE_LIMIT) {
|
|
1786
1935
|
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.`);
|
|
1787
1936
|
}
|
|
@@ -1848,22 +1997,22 @@ function respond(value, init = {}) {
|
|
|
1848
1997
|
const isServer = false;
|
|
1849
1998
|
const isDev = false;
|
|
1850
1999
|
function Portal(props) {
|
|
1851
|
-
return
|
|
2000
|
+
return runWithOwner(createOwner(), () => portalImpl(props));
|
|
1852
2001
|
}
|
|
1853
2002
|
function portalImpl(props) {
|
|
1854
2003
|
const treeMarker = document.createTextNode(""),
|
|
1855
2004
|
startMarker = document.createTextNode(""),
|
|
1856
2005
|
endMarker = document.createTextNode(""),
|
|
1857
2006
|
mount = () => props.mount || document.body,
|
|
1858
|
-
content =
|
|
2007
|
+
content = createMemo(() => [startMarker, props.children], {
|
|
1859
2008
|
ssrSource: "client",
|
|
1860
2009
|
loadingValue: undefined
|
|
1861
2010
|
});
|
|
1862
|
-
|
|
1863
|
-
() => [mount(), content(),
|
|
1864
|
-
const m =
|
|
2011
|
+
createRenderEffect(
|
|
2012
|
+
() => [mount(), content(), getOwner()], ([, c, owner]) => {
|
|
2013
|
+
const m = untrack(mount);
|
|
1865
2014
|
m.appendChild(endMarker);
|
|
1866
|
-
const dispose =
|
|
2015
|
+
const dispose = runWithOwner(owner, () => createRoot(d => {
|
|
1867
2016
|
insert(m, c, endMarker, undefined, {
|
|
1868
2017
|
host: () => treeMarker.parentNode
|
|
1869
2018
|
});
|
|
@@ -1884,8 +2033,8 @@ function portalImpl(props) {
|
|
|
1884
2033
|
schedule: true,
|
|
1885
2034
|
ssrSource: "client"
|
|
1886
2035
|
});
|
|
1887
|
-
|
|
1888
|
-
const m =
|
|
2036
|
+
createEffect(mount, () => {
|
|
2037
|
+
const m = untrack(mount);
|
|
1889
2038
|
const ownerRoot = getDelegatedRoot(treeMarker);
|
|
1890
2039
|
if (!ownerRoot || ownerRoot.contains(m)) return;
|
|
1891
2040
|
registerDelegatedContainer(m, ownerRoot);
|
|
@@ -1893,7 +2042,7 @@ function portalImpl(props) {
|
|
|
1893
2042
|
}, {
|
|
1894
2043
|
ssrSource: "client"
|
|
1895
2044
|
});
|
|
1896
|
-
if (
|
|
2045
|
+
if (sharedConfig.hydrating) return createMemo(() => treeMarker, {
|
|
1897
2046
|
ssrSource: "client",
|
|
1898
2047
|
loadingValue: undefined
|
|
1899
2048
|
});
|
|
@@ -1903,7 +2052,8 @@ const COMPONENT_BINDING = Symbol.for("solid.component-binding");
|
|
|
1903
2052
|
function bindingOf(value) {
|
|
1904
2053
|
return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
|
|
1905
2054
|
}
|
|
1906
|
-
function dynamic(source,
|
|
2055
|
+
function dynamic(source, options) {
|
|
2056
|
+
if (options?.static) return staticDynamic(untrack(source));
|
|
1907
2057
|
let latest = 0;
|
|
1908
2058
|
const sites = new Set();
|
|
1909
2059
|
let deliveredAddress;
|
|
@@ -1918,7 +2068,7 @@ function dynamic(source, _options) {
|
|
|
1918
2068
|
}
|
|
1919
2069
|
return next;
|
|
1920
2070
|
};
|
|
1921
|
-
const cached =
|
|
2071
|
+
const cached = createMemo(prev => {
|
|
1922
2072
|
const next = source();
|
|
1923
2073
|
if (!next || typeof next.then !== "function") return resolveBinding(next, prev);
|
|
1924
2074
|
const token = ++latest;
|
|
@@ -1929,34 +2079,53 @@ function dynamic(source, _options) {
|
|
|
1929
2079
|
lazy: true
|
|
1930
2080
|
});
|
|
1931
2081
|
return props => {
|
|
1932
|
-
return
|
|
2082
|
+
return createMemo(() => {
|
|
1933
2083
|
const component = cached();
|
|
1934
2084
|
switch (typeof component) {
|
|
1935
2085
|
case "function":
|
|
1936
2086
|
{
|
|
1937
2087
|
const binding = bindingOf(component);
|
|
1938
2088
|
if (binding) {
|
|
1939
|
-
const [address, setAddress] =
|
|
2089
|
+
const [address, setAddress] = createSignal(deliveredAddress ?? binding.address);
|
|
1940
2090
|
sites.add(setAddress);
|
|
1941
|
-
|
|
1942
|
-
return
|
|
2091
|
+
onCleanup(() => sites.delete(setAddress));
|
|
2092
|
+
return untrack(() => binding.component(props, address));
|
|
1943
2093
|
}
|
|
1944
|
-
return
|
|
2094
|
+
return untrack(() => component(props));
|
|
1945
2095
|
}
|
|
1946
2096
|
case "string":
|
|
1947
|
-
|
|
1948
|
-
spread(el, props);
|
|
1949
|
-
return el;
|
|
2097
|
+
return staticElement(component, props);
|
|
1950
2098
|
}
|
|
1951
2099
|
});
|
|
1952
2100
|
};
|
|
1953
2101
|
}
|
|
2102
|
+
function staticDynamic(component) {
|
|
2103
|
+
if (typeof component === "function") {
|
|
2104
|
+
const binding = bindingOf(component);
|
|
2105
|
+
if (binding) {
|
|
2106
|
+
const address = () => binding.address;
|
|
2107
|
+
return props => untrack(() => binding.component(props, address));
|
|
2108
|
+
}
|
|
2109
|
+
return props => untrack(() => component(props));
|
|
2110
|
+
}
|
|
2111
|
+
if (typeof component === "string") return props => staticElement(component, props);
|
|
2112
|
+
return () => undefined;
|
|
2113
|
+
}
|
|
2114
|
+
function staticElement(tag, props) {
|
|
2115
|
+
const hydrating = sharedConfig.hydrating;
|
|
2116
|
+
const el = hydrating ? getNextElement() : createElement(tag, untrack(() => props.is), untrack(() => props.xmlns));
|
|
2117
|
+
spread(el, props);
|
|
2118
|
+
if (hydrating) runHydrationEvents();
|
|
2119
|
+
return el;
|
|
2120
|
+
}
|
|
1954
2121
|
function Dynamic(props) {
|
|
1955
2122
|
const Comp = dynamic(() => props.component);
|
|
1956
|
-
return
|
|
2123
|
+
return createComponent(Comp, omit(props, "component"));
|
|
1957
2124
|
}
|
|
1958
|
-
function createElement(tagName, is = undefined) {
|
|
1959
|
-
return
|
|
2125
|
+
function createElement(tagName, is = undefined, xmlns = undefined) {
|
|
2126
|
+
return xmlns ? document.createElementNS(xmlns, tagName, {
|
|
2127
|
+
is
|
|
2128
|
+
}) : SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
1960
2129
|
is
|
|
1961
2130
|
});
|
|
1962
2131
|
}
|
|
@@ -1965,21 +2134,21 @@ function loadClientOnly(fn, setComp, exportName) {
|
|
|
1965
2134
|
}
|
|
1966
2135
|
function clientOnly(fn, options = {},
|
|
1967
2136
|
_moduleUrl) {
|
|
1968
|
-
const [comp, setComp] =
|
|
2137
|
+
const [comp, setComp] = createSignal();
|
|
1969
2138
|
let started = !options.lazy;
|
|
1970
2139
|
started && loadClientOnly(fn, setComp, options.export);
|
|
1971
2140
|
return props => {
|
|
1972
2141
|
let Comp;
|
|
1973
2142
|
let m;
|
|
1974
|
-
const rest =
|
|
2143
|
+
const rest = omit(props, "fallback");
|
|
1975
2144
|
if (!started) {
|
|
1976
2145
|
started = true;
|
|
1977
2146
|
loadClientOnly(fn, setComp, options.export);
|
|
1978
2147
|
}
|
|
1979
|
-
if ((Comp =
|
|
1980
|
-
const [mounted, setMounted] =
|
|
1981
|
-
const gate =
|
|
1982
|
-
const onHydrationEnd =
|
|
2148
|
+
if ((Comp = untrack(comp)) && !sharedConfig.hydrating) return Comp(rest);
|
|
2149
|
+
const [mounted, setMounted] = createSignal(!sharedConfig.hydrating);
|
|
2150
|
+
const gate = createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
|
|
2151
|
+
const onHydrationEnd = sharedConfig.onHydrationEnd;
|
|
1983
2152
|
const release = () => setMounted(true);
|
|
1984
2153
|
onHydrationEnd ? onHydrationEnd(release) : queueMicrotask(release);
|
|
1985
2154
|
return gate;
|
|
@@ -1988,158 +2157,4 @@ _moduleUrl) {
|
|
|
1988
2157
|
function httpStatus(_code, _text) {}
|
|
1989
2158
|
function httpHeader(_name, _value, _options) {}
|
|
1990
2159
|
|
|
1991
|
-
|
|
1992
|
-
enumerable: true,
|
|
1993
|
-
get: function () { return solidJs.Errored; }
|
|
1994
|
-
});
|
|
1995
|
-
Object.defineProperty(exports, "For", {
|
|
1996
|
-
enumerable: true,
|
|
1997
|
-
get: function () { return solidJs.For; }
|
|
1998
|
-
});
|
|
1999
|
-
Object.defineProperty(exports, "Hydration", {
|
|
2000
|
-
enumerable: true,
|
|
2001
|
-
get: function () { return solidJs.Hydration; }
|
|
2002
|
-
});
|
|
2003
|
-
Object.defineProperty(exports, "Loading", {
|
|
2004
|
-
enumerable: true,
|
|
2005
|
-
get: function () { return solidJs.Loading; }
|
|
2006
|
-
});
|
|
2007
|
-
Object.defineProperty(exports, "Match", {
|
|
2008
|
-
enumerable: true,
|
|
2009
|
-
get: function () { return solidJs.Match; }
|
|
2010
|
-
});
|
|
2011
|
-
Object.defineProperty(exports, "NoHydration", {
|
|
2012
|
-
enumerable: true,
|
|
2013
|
-
get: function () { return solidJs.NoHydration; }
|
|
2014
|
-
});
|
|
2015
|
-
Object.defineProperty(exports, "Repeat", {
|
|
2016
|
-
enumerable: true,
|
|
2017
|
-
get: function () { return solidJs.Repeat; }
|
|
2018
|
-
});
|
|
2019
|
-
Object.defineProperty(exports, "Reveal", {
|
|
2020
|
-
enumerable: true,
|
|
2021
|
-
get: function () { return solidJs.Reveal; }
|
|
2022
|
-
});
|
|
2023
|
-
Object.defineProperty(exports, "Show", {
|
|
2024
|
-
enumerable: true,
|
|
2025
|
-
get: function () { return solidJs.Show; }
|
|
2026
|
-
});
|
|
2027
|
-
Object.defineProperty(exports, "Switch", {
|
|
2028
|
-
enumerable: true,
|
|
2029
|
-
get: function () { return solidJs.Switch; }
|
|
2030
|
-
});
|
|
2031
|
-
Object.defineProperty(exports, "createComponent", {
|
|
2032
|
-
enumerable: true,
|
|
2033
|
-
get: function () { return solidJs.createComponent; }
|
|
2034
|
-
});
|
|
2035
|
-
Object.defineProperty(exports, "getOwner", {
|
|
2036
|
-
enumerable: true,
|
|
2037
|
-
get: function () { return solidJs.getOwner; }
|
|
2038
|
-
});
|
|
2039
|
-
Object.defineProperty(exports, "mergeProps", {
|
|
2040
|
-
enumerable: true,
|
|
2041
|
-
get: function () { return solidJs.merge; }
|
|
2042
|
-
});
|
|
2043
|
-
Object.defineProperty(exports, "untrack", {
|
|
2044
|
-
enumerable: true,
|
|
2045
|
-
get: function () { return solidJs.untrack; }
|
|
2046
|
-
});
|
|
2047
|
-
exports.ChildProperties = ChildProperties;
|
|
2048
|
-
exports.DOMElements = DOMElements;
|
|
2049
|
-
exports.DOMWithState = DOMWithState;
|
|
2050
|
-
exports.DelegatedEvents = DelegatedEvents;
|
|
2051
|
-
exports.Dynamic = Dynamic;
|
|
2052
|
-
exports.HREF = HREF;
|
|
2053
|
-
exports.HydrationScript = HydrationScript;
|
|
2054
|
-
exports.MathMLElements = MathMLElements;
|
|
2055
|
-
exports.NULL_BODY_STATUSES = NULL_BODY_STATUSES;
|
|
2056
|
-
exports.Namespaces = Namespaces;
|
|
2057
|
-
exports.Portal = Portal;
|
|
2058
|
-
exports.RESPONSE_HEADER_VALUE_LIMIT = RESPONSE_HEADER_VALUE_LIMIT;
|
|
2059
|
-
exports.REVALIDATE_HEADER = REVALIDATE_HEADER;
|
|
2060
|
-
exports.RawTextElements = RawTextElements;
|
|
2061
|
-
exports.RequestContext = RequestContext;
|
|
2062
|
-
exports.ResponseEnvelope = ResponseEnvelope;
|
|
2063
|
-
exports.SAFE_ERROR = SAFE_ERROR;
|
|
2064
|
-
exports.SVGElements = SVGElements;
|
|
2065
|
-
exports.VoidElements = VoidElements;
|
|
2066
|
-
exports.acquireAsset = acquireAsset;
|
|
2067
|
-
exports.addEvent = addEvent;
|
|
2068
|
-
exports.applyRef = applyRef;
|
|
2069
|
-
exports.assign = assign;
|
|
2070
|
-
exports.claimElement = claimElement;
|
|
2071
|
-
exports.claimElementTree = claimElementTree;
|
|
2072
|
-
exports.className = className;
|
|
2073
|
-
exports.clearFlashCookie = clearFlashCookie;
|
|
2074
|
-
exports.clientOnly = clientOnly;
|
|
2075
|
-
exports.commitEventResponse = commitEventResponse;
|
|
2076
|
-
exports.composeMiddleware = composeMiddleware;
|
|
2077
|
-
exports.createRequestEvent = createRequestEvent;
|
|
2078
|
-
exports.createResponseStub = createResponseStub;
|
|
2079
|
-
exports.createSSRResponse = createSSRResponse;
|
|
2080
|
-
exports.delegateEvents = delegateEvents;
|
|
2081
|
-
exports.dynamic = dynamic;
|
|
2082
|
-
exports.dynamicProperty = dynamicProperty;
|
|
2083
|
-
exports.effect = effect;
|
|
2084
|
-
exports.escape = escape;
|
|
2085
|
-
exports.generateHydrationScript = generateHydrationScript;
|
|
2086
|
-
exports.getDelegatedRoot = getDelegatedRoot;
|
|
2087
|
-
exports.getExpectedRedirectStatus = getExpectedRedirectStatus;
|
|
2088
|
-
exports.getFirstChild = getFirstChild;
|
|
2089
|
-
exports.getHydrationKey = getHydrationKey;
|
|
2090
|
-
exports.getNextElement = getNextElement;
|
|
2091
|
-
exports.getNextMarker = getNextMarker;
|
|
2092
|
-
exports.getNextMatch = getNextMatch;
|
|
2093
|
-
exports.getNextSibling = getNextSibling;
|
|
2094
|
-
exports.getRequestEvent = getRequestEvent;
|
|
2095
|
-
exports.getServerFunctionMetadata = getServerFunctionMetadata;
|
|
2096
|
-
exports.getServerFunctionRPC = getServerFunctionRPC;
|
|
2097
|
-
exports.hasFlashCookie = hasFlashCookie;
|
|
2098
|
-
exports.httpHeader = httpHeader;
|
|
2099
|
-
exports.httpStatus = httpStatus;
|
|
2100
|
-
exports.hydrate = hydrate;
|
|
2101
|
-
exports.insert = insert;
|
|
2102
|
-
exports.installHydrationRuntime = installHydrationRuntime;
|
|
2103
|
-
exports.isDev = isDev;
|
|
2104
|
-
exports.isHref = isHref;
|
|
2105
|
-
exports.isResponseEnvelope = isResponseEnvelope;
|
|
2106
|
-
exports.isSafeError = isSafeError;
|
|
2107
|
-
exports.isServer = isServer;
|
|
2108
|
-
exports.isServerFunction = isServerFunction;
|
|
2109
|
-
exports.markSafeError = markSafeError;
|
|
2110
|
-
exports.memo = memo;
|
|
2111
|
-
exports.parseCookieHeader = parseCookieHeader;
|
|
2112
|
-
exports.redirect = redirect;
|
|
2113
|
-
exports.ref = ref;
|
|
2114
|
-
exports.registerDelegatedContainer = registerDelegatedContainer;
|
|
2115
|
-
exports.registerDelegatedRoot = registerDelegatedRoot;
|
|
2116
|
-
exports.registerElementClaim = registerElementClaim;
|
|
2117
|
-
exports.reload = reload;
|
|
2118
|
-
exports.render = render;
|
|
2119
|
-
exports.renderToStream = renderToStream;
|
|
2120
|
-
exports.renderToString = renderToString;
|
|
2121
|
-
exports.resolveSSRNode = resolveSSRNode;
|
|
2122
|
-
exports.respond = respond;
|
|
2123
|
-
exports.runHydrationEvents = runHydrationEvents;
|
|
2124
|
-
exports.scope = scope;
|
|
2125
|
-
exports.serializeCookie = serializeCookie;
|
|
2126
|
-
exports.setAttribute = setAttribute;
|
|
2127
|
-
exports.setAttributeNS = setAttributeNS;
|
|
2128
|
-
exports.setProperty = setProperty;
|
|
2129
|
-
exports.setStyleProperty = setStyleProperty;
|
|
2130
|
-
exports.spread = spread;
|
|
2131
|
-
exports.ssr = ssr;
|
|
2132
|
-
exports.ssrAttribute = ssrAttribute;
|
|
2133
|
-
exports.ssrClassName = ssrClassName;
|
|
2134
|
-
exports.ssrElement = ssrElement;
|
|
2135
|
-
exports.ssrGroup = ssrGroup;
|
|
2136
|
-
exports.ssrHydrationKey = ssrHydrationKey;
|
|
2137
|
-
exports.ssrStyle = ssrStyle;
|
|
2138
|
-
exports.ssrStyleProperty = ssrStyleProperty;
|
|
2139
|
-
exports.style = style;
|
|
2140
|
-
exports.template = template;
|
|
2141
|
-
exports.unregisterDelegatedContainer = unregisterDelegatedContainer;
|
|
2142
|
-
exports.unregisterDelegatedRoot = unregisterDelegatedRoot;
|
|
2143
|
-
exports.useHead = useHead;
|
|
2144
|
-
exports.waitAsset = waitAsset;
|
|
2145
|
-
exports.warmAsset = warmAsset;
|
|
2160
|
+
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 };
|