@solidjs/web 2.0.0-beta.7 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.cjs +59 -30
- package/dist/dev.js +60 -31
- package/dist/server.cjs +19 -8
- package/dist/server.js +19 -8
- package/dist/web.cjs +54 -28
- package/dist/web.js +55 -29
- package/package.json +5 -5
- package/storage/types/src/index.d.ts +22 -8
- package/storage/types-cjs/src/index.d.cts +22 -8
- package/types/client.d.ts +18 -9
- package/types/core.d.ts +1 -1
- package/types/index.d.ts +22 -8
- package/types/server.d.ts +21 -10
- package/types-cjs/client.d.cts +18 -9
- package/types-cjs/core.d.cts +1 -1
- package/types-cjs/index.d.cts +22 -8
- package/types-cjs/server.d.cts +21 -10
package/dist/dev.cjs
CHANGED
|
@@ -49,9 +49,13 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
|
|
|
49
49
|
"webview",
|
|
50
50
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const transparentOptions = {
|
|
53
53
|
transparent: true
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
|
+
const effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
56
|
+
transparent: true,
|
|
57
|
+
...options
|
|
58
|
+
} : transparentOptions);
|
|
55
59
|
const memo = (fn, transparent) => transparent ? fn.$r ? fn : signals.createMemo(() => fn(), {
|
|
56
60
|
transparent: true
|
|
57
61
|
}) : solidJs.createMemo(() => fn());
|
|
@@ -267,7 +271,7 @@ function ref(fn, element) {
|
|
|
267
271
|
const resolved = solidJs.untrack(fn);
|
|
268
272
|
solidJs.runWithOwner(null, () => applyRef(resolved, element));
|
|
269
273
|
}
|
|
270
|
-
function insert(parent, accessor, marker, initial) {
|
|
274
|
+
function insert(parent, accessor, marker, initial, options) {
|
|
271
275
|
const childRoot = getChildRoot(parent);
|
|
272
276
|
const multi = marker !== undefined;
|
|
273
277
|
if (multi && !initial) initial = [];
|
|
@@ -291,7 +295,7 @@ function insert(parent, accessor, marker, initial) {
|
|
|
291
295
|
childRoot.insertBefore(placeholder, marker);
|
|
292
296
|
initial = [placeholder];
|
|
293
297
|
}
|
|
294
|
-
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker));
|
|
298
|
+
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker), options);
|
|
295
299
|
}
|
|
296
300
|
function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
|
|
297
301
|
const nodeName = node.nodeName;
|
|
@@ -711,18 +715,38 @@ function ssrHydrationKey() {}
|
|
|
711
715
|
function resolveSSRNode(node) {}
|
|
712
716
|
function escape(html) {}
|
|
713
717
|
|
|
714
|
-
function render(...args) {
|
|
715
|
-
solidJs.enforceLoadingBoundary(true);
|
|
716
|
-
const result = render$1(...args);
|
|
717
|
-
solidJs.enforceLoadingBoundary(false);
|
|
718
|
-
return result;
|
|
719
|
-
}
|
|
720
718
|
const isServer = false;
|
|
721
719
|
const isDev = true;
|
|
722
|
-
function
|
|
723
|
-
|
|
724
|
-
|
|
720
|
+
function render(code, element, init, options = {}) {
|
|
721
|
+
if (!element) {
|
|
722
|
+
throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
|
|
723
|
+
}
|
|
724
|
+
const renderRoot = element.localName === "template" ? element.content : element;
|
|
725
|
+
let disposer;
|
|
726
|
+
solidJs.createRoot(dispose => {
|
|
727
|
+
disposer = dispose;
|
|
728
|
+
if (element === document) {
|
|
729
|
+
solidJs.flatten(code);
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
const marker = renderRoot.firstChild ? null : undefined;
|
|
733
|
+
solidJs.enforceLoadingBoundary(true);
|
|
734
|
+
try {
|
|
735
|
+
const tree = code();
|
|
736
|
+
insert(element, () => tree, marker, init, {
|
|
737
|
+
schedule: true
|
|
738
|
+
});
|
|
739
|
+
} finally {
|
|
740
|
+
solidJs.enforceLoadingBoundary(false);
|
|
741
|
+
}
|
|
742
|
+
}, {
|
|
743
|
+
id: options.renderId
|
|
725
744
|
});
|
|
745
|
+
solidJs.flush();
|
|
746
|
+
return () => {
|
|
747
|
+
disposer();
|
|
748
|
+
renderRoot.textContent = "";
|
|
749
|
+
};
|
|
726
750
|
}
|
|
727
751
|
const hydrate = (...args) => {
|
|
728
752
|
solidJs.enableHydration();
|
|
@@ -748,23 +772,6 @@ function Portal(props) {
|
|
|
748
772
|
});
|
|
749
773
|
return treeMarker;
|
|
750
774
|
}
|
|
751
|
-
function createElementProxy(el, marker) {
|
|
752
|
-
return new Proxy(el, {
|
|
753
|
-
get(target, prop) {
|
|
754
|
-
if (prop === "appendChild" || prop === "insertBefore") {
|
|
755
|
-
return (...args) => {
|
|
756
|
-
Object.defineProperty(args[0], "_$host", {
|
|
757
|
-
get: () => marker.parentNode,
|
|
758
|
-
configurable: true
|
|
759
|
-
});
|
|
760
|
-
target[prop](...args);
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
const value = Reflect.get(target, prop);
|
|
764
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
775
|
function createDynamic(component, props) {
|
|
769
776
|
const cached = solidJs.createMemo(component);
|
|
770
777
|
return solidJs.createMemo(() => {
|
|
@@ -786,6 +793,28 @@ function Dynamic(props) {
|
|
|
786
793
|
const others = solidJs.omit(props, "component");
|
|
787
794
|
return createDynamic(() => props.component, others);
|
|
788
795
|
}
|
|
796
|
+
function createElement(tagName, is = undefined) {
|
|
797
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
798
|
+
is
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function createElementProxy(el, marker) {
|
|
802
|
+
return new Proxy(el, {
|
|
803
|
+
get(target, prop) {
|
|
804
|
+
if (prop === "appendChild" || prop === "insertBefore") {
|
|
805
|
+
return (...args) => {
|
|
806
|
+
Object.defineProperty(args[0], "_$host", {
|
|
807
|
+
get: () => marker.parentNode,
|
|
808
|
+
configurable: true
|
|
809
|
+
});
|
|
810
|
+
target[prop](...args);
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
const value = Reflect.get(target, prop);
|
|
814
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
}
|
|
789
818
|
|
|
790
819
|
Object.defineProperty(exports, "Errored", {
|
|
791
820
|
enumerable: true,
|
package/dist/dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, $DEVCOMP, enableHydration, enforceLoadingBoundary } from 'solid-js';
|
|
1
|
+
import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, $DEVCOMP, enableHydration, enforceLoadingBoundary, flush } 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
3
|
import { createMemo } from '@solidjs/signals';
|
|
4
4
|
|
|
@@ -48,9 +48,13 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
|
|
|
48
48
|
"webview",
|
|
49
49
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const transparentOptions = {
|
|
52
52
|
transparent: true
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
|
+
const effect = (fn, effectFn, options) => createRenderEffect(fn, effectFn, options ? {
|
|
55
|
+
transparent: true,
|
|
56
|
+
...options
|
|
57
|
+
} : transparentOptions);
|
|
54
58
|
const memo = (fn, transparent) => transparent ? fn.$r ? fn : createMemo(() => fn(), {
|
|
55
59
|
transparent: true
|
|
56
60
|
}) : createMemo$1(() => fn());
|
|
@@ -266,7 +270,7 @@ function ref(fn, element) {
|
|
|
266
270
|
const resolved = untrack(fn);
|
|
267
271
|
runWithOwner(null, () => applyRef(resolved, element));
|
|
268
272
|
}
|
|
269
|
-
function insert(parent, accessor, marker, initial) {
|
|
273
|
+
function insert(parent, accessor, marker, initial, options) {
|
|
270
274
|
const childRoot = getChildRoot(parent);
|
|
271
275
|
const multi = marker !== undefined;
|
|
272
276
|
if (multi && !initial) initial = [];
|
|
@@ -290,7 +294,7 @@ function insert(parent, accessor, marker, initial) {
|
|
|
290
294
|
childRoot.insertBefore(placeholder, marker);
|
|
291
295
|
initial = [placeholder];
|
|
292
296
|
}
|
|
293
|
-
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker));
|
|
297
|
+
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker), options);
|
|
294
298
|
}
|
|
295
299
|
function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
|
|
296
300
|
const nodeName = node.nodeName;
|
|
@@ -710,18 +714,38 @@ function ssrHydrationKey() {}
|
|
|
710
714
|
function resolveSSRNode(node) {}
|
|
711
715
|
function escape(html) {}
|
|
712
716
|
|
|
713
|
-
function render(...args) {
|
|
714
|
-
enforceLoadingBoundary(true);
|
|
715
|
-
const result = render$1(...args);
|
|
716
|
-
enforceLoadingBoundary(false);
|
|
717
|
-
return result;
|
|
718
|
-
}
|
|
719
717
|
const isServer = false;
|
|
720
718
|
const isDev = true;
|
|
721
|
-
function
|
|
722
|
-
|
|
723
|
-
|
|
719
|
+
function render(code, element, init, options = {}) {
|
|
720
|
+
if (!element) {
|
|
721
|
+
throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
|
|
722
|
+
}
|
|
723
|
+
const renderRoot = element.localName === "template" ? element.content : element;
|
|
724
|
+
let disposer;
|
|
725
|
+
createRoot(dispose => {
|
|
726
|
+
disposer = dispose;
|
|
727
|
+
if (element === document) {
|
|
728
|
+
flatten(code);
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
const marker = renderRoot.firstChild ? null : undefined;
|
|
732
|
+
enforceLoadingBoundary(true);
|
|
733
|
+
try {
|
|
734
|
+
const tree = code();
|
|
735
|
+
insert(element, () => tree, marker, init, {
|
|
736
|
+
schedule: true
|
|
737
|
+
});
|
|
738
|
+
} finally {
|
|
739
|
+
enforceLoadingBoundary(false);
|
|
740
|
+
}
|
|
741
|
+
}, {
|
|
742
|
+
id: options.renderId
|
|
724
743
|
});
|
|
744
|
+
flush();
|
|
745
|
+
return () => {
|
|
746
|
+
disposer();
|
|
747
|
+
renderRoot.textContent = "";
|
|
748
|
+
};
|
|
725
749
|
}
|
|
726
750
|
const hydrate = (...args) => {
|
|
727
751
|
enableHydration();
|
|
@@ -747,23 +771,6 @@ function Portal(props) {
|
|
|
747
771
|
});
|
|
748
772
|
return treeMarker;
|
|
749
773
|
}
|
|
750
|
-
function createElementProxy(el, marker) {
|
|
751
|
-
return new Proxy(el, {
|
|
752
|
-
get(target, prop) {
|
|
753
|
-
if (prop === "appendChild" || prop === "insertBefore") {
|
|
754
|
-
return (...args) => {
|
|
755
|
-
Object.defineProperty(args[0], "_$host", {
|
|
756
|
-
get: () => marker.parentNode,
|
|
757
|
-
configurable: true
|
|
758
|
-
});
|
|
759
|
-
target[prop](...args);
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
const value = Reflect.get(target, prop);
|
|
763
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
774
|
function createDynamic(component, props) {
|
|
768
775
|
const cached = createMemo$1(component);
|
|
769
776
|
return createMemo$1(() => {
|
|
@@ -785,5 +792,27 @@ function Dynamic(props) {
|
|
|
785
792
|
const others = omit(props, "component");
|
|
786
793
|
return createDynamic(() => props.component, others);
|
|
787
794
|
}
|
|
795
|
+
function createElement(tagName, is = undefined) {
|
|
796
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
797
|
+
is
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
function createElementProxy(el, marker) {
|
|
801
|
+
return new Proxy(el, {
|
|
802
|
+
get(target, prop) {
|
|
803
|
+
if (prop === "appendChild" || prop === "insertBefore") {
|
|
804
|
+
return (...args) => {
|
|
805
|
+
Object.defineProperty(args[0], "_$host", {
|
|
806
|
+
get: () => marker.parentNode,
|
|
807
|
+
configurable: true
|
|
808
|
+
});
|
|
809
|
+
target[prop](...args);
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
const value = Reflect.get(target, prop);
|
|
813
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
}
|
|
788
817
|
|
|
789
818
|
export { voidFn as Assets, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, voidFn as HydrationScript, MathMLElements, Namespaces, Portal, RequestContext, SVGElements, 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
|
@@ -23,16 +23,20 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
|
|
|
23
23
|
"webview",
|
|
24
24
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const transparentOptions = {
|
|
27
27
|
transparent: true
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
|
+
const effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
30
|
+
transparent: true,
|
|
31
|
+
...options
|
|
32
|
+
} : transparentOptions);
|
|
29
33
|
const memo = (fn, transparent) => transparent ? fn.$r ? fn : signals.createMemo(() => fn(), {
|
|
30
34
|
transparent: true
|
|
31
35
|
}) : solidJs.createMemo(() => fn());
|
|
32
36
|
|
|
33
|
-
const ES2017FLAG = seroval.Feature.AggregateError
|
|
34
|
-
|
|
35
|
-
const GLOBAL_IDENTIFIER =
|
|
37
|
+
const ES2017FLAG = seroval.Feature.AggregateError |
|
|
38
|
+
seroval.Feature.BigIntTypedArray;
|
|
39
|
+
const GLOBAL_IDENTIFIER = "_$HY.r";
|
|
36
40
|
function createSerializer({
|
|
37
41
|
onData,
|
|
38
42
|
onDone,
|
|
@@ -55,7 +59,7 @@ function createSerializer({
|
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
function getLocalHeaderScript(id) {
|
|
58
|
-
return seroval.getCrossReferenceHeader(id) +
|
|
62
|
+
return seroval.getCrossReferenceHeader(id) + ";";
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
function resolveAssets(moduleUrl, manifest) {
|
|
@@ -143,7 +147,7 @@ function applyAssetTracking(context, tracking, manifest) {
|
|
|
143
147
|
if (manifest) context.resolveAssets = moduleUrl => resolveAssets(moduleUrl, manifest);
|
|
144
148
|
}
|
|
145
149
|
const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
146
|
-
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(!(n=document.getElementById(e))||!(o=document.getElementById("pl-"+e)))return 0;for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content),n.remove(),_$HY.fe(e);return 1}function $dfl(e,o,n){if(!(o=document.getElementById("pl-"+e)))return 0;if(o._$fl)return 1;for(n=o.nextSibling;n;){if(8===n.nodeType&&n.nodeValue==="pl-"+e){o.parentNode&&o.parentNode.insertBefore(o.content.cloneNode(!0),n),o._$fl=1;return 1}n=n.nextSibling}return 0}function $dflj(e,i){for(i=0;i<e.length;i++)
|
|
150
|
+
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(!(n=document.getElementById(e))||!(o=document.getElementById("pl-"+e)))return 0;for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content),n.remove(),_$HY.fe(e);return 1}function $dfl(e,o,n){if(!(o=document.getElementById("pl-"+e)))return 0;if(o._$fl)return 1;for(n=o.nextSibling;n;){if(8===n.nodeType&&n.nodeValue==="pl-"+e){o.parentNode&&o.parentNode.insertBefore(o.content.cloneNode(!0),n),o._$fl=1;return 1}n=n.nextSibling}return 0}function $dflj(e,i){for(i=0;i<e.length;i++)$dfl(e[i])}function $dfs(e,c,d){(_$HY.sc=_$HY.sc||{})[e]=c,d&&((_$HY.sd=_$HY.sd||{})[e]=1)}function $dfg(e,g,i,k){if(!(g=_$HY.sg&&_$HY.sg[e]))return;for(i=0;i<g.length;i++)if(_$HY.sc&&_$HY.sc[g[i]]>0)return;for(i=0;i<g.length;i++)k=g[i],delete _$HY.sg[k],$df(k)}function $dfc(e){if(--_$HY.sc[e]<=0){delete _$HY.sc[e],_$HY.sg&&_$HY.sg[e]?$dfg(e):!(_$HY.sd&&_$HY.sd[e])&&$df(e);_$HY.sd&&delete _$HY.sd[e]}}function $dfj(e,i,n){for(i=0;i<e.length;i++)if(_$HY.sc&&_$HY.sc[e[i]]>0){for(n=0;n<e.length;n++)(_$HY.sg=_$HY.sg||{})[e[n]]=e;return}for(i=0;i<e.length;i++)$df(e[i])}`;
|
|
147
151
|
function renderToString(code, options = {}) {
|
|
148
152
|
const {
|
|
149
153
|
renderId = "",
|
|
@@ -248,8 +252,15 @@ function renderToStream(code, options = {}) {
|
|
|
248
252
|
onDone,
|
|
249
253
|
onError: options.onError
|
|
250
254
|
});
|
|
255
|
+
let rootAssetsSerialized = false;
|
|
256
|
+
const serializeRootAssets = () => {
|
|
257
|
+
if (rootAssetsSerialized) return;
|
|
258
|
+
rootAssetsSerialized = true;
|
|
259
|
+
serializeFragmentAssets("", tracking.boundaryModules, context);
|
|
260
|
+
};
|
|
251
261
|
const flushEnd = () => {
|
|
252
262
|
if (!registry.size) {
|
|
263
|
+
serializeRootAssets();
|
|
253
264
|
queue(() => queue(() => serializer.flush()));
|
|
254
265
|
}
|
|
255
266
|
};
|
|
@@ -493,7 +504,7 @@ function renderToStream(code, options = {}) {
|
|
|
493
504
|
if (url.endsWith(".css")) headStyles.add(url);
|
|
494
505
|
}
|
|
495
506
|
html = injectPreloadLinks(tracking.emittedAssets, html);
|
|
496
|
-
|
|
507
|
+
serializeRootAssets();
|
|
497
508
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
498
509
|
buffer.write(html);
|
|
499
510
|
tasks = "";
|
package/dist/server.js
CHANGED
|
@@ -22,16 +22,20 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
|
|
|
22
22
|
"webview",
|
|
23
23
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const transparentOptions = {
|
|
26
26
|
transparent: true
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
const effect = (fn, effectFn, options) => createRenderEffect(fn, effectFn, options ? {
|
|
29
|
+
transparent: true,
|
|
30
|
+
...options
|
|
31
|
+
} : transparentOptions);
|
|
28
32
|
const memo = (fn, transparent) => transparent ? fn.$r ? fn : createMemo(() => fn(), {
|
|
29
33
|
transparent: true
|
|
30
34
|
}) : createMemo$1(() => fn());
|
|
31
35
|
|
|
32
|
-
const ES2017FLAG = Feature.AggregateError
|
|
33
|
-
|
|
34
|
-
const GLOBAL_IDENTIFIER =
|
|
36
|
+
const ES2017FLAG = Feature.AggregateError |
|
|
37
|
+
Feature.BigIntTypedArray;
|
|
38
|
+
const GLOBAL_IDENTIFIER = "_$HY.r";
|
|
35
39
|
function createSerializer({
|
|
36
40
|
onData,
|
|
37
41
|
onDone,
|
|
@@ -54,7 +58,7 @@ function createSerializer({
|
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
60
|
function getLocalHeaderScript(id) {
|
|
57
|
-
return getCrossReferenceHeader(id) +
|
|
61
|
+
return getCrossReferenceHeader(id) + ";";
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
function resolveAssets(moduleUrl, manifest) {
|
|
@@ -142,7 +146,7 @@ function applyAssetTracking(context, tracking, manifest) {
|
|
|
142
146
|
if (manifest) context.resolveAssets = moduleUrl => resolveAssets(moduleUrl, manifest);
|
|
143
147
|
}
|
|
144
148
|
const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
145
|
-
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(!(n=document.getElementById(e))||!(o=document.getElementById("pl-"+e)))return 0;for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content),n.remove(),_$HY.fe(e);return 1}function $dfl(e,o,n){if(!(o=document.getElementById("pl-"+e)))return 0;if(o._$fl)return 1;for(n=o.nextSibling;n;){if(8===n.nodeType&&n.nodeValue==="pl-"+e){o.parentNode&&o.parentNode.insertBefore(o.content.cloneNode(!0),n),o._$fl=1;return 1}n=n.nextSibling}return 0}function $dflj(e,i){for(i=0;i<e.length;i++)
|
|
149
|
+
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(!(n=document.getElementById(e))||!(o=document.getElementById("pl-"+e)))return 0;for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content),n.remove(),_$HY.fe(e);return 1}function $dfl(e,o,n){if(!(o=document.getElementById("pl-"+e)))return 0;if(o._$fl)return 1;for(n=o.nextSibling;n;){if(8===n.nodeType&&n.nodeValue==="pl-"+e){o.parentNode&&o.parentNode.insertBefore(o.content.cloneNode(!0),n),o._$fl=1;return 1}n=n.nextSibling}return 0}function $dflj(e,i){for(i=0;i<e.length;i++)$dfl(e[i])}function $dfs(e,c,d){(_$HY.sc=_$HY.sc||{})[e]=c,d&&((_$HY.sd=_$HY.sd||{})[e]=1)}function $dfg(e,g,i,k){if(!(g=_$HY.sg&&_$HY.sg[e]))return;for(i=0;i<g.length;i++)if(_$HY.sc&&_$HY.sc[g[i]]>0)return;for(i=0;i<g.length;i++)k=g[i],delete _$HY.sg[k],$df(k)}function $dfc(e){if(--_$HY.sc[e]<=0){delete _$HY.sc[e],_$HY.sg&&_$HY.sg[e]?$dfg(e):!(_$HY.sd&&_$HY.sd[e])&&$df(e);_$HY.sd&&delete _$HY.sd[e]}}function $dfj(e,i,n){for(i=0;i<e.length;i++)if(_$HY.sc&&_$HY.sc[e[i]]>0){for(n=0;n<e.length;n++)(_$HY.sg=_$HY.sg||{})[e[n]]=e;return}for(i=0;i<e.length;i++)$df(e[i])}`;
|
|
146
150
|
function renderToString(code, options = {}) {
|
|
147
151
|
const {
|
|
148
152
|
renderId = "",
|
|
@@ -247,8 +251,15 @@ function renderToStream(code, options = {}) {
|
|
|
247
251
|
onDone,
|
|
248
252
|
onError: options.onError
|
|
249
253
|
});
|
|
254
|
+
let rootAssetsSerialized = false;
|
|
255
|
+
const serializeRootAssets = () => {
|
|
256
|
+
if (rootAssetsSerialized) return;
|
|
257
|
+
rootAssetsSerialized = true;
|
|
258
|
+
serializeFragmentAssets("", tracking.boundaryModules, context);
|
|
259
|
+
};
|
|
250
260
|
const flushEnd = () => {
|
|
251
261
|
if (!registry.size) {
|
|
262
|
+
serializeRootAssets();
|
|
252
263
|
queue(() => queue(() => serializer.flush()));
|
|
253
264
|
}
|
|
254
265
|
};
|
|
@@ -492,7 +503,7 @@ function renderToStream(code, options = {}) {
|
|
|
492
503
|
if (url.endsWith(".css")) headStyles.add(url);
|
|
493
504
|
}
|
|
494
505
|
html = injectPreloadLinks(tracking.emittedAssets, html);
|
|
495
|
-
|
|
506
|
+
serializeRootAssets();
|
|
496
507
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
497
508
|
buffer.write(html);
|
|
498
509
|
tasks = "";
|
package/dist/web.cjs
CHANGED
|
@@ -49,9 +49,13 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
|
|
|
49
49
|
"webview",
|
|
50
50
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const transparentOptions = {
|
|
53
53
|
transparent: true
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
|
+
const effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
56
|
+
transparent: true,
|
|
57
|
+
...options
|
|
58
|
+
} : transparentOptions);
|
|
55
59
|
const memo = (fn, transparent) => transparent ? fn.$r ? fn : signals.createMemo(() => fn(), {
|
|
56
60
|
transparent: true
|
|
57
61
|
}) : solidJs.createMemo(() => fn());
|
|
@@ -262,7 +266,7 @@ function ref(fn, element) {
|
|
|
262
266
|
const resolved = solidJs.untrack(fn);
|
|
263
267
|
solidJs.runWithOwner(null, () => applyRef(resolved, element));
|
|
264
268
|
}
|
|
265
|
-
function insert(parent, accessor, marker, initial) {
|
|
269
|
+
function insert(parent, accessor, marker, initial, options) {
|
|
266
270
|
const childRoot = getChildRoot(parent);
|
|
267
271
|
const multi = marker !== undefined;
|
|
268
272
|
if (multi && !initial) initial = [];
|
|
@@ -286,7 +290,7 @@ function insert(parent, accessor, marker, initial) {
|
|
|
286
290
|
childRoot.insertBefore(placeholder, marker);
|
|
287
291
|
initial = [placeholder];
|
|
288
292
|
}
|
|
289
|
-
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker));
|
|
293
|
+
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker), options);
|
|
290
294
|
}
|
|
291
295
|
function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
|
|
292
296
|
const nodeName = node.nodeName;
|
|
@@ -654,16 +658,33 @@ function ssrHydrationKey() {}
|
|
|
654
658
|
function resolveSSRNode(node) {}
|
|
655
659
|
function escape(html) {}
|
|
656
660
|
|
|
657
|
-
function render(...args) {
|
|
658
|
-
const result = render$1(...args);
|
|
659
|
-
return result;
|
|
660
|
-
}
|
|
661
661
|
const isServer = false;
|
|
662
662
|
const isDev = false;
|
|
663
|
-
function
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
function render(code, element, init, options = {}) {
|
|
664
|
+
const renderRoot = element.localName === "template" ? element.content : element;
|
|
665
|
+
let disposer;
|
|
666
|
+
solidJs.createRoot(dispose => {
|
|
667
|
+
disposer = dispose;
|
|
668
|
+
if (element === document) {
|
|
669
|
+
solidJs.flatten(code);
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const marker = renderRoot.firstChild ? null : undefined;
|
|
673
|
+
try {
|
|
674
|
+
const tree = code();
|
|
675
|
+
insert(element, () => tree, marker, init, {
|
|
676
|
+
schedule: true
|
|
677
|
+
});
|
|
678
|
+
} finally {
|
|
679
|
+
}
|
|
680
|
+
}, {
|
|
681
|
+
id: options.renderId
|
|
666
682
|
});
|
|
683
|
+
solidJs.flush();
|
|
684
|
+
return () => {
|
|
685
|
+
disposer();
|
|
686
|
+
renderRoot.textContent = "";
|
|
687
|
+
};
|
|
667
688
|
}
|
|
668
689
|
const hydrate = (...args) => {
|
|
669
690
|
solidJs.enableHydration();
|
|
@@ -689,23 +710,6 @@ function Portal(props) {
|
|
|
689
710
|
});
|
|
690
711
|
return treeMarker;
|
|
691
712
|
}
|
|
692
|
-
function createElementProxy(el, marker) {
|
|
693
|
-
return new Proxy(el, {
|
|
694
|
-
get(target, prop) {
|
|
695
|
-
if (prop === "appendChild" || prop === "insertBefore") {
|
|
696
|
-
return (...args) => {
|
|
697
|
-
Object.defineProperty(args[0], "_$host", {
|
|
698
|
-
get: () => marker.parentNode,
|
|
699
|
-
configurable: true
|
|
700
|
-
});
|
|
701
|
-
target[prop](...args);
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
const value = Reflect.get(target, prop);
|
|
705
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
713
|
function createDynamic(component, props) {
|
|
710
714
|
const cached = solidJs.createMemo(component);
|
|
711
715
|
return solidJs.createMemo(() => {
|
|
@@ -724,6 +728,28 @@ function Dynamic(props) {
|
|
|
724
728
|
const others = solidJs.omit(props, "component");
|
|
725
729
|
return createDynamic(() => props.component, others);
|
|
726
730
|
}
|
|
731
|
+
function createElement(tagName, is = undefined) {
|
|
732
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
733
|
+
is
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function createElementProxy(el, marker) {
|
|
737
|
+
return new Proxy(el, {
|
|
738
|
+
get(target, prop) {
|
|
739
|
+
if (prop === "appendChild" || prop === "insertBefore") {
|
|
740
|
+
return (...args) => {
|
|
741
|
+
Object.defineProperty(args[0], "_$host", {
|
|
742
|
+
get: () => marker.parentNode,
|
|
743
|
+
configurable: true
|
|
744
|
+
});
|
|
745
|
+
target[prop](...args);
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
const value = Reflect.get(target, prop);
|
|
749
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
}
|
|
727
753
|
|
|
728
754
|
Object.defineProperty(exports, "Errored", {
|
|
729
755
|
enumerable: true,
|
package/dist/web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, enableHydration } from 'solid-js';
|
|
1
|
+
import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, enableHydration, flush } 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
3
|
import { createMemo } from '@solidjs/signals';
|
|
4
4
|
|
|
@@ -48,9 +48,13 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
|
|
|
48
48
|
"webview",
|
|
49
49
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const transparentOptions = {
|
|
52
52
|
transparent: true
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
|
+
const effect = (fn, effectFn, options) => createRenderEffect(fn, effectFn, options ? {
|
|
55
|
+
transparent: true,
|
|
56
|
+
...options
|
|
57
|
+
} : transparentOptions);
|
|
54
58
|
const memo = (fn, transparent) => transparent ? fn.$r ? fn : createMemo(() => fn(), {
|
|
55
59
|
transparent: true
|
|
56
60
|
}) : createMemo$1(() => fn());
|
|
@@ -261,7 +265,7 @@ function ref(fn, element) {
|
|
|
261
265
|
const resolved = untrack(fn);
|
|
262
266
|
runWithOwner(null, () => applyRef(resolved, element));
|
|
263
267
|
}
|
|
264
|
-
function insert(parent, accessor, marker, initial) {
|
|
268
|
+
function insert(parent, accessor, marker, initial, options) {
|
|
265
269
|
const childRoot = getChildRoot(parent);
|
|
266
270
|
const multi = marker !== undefined;
|
|
267
271
|
if (multi && !initial) initial = [];
|
|
@@ -285,7 +289,7 @@ function insert(parent, accessor, marker, initial) {
|
|
|
285
289
|
childRoot.insertBefore(placeholder, marker);
|
|
286
290
|
initial = [placeholder];
|
|
287
291
|
}
|
|
288
|
-
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker));
|
|
292
|
+
effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker), options);
|
|
289
293
|
}
|
|
290
294
|
function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
|
|
291
295
|
const nodeName = node.nodeName;
|
|
@@ -653,16 +657,33 @@ function ssrHydrationKey() {}
|
|
|
653
657
|
function resolveSSRNode(node) {}
|
|
654
658
|
function escape(html) {}
|
|
655
659
|
|
|
656
|
-
function render(...args) {
|
|
657
|
-
const result = render$1(...args);
|
|
658
|
-
return result;
|
|
659
|
-
}
|
|
660
660
|
const isServer = false;
|
|
661
661
|
const isDev = false;
|
|
662
|
-
function
|
|
663
|
-
|
|
664
|
-
|
|
662
|
+
function render(code, element, init, options = {}) {
|
|
663
|
+
const renderRoot = element.localName === "template" ? element.content : element;
|
|
664
|
+
let disposer;
|
|
665
|
+
createRoot(dispose => {
|
|
666
|
+
disposer = dispose;
|
|
667
|
+
if (element === document) {
|
|
668
|
+
flatten(code);
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const marker = renderRoot.firstChild ? null : undefined;
|
|
672
|
+
try {
|
|
673
|
+
const tree = code();
|
|
674
|
+
insert(element, () => tree, marker, init, {
|
|
675
|
+
schedule: true
|
|
676
|
+
});
|
|
677
|
+
} finally {
|
|
678
|
+
}
|
|
679
|
+
}, {
|
|
680
|
+
id: options.renderId
|
|
665
681
|
});
|
|
682
|
+
flush();
|
|
683
|
+
return () => {
|
|
684
|
+
disposer();
|
|
685
|
+
renderRoot.textContent = "";
|
|
686
|
+
};
|
|
666
687
|
}
|
|
667
688
|
const hydrate = (...args) => {
|
|
668
689
|
enableHydration();
|
|
@@ -688,23 +709,6 @@ function Portal(props) {
|
|
|
688
709
|
});
|
|
689
710
|
return treeMarker;
|
|
690
711
|
}
|
|
691
|
-
function createElementProxy(el, marker) {
|
|
692
|
-
return new Proxy(el, {
|
|
693
|
-
get(target, prop) {
|
|
694
|
-
if (prop === "appendChild" || prop === "insertBefore") {
|
|
695
|
-
return (...args) => {
|
|
696
|
-
Object.defineProperty(args[0], "_$host", {
|
|
697
|
-
get: () => marker.parentNode,
|
|
698
|
-
configurable: true
|
|
699
|
-
});
|
|
700
|
-
target[prop](...args);
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
const value = Reflect.get(target, prop);
|
|
704
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
712
|
function createDynamic(component, props) {
|
|
709
713
|
const cached = createMemo$1(component);
|
|
710
714
|
return createMemo$1(() => {
|
|
@@ -723,5 +727,27 @@ function Dynamic(props) {
|
|
|
723
727
|
const others = omit(props, "component");
|
|
724
728
|
return createDynamic(() => props.component, others);
|
|
725
729
|
}
|
|
730
|
+
function createElement(tagName, is = undefined) {
|
|
731
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
732
|
+
is
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function createElementProxy(el, marker) {
|
|
736
|
+
return new Proxy(el, {
|
|
737
|
+
get(target, prop) {
|
|
738
|
+
if (prop === "appendChild" || prop === "insertBefore") {
|
|
739
|
+
return (...args) => {
|
|
740
|
+
Object.defineProperty(args[0], "_$host", {
|
|
741
|
+
get: () => marker.parentNode,
|
|
742
|
+
configurable: true
|
|
743
|
+
});
|
|
744
|
+
target[prop](...args);
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
const value = Reflect.get(target, prop);
|
|
748
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
726
752
|
|
|
727
753
|
export { voidFn as Assets, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, voidFn as HydrationScript, MathMLElements, Namespaces, Portal, RequestContext, SVGElements, 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.8",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -116,12 +116,12 @@
|
|
|
116
116
|
"seroval-plugins": "^1.1.0"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@solidjs/signals": "^2.0.0-beta.
|
|
120
|
-
"solid-js": "^2.0.0-beta.
|
|
119
|
+
"@solidjs/signals": "^2.0.0-beta.8",
|
|
120
|
+
"solid-js": "^2.0.0-beta.8"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@solidjs/signals": "2.0.0-beta.
|
|
124
|
-
"solid-js": "2.0.0-beta.
|
|
123
|
+
"@solidjs/signals": "2.0.0-beta.8",
|
|
124
|
+
"solid-js": "2.0.0-beta.8"
|
|
125
125
|
},
|
|
126
126
|
"scripts": {
|
|
127
127
|
"build": "npm-run-all -nl build:*",
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { hydrate as hydrateCore
|
|
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 declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
-
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
4
|
export * from "./server-mock.js";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
7
6
|
export declare const isServer: boolean;
|
|
8
7
|
export declare const isDev: boolean;
|
|
8
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
|
+
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
10
|
+
[K in keyof P]: P[K];
|
|
11
|
+
} & {
|
|
12
|
+
component: T | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a component tree into a DOM element and returns a dispose function.
|
|
16
|
+
*
|
|
17
|
+
* The top-level insert runs with `schedule: true` so its initial DOM attach
|
|
18
|
+
* goes through the effect queue rather than executing inline. This lets the
|
|
19
|
+
* mount participate in transitions: if an uncaught async read surfaces during
|
|
20
|
+
* the initial render (no `Loading` ancestor absorbs it), the mount is held by
|
|
21
|
+
* the transition and attaches atomically once all pending settles. On the
|
|
22
|
+
* no-async happy path the tail `flush()` drains the queued callback so the
|
|
23
|
+
* attach is synchronous by the time `render()` returns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
|
|
26
|
+
renderId?: string;
|
|
27
|
+
}): () => void;
|
|
9
28
|
export declare const hydrate: typeof hydrateCore;
|
|
10
29
|
/**
|
|
11
30
|
* Renders components somewhere else in the DOM
|
|
@@ -18,11 +37,6 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
|
|
|
18
37
|
mount?: Element;
|
|
19
38
|
children: JSX.Element;
|
|
20
39
|
}): Text;
|
|
21
|
-
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
22
|
-
[K in keyof P]: P[K];
|
|
23
|
-
} & {
|
|
24
|
-
component: T | undefined;
|
|
25
|
-
};
|
|
26
40
|
/**
|
|
27
41
|
* Renders an arbitrary component or element with the given props
|
|
28
42
|
*
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { hydrate as hydrateCore
|
|
1
|
+
import { hydrate as hydrateCore } from "./client.cjs";
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.cjs";
|
|
4
|
-
export declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
-
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
4
|
export * from "./server-mock.cjs";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
7
6
|
export declare const isServer: boolean;
|
|
8
7
|
export declare const isDev: boolean;
|
|
8
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
|
+
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
10
|
+
[K in keyof P]: P[K];
|
|
11
|
+
} & {
|
|
12
|
+
component: T | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a component tree into a DOM element and returns a dispose function.
|
|
16
|
+
*
|
|
17
|
+
* The top-level insert runs with `schedule: true` so its initial DOM attach
|
|
18
|
+
* goes through the effect queue rather than executing inline. This lets the
|
|
19
|
+
* mount participate in transitions: if an uncaught async read surfaces during
|
|
20
|
+
* the initial render (no `Loading` ancestor absorbs it), the mount is held by
|
|
21
|
+
* the transition and attaches atomically once all pending settles. On the
|
|
22
|
+
* no-async happy path the tail `flush()` drains the queued callback so the
|
|
23
|
+
* attach is synchronous by the time `render()` returns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
|
|
26
|
+
renderId?: string;
|
|
27
|
+
}): () => void;
|
|
9
28
|
export declare const hydrate: typeof hydrateCore;
|
|
10
29
|
/**
|
|
11
30
|
* Renders components somewhere else in the DOM
|
|
@@ -18,11 +37,6 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
|
|
|
18
37
|
mount?: Element;
|
|
19
38
|
children: JSX.Element;
|
|
20
39
|
}): Text;
|
|
21
|
-
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
22
|
-
[K in keyof P]: P[K];
|
|
23
|
-
} & {
|
|
24
|
-
component: T | undefined;
|
|
25
|
-
};
|
|
26
40
|
/**
|
|
27
41
|
* Renders an arbitrary component or element with the given props
|
|
28
42
|
*
|
package/types/client.d.ts
CHANGED
|
@@ -33,11 +33,7 @@ export function insert<T>(
|
|
|
33
33
|
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
34
34
|
export function delegateEvents(eventNames: string[], d?: Document): void;
|
|
35
35
|
export function clearDelegatedEvents(d?: Document): void;
|
|
36
|
-
export function spread<T>(
|
|
37
|
-
node: Element,
|
|
38
|
-
accessor: T,
|
|
39
|
-
skipChildren?: Boolean
|
|
40
|
-
): void;
|
|
36
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
41
37
|
export function assign(
|
|
42
38
|
node: Element,
|
|
43
39
|
props: any,
|
|
@@ -50,7 +46,11 @@ export function setAttributeNS(node: Element, namespace: string, name: string, v
|
|
|
50
46
|
type ClassList =
|
|
51
47
|
| Record<string, boolean>
|
|
52
48
|
| Array<string | number | boolean | null | undefined | Record<string, boolean>>;
|
|
53
|
-
export function className(
|
|
49
|
+
export function className(
|
|
50
|
+
node: Element,
|
|
51
|
+
value: string | ClassList,
|
|
52
|
+
prev?: string | ClassList
|
|
53
|
+
): void;
|
|
54
54
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
55
55
|
export function setStyleProperty(node: Element, name: string, value: any): void;
|
|
56
56
|
export function addEventListener(
|
|
@@ -67,8 +67,14 @@ export function style(
|
|
|
67
67
|
export function getOwner(): unknown;
|
|
68
68
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
69
69
|
export function dynamicProperty(props: unknown, key: string): unknown;
|
|
70
|
-
export function applyRef(
|
|
71
|
-
|
|
70
|
+
export function applyRef(
|
|
71
|
+
r: ((element: Element) => void) | ((element: Element) => void)[],
|
|
72
|
+
element: Element
|
|
73
|
+
): void;
|
|
74
|
+
export function ref(
|
|
75
|
+
fn: () => ((element: Element) => void) | ((element: Element) => void)[],
|
|
76
|
+
element: Element
|
|
77
|
+
): void;
|
|
72
78
|
|
|
73
79
|
export function hydrate(
|
|
74
80
|
fn: () => JSX.Element,
|
|
@@ -82,7 +88,10 @@ export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
|
82
88
|
export function useAssets(fn: () => JSX.Element): void;
|
|
83
89
|
export function getAssets(): string;
|
|
84
90
|
export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
85
|
-
export function generateHydrationScript(options?: {
|
|
91
|
+
export function generateHydrationScript(options?: {
|
|
92
|
+
nonce?: string;
|
|
93
|
+
eventNames?: string[];
|
|
94
|
+
}): string;
|
|
86
95
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
87
96
|
export interface RequestEvent {
|
|
88
97
|
request: Request;
|
package/types/core.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { getOwner, runWithOwner, createComponent, createRoot as root, sharedConfig, untrack, merge as mergeProps, flatten, ssrHandleError, ssrRunInScope } from "solid-js";
|
|
2
|
-
export declare const effect: (fn: any, effectFn: any) => void;
|
|
2
|
+
export declare const effect: (fn: any, effectFn: any, options: any) => void;
|
|
3
3
|
export declare const memo: (fn: any, transparent: any) => any;
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { hydrate as hydrateCore
|
|
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 declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
-
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
4
|
export * from "./server-mock.js";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
7
6
|
export declare const isServer: boolean;
|
|
8
7
|
export declare const isDev: boolean;
|
|
8
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
|
+
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
10
|
+
[K in keyof P]: P[K];
|
|
11
|
+
} & {
|
|
12
|
+
component: T | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a component tree into a DOM element and returns a dispose function.
|
|
16
|
+
*
|
|
17
|
+
* The top-level insert runs with `schedule: true` so its initial DOM attach
|
|
18
|
+
* goes through the effect queue rather than executing inline. This lets the
|
|
19
|
+
* mount participate in transitions: if an uncaught async read surfaces during
|
|
20
|
+
* the initial render (no `Loading` ancestor absorbs it), the mount is held by
|
|
21
|
+
* the transition and attaches atomically once all pending settles. On the
|
|
22
|
+
* no-async happy path the tail `flush()` drains the queued callback so the
|
|
23
|
+
* attach is synchronous by the time `render()` returns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
|
|
26
|
+
renderId?: string;
|
|
27
|
+
}): () => void;
|
|
9
28
|
export declare const hydrate: typeof hydrateCore;
|
|
10
29
|
/**
|
|
11
30
|
* Renders components somewhere else in the DOM
|
|
@@ -18,11 +37,6 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
|
|
|
18
37
|
mount?: Element;
|
|
19
38
|
children: JSX.Element;
|
|
20
39
|
}): Text;
|
|
21
|
-
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
22
|
-
[K in keyof P]: P[K];
|
|
23
|
-
} & {
|
|
24
|
-
component: T | undefined;
|
|
25
|
-
};
|
|
26
40
|
/**
|
|
27
41
|
* Renders an arbitrary component or element with the given props
|
|
28
42
|
*
|
package/types/server.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ export function renderToString<T>(
|
|
|
15
15
|
renderId?: string;
|
|
16
16
|
noScripts?: boolean;
|
|
17
17
|
plugins?: any[];
|
|
18
|
-
manifest?: Record<
|
|
18
|
+
manifest?: Record<
|
|
19
|
+
string,
|
|
20
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
21
|
+
> & { _base?: string };
|
|
19
22
|
onError?: (err: any) => void;
|
|
20
23
|
}
|
|
21
24
|
): string;
|
|
@@ -28,7 +31,10 @@ export function renderToStringAsync<T>(
|
|
|
28
31
|
renderId?: string;
|
|
29
32
|
noScripts?: boolean;
|
|
30
33
|
plugins?: any[];
|
|
31
|
-
manifest?: Record<
|
|
34
|
+
manifest?: Record<
|
|
35
|
+
string,
|
|
36
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
37
|
+
> & { _base?: string };
|
|
32
38
|
onError?: (err: any) => void;
|
|
33
39
|
}
|
|
34
40
|
): Promise<string>;
|
|
@@ -39,7 +45,10 @@ export function renderToStream<T>(
|
|
|
39
45
|
renderId?: string;
|
|
40
46
|
noScripts?: boolean;
|
|
41
47
|
plugins?: any[];
|
|
42
|
-
manifest?: Record<
|
|
48
|
+
manifest?: Record<
|
|
49
|
+
string,
|
|
50
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
51
|
+
> & { _base?: string };
|
|
43
52
|
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
44
53
|
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
45
54
|
onError?: (err: any) => void;
|
|
@@ -65,7 +74,10 @@ export function ssrAttribute(key: string, value: any): string;
|
|
|
65
74
|
export function ssrHydrationKey(): string;
|
|
66
75
|
export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
|
|
67
76
|
export function escape(s: any, attr?: boolean): any;
|
|
68
|
-
export function applyRef(
|
|
77
|
+
export function applyRef(
|
|
78
|
+
r: ((element: any) => void) | ((element: any) => void)[],
|
|
79
|
+
element: any
|
|
80
|
+
): void;
|
|
69
81
|
export function useAssets(fn: () => JSX.Element): void;
|
|
70
82
|
export function getAssets(): string;
|
|
71
83
|
export function getHydrationKey(): string | undefined;
|
|
@@ -75,7 +87,10 @@ export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): J
|
|
|
75
87
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
76
88
|
export function getOwner(): unknown;
|
|
77
89
|
export function ssrRunInScope(fn: () => void, owner: unknown): void;
|
|
78
|
-
export function generateHydrationScript(options?: {
|
|
90
|
+
export function generateHydrationScript(options?: {
|
|
91
|
+
nonce?: string;
|
|
92
|
+
eventNames?: string[];
|
|
93
|
+
}): string;
|
|
79
94
|
export declare const RequestContext: unique symbol;
|
|
80
95
|
export interface RequestEvent {
|
|
81
96
|
request: Request;
|
|
@@ -104,11 +119,7 @@ export function insert<T>(
|
|
|
104
119
|
): JSX.Element;
|
|
105
120
|
|
|
106
121
|
/** @deprecated not supported on the server side */
|
|
107
|
-
export function spread<T>(
|
|
108
|
-
node: Element,
|
|
109
|
-
accessor: T,
|
|
110
|
-
skipChildren?: Boolean
|
|
111
|
-
): void;
|
|
122
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
112
123
|
|
|
113
124
|
/** @deprecated not supported on the server side */
|
|
114
125
|
export function delegateEvents(eventNames: string[], d?: Document): void;
|
package/types-cjs/client.d.cts
CHANGED
|
@@ -33,11 +33,7 @@ export function insert<T>(
|
|
|
33
33
|
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
34
34
|
export function delegateEvents(eventNames: string[], d?: Document): void;
|
|
35
35
|
export function clearDelegatedEvents(d?: Document): void;
|
|
36
|
-
export function spread<T>(
|
|
37
|
-
node: Element,
|
|
38
|
-
accessor: T,
|
|
39
|
-
skipChildren?: Boolean
|
|
40
|
-
): void;
|
|
36
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
41
37
|
export function assign(
|
|
42
38
|
node: Element,
|
|
43
39
|
props: any,
|
|
@@ -50,7 +46,11 @@ export function setAttributeNS(node: Element, namespace: string, name: string, v
|
|
|
50
46
|
type ClassList =
|
|
51
47
|
| Record<string, boolean>
|
|
52
48
|
| Array<string | number | boolean | null | undefined | Record<string, boolean>>;
|
|
53
|
-
export function className(
|
|
49
|
+
export function className(
|
|
50
|
+
node: Element,
|
|
51
|
+
value: string | ClassList,
|
|
52
|
+
prev?: string | ClassList
|
|
53
|
+
): void;
|
|
54
54
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
55
55
|
export function setStyleProperty(node: Element, name: string, value: any): void;
|
|
56
56
|
export function addEventListener(
|
|
@@ -67,8 +67,14 @@ export function style(
|
|
|
67
67
|
export function getOwner(): unknown;
|
|
68
68
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
69
69
|
export function dynamicProperty(props: unknown, key: string): unknown;
|
|
70
|
-
export function applyRef(
|
|
71
|
-
|
|
70
|
+
export function applyRef(
|
|
71
|
+
r: ((element: Element) => void) | ((element: Element) => void)[],
|
|
72
|
+
element: Element
|
|
73
|
+
): void;
|
|
74
|
+
export function ref(
|
|
75
|
+
fn: () => ((element: Element) => void) | ((element: Element) => void)[],
|
|
76
|
+
element: Element
|
|
77
|
+
): void;
|
|
72
78
|
|
|
73
79
|
export function hydrate(
|
|
74
80
|
fn: () => JSX.Element,
|
|
@@ -82,7 +88,10 @@ export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
|
82
88
|
export function useAssets(fn: () => JSX.Element): void;
|
|
83
89
|
export function getAssets(): string;
|
|
84
90
|
export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
85
|
-
export function generateHydrationScript(options?: {
|
|
91
|
+
export function generateHydrationScript(options?: {
|
|
92
|
+
nonce?: string;
|
|
93
|
+
eventNames?: string[];
|
|
94
|
+
}): string;
|
|
86
95
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
87
96
|
export interface RequestEvent {
|
|
88
97
|
request: Request;
|
package/types-cjs/core.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { getOwner, runWithOwner, createComponent, createRoot as root, sharedConfig, untrack, merge as mergeProps, flatten, ssrHandleError, ssrRunInScope } from "solid-js";
|
|
2
|
-
export declare const effect: (fn: any, effectFn: any) => void;
|
|
2
|
+
export declare const effect: (fn: any, effectFn: any, options: any) => void;
|
|
3
3
|
export declare const memo: (fn: any, transparent: any) => any;
|
package/types-cjs/index.d.cts
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { hydrate as hydrateCore
|
|
1
|
+
import { hydrate as hydrateCore } from "./client.cjs";
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.cjs";
|
|
4
|
-
export declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
-
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
4
|
export * from "./server-mock.cjs";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
7
6
|
export declare const isServer: boolean;
|
|
8
7
|
export declare const isDev: boolean;
|
|
8
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
|
+
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
10
|
+
[K in keyof P]: P[K];
|
|
11
|
+
} & {
|
|
12
|
+
component: T | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a component tree into a DOM element and returns a dispose function.
|
|
16
|
+
*
|
|
17
|
+
* The top-level insert runs with `schedule: true` so its initial DOM attach
|
|
18
|
+
* goes through the effect queue rather than executing inline. This lets the
|
|
19
|
+
* mount participate in transitions: if an uncaught async read surfaces during
|
|
20
|
+
* the initial render (no `Loading` ancestor absorbs it), the mount is held by
|
|
21
|
+
* the transition and attaches atomically once all pending settles. On the
|
|
22
|
+
* no-async happy path the tail `flush()` drains the queued callback so the
|
|
23
|
+
* attach is synchronous by the time `render()` returns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
|
|
26
|
+
renderId?: string;
|
|
27
|
+
}): () => void;
|
|
9
28
|
export declare const hydrate: typeof hydrateCore;
|
|
10
29
|
/**
|
|
11
30
|
* Renders components somewhere else in the DOM
|
|
@@ -18,11 +37,6 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
|
|
|
18
37
|
mount?: Element;
|
|
19
38
|
children: JSX.Element;
|
|
20
39
|
}): Text;
|
|
21
|
-
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
22
|
-
[K in keyof P]: P[K];
|
|
23
|
-
} & {
|
|
24
|
-
component: T | undefined;
|
|
25
|
-
};
|
|
26
40
|
/**
|
|
27
41
|
* Renders an arbitrary component or element with the given props
|
|
28
42
|
*
|
package/types-cjs/server.d.cts
CHANGED
|
@@ -15,7 +15,10 @@ export function renderToString<T>(
|
|
|
15
15
|
renderId?: string;
|
|
16
16
|
noScripts?: boolean;
|
|
17
17
|
plugins?: any[];
|
|
18
|
-
manifest?: Record<
|
|
18
|
+
manifest?: Record<
|
|
19
|
+
string,
|
|
20
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
21
|
+
> & { _base?: string };
|
|
19
22
|
onError?: (err: any) => void;
|
|
20
23
|
}
|
|
21
24
|
): string;
|
|
@@ -28,7 +31,10 @@ export function renderToStringAsync<T>(
|
|
|
28
31
|
renderId?: string;
|
|
29
32
|
noScripts?: boolean;
|
|
30
33
|
plugins?: any[];
|
|
31
|
-
manifest?: Record<
|
|
34
|
+
manifest?: Record<
|
|
35
|
+
string,
|
|
36
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
37
|
+
> & { _base?: string };
|
|
32
38
|
onError?: (err: any) => void;
|
|
33
39
|
}
|
|
34
40
|
): Promise<string>;
|
|
@@ -39,7 +45,10 @@ export function renderToStream<T>(
|
|
|
39
45
|
renderId?: string;
|
|
40
46
|
noScripts?: boolean;
|
|
41
47
|
plugins?: any[];
|
|
42
|
-
manifest?: Record<
|
|
48
|
+
manifest?: Record<
|
|
49
|
+
string,
|
|
50
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
51
|
+
> & { _base?: string };
|
|
43
52
|
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
44
53
|
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
45
54
|
onError?: (err: any) => void;
|
|
@@ -65,7 +74,10 @@ export function ssrAttribute(key: string, value: any): string;
|
|
|
65
74
|
export function ssrHydrationKey(): string;
|
|
66
75
|
export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
|
|
67
76
|
export function escape(s: any, attr?: boolean): any;
|
|
68
|
-
export function applyRef(
|
|
77
|
+
export function applyRef(
|
|
78
|
+
r: ((element: any) => void) | ((element: any) => void)[],
|
|
79
|
+
element: any
|
|
80
|
+
): void;
|
|
69
81
|
export function useAssets(fn: () => JSX.Element): void;
|
|
70
82
|
export function getAssets(): string;
|
|
71
83
|
export function getHydrationKey(): string | undefined;
|
|
@@ -75,7 +87,10 @@ export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): J
|
|
|
75
87
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
76
88
|
export function getOwner(): unknown;
|
|
77
89
|
export function ssrRunInScope(fn: () => void, owner: unknown): void;
|
|
78
|
-
export function generateHydrationScript(options?: {
|
|
90
|
+
export function generateHydrationScript(options?: {
|
|
91
|
+
nonce?: string;
|
|
92
|
+
eventNames?: string[];
|
|
93
|
+
}): string;
|
|
79
94
|
export declare const RequestContext: unique symbol;
|
|
80
95
|
export interface RequestEvent {
|
|
81
96
|
request: Request;
|
|
@@ -104,11 +119,7 @@ export function insert<T>(
|
|
|
104
119
|
): JSX.Element;
|
|
105
120
|
|
|
106
121
|
/** @deprecated not supported on the server side */
|
|
107
|
-
export function spread<T>(
|
|
108
|
-
node: Element,
|
|
109
|
-
accessor: T,
|
|
110
|
-
skipChildren?: Boolean
|
|
111
|
-
): void;
|
|
122
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
112
123
|
|
|
113
124
|
/** @deprecated not supported on the server side */
|
|
114
125
|
export function delegateEvents(eventNames: string[], d?: Document): void;
|