@solidjs/web 2.0.0-rc.16 → 2.0.0-rc.17
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 +16 -17
- package/dist/server.js +16 -17
- package/dist/server.observe.js +16 -17
- package/dist/web.dev.js +53 -1
- package/dist/web.js +4 -1
- package/dist/web.observe.js +4 -1
- package/frames/dist/server.dev.js +281 -3
- package/frames/dist/server.js +280 -3
- package/frames/dist/server.observe.js +280 -3
- package/package.json +2 -2
- package/server-functions/dist/client.dev.js +10 -21
- package/server-functions/dist/client.js +10 -21
- package/server-functions/dist/client.observe.js +10 -21
- package/server-functions/dist/rich-args.js +54 -3
- package/server-functions/dist/server.dev.js +68 -3
- package/server-functions/dist/server.js +68 -3
- package/server-functions/dist/server.observe.js +68 -3
- package/types/client.d.ts +12 -0
- package/types/diagnostics.d.ts +16 -0
- package/types/server-functions/argument-codec.d.ts +11 -2
- package/types/server-functions/client.d.ts +13 -4
- package/types/server-functions/server.d.ts +17 -0
- package/types/server-functions/uploads.d.ts +50 -0
- package/types/server.d.ts +1 -1
package/dist/server.dev.js
CHANGED
|
@@ -1883,6 +1883,13 @@ function renderToStream(code, options = {}) {
|
|
|
1883
1883
|
const requestEvent = peekRequestEvent();
|
|
1884
1884
|
if (requestEvent) setRequestErrorHook(requestEvent, options.onError);
|
|
1885
1885
|
const errorScope = requestEvent || {};
|
|
1886
|
+
const reportFailure = (err, handling) => {
|
|
1887
|
+
reportServerError(err, {
|
|
1888
|
+
kind: "render",
|
|
1889
|
+
handling
|
|
1890
|
+
}, null, options.onError, errorScope);
|
|
1891
|
+
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1892
|
+
};
|
|
1886
1893
|
let dispose;
|
|
1887
1894
|
let dead = false;
|
|
1888
1895
|
let render;
|
|
@@ -1937,15 +1944,7 @@ function renderToStream(code, options = {}) {
|
|
|
1937
1944
|
if (dispose) {
|
|
1938
1945
|
const d = dispose;
|
|
1939
1946
|
dispose = () => {};
|
|
1940
|
-
|
|
1941
|
-
d();
|
|
1942
|
-
} catch (err) {
|
|
1943
|
-
reportServerError(err, {
|
|
1944
|
-
kind: "render",
|
|
1945
|
-
handling: "failed"
|
|
1946
|
-
}, null, options.onError, errorScope);
|
|
1947
|
-
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1948
|
-
}
|
|
1947
|
+
d();
|
|
1949
1948
|
}
|
|
1950
1949
|
if (serializer && typeof serializer.close === "function") {
|
|
1951
1950
|
try {
|
|
@@ -1968,11 +1967,7 @@ function renderToStream(code, options = {}) {
|
|
|
1968
1967
|
} else if (!sink && onDisconnectedBeforeShell) onDisconnectedBeforeShell();
|
|
1969
1968
|
};
|
|
1970
1969
|
const failRender = err => {
|
|
1971
|
-
|
|
1972
|
-
kind: "render",
|
|
1973
|
-
handling: "failed"
|
|
1974
|
-
}, null, options.onError, errorScope);
|
|
1975
|
-
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1970
|
+
reportFailure(err, "failed");
|
|
1976
1971
|
abandon();
|
|
1977
1972
|
};
|
|
1978
1973
|
const failRootRender = err => {
|
|
@@ -2141,7 +2136,7 @@ function renderToStream(code, options = {}) {
|
|
|
2141
2136
|
plugins: options.plugins,
|
|
2142
2137
|
onData: payload => sink.data(payload),
|
|
2143
2138
|
onDone,
|
|
2144
|
-
onError:
|
|
2139
|
+
onError: err => reportFailure(err, "serialize")
|
|
2145
2140
|
});
|
|
2146
2141
|
let rootAssetsSerialized = false;
|
|
2147
2142
|
const serializeRootAssets = () => {
|
|
@@ -2512,7 +2507,11 @@ function renderToStream(code, options = {}) {
|
|
|
2512
2507
|
context.trace = undefined;
|
|
2513
2508
|
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
2514
2509
|
if (endEdges) endEdges();
|
|
2515
|
-
|
|
2510
|
+
try {
|
|
2511
|
+
d();
|
|
2512
|
+
} catch (err) {
|
|
2513
|
+
reportFailure(err, "failed");
|
|
2514
|
+
}
|
|
2516
2515
|
};
|
|
2517
2516
|
rootOwner = claimRenderRoot(context);
|
|
2518
2517
|
if (requestEvent) claimEventRender(requestEvent, context);
|
|
@@ -4907,4 +4906,4 @@ function httpHeader(name, value, options) {
|
|
|
4907
4906
|
}
|
|
4908
4907
|
}
|
|
4909
4908
|
|
|
4910
|
-
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, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, configureServerErrors, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dispatchAsInteraction, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, getHydrationWriter, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, setLinkClaim, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrSelectValues, ssrStyle, ssrStyleProperties, ssrStyleProperty, notSup as style, takeHydrationValue, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
|
4909
|
+
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, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, configureServerErrors, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dispatchAsInteraction, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, getHydrationWriter, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, setLinkClaim, notSup as setProperty, notSup as setStatefulProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrSelectValues, ssrStyle, ssrStyleProperties, ssrStyleProperty, notSup as style, takeHydrationValue, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
package/dist/server.js
CHANGED
|
@@ -1618,6 +1618,13 @@ function renderToStream(code, options = {}) {
|
|
|
1618
1618
|
const requestEvent = peekRequestEvent();
|
|
1619
1619
|
if (requestEvent) setRequestErrorHook(requestEvent, options.onError);
|
|
1620
1620
|
const errorScope = requestEvent || {};
|
|
1621
|
+
const reportFailure = (err, handling) => {
|
|
1622
|
+
reportServerError(err, {
|
|
1623
|
+
kind: "render",
|
|
1624
|
+
handling
|
|
1625
|
+
}, null, options.onError, errorScope);
|
|
1626
|
+
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1627
|
+
};
|
|
1621
1628
|
let dispose;
|
|
1622
1629
|
let dead = false;
|
|
1623
1630
|
let render;
|
|
@@ -1661,15 +1668,7 @@ function renderToStream(code, options = {}) {
|
|
|
1661
1668
|
if (dispose) {
|
|
1662
1669
|
const d = dispose;
|
|
1663
1670
|
dispose = () => {};
|
|
1664
|
-
|
|
1665
|
-
d();
|
|
1666
|
-
} catch (err) {
|
|
1667
|
-
reportServerError(err, {
|
|
1668
|
-
kind: "render",
|
|
1669
|
-
handling: "failed"
|
|
1670
|
-
}, null, options.onError, errorScope);
|
|
1671
|
-
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1672
|
-
}
|
|
1671
|
+
d();
|
|
1673
1672
|
}
|
|
1674
1673
|
if (serializer && typeof serializer.close === "function") {
|
|
1675
1674
|
try {
|
|
@@ -1692,11 +1691,7 @@ function renderToStream(code, options = {}) {
|
|
|
1692
1691
|
} else if (!sink && onDisconnectedBeforeShell) onDisconnectedBeforeShell();
|
|
1693
1692
|
};
|
|
1694
1693
|
const failRender = err => {
|
|
1695
|
-
|
|
1696
|
-
kind: "render",
|
|
1697
|
-
handling: "failed"
|
|
1698
|
-
}, null, options.onError, errorScope);
|
|
1699
|
-
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1694
|
+
reportFailure(err, "failed");
|
|
1700
1695
|
abandon();
|
|
1701
1696
|
};
|
|
1702
1697
|
const failRootRender = err => {
|
|
@@ -1855,7 +1850,7 @@ function renderToStream(code, options = {}) {
|
|
|
1855
1850
|
plugins: options.plugins,
|
|
1856
1851
|
onData: payload => sink.data(payload),
|
|
1857
1852
|
onDone,
|
|
1858
|
-
onError:
|
|
1853
|
+
onError: err => reportFailure(err, "serialize")
|
|
1859
1854
|
});
|
|
1860
1855
|
let rootAssetsSerialized = false;
|
|
1861
1856
|
const serializeRootAssets = () => {
|
|
@@ -2210,7 +2205,11 @@ function renderToStream(code, options = {}) {
|
|
|
2210
2205
|
context.trace = undefined;
|
|
2211
2206
|
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
2212
2207
|
if (endEdges) endEdges();
|
|
2213
|
-
|
|
2208
|
+
try {
|
|
2209
|
+
d();
|
|
2210
|
+
} catch (err) {
|
|
2211
|
+
reportFailure(err, "failed");
|
|
2212
|
+
}
|
|
2214
2213
|
};
|
|
2215
2214
|
rootOwner = claimRenderRoot(context);
|
|
2216
2215
|
if (requestEvent) claimEventRender(requestEvent, context);
|
|
@@ -4564,4 +4563,4 @@ function httpHeader(name, value, options) {
|
|
|
4564
4563
|
}
|
|
4565
4564
|
}
|
|
4566
4565
|
|
|
4567
|
-
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, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, configureServerErrors, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dispatchAsInteraction, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, getHydrationWriter, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, setLinkClaim, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrSelectValues, ssrStyle, ssrStyleProperties, ssrStyleProperty, notSup as style, takeHydrationValue, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
|
4566
|
+
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, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, configureServerErrors, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dispatchAsInteraction, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, getHydrationWriter, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, setLinkClaim, notSup as setProperty, notSup as setStatefulProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrSelectValues, ssrStyle, ssrStyleProperties, ssrStyleProperty, notSup as style, takeHydrationValue, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
package/dist/server.observe.js
CHANGED
|
@@ -1714,6 +1714,13 @@ function renderToStream(code, options = {}) {
|
|
|
1714
1714
|
const requestEvent = peekRequestEvent();
|
|
1715
1715
|
if (requestEvent) setRequestErrorHook(requestEvent, options.onError);
|
|
1716
1716
|
const errorScope = requestEvent || {};
|
|
1717
|
+
const reportFailure = (err, handling) => {
|
|
1718
|
+
reportServerError(err, {
|
|
1719
|
+
kind: "render",
|
|
1720
|
+
handling
|
|
1721
|
+
}, null, options.onError, errorScope);
|
|
1722
|
+
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1723
|
+
};
|
|
1717
1724
|
let dispose;
|
|
1718
1725
|
let dead = false;
|
|
1719
1726
|
let render;
|
|
@@ -1768,15 +1775,7 @@ function renderToStream(code, options = {}) {
|
|
|
1768
1775
|
if (dispose) {
|
|
1769
1776
|
const d = dispose;
|
|
1770
1777
|
dispose = () => {};
|
|
1771
|
-
|
|
1772
|
-
d();
|
|
1773
|
-
} catch (err) {
|
|
1774
|
-
reportServerError(err, {
|
|
1775
|
-
kind: "render",
|
|
1776
|
-
handling: "failed"
|
|
1777
|
-
}, null, options.onError, errorScope);
|
|
1778
|
-
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1779
|
-
}
|
|
1778
|
+
d();
|
|
1780
1779
|
}
|
|
1781
1780
|
if (serializer && typeof serializer.close === "function") {
|
|
1782
1781
|
try {
|
|
@@ -1799,11 +1798,7 @@ function renderToStream(code, options = {}) {
|
|
|
1799
1798
|
} else if (!sink && onDisconnectedBeforeShell) onDisconnectedBeforeShell();
|
|
1800
1799
|
};
|
|
1801
1800
|
const failRender = err => {
|
|
1802
|
-
|
|
1803
|
-
kind: "render",
|
|
1804
|
-
handling: "failed"
|
|
1805
|
-
}, null, options.onError, errorScope);
|
|
1806
|
-
if (!options.onError && ambientServerErrorHook() === undefined) console.error(err);
|
|
1801
|
+
reportFailure(err, "failed");
|
|
1807
1802
|
abandon();
|
|
1808
1803
|
};
|
|
1809
1804
|
const failRootRender = err => {
|
|
@@ -1972,7 +1967,7 @@ function renderToStream(code, options = {}) {
|
|
|
1972
1967
|
plugins: options.plugins,
|
|
1973
1968
|
onData: payload => sink.data(payload),
|
|
1974
1969
|
onDone,
|
|
1975
|
-
onError:
|
|
1970
|
+
onError: err => reportFailure(err, "serialize")
|
|
1976
1971
|
});
|
|
1977
1972
|
let rootAssetsSerialized = false;
|
|
1978
1973
|
const serializeRootAssets = () => {
|
|
@@ -2343,7 +2338,11 @@ function renderToStream(code, options = {}) {
|
|
|
2343
2338
|
context.trace = undefined;
|
|
2344
2339
|
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
2345
2340
|
if (endEdges) endEdges();
|
|
2346
|
-
|
|
2341
|
+
try {
|
|
2342
|
+
d();
|
|
2343
|
+
} catch (err) {
|
|
2344
|
+
reportFailure(err, "failed");
|
|
2345
|
+
}
|
|
2347
2346
|
};
|
|
2348
2347
|
rootOwner = claimRenderRoot(context);
|
|
2349
2348
|
if (requestEvent) claimEventRender(requestEvent, context);
|
|
@@ -4719,4 +4718,4 @@ function httpHeader(name, value, options) {
|
|
|
4719
4718
|
}
|
|
4720
4719
|
}
|
|
4721
4720
|
|
|
4722
|
-
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, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, configureServerErrors, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dispatchAsInteraction, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, getHydrationWriter, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, setLinkClaim, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrSelectValues, ssrStyle, ssrStyleProperties, ssrStyleProperty, notSup as style, takeHydrationValue, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
|
4721
|
+
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, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, configureServerErrors, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dispatchAsInteraction, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, getHydrationWriter, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, notSup as readShallow, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, setLinkClaim, notSup as setProperty, notSup as setStatefulProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrSelectValues, ssrStyle, ssrStyleProperties, ssrStyleProperty, notSup as style, takeHydrationValue, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
package/dist/web.dev.js
CHANGED
|
@@ -240,6 +240,49 @@ function lowercaseEventAttribute(name, node) {
|
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
+
const statefulWrites = /*#__PURE__*/new WeakMap();
|
|
244
|
+
function statefulRecord(node, prop) {
|
|
245
|
+
if (DOMWithState[node.nodeName]?.[prop] !== 1 || node.nodeName === "SELECT") return;
|
|
246
|
+
let records = statefulWrites.get(node);
|
|
247
|
+
if (!records) statefulWrites.set(node, records = {});
|
|
248
|
+
return records;
|
|
249
|
+
}
|
|
250
|
+
function checkStatefulWrite(node, prop, value) {
|
|
251
|
+
const record = statefulRecord(node, prop)?.[prop];
|
|
252
|
+
if (!record || record.w || value !== record.v || node[prop] === record.d) return;
|
|
253
|
+
record.w = 1;
|
|
254
|
+
const tag = node.localName;
|
|
255
|
+
const type = tag === "input" ? node.type : undefined;
|
|
256
|
+
const name = node.getAttribute("name") || undefined,
|
|
257
|
+
id = node.id || undefined;
|
|
258
|
+
let element = `<${tag}`;
|
|
259
|
+
if (type) element += ` type="${type}"`;
|
|
260
|
+
if (name) element += ` name="${name}"`;else if (id) element += ` id="${id}"`;
|
|
261
|
+
element += `>.${prop}`;
|
|
262
|
+
const handler = prop === "muted" ? "onVolumeChange" : prop === "value" ? "onInput" : "onChange";
|
|
263
|
+
const defaultProp = "default" + prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
264
|
+
devCheck({
|
|
265
|
+
code: "UNCOMMITTED_INPUT_OVERWRITTEN",
|
|
266
|
+
kind: "render",
|
|
267
|
+
severity: "warn",
|
|
268
|
+
message: `[UNCOMMITTED_INPUT_OVERWRITTEN] ${element} was changed by the user, but the change was ` + `never committed to the signal bound to \`${prop}\`, and Solid is writing the bound value ` + `back over it: the user's input is lost. A compiled \`${prop}\` binding re-applies the ` + `bound value whenever its effect runs — here with the value unchanged, because another ` + `binding in the same template changed, a spread re-ran, or the source fired with an equal ` + `value — and the signal is the source of truth. Write the signal on every edit ` + `(\`${handler}={e => setValue(e.currentTarget.${prop})}\`, a draft signal you commit ` + `later), use \`${defaultProp}\` for an uncontrolled element, or write a rejected edit back ` + `explicitly (\`e.currentTarget.${prop} = next\`).`,
|
|
269
|
+
data: {
|
|
270
|
+
tag,
|
|
271
|
+
prop,
|
|
272
|
+
type,
|
|
273
|
+
name,
|
|
274
|
+
id
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function recordStatefulWrite(node, prop, value) {
|
|
279
|
+
const records = statefulRecord(node, prop);
|
|
280
|
+
if (records) records[prop] = {
|
|
281
|
+
v: value,
|
|
282
|
+
d: node[prop],
|
|
283
|
+
w: records[prop]?.w
|
|
284
|
+
};
|
|
285
|
+
}
|
|
243
286
|
|
|
244
287
|
const HEAD_ELIGIBLE_TAGS = new Set(["title", "meta", "link", "style", "script", "base"]);
|
|
245
288
|
const HEAD_ATTR_NAME = /^[a-zA-Z_][a-zA-Z0-9_:.-]*$/;
|
|
@@ -637,11 +680,18 @@ function setProperty(node, name, value) {
|
|
|
637
680
|
tagElement(node);
|
|
638
681
|
if (isHydrating(node)) return;
|
|
639
682
|
const nodeName = node.nodeName;
|
|
683
|
+
checkStatefulWrite(node, name, value);
|
|
640
684
|
if (name === "value" && nodeName === "SELECT") writeSelectValue(node, value);else if ((name === "value" || name === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA")) {
|
|
641
685
|
if (value == null && /^(checkbox|radio)$/.test(node.type)) node.removeAttribute("value");else node[name] = value ?? "";
|
|
642
686
|
} else node[name] = value;
|
|
687
|
+
recordStatefulWrite(node, name, value);
|
|
643
688
|
reclaimAttribute(node, name);
|
|
644
689
|
}
|
|
690
|
+
function setStatefulProperty(node, name, value) {
|
|
691
|
+
checkStatefulWrite(node, name, value);
|
|
692
|
+
node[name] = value;
|
|
693
|
+
recordStatefulWrite(node, name, value);
|
|
694
|
+
}
|
|
645
695
|
let claimHandlers = null;
|
|
646
696
|
const claimAttributeSets = [];
|
|
647
697
|
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
@@ -1904,9 +1954,11 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
|
|
|
1904
1954
|
}
|
|
1905
1955
|
} else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
|
|
1906
1956
|
if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
|
|
1957
|
+
checkStatefulWrite(node, prop, value);
|
|
1907
1958
|
if (prop === "value" && nodeName === "SELECT") writeSelectValue(node, value);else if ((prop === "value" || prop === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA")) {
|
|
1908
1959
|
if (value == null && /^(checkbox|radio)$/.test(node.type)) node.removeAttribute("value");else node[prop] = value ?? "";
|
|
1909
1960
|
} else node[prop] = value;
|
|
1961
|
+
recordStatefulWrite(node, prop, value);
|
|
1910
1962
|
reclaimAttribute(node, prop);
|
|
1911
1963
|
} else {
|
|
1912
1964
|
const ns = hasNamespace && Namespaces[prop.split(":")[0]];
|
|
@@ -2460,4 +2512,4 @@ _moduleUrl) {
|
|
|
2460
2512
|
function httpStatus(_code, _text) {}
|
|
2461
2513
|
function httpHeader(_name, _value, _options) {}
|
|
2462
2514
|
|
|
2463
|
-
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, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
|
2515
|
+
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, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
package/dist/web.js
CHANGED
|
@@ -510,6 +510,9 @@ function setProperty(node, name, value) {
|
|
|
510
510
|
} else node[name] = value;
|
|
511
511
|
reclaimAttribute(node, name);
|
|
512
512
|
}
|
|
513
|
+
function setStatefulProperty(node, name, value) {
|
|
514
|
+
node[name] = value;
|
|
515
|
+
}
|
|
513
516
|
let claimHandlers = null;
|
|
514
517
|
const claimAttributeSets = [];
|
|
515
518
|
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
@@ -2197,4 +2200,4 @@ _moduleUrl) {
|
|
|
2197
2200
|
function httpStatus(_code, _text) {}
|
|
2198
2201
|
function httpHeader(_name, _value, _options) {}
|
|
2199
2202
|
|
|
2200
|
-
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, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
|
2203
|
+
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, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
package/dist/web.observe.js
CHANGED
|
@@ -541,6 +541,9 @@ function setProperty(node, name, value) {
|
|
|
541
541
|
} else node[name] = value;
|
|
542
542
|
reclaimAttribute(node, name);
|
|
543
543
|
}
|
|
544
|
+
function setStatefulProperty(node, name, value) {
|
|
545
|
+
node[name] = value;
|
|
546
|
+
}
|
|
544
547
|
let claimHandlers = null;
|
|
545
548
|
const claimAttributeSets = [];
|
|
546
549
|
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
@@ -2248,4 +2251,4 @@ _moduleUrl) {
|
|
|
2248
2251
|
function httpStatus(_code, _text) {}
|
|
2249
2252
|
function httpHeader(_name, _value, _options) {}
|
|
2250
2253
|
|
|
2251
|
-
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, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
|
2254
|
+
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, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|