@solidjs/web 2.0.0-beta.0 → 2.0.0-beta.1
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/dev.cjs +16 -13
- package/dist/dev.js +10 -13
- package/dist/server.cjs +12 -26
- package/dist/server.js +6 -26
- package/dist/web.cjs +16 -13
- package/dist/web.js +10 -13
- package/package.json +3 -3
- package/storage/types/src/index.d.ts +1 -1
- package/types/client.d.ts +0 -2
- package/types/index.d.ts +1 -1
- package/types/server.d.ts +3 -2
package/dist/dev.cjs
CHANGED
|
@@ -242,12 +242,15 @@ function ref(fn, element) {
|
|
|
242
242
|
function insert(parent, accessor, marker, initial) {
|
|
243
243
|
const multi = marker !== undefined;
|
|
244
244
|
if (multi && !initial) initial = [];
|
|
245
|
-
if (isHydrating(parent)
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
if (isHydrating(parent)) {
|
|
246
|
+
if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
|
|
247
|
+
if (Array.isArray(initial)) {
|
|
248
|
+
let j = 0;
|
|
249
|
+
for (let i = 0; i < initial.length; i++) {
|
|
250
|
+
if (initial[i].nodeType === 8 && initial[i].nodeValue === "!$") initial[i].remove();else initial[j++] = initial[i];
|
|
251
|
+
}
|
|
252
|
+
initial.length = j;
|
|
249
253
|
}
|
|
250
|
-
initial.length = j;
|
|
251
254
|
}
|
|
252
255
|
if (typeof accessor !== "function") {
|
|
253
256
|
accessor = normalize(accessor, initial, multi, true);
|
|
@@ -602,12 +605,6 @@ function gatherHydratable(element, root) {
|
|
|
602
605
|
function getHydrationKey() {
|
|
603
606
|
return solidJs.sharedConfig.getNextContextId();
|
|
604
607
|
}
|
|
605
|
-
function NoHydration(props) {
|
|
606
|
-
return solidJs.sharedConfig.hydrating ? undefined : props.children;
|
|
607
|
-
}
|
|
608
|
-
function Hydration(props) {
|
|
609
|
-
return props.children;
|
|
610
|
-
}
|
|
611
608
|
const voidFn = () => undefined;
|
|
612
609
|
const RequestContext = Symbol();
|
|
613
610
|
|
|
@@ -713,6 +710,10 @@ Object.defineProperty(exports, "For", {
|
|
|
713
710
|
enumerable: true,
|
|
714
711
|
get: function () { return solidJs.For; }
|
|
715
712
|
});
|
|
713
|
+
Object.defineProperty(exports, "Hydration", {
|
|
714
|
+
enumerable: true,
|
|
715
|
+
get: function () { return solidJs.Hydration; }
|
|
716
|
+
});
|
|
716
717
|
Object.defineProperty(exports, "Loading", {
|
|
717
718
|
enumerable: true,
|
|
718
719
|
get: function () { return solidJs.Loading; }
|
|
@@ -721,6 +722,10 @@ Object.defineProperty(exports, "Match", {
|
|
|
721
722
|
enumerable: true,
|
|
722
723
|
get: function () { return solidJs.Match; }
|
|
723
724
|
});
|
|
725
|
+
Object.defineProperty(exports, "NoHydration", {
|
|
726
|
+
enumerable: true,
|
|
727
|
+
get: function () { return solidJs.NoHydration; }
|
|
728
|
+
});
|
|
724
729
|
Object.defineProperty(exports, "Show", {
|
|
725
730
|
enumerable: true,
|
|
726
731
|
get: function () { return solidJs.Show; }
|
|
@@ -750,9 +755,7 @@ exports.ChildProperties = ChildProperties;
|
|
|
750
755
|
exports.DOMElements = DOMElements;
|
|
751
756
|
exports.DelegatedEvents = DelegatedEvents;
|
|
752
757
|
exports.Dynamic = Dynamic;
|
|
753
|
-
exports.Hydration = Hydration;
|
|
754
758
|
exports.HydrationScript = voidFn;
|
|
755
|
-
exports.NoHydration = NoHydration;
|
|
756
759
|
exports.Portal = Portal;
|
|
757
760
|
exports.Properties = Properties;
|
|
758
761
|
exports.RequestContext = RequestContext;
|
package/dist/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRenderEffect, createMemo, sharedConfig, untrack, runWithOwner, createRoot, flatten, omit, $DEVCOMP, enableHydration } from 'solid-js';
|
|
2
|
-
export { Errored, For, Loading, Match, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
2
|
+
export { Errored, For, Hydration, Loading, Match, NoHydration, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const Properties = /*#__PURE__*/new Set([
|
|
5
5
|
"value", "checked", "selected", "muted"]);
|
|
@@ -241,12 +241,15 @@ function ref(fn, element) {
|
|
|
241
241
|
function insert(parent, accessor, marker, initial) {
|
|
242
242
|
const multi = marker !== undefined;
|
|
243
243
|
if (multi && !initial) initial = [];
|
|
244
|
-
if (isHydrating(parent)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
if (isHydrating(parent)) {
|
|
245
|
+
if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
|
|
246
|
+
if (Array.isArray(initial)) {
|
|
247
|
+
let j = 0;
|
|
248
|
+
for (let i = 0; i < initial.length; i++) {
|
|
249
|
+
if (initial[i].nodeType === 8 && initial[i].nodeValue === "!$") initial[i].remove();else initial[j++] = initial[i];
|
|
250
|
+
}
|
|
251
|
+
initial.length = j;
|
|
248
252
|
}
|
|
249
|
-
initial.length = j;
|
|
250
253
|
}
|
|
251
254
|
if (typeof accessor !== "function") {
|
|
252
255
|
accessor = normalize(accessor, initial, multi, true);
|
|
@@ -601,12 +604,6 @@ function gatherHydratable(element, root) {
|
|
|
601
604
|
function getHydrationKey() {
|
|
602
605
|
return sharedConfig.getNextContextId();
|
|
603
606
|
}
|
|
604
|
-
function NoHydration(props) {
|
|
605
|
-
return sharedConfig.hydrating ? undefined : props.children;
|
|
606
|
-
}
|
|
607
|
-
function Hydration(props) {
|
|
608
|
-
return props.children;
|
|
609
|
-
}
|
|
610
607
|
const voidFn = () => undefined;
|
|
611
608
|
const RequestContext = Symbol();
|
|
612
609
|
|
|
@@ -704,4 +701,4 @@ function Dynamic(props) {
|
|
|
704
701
|
return createDynamic(() => props.component, others);
|
|
705
702
|
}
|
|
706
703
|
|
|
707
|
-
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic,
|
|
704
|
+
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, voidFn as HydrationScript, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, applyRef, assign, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, effect, escape, voidFn as generateHydrationScript, voidFn as getAssets, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, voidFn as getRequestEvent, hydrate, insert, isDev, isServer, memo, ref, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrStyle, style, template, voidFn as useAssets };
|
package/dist/server.cjs
CHANGED
|
@@ -56,6 +56,7 @@ function getLocalHeaderScript(id) {
|
|
|
56
56
|
|
|
57
57
|
function resolveAssets(moduleUrl, manifest) {
|
|
58
58
|
if (!manifest) return null;
|
|
59
|
+
const base = manifest._base || "/";
|
|
59
60
|
const entry = manifest[moduleUrl];
|
|
60
61
|
if (!entry) return null;
|
|
61
62
|
const css = [];
|
|
@@ -66,8 +67,8 @@ function resolveAssets(moduleUrl, manifest) {
|
|
|
66
67
|
visited.add(key);
|
|
67
68
|
const e = manifest[key];
|
|
68
69
|
if (!e) return;
|
|
69
|
-
js.push(e.file);
|
|
70
|
-
if (e.css) for (let i = 0; i < e.css.length; i++) css.push(e.css[i]);
|
|
70
|
+
js.push(base + e.file);
|
|
71
|
+
if (e.css) for (let i = 0; i < e.css.length; i++) css.push(base + e.css[i]);
|
|
71
72
|
if (e.imports) for (let i = 0; i < e.imports.length; i++) walk(e.imports[i]);
|
|
72
73
|
};
|
|
73
74
|
walk(moduleUrl);
|
|
@@ -646,7 +647,7 @@ function mergeProps(...sources) {
|
|
|
646
647
|
}
|
|
647
648
|
function getHydrationKey() {
|
|
648
649
|
const hydrate = solidJs.sharedConfig.context;
|
|
649
|
-
return hydrate &&
|
|
650
|
+
return hydrate && solidJs.sharedConfig.getNextContextId();
|
|
650
651
|
}
|
|
651
652
|
function applyRef(r, element) {
|
|
652
653
|
Array.isArray(r) ? r.flat(Infinity).forEach(f => f && f(element)) : r(element);
|
|
@@ -666,27 +667,6 @@ function generateHydrationScript({
|
|
|
666
667
|
} = {}) {
|
|
667
668
|
return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("_hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
668
669
|
}
|
|
669
|
-
function Hydration(props) {
|
|
670
|
-
if (!solidJs.sharedConfig.context.noHydrate) return props.children;
|
|
671
|
-
const context = solidJs.sharedConfig.context;
|
|
672
|
-
solidJs.sharedConfig.context = {
|
|
673
|
-
...context,
|
|
674
|
-
noHydrate: false
|
|
675
|
-
};
|
|
676
|
-
const res = props.children;
|
|
677
|
-
solidJs.sharedConfig.context = context;
|
|
678
|
-
return res;
|
|
679
|
-
}
|
|
680
|
-
function NoHydration(props) {
|
|
681
|
-
let context = solidJs.sharedConfig.context;
|
|
682
|
-
if (context) solidJs.sharedConfig.context = {
|
|
683
|
-
...context,
|
|
684
|
-
noHydrate: true
|
|
685
|
-
};
|
|
686
|
-
const res = props.children;
|
|
687
|
-
if (context) solidJs.sharedConfig.context = context;
|
|
688
|
-
return res;
|
|
689
|
-
}
|
|
690
670
|
function queue(fn) {
|
|
691
671
|
return Promise.resolve().then(fn);
|
|
692
672
|
}
|
|
@@ -882,6 +862,10 @@ Object.defineProperty(exports, "For", {
|
|
|
882
862
|
enumerable: true,
|
|
883
863
|
get: function () { return solidJs.For; }
|
|
884
864
|
});
|
|
865
|
+
Object.defineProperty(exports, "Hydration", {
|
|
866
|
+
enumerable: true,
|
|
867
|
+
get: function () { return solidJs.Hydration; }
|
|
868
|
+
});
|
|
885
869
|
Object.defineProperty(exports, "Loading", {
|
|
886
870
|
enumerable: true,
|
|
887
871
|
get: function () { return solidJs.Loading; }
|
|
@@ -890,6 +874,10 @@ Object.defineProperty(exports, "Match", {
|
|
|
890
874
|
enumerable: true,
|
|
891
875
|
get: function () { return solidJs.Match; }
|
|
892
876
|
});
|
|
877
|
+
Object.defineProperty(exports, "NoHydration", {
|
|
878
|
+
enumerable: true,
|
|
879
|
+
get: function () { return solidJs.NoHydration; }
|
|
880
|
+
});
|
|
893
881
|
Object.defineProperty(exports, "Repeat", {
|
|
894
882
|
enumerable: true,
|
|
895
883
|
get: function () { return solidJs.Repeat; }
|
|
@@ -922,9 +910,7 @@ exports.ChildProperties = ChildProperties;
|
|
|
922
910
|
exports.DOMElements = DOMElements;
|
|
923
911
|
exports.DelegatedEvents = DelegatedEvents;
|
|
924
912
|
exports.Dynamic = Dynamic;
|
|
925
|
-
exports.Hydration = Hydration;
|
|
926
913
|
exports.HydrationScript = HydrationScript;
|
|
927
|
-
exports.NoHydration = NoHydration;
|
|
928
914
|
exports.Portal = Portal;
|
|
929
915
|
exports.Properties = Properties;
|
|
930
916
|
exports.RequestContext = RequestContext;
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRenderEffect, createMemo, sharedConfig, createRoot, ssrHandleError, omit, getOwner, getNextChildId, createOwner, runWithOwner } from 'solid-js';
|
|
2
|
-
export { Errored, For, Loading, Match, Repeat, Show, Switch, createComponent, getOwner, ssrRunInScope, untrack } from 'solid-js';
|
|
2
|
+
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Show, Switch, createComponent, getOwner, ssrRunInScope, untrack } from 'solid-js';
|
|
3
3
|
import { Serializer, Feature, getCrossReferenceHeader } from 'seroval';
|
|
4
4
|
import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
|
|
5
5
|
|
|
@@ -55,6 +55,7 @@ function getLocalHeaderScript(id) {
|
|
|
55
55
|
|
|
56
56
|
function resolveAssets(moduleUrl, manifest) {
|
|
57
57
|
if (!manifest) return null;
|
|
58
|
+
const base = manifest._base || "/";
|
|
58
59
|
const entry = manifest[moduleUrl];
|
|
59
60
|
if (!entry) return null;
|
|
60
61
|
const css = [];
|
|
@@ -65,8 +66,8 @@ function resolveAssets(moduleUrl, manifest) {
|
|
|
65
66
|
visited.add(key);
|
|
66
67
|
const e = manifest[key];
|
|
67
68
|
if (!e) return;
|
|
68
|
-
js.push(e.file);
|
|
69
|
-
if (e.css) for (let i = 0; i < e.css.length; i++) css.push(e.css[i]);
|
|
69
|
+
js.push(base + e.file);
|
|
70
|
+
if (e.css) for (let i = 0; i < e.css.length; i++) css.push(base + e.css[i]);
|
|
70
71
|
if (e.imports) for (let i = 0; i < e.imports.length; i++) walk(e.imports[i]);
|
|
71
72
|
};
|
|
72
73
|
walk(moduleUrl);
|
|
@@ -645,7 +646,7 @@ function mergeProps(...sources) {
|
|
|
645
646
|
}
|
|
646
647
|
function getHydrationKey() {
|
|
647
648
|
const hydrate = sharedConfig.context;
|
|
648
|
-
return hydrate &&
|
|
649
|
+
return hydrate && sharedConfig.getNextContextId();
|
|
649
650
|
}
|
|
650
651
|
function applyRef(r, element) {
|
|
651
652
|
Array.isArray(r) ? r.flat(Infinity).forEach(f => f && f(element)) : r(element);
|
|
@@ -665,27 +666,6 @@ function generateHydrationScript({
|
|
|
665
666
|
} = {}) {
|
|
666
667
|
return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("_hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
667
668
|
}
|
|
668
|
-
function Hydration(props) {
|
|
669
|
-
if (!sharedConfig.context.noHydrate) return props.children;
|
|
670
|
-
const context = sharedConfig.context;
|
|
671
|
-
sharedConfig.context = {
|
|
672
|
-
...context,
|
|
673
|
-
noHydrate: false
|
|
674
|
-
};
|
|
675
|
-
const res = props.children;
|
|
676
|
-
sharedConfig.context = context;
|
|
677
|
-
return res;
|
|
678
|
-
}
|
|
679
|
-
function NoHydration(props) {
|
|
680
|
-
let context = sharedConfig.context;
|
|
681
|
-
if (context) sharedConfig.context = {
|
|
682
|
-
...context,
|
|
683
|
-
noHydrate: true
|
|
684
|
-
};
|
|
685
|
-
const res = props.children;
|
|
686
|
-
if (context) sharedConfig.context = context;
|
|
687
|
-
return res;
|
|
688
|
-
}
|
|
689
669
|
function queue(fn) {
|
|
690
670
|
return Promise.resolve().then(fn);
|
|
691
671
|
}
|
|
@@ -873,4 +853,4 @@ function Portal(props) {
|
|
|
873
853
|
throw new Error("Portal is not supported on the server");
|
|
874
854
|
}
|
|
875
855
|
|
|
876
|
-
export { ChildProperties, DOMElements, DelegatedEvents, Dynamic,
|
|
856
|
+
export { ChildProperties, DOMElements, DelegatedEvents, Dynamic, HydrationScript, Portal, Properties, RequestContext, SVGElements, SVGNamespace, notSup as addEventListener, applyRef, notSup as assign, notSup as className, createDynamic, notSup as delegateEvents, notSup as dynamicProperty, effect, escape, generateHydrationScript, getAssets, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, notSup as hydrate, notSup as insert, isDev, isServer, memo, mergeProps, notSup as render, renderToStream, renderToString, renderToStringAsync, notSup as runHydrationEvents, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrHydrationKey, ssrStyle, ssrStyleProperty, notSup as style, notSup as template, useAssets };
|
package/dist/web.cjs
CHANGED
|
@@ -237,12 +237,15 @@ function ref(fn, element) {
|
|
|
237
237
|
function insert(parent, accessor, marker, initial) {
|
|
238
238
|
const multi = marker !== undefined;
|
|
239
239
|
if (multi && !initial) initial = [];
|
|
240
|
-
if (isHydrating(parent)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
if (isHydrating(parent)) {
|
|
241
|
+
if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
|
|
242
|
+
if (Array.isArray(initial)) {
|
|
243
|
+
let j = 0;
|
|
244
|
+
for (let i = 0; i < initial.length; i++) {
|
|
245
|
+
if (initial[i].nodeType === 8 && initial[i].nodeValue === "!$") initial[i].remove();else initial[j++] = initial[i];
|
|
246
|
+
}
|
|
247
|
+
initial.length = j;
|
|
244
248
|
}
|
|
245
|
-
initial.length = j;
|
|
246
249
|
}
|
|
247
250
|
if (typeof accessor !== "function") {
|
|
248
251
|
accessor = normalize(accessor, initial, multi, true);
|
|
@@ -548,12 +551,6 @@ function gatherHydratable(element, root) {
|
|
|
548
551
|
function getHydrationKey() {
|
|
549
552
|
return solidJs.sharedConfig.getNextContextId();
|
|
550
553
|
}
|
|
551
|
-
function NoHydration(props) {
|
|
552
|
-
return solidJs.sharedConfig.hydrating ? undefined : props.children;
|
|
553
|
-
}
|
|
554
|
-
function Hydration(props) {
|
|
555
|
-
return props.children;
|
|
556
|
-
}
|
|
557
554
|
const voidFn = () => undefined;
|
|
558
555
|
const RequestContext = Symbol();
|
|
559
556
|
|
|
@@ -656,6 +653,10 @@ Object.defineProperty(exports, "For", {
|
|
|
656
653
|
enumerable: true,
|
|
657
654
|
get: function () { return solidJs.For; }
|
|
658
655
|
});
|
|
656
|
+
Object.defineProperty(exports, "Hydration", {
|
|
657
|
+
enumerable: true,
|
|
658
|
+
get: function () { return solidJs.Hydration; }
|
|
659
|
+
});
|
|
659
660
|
Object.defineProperty(exports, "Loading", {
|
|
660
661
|
enumerable: true,
|
|
661
662
|
get: function () { return solidJs.Loading; }
|
|
@@ -664,6 +665,10 @@ Object.defineProperty(exports, "Match", {
|
|
|
664
665
|
enumerable: true,
|
|
665
666
|
get: function () { return solidJs.Match; }
|
|
666
667
|
});
|
|
668
|
+
Object.defineProperty(exports, "NoHydration", {
|
|
669
|
+
enumerable: true,
|
|
670
|
+
get: function () { return solidJs.NoHydration; }
|
|
671
|
+
});
|
|
667
672
|
Object.defineProperty(exports, "Show", {
|
|
668
673
|
enumerable: true,
|
|
669
674
|
get: function () { return solidJs.Show; }
|
|
@@ -693,9 +698,7 @@ exports.ChildProperties = ChildProperties;
|
|
|
693
698
|
exports.DOMElements = DOMElements;
|
|
694
699
|
exports.DelegatedEvents = DelegatedEvents;
|
|
695
700
|
exports.Dynamic = Dynamic;
|
|
696
|
-
exports.Hydration = Hydration;
|
|
697
701
|
exports.HydrationScript = voidFn;
|
|
698
|
-
exports.NoHydration = NoHydration;
|
|
699
702
|
exports.Portal = Portal;
|
|
700
703
|
exports.Properties = Properties;
|
|
701
704
|
exports.RequestContext = RequestContext;
|
package/dist/web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRenderEffect, createMemo, sharedConfig, untrack, runWithOwner, createRoot, flatten, omit, enableHydration } from 'solid-js';
|
|
2
|
-
export { Errored, For, Loading, Match, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
2
|
+
export { Errored, For, Hydration, Loading, Match, NoHydration, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const Properties = /*#__PURE__*/new Set([
|
|
5
5
|
"value", "checked", "selected", "muted"]);
|
|
@@ -236,12 +236,15 @@ function ref(fn, element) {
|
|
|
236
236
|
function insert(parent, accessor, marker, initial) {
|
|
237
237
|
const multi = marker !== undefined;
|
|
238
238
|
if (multi && !initial) initial = [];
|
|
239
|
-
if (isHydrating(parent)
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
if (isHydrating(parent)) {
|
|
240
|
+
if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
|
|
241
|
+
if (Array.isArray(initial)) {
|
|
242
|
+
let j = 0;
|
|
243
|
+
for (let i = 0; i < initial.length; i++) {
|
|
244
|
+
if (initial[i].nodeType === 8 && initial[i].nodeValue === "!$") initial[i].remove();else initial[j++] = initial[i];
|
|
245
|
+
}
|
|
246
|
+
initial.length = j;
|
|
243
247
|
}
|
|
244
|
-
initial.length = j;
|
|
245
248
|
}
|
|
246
249
|
if (typeof accessor !== "function") {
|
|
247
250
|
accessor = normalize(accessor, initial, multi, true);
|
|
@@ -547,12 +550,6 @@ function gatherHydratable(element, root) {
|
|
|
547
550
|
function getHydrationKey() {
|
|
548
551
|
return sharedConfig.getNextContextId();
|
|
549
552
|
}
|
|
550
|
-
function NoHydration(props) {
|
|
551
|
-
return sharedConfig.hydrating ? undefined : props.children;
|
|
552
|
-
}
|
|
553
|
-
function Hydration(props) {
|
|
554
|
-
return props.children;
|
|
555
|
-
}
|
|
556
553
|
const voidFn = () => undefined;
|
|
557
554
|
const RequestContext = Symbol();
|
|
558
555
|
|
|
@@ -647,4 +644,4 @@ function Dynamic(props) {
|
|
|
647
644
|
return createDynamic(() => props.component, others);
|
|
648
645
|
}
|
|
649
646
|
|
|
650
|
-
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic,
|
|
647
|
+
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, voidFn as HydrationScript, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, applyRef, assign, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, effect, escape, voidFn as generateHydrationScript, voidFn as getAssets, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, voidFn as getRequestEvent, hydrate, insert, isDev, isServer, memo, ref, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrStyle, style, template, voidFn as useAssets };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web",
|
|
3
3
|
"description": "Solid's web runtime for the browser and the server",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.1",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"seroval-plugins": "^1.1.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"solid-js": "^2.0.0-beta.
|
|
78
|
+
"solid-js": "^2.0.0-beta.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"solid-js": "2.0.0-beta.
|
|
81
|
+
"solid-js": "2.0.0-beta.1"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "npm-run-all -nl build:*",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hydrate as hydrateCore } from "./client.js";
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.js";
|
|
4
|
-
export { For, Show, Switch, Match, Errored, Loading, merge as mergeProps } from "solid-js";
|
|
4
|
+
export { For, Show, Switch, Match, Errored, Loading, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
5
5
|
export * from "./server-mock.js";
|
|
6
6
|
export declare const isServer: boolean;
|
|
7
7
|
export declare const isDev: boolean;
|
package/types/client.d.ts
CHANGED
|
@@ -79,8 +79,6 @@ export function getAssets(): string;
|
|
|
79
79
|
export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
80
80
|
export function generateHydrationScript(options?: { nonce?: string; eventNames?: string[] }): string;
|
|
81
81
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
82
|
-
export function Hydration(props: { children?: JSX.Element }): JSX.Element;
|
|
83
|
-
export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
|
|
84
82
|
export interface RequestEvent {
|
|
85
83
|
request: Request;
|
|
86
84
|
locals: Record<string | number | symbol, any>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hydrate as hydrateCore } from "./client.js";
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.js";
|
|
4
|
-
export { For, Show, Switch, Match, Errored, Loading, merge as mergeProps } from "solid-js";
|
|
4
|
+
export { For, Show, Switch, Match, Errored, Loading, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
5
5
|
export * from "./server-mock.js";
|
|
6
6
|
export declare const isServer: boolean;
|
|
7
7
|
export declare const isDev: boolean;
|
package/types/server.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export function renderToString<T>(
|
|
|
15
15
|
renderId?: string;
|
|
16
16
|
noScripts?: boolean;
|
|
17
17
|
plugins?: any[];
|
|
18
|
+
manifest?: Record<string, { file: string; css?: string[]; isEntry?: boolean; imports?: string[] }> & { _base?: string };
|
|
18
19
|
onError?: (err: any) => void;
|
|
19
20
|
}
|
|
20
21
|
): string;
|
|
@@ -27,6 +28,7 @@ export function renderToStringAsync<T>(
|
|
|
27
28
|
renderId?: string;
|
|
28
29
|
noScripts?: boolean;
|
|
29
30
|
plugins?: any[];
|
|
31
|
+
manifest?: Record<string, { file: string; css?: string[]; isEntry?: boolean; imports?: string[] }> & { _base?: string };
|
|
30
32
|
onError?: (err: any) => void;
|
|
31
33
|
}
|
|
32
34
|
): Promise<string>;
|
|
@@ -37,6 +39,7 @@ export function renderToStream<T>(
|
|
|
37
39
|
renderId?: string;
|
|
38
40
|
noScripts?: boolean;
|
|
39
41
|
plugins?: any[];
|
|
42
|
+
manifest?: Record<string, { file: string; css?: string[]; isEntry?: boolean; imports?: string[] }> & { _base?: string };
|
|
40
43
|
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
41
44
|
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
42
45
|
onError?: (err: any) => void;
|
|
@@ -80,8 +83,6 @@ export interface RequestEvent {
|
|
|
80
83
|
}
|
|
81
84
|
export function getRequestEvent(): RequestEvent | undefined;
|
|
82
85
|
|
|
83
|
-
export function Hydration(props: { children?: JSX.Element }): JSX.Element;
|
|
84
|
-
export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
|
|
85
86
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
86
87
|
export function untrack<T>(fn: () => T): T;
|
|
87
88
|
|