@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.3
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 +86 -61
- package/dist/dev.js +81 -60
- package/dist/server.cjs +34 -17
- package/dist/server.js +35 -19
- package/dist/web.cjs +83 -59
- package/dist/web.js +78 -58
- package/frames/dist/client.cjs +8 -8
- package/frames/dist/client.dev.cjs +8 -8
- package/frames/dist/client.dev.js +8 -8
- package/frames/dist/client.js +8 -8
- package/frames/dist/server.cjs +28 -18
- package/frames/dist/server.js +29 -19
- package/package.json +20 -22
- package/serialization/dist/decode.cjs +3 -3
- package/serialization/dist/decode.js +3 -3
- package/serialization/dist/serialization.cjs +7 -11
- package/serialization/dist/serialization.js +7 -6
- package/serialization/types/index.d.ts +69 -157
- package/serialization/types/serializer-decode.d.ts +89 -112
- package/serialization/types/serializer.d.ts +94 -0
- package/serialization/types-cjs/index.d.cts +69 -157
- package/serialization/types-cjs/serializer-decode.d.cts +89 -112
- package/serialization/types-cjs/serializer.d.cts +94 -0
- package/types/client.d.ts +150 -290
- package/types/constants.d.ts +18 -0
- package/types/cookies.d.ts +31 -75
- package/types/frames/frame-client.d.ts +287 -277
- package/types/frames/frame-container-plugin.d.ts +71 -0
- package/types/frames/frame-sink.d.ts +58 -160
- package/types/frames/frame-transport.d.ts +161 -194
- package/types/frames/serializer-decode.d.ts +159 -0
- package/types/frames/serializer.d.ts +69 -157
- package/types/head.d.ts +16 -0
- package/types/index.d.ts +0 -65
- package/types/index.server.d.ts +125 -0
- package/types/jsx.d.ts +5 -13
- package/types/reconcile.d.ts +1 -0
- package/types/render.d.ts +4 -0
- package/types/response.d.ts +41 -153
- package/types/serializer-decode.d.ts +89 -112
- package/types/serializer.d.ts +69 -157
- package/types/server-functions/client.d.ts +93 -222
- package/types/server-functions/flash.d.ts +10 -30
- package/types/server-functions/registry.d.ts +63 -0
- package/types/server-functions/rich-args.d.ts +1 -10
- package/types/server-functions/server.d.ts +292 -574
- package/types/server-functions/shared.d.ts +112 -458
- package/types/server-mock.d.ts +2 -2
- package/types/server.d.ts +242 -434
- package/types-cjs/client.d.cts +150 -290
- package/types-cjs/constants.d.cts +18 -0
- package/types-cjs/cookies.d.cts +31 -75
- package/types-cjs/frames/frame-client.d.cts +287 -277
- package/types-cjs/frames/frame-container-plugin.d.cts +71 -0
- package/types-cjs/frames/frame-sink.d.cts +58 -160
- package/types-cjs/frames/frame-transport.d.cts +161 -194
- package/types-cjs/frames/serializer-decode.d.cts +159 -0
- package/types-cjs/frames/serializer.d.cts +69 -157
- package/types-cjs/head.d.cts +16 -0
- package/types-cjs/index.d.cts +0 -65
- package/types-cjs/index.server.d.cts +125 -0
- package/types-cjs/jsx.d.cts +5 -13
- package/types-cjs/reconcile.d.cts +1 -0
- package/types-cjs/render.d.cts +4 -0
- package/types-cjs/response.d.cts +41 -153
- package/types-cjs/serializer-decode.d.cts +89 -112
- package/types-cjs/serializer.d.cts +69 -157
- package/types-cjs/server-functions/client.d.cts +93 -222
- package/types-cjs/server-functions/flash.d.cts +10 -30
- package/types-cjs/server-functions/registry.d.cts +63 -0
- package/types-cjs/server-functions/rich-args.d.cts +1 -10
- package/types-cjs/server-functions/server.d.cts +292 -574
- package/types-cjs/server-functions/shared.d.cts +112 -458
- package/types-cjs/server-mock.d.cts +2 -2
- package/types-cjs/server.d.cts +242 -434
- package/LICENSE +0 -21
- package/types/core.d.ts +0 -9
- package/types-cjs/core.d.cts +0 -9
package/dist/web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo,
|
|
2
|
-
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, untrack } from 'solid-js';
|
|
1
|
+
import { createRenderEffect, createMemo, sharedConfig, enableHydration, untrack, runWithOwner, createRoot, flatten, flush, createComponent, omit, createOwner, createSignal, onCleanup, getOwner, createEffect } from 'solid-js';
|
|
2
|
+
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const DOMWithState = {
|
|
5
5
|
INPUT: {
|
|
@@ -56,23 +56,16 @@ const transparentOptions = {
|
|
|
56
56
|
const syncOptions = {
|
|
57
57
|
sync: true
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
runWithOwner(null, () => {
|
|
70
|
-
gate = createMemo(() => promise);
|
|
71
|
-
});
|
|
72
|
-
assetGates.set(promise, gate);
|
|
73
|
-
}
|
|
74
|
-
gate();
|
|
75
|
-
};
|
|
59
|
+
function effect(fn, effectFn, options) {
|
|
60
|
+
createRenderEffect(fn, effectFn, options ? {
|
|
61
|
+
sync: true,
|
|
62
|
+
...options,
|
|
63
|
+
transparent: !options.scope
|
|
64
|
+
} : transparentOptions);
|
|
65
|
+
}
|
|
66
|
+
function memo(fn) {
|
|
67
|
+
return createMemo(() => fn(), syncOptions);
|
|
68
|
+
}
|
|
76
69
|
|
|
77
70
|
function reconcileArrays(parentNode, a, b, marker) {
|
|
78
71
|
let bLength = b.length,
|
|
@@ -328,11 +321,30 @@ function getServerFunctionRPC() {
|
|
|
328
321
|
return globalThis[SERVER_FUNCTION_RPC];
|
|
329
322
|
}
|
|
330
323
|
|
|
331
|
-
const
|
|
324
|
+
const assetGates = new WeakMap();
|
|
325
|
+
const waitAsset = promise => {
|
|
326
|
+
let gate = assetGates.get(promise);
|
|
327
|
+
if (!gate) {
|
|
328
|
+
runWithOwner(null, () => {
|
|
329
|
+
gate = createMemo(() => promise);
|
|
330
|
+
});
|
|
331
|
+
assetGates.set(promise, gate);
|
|
332
|
+
}
|
|
333
|
+
gate();
|
|
334
|
+
};
|
|
335
|
+
const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
|
|
332
336
|
const INNER_OWNED = {};
|
|
333
337
|
const delegatedEvents = new Set();
|
|
334
338
|
const delegatedContainers = new Map();
|
|
335
|
-
function
|
|
339
|
+
function voidFn() {}
|
|
340
|
+
function generateHydrationScript(_options) {
|
|
341
|
+
return "";
|
|
342
|
+
}
|
|
343
|
+
function HydrationScript(_props) {
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
const getRequestEvent = voidFn;
|
|
347
|
+
function render(code, element, init, options = {}) {
|
|
336
348
|
let disposer;
|
|
337
349
|
registerDelegatedRoot(element);
|
|
338
350
|
try {
|
|
@@ -343,15 +355,20 @@ function render$1(code, element, init, options = {}) {
|
|
|
343
355
|
effect(() => flatten(tree), () => {});
|
|
344
356
|
} else {
|
|
345
357
|
const tree = code();
|
|
346
|
-
insert(element, () => tree, element.firstChild ? null : undefined, init,
|
|
358
|
+
insert(element, () => tree, element.firstChild ? null : undefined, init, {
|
|
359
|
+
...options.insertOptions,
|
|
360
|
+
schedule: true
|
|
361
|
+
});
|
|
347
362
|
}
|
|
348
363
|
}, {
|
|
349
364
|
id: options.renderId
|
|
350
365
|
});
|
|
366
|
+
flush();
|
|
351
367
|
} catch (err) {
|
|
352
368
|
if (disposer) disposer();
|
|
353
369
|
unregisterDelegatedRoot(element);
|
|
354
370
|
throw err;
|
|
371
|
+
} finally {
|
|
355
372
|
}
|
|
356
373
|
return () => {
|
|
357
374
|
disposer();
|
|
@@ -436,7 +453,7 @@ function setProperty(node, name, value) {
|
|
|
436
453
|
node[name] = value;
|
|
437
454
|
}
|
|
438
455
|
let claimHandlers = null;
|
|
439
|
-
const CLAIM_SEAM = Symbol.for("
|
|
456
|
+
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
440
457
|
function registerElementClaim(handler) {
|
|
441
458
|
(claimHandlers || (claimHandlers = globalThis[CLAIM_SEAM] = [])).push(handler);
|
|
442
459
|
return () => {
|
|
@@ -1139,9 +1156,10 @@ function loadModuleAssets(mapping) {
|
|
|
1139
1156
|
}
|
|
1140
1157
|
return pending.length ? Promise.all(pending).then(() => {}) : undefined;
|
|
1141
1158
|
}
|
|
1142
|
-
function hydrate
|
|
1159
|
+
function hydrate(code, element, options = {}) {
|
|
1160
|
+
enableHydration();
|
|
1143
1161
|
installHydrationRuntime();
|
|
1144
|
-
if (globalThis._$HY.done) return render
|
|
1162
|
+
if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);
|
|
1145
1163
|
options.renderId ||= "";
|
|
1146
1164
|
if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
|
|
1147
1165
|
if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
|
|
@@ -1190,7 +1208,7 @@ function hydrate$1(code, element, options = {}) {
|
|
|
1190
1208
|
sharedConfig.gather = gather;
|
|
1191
1209
|
sharedConfig.hydrating = true;
|
|
1192
1210
|
try {
|
|
1193
|
-
disposer = render
|
|
1211
|
+
disposer = render(code, element, [...element.childNodes], options);
|
|
1194
1212
|
} finally {
|
|
1195
1213
|
sharedConfig.hydrating = false;
|
|
1196
1214
|
}
|
|
@@ -1198,14 +1216,14 @@ function hydrate$1(code, element, options = {}) {
|
|
|
1198
1216
|
console.error("Hydration module preload failed, falling back to client render:", err);
|
|
1199
1217
|
sharedConfig.hydrating = false;
|
|
1200
1218
|
sharedConfig.registry = undefined;
|
|
1201
|
-
disposer = render
|
|
1219
|
+
disposer = render(code, element, [...element.childNodes], options);
|
|
1202
1220
|
});
|
|
1203
1221
|
return () => disposer && disposer();
|
|
1204
1222
|
}
|
|
1205
1223
|
}
|
|
1206
1224
|
try {
|
|
1207
1225
|
gatherHydratable(element, options.renderId);
|
|
1208
|
-
return render
|
|
1226
|
+
return render(code, element, [...element.childNodes], options);
|
|
1209
1227
|
} finally {
|
|
1210
1228
|
sharedConfig.hydrating = false;
|
|
1211
1229
|
}
|
|
@@ -1392,7 +1410,7 @@ function eventHandler(e, container, state) {
|
|
|
1392
1410
|
const handleNode = () => {
|
|
1393
1411
|
let handler = node[key];
|
|
1394
1412
|
if (handler === undefined && node.hasAttribute && node.hasAttribute("_bnd")) {
|
|
1395
|
-
const seam = globalThis[Symbol.for("
|
|
1413
|
+
const seam = globalThis[Symbol.for("solid.bnd")];
|
|
1396
1414
|
if (seam) handler = seam.resolve(node, e.type);
|
|
1397
1415
|
}
|
|
1398
1416
|
if (handler && !node.disabled) {
|
|
@@ -1441,7 +1459,16 @@ function eventHandler(e, container, state) {
|
|
|
1441
1459
|
}
|
|
1442
1460
|
function insertExpression(parent, value, current, marker) {
|
|
1443
1461
|
if (hydrationRt !== null && isHydrating(parent)) {
|
|
1444
|
-
if (value && value !== current)
|
|
1462
|
+
if (value && value !== current) {
|
|
1463
|
+
const arr = Array.isArray(value);
|
|
1464
|
+
for (const n of arr ? value : [value]) {
|
|
1465
|
+
if (n && n.nodeType) {
|
|
1466
|
+
if (!isHydrating(n)) return current;
|
|
1467
|
+
} else if (arr && (typeof n === "string" || typeof n === "number")) {
|
|
1468
|
+
return current;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1445
1472
|
return value;
|
|
1446
1473
|
}
|
|
1447
1474
|
if (value === current) return value;
|
|
@@ -1472,6 +1499,17 @@ function insertExpression(parent, value, current, marker) {
|
|
|
1472
1499
|
if (marker) value[$$SLOT] = marker;
|
|
1473
1500
|
} else if (Array.isArray(value)) {
|
|
1474
1501
|
const currentArray = current && Array.isArray(current);
|
|
1502
|
+
for (let i = 0, len = value.length; i < len; i++) {
|
|
1503
|
+
const item = value[i],
|
|
1504
|
+
t = typeof item;
|
|
1505
|
+
if (t === "string" || t === "number") {
|
|
1506
|
+
const prev = currentArray ? current[i] : undefined;
|
|
1507
|
+
if (prev && prev.nodeType === 3) {
|
|
1508
|
+
if (prev.data !== "" + item) prev.data = item;
|
|
1509
|
+
value[i] = prev;
|
|
1510
|
+
} else value[i] = document.createTextNode(item);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1475
1513
|
if (value.length === 0) {
|
|
1476
1514
|
cleanChildren(parent, current, marker);
|
|
1477
1515
|
} else if (currentArray) {
|
|
@@ -1492,12 +1530,12 @@ function normalize(value, current, multi, doNotUnwrap) {
|
|
|
1492
1530
|
});
|
|
1493
1531
|
if (doNotUnwrap && typeof value === "function") return value;
|
|
1494
1532
|
if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
|
|
1495
|
-
if (Array.isArray(value)) {
|
|
1533
|
+
if (sharedConfig.hydrating && Array.isArray(value)) {
|
|
1496
1534
|
for (let i = 0, len = value.length; i < len; i++) {
|
|
1497
1535
|
const item = value[i],
|
|
1498
1536
|
prev = current && current[i],
|
|
1499
1537
|
t = typeof item;
|
|
1500
|
-
if (t === "string" || t === "number")
|
|
1538
|
+
if ((t === "string" || t === "number") && prev && prev.nodeType === 3) value[i] = prev;
|
|
1501
1539
|
}
|
|
1502
1540
|
}
|
|
1503
1541
|
return value;
|
|
@@ -1578,7 +1616,6 @@ function gatherHydratable(element, root) {
|
|
|
1578
1616
|
function getHydrationKey() {
|
|
1579
1617
|
return sharedConfig.getNextContextId();
|
|
1580
1618
|
}
|
|
1581
|
-
const voidFn = () => undefined;
|
|
1582
1619
|
const RequestContext = Symbol();
|
|
1583
1620
|
|
|
1584
1621
|
function throwInBrowser(func) {
|
|
@@ -1654,11 +1691,14 @@ function isSafeError(value) {
|
|
|
1654
1691
|
return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
|
|
1655
1692
|
}
|
|
1656
1693
|
const REVALIDATE_HEADER = "X-Revalidate";
|
|
1657
|
-
function initWithRevalidate(init) {
|
|
1694
|
+
function initWithRevalidate(init = {}) {
|
|
1695
|
+
const resolved = typeof init === "number" ? {
|
|
1696
|
+
status: init
|
|
1697
|
+
} : init;
|
|
1658
1698
|
const {
|
|
1659
1699
|
revalidate,
|
|
1660
1700
|
...responseInit
|
|
1661
|
-
} =
|
|
1701
|
+
} = resolved;
|
|
1662
1702
|
let headers;
|
|
1663
1703
|
if (responseInit.headers && responseInit.headers.getSetCookie) {
|
|
1664
1704
|
headers = new Headers();
|
|
@@ -1684,9 +1724,7 @@ function redirect(url, init = 302) {
|
|
|
1684
1724
|
const {
|
|
1685
1725
|
responseInit,
|
|
1686
1726
|
headers
|
|
1687
|
-
} = initWithRevalidate(
|
|
1688
|
-
status: init
|
|
1689
|
-
} : init);
|
|
1727
|
+
} = initWithRevalidate(init);
|
|
1690
1728
|
if (responseInit.status === undefined) {
|
|
1691
1729
|
responseInit.status = 302;
|
|
1692
1730
|
}
|
|
@@ -1718,26 +1756,8 @@ function respond(value, init = {}) {
|
|
|
1718
1756
|
}), value);
|
|
1719
1757
|
}
|
|
1720
1758
|
|
|
1721
|
-
const mergeProps = merge;
|
|
1722
1759
|
const isServer = false;
|
|
1723
1760
|
const isDev = false;
|
|
1724
|
-
function render(code, element, init, options = {}) {
|
|
1725
|
-
try {
|
|
1726
|
-
const dispose = render$1(code, element, init, {
|
|
1727
|
-
...options,
|
|
1728
|
-
insertOptions: {
|
|
1729
|
-
schedule: true
|
|
1730
|
-
}
|
|
1731
|
-
});
|
|
1732
|
-
flush();
|
|
1733
|
-
return dispose;
|
|
1734
|
-
} finally {
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
const hydrate = (...args) => {
|
|
1738
|
-
enableHydration();
|
|
1739
|
-
return hydrate$1(...args);
|
|
1740
|
-
};
|
|
1741
1761
|
function Portal(props) {
|
|
1742
1762
|
return runWithOwner(createOwner(), () => portalImpl(props));
|
|
1743
1763
|
}
|
|
@@ -1790,7 +1810,7 @@ function portalImpl(props) {
|
|
|
1790
1810
|
});
|
|
1791
1811
|
return treeMarker;
|
|
1792
1812
|
}
|
|
1793
|
-
const COMPONENT_BINDING = Symbol.for("
|
|
1813
|
+
const COMPONENT_BINDING = Symbol.for("solid.component-binding");
|
|
1794
1814
|
function bindingOf(value) {
|
|
1795
1815
|
return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
|
|
1796
1816
|
}
|
|
@@ -1879,4 +1899,4 @@ _moduleUrl) {
|
|
|
1879
1899
|
function httpStatus(_code, _text) {}
|
|
1880
1900
|
function httpHeader(_name, _value, _options) {}
|
|
1881
1901
|
|
|
1882
|
-
export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF,
|
|
1902
|
+
export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, Namespaces, Portal, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, patchDriver, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, resolveSSRNode, respond, rowProof, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle, ssrStyleProperty, style, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
package/frames/dist/client.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var client = require('@solidjs/web/server-functions/client');
|
|
|
7
7
|
const ELEMENT_NODE = 1;
|
|
8
8
|
const TEXT_NODE = 3;
|
|
9
9
|
const COMMENT_NODE = 8;
|
|
10
|
-
const CLAIM_SEAM = Symbol.for("
|
|
10
|
+
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
11
11
|
const CLAIMED_ELEMENTS = "a[href], form[action]";
|
|
12
12
|
function claimHandlers() {
|
|
13
13
|
const handlers = globalThis[CLAIM_SEAM];
|
|
@@ -17,7 +17,7 @@ function claimNode(handlers, el) {
|
|
|
17
17
|
for (let i = 0; i < handlers.length; i++) handlers[i](el);
|
|
18
18
|
}
|
|
19
19
|
const claimedAttr = name => name === "href" || name === "action";
|
|
20
|
-
const BOUND_SEAM = Symbol.for("
|
|
20
|
+
const BOUND_SEAM = Symbol.for("solid.bnd");
|
|
21
21
|
const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
|
|
22
22
|
const BND_ATTR = "_bnd";
|
|
23
23
|
const BND_SELECTOR = "[_bnd]";
|
|
@@ -845,7 +845,7 @@ class FrameImpl {
|
|
|
845
845
|
function createFrame(boundary, options) {
|
|
846
846
|
return new FrameImpl(boundary, null, null, options);
|
|
847
847
|
}
|
|
848
|
-
const FRAME_TAG = "
|
|
848
|
+
const FRAME_TAG = "solid-frame";
|
|
849
849
|
const FRAME_ID_ATTR = "data-fid";
|
|
850
850
|
function createFrameElement(options) {
|
|
851
851
|
const el = makeFrameElement(options.id);
|
|
@@ -1300,9 +1300,9 @@ async function applyFrameResponse(response, host, options = {}) {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
return as !== undefined ? as : rootId;
|
|
1302
1302
|
}
|
|
1303
|
-
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("
|
|
1304
|
-
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("
|
|
1305
|
-
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("
|
|
1303
|
+
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
|
|
1304
|
+
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
|
|
1305
|
+
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
|
|
1306
1306
|
let resolveServerComponent;
|
|
1307
1307
|
function parseServerComponent(value, ctx) {
|
|
1308
1308
|
return {
|
|
@@ -1311,7 +1311,7 @@ function parseServerComponent(value, ctx) {
|
|
|
1311
1311
|
};
|
|
1312
1312
|
}
|
|
1313
1313
|
const ServerComponentPlugin = {
|
|
1314
|
-
tag: "
|
|
1314
|
+
tag: "solid/server-component",
|
|
1315
1315
|
test(value) {
|
|
1316
1316
|
return typeof value === "function" && SERVER_COMPONENT in value;
|
|
1317
1317
|
},
|
|
@@ -1457,7 +1457,7 @@ function createServerComponentHandler({
|
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
1460
|
-
const STATE = Symbol.for("
|
|
1460
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
1461
1461
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
1462
1462
|
materialized: new WeakMap(),
|
|
1463
1463
|
materializedValues: new WeakSet()
|
|
@@ -7,7 +7,7 @@ var client = require('@solidjs/web/server-functions/client');
|
|
|
7
7
|
const ELEMENT_NODE = 1;
|
|
8
8
|
const TEXT_NODE = 3;
|
|
9
9
|
const COMMENT_NODE = 8;
|
|
10
|
-
const CLAIM_SEAM = Symbol.for("
|
|
10
|
+
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
11
11
|
const CLAIMED_ELEMENTS = "a[href], form[action]";
|
|
12
12
|
function claimHandlers() {
|
|
13
13
|
const handlers = globalThis[CLAIM_SEAM];
|
|
@@ -17,7 +17,7 @@ function claimNode(handlers, el) {
|
|
|
17
17
|
for (let i = 0; i < handlers.length; i++) handlers[i](el);
|
|
18
18
|
}
|
|
19
19
|
const claimedAttr = name => name === "href" || name === "action";
|
|
20
|
-
const BOUND_SEAM = Symbol.for("
|
|
20
|
+
const BOUND_SEAM = Symbol.for("solid.bnd");
|
|
21
21
|
const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
|
|
22
22
|
const BND_ATTR = "_bnd";
|
|
23
23
|
const BND_SELECTOR = "[_bnd]";
|
|
@@ -855,7 +855,7 @@ class FrameImpl {
|
|
|
855
855
|
function createFrame(boundary, options) {
|
|
856
856
|
return new FrameImpl(boundary, null, null, options);
|
|
857
857
|
}
|
|
858
|
-
const FRAME_TAG = "
|
|
858
|
+
const FRAME_TAG = "solid-frame";
|
|
859
859
|
const FRAME_ID_ATTR = "data-fid";
|
|
860
860
|
function createFrameElement(options) {
|
|
861
861
|
const el = makeFrameElement(options.id);
|
|
@@ -1320,9 +1320,9 @@ async function applyFrameResponse(response, host, options = {}) {
|
|
|
1320
1320
|
}
|
|
1321
1321
|
return as !== undefined ? as : rootId;
|
|
1322
1322
|
}
|
|
1323
|
-
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("
|
|
1324
|
-
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("
|
|
1325
|
-
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("
|
|
1323
|
+
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
|
|
1324
|
+
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
|
|
1325
|
+
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
|
|
1326
1326
|
let resolveServerComponent;
|
|
1327
1327
|
function parseServerComponent(value, ctx) {
|
|
1328
1328
|
return {
|
|
@@ -1331,7 +1331,7 @@ function parseServerComponent(value, ctx) {
|
|
|
1331
1331
|
};
|
|
1332
1332
|
}
|
|
1333
1333
|
const ServerComponentPlugin = {
|
|
1334
|
-
tag: "
|
|
1334
|
+
tag: "solid/server-component",
|
|
1335
1335
|
test(value) {
|
|
1336
1336
|
return typeof value === "function" && SERVER_COMPONENT in value;
|
|
1337
1337
|
},
|
|
@@ -1477,7 +1477,7 @@ function createServerComponentHandler({
|
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
1479
|
|
|
1480
|
-
const STATE = Symbol.for("
|
|
1480
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
1481
1481
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
1482
1482
|
materialized: new WeakMap(),
|
|
1483
1483
|
materializedValues: new WeakSet()
|
|
@@ -5,7 +5,7 @@ import { ChunkReader, frameAddress, SINGLE_FLIGHT_HEADER, deserializeStream, get
|
|
|
5
5
|
const ELEMENT_NODE = 1;
|
|
6
6
|
const TEXT_NODE = 3;
|
|
7
7
|
const COMMENT_NODE = 8;
|
|
8
|
-
const CLAIM_SEAM = Symbol.for("
|
|
8
|
+
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
9
9
|
const CLAIMED_ELEMENTS = "a[href], form[action]";
|
|
10
10
|
function claimHandlers() {
|
|
11
11
|
const handlers = globalThis[CLAIM_SEAM];
|
|
@@ -15,7 +15,7 @@ function claimNode(handlers, el) {
|
|
|
15
15
|
for (let i = 0; i < handlers.length; i++) handlers[i](el);
|
|
16
16
|
}
|
|
17
17
|
const claimedAttr = name => name === "href" || name === "action";
|
|
18
|
-
const BOUND_SEAM = Symbol.for("
|
|
18
|
+
const BOUND_SEAM = Symbol.for("solid.bnd");
|
|
19
19
|
const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
|
|
20
20
|
const BND_ATTR = "_bnd";
|
|
21
21
|
const BND_SELECTOR = "[_bnd]";
|
|
@@ -853,7 +853,7 @@ class FrameImpl {
|
|
|
853
853
|
function createFrame(boundary, options) {
|
|
854
854
|
return new FrameImpl(boundary, null, null, options);
|
|
855
855
|
}
|
|
856
|
-
const FRAME_TAG = "
|
|
856
|
+
const FRAME_TAG = "solid-frame";
|
|
857
857
|
const FRAME_ID_ATTR = "data-fid";
|
|
858
858
|
function createFrameElement(options) {
|
|
859
859
|
const el = makeFrameElement(options.id);
|
|
@@ -1318,9 +1318,9 @@ async function applyFrameResponse(response, host, options = {}) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
return as !== undefined ? as : rootId;
|
|
1320
1320
|
}
|
|
1321
|
-
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("
|
|
1322
|
-
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("
|
|
1323
|
-
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("
|
|
1321
|
+
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
|
|
1322
|
+
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
|
|
1323
|
+
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
|
|
1324
1324
|
let resolveServerComponent;
|
|
1325
1325
|
function parseServerComponent(value, ctx) {
|
|
1326
1326
|
return {
|
|
@@ -1329,7 +1329,7 @@ function parseServerComponent(value, ctx) {
|
|
|
1329
1329
|
};
|
|
1330
1330
|
}
|
|
1331
1331
|
const ServerComponentPlugin = {
|
|
1332
|
-
tag: "
|
|
1332
|
+
tag: "solid/server-component",
|
|
1333
1333
|
test(value) {
|
|
1334
1334
|
return typeof value === "function" && SERVER_COMPONENT in value;
|
|
1335
1335
|
},
|
|
@@ -1475,7 +1475,7 @@ function createServerComponentHandler({
|
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
1477
|
|
|
1478
|
-
const STATE = Symbol.for("
|
|
1478
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
1479
1479
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
1480
1480
|
materialized: new WeakMap(),
|
|
1481
1481
|
materializedValues: new WeakSet()
|
package/frames/dist/client.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ChunkReader, frameAddress, SINGLE_FLIGHT_HEADER, deserializeStream, get
|
|
|
5
5
|
const ELEMENT_NODE = 1;
|
|
6
6
|
const TEXT_NODE = 3;
|
|
7
7
|
const COMMENT_NODE = 8;
|
|
8
|
-
const CLAIM_SEAM = Symbol.for("
|
|
8
|
+
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
9
9
|
const CLAIMED_ELEMENTS = "a[href], form[action]";
|
|
10
10
|
function claimHandlers() {
|
|
11
11
|
const handlers = globalThis[CLAIM_SEAM];
|
|
@@ -15,7 +15,7 @@ function claimNode(handlers, el) {
|
|
|
15
15
|
for (let i = 0; i < handlers.length; i++) handlers[i](el);
|
|
16
16
|
}
|
|
17
17
|
const claimedAttr = name => name === "href" || name === "action";
|
|
18
|
-
const BOUND_SEAM = Symbol.for("
|
|
18
|
+
const BOUND_SEAM = Symbol.for("solid.bnd");
|
|
19
19
|
const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
|
|
20
20
|
const BND_ATTR = "_bnd";
|
|
21
21
|
const BND_SELECTOR = "[_bnd]";
|
|
@@ -843,7 +843,7 @@ class FrameImpl {
|
|
|
843
843
|
function createFrame(boundary, options) {
|
|
844
844
|
return new FrameImpl(boundary, null, null, options);
|
|
845
845
|
}
|
|
846
|
-
const FRAME_TAG = "
|
|
846
|
+
const FRAME_TAG = "solid-frame";
|
|
847
847
|
const FRAME_ID_ATTR = "data-fid";
|
|
848
848
|
function createFrameElement(options) {
|
|
849
849
|
const el = makeFrameElement(options.id);
|
|
@@ -1298,9 +1298,9 @@ async function applyFrameResponse(response, host, options = {}) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
return as !== undefined ? as : rootId;
|
|
1300
1300
|
}
|
|
1301
|
-
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("
|
|
1302
|
-
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("
|
|
1303
|
-
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("
|
|
1301
|
+
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
|
|
1302
|
+
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
|
|
1303
|
+
const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
|
|
1304
1304
|
let resolveServerComponent;
|
|
1305
1305
|
function parseServerComponent(value, ctx) {
|
|
1306
1306
|
return {
|
|
@@ -1309,7 +1309,7 @@ function parseServerComponent(value, ctx) {
|
|
|
1309
1309
|
};
|
|
1310
1310
|
}
|
|
1311
1311
|
const ServerComponentPlugin = {
|
|
1312
|
-
tag: "
|
|
1312
|
+
tag: "solid/server-component",
|
|
1313
1313
|
test(value) {
|
|
1314
1314
|
return typeof value === "function" && SERVER_COMPONENT in value;
|
|
1315
1315
|
},
|
|
@@ -1455,7 +1455,7 @@ function createServerComponentHandler({
|
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
1457
|
|
|
1458
|
-
const STATE = Symbol.for("
|
|
1458
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
1459
1459
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
1460
1460
|
materialized: new WeakMap(),
|
|
1461
1461
|
materializedValues: new WeakSet()
|
package/frames/dist/server.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var solidJs = require('solid-js');
|
|
|
4
4
|
var seroval = require('seroval');
|
|
5
5
|
var web = require('seroval-plugins/web');
|
|
6
6
|
|
|
7
|
-
const STATE = Symbol.for("
|
|
7
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
8
8
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
9
9
|
materialized: new WeakMap(),
|
|
10
10
|
materializedValues: new WeakSet()
|
|
@@ -19,7 +19,7 @@ function isContainerTraced(value) {
|
|
|
19
19
|
const resolve = state.resolveTrace;
|
|
20
20
|
return !!(resolve && value && typeof value === "object" && resolve(value));
|
|
21
21
|
}
|
|
22
|
-
const TRACE = Symbol.for("
|
|
22
|
+
const TRACE = Symbol.for("solid.container-trace");
|
|
23
23
|
function envelopeContainerTraces(value) {
|
|
24
24
|
if (!state.resolveTrace || value == null || typeof value !== "object") return value;
|
|
25
25
|
const trace = state.resolveTrace(value);
|
|
@@ -70,7 +70,7 @@ function parseTrace(value, ctx) {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
const ContainerTracePlugin = {
|
|
73
|
-
tag: "
|
|
73
|
+
tag: "solid/container-trace",
|
|
74
74
|
test(value) {
|
|
75
75
|
return value != null && typeof value === "object" && TRACE in value;
|
|
76
76
|
},
|
|
@@ -101,13 +101,6 @@ const ContainerTracePlugin = {
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
const runWithHydrationScope = (id, fn) => solidJs.runWithOwner(solidJs.createOwner({
|
|
105
|
-
id
|
|
106
|
-
}), fn);
|
|
107
|
-
const ssrAsyncValue = value => solidJs.createMemo(() => value, {
|
|
108
|
-
serialize: false
|
|
109
|
-
});
|
|
110
|
-
|
|
111
104
|
setContainerTraceStreamMint(iterable => {
|
|
112
105
|
const stream = seroval.createStream();
|
|
113
106
|
(async () => {
|
|
@@ -1818,6 +1811,15 @@ function createLiveHoles(sink, scoped) {
|
|
|
1818
1811
|
const stamp = typeof solidJs.creationStamp === "function" ? solidJs.creationStamp : () => 0;
|
|
1819
1812
|
const inScope = scoped && typeof solidJs.inServerComponentScope === "function" ? solidJs.inServerComponentScope : null;
|
|
1820
1813
|
const stripMarkers = html => html.replace(/<!--lh:\/?\d+-->/g, "");
|
|
1814
|
+
const swept = (owner, ctx, fn) => {
|
|
1815
|
+
const prev = solidJs.sharedConfig.context;
|
|
1816
|
+
solidJs.sharedConfig.context = ctx;
|
|
1817
|
+
try {
|
|
1818
|
+
return owner ? solidJs.runWithOwner(owner, fn) : fn();
|
|
1819
|
+
} finally {
|
|
1820
|
+
solidJs.sharedConfig.context = prev;
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1821
1823
|
function resolveHoleValue(hole) {
|
|
1822
1824
|
const result = {
|
|
1823
1825
|
t: [""],
|
|
@@ -1883,6 +1885,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
1883
1885
|
const recordsBefore = engine.recordStamp;
|
|
1884
1886
|
const ownersBefore = stamp();
|
|
1885
1887
|
const owner = solidJs.getOwner();
|
|
1888
|
+
const holeCtx = solidJs.sharedConfig.context;
|
|
1886
1889
|
const b = {
|
|
1887
1890
|
key: null,
|
|
1888
1891
|
children: [],
|
|
@@ -1896,7 +1899,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
1896
1899
|
const sweepOwnersBefore = stamp();
|
|
1897
1900
|
let res;
|
|
1898
1901
|
try {
|
|
1899
|
-
res =
|
|
1902
|
+
res = swept(owner, holeCtx, () => resolveHoleValue(hole));
|
|
1900
1903
|
} catch (err) {
|
|
1901
1904
|
b.closed = true;
|
|
1902
1905
|
sink.closeBinding(b.key);
|
|
@@ -2004,6 +2007,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
2004
2007
|
},
|
|
2005
2008
|
attr(cap) {
|
|
2006
2009
|
const owner = solidJs.getOwner();
|
|
2010
|
+
const holeCtx = solidJs.sharedConfig.context;
|
|
2007
2011
|
const b = {
|
|
2008
2012
|
key: "lha:" + cap.id,
|
|
2009
2013
|
children: [],
|
|
@@ -2039,7 +2043,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
2039
2043
|
if (vt === "string" || vt === "number") html += v;
|
|
2040
2044
|
}
|
|
2041
2045
|
};
|
|
2042
|
-
|
|
2046
|
+
swept(owner, holeCtx, run);
|
|
2043
2047
|
} catch (err) {
|
|
2044
2048
|
if (solidJs.ssrHandleError(err, true)) return;
|
|
2045
2049
|
b.closed = true;
|
|
@@ -2299,7 +2303,7 @@ function ssr(t) {
|
|
|
2299
2303
|
};
|
|
2300
2304
|
return result;
|
|
2301
2305
|
}
|
|
2302
|
-
const CLAIM_PROP = /*#__PURE__*/Symbol.for("
|
|
2306
|
+
const CLAIM_PROP = /*#__PURE__*/Symbol.for("solid.claim-prop");
|
|
2303
2307
|
const CLAIMS_STREAM = 1;
|
|
2304
2308
|
const CLAIMS_DOCUMENT = 2;
|
|
2305
2309
|
function resolveSSRSelectValues(html) {
|
|
@@ -2670,9 +2674,9 @@ const FRAME_STREAM_HEADER = "X-Frame-Stream";
|
|
|
2670
2674
|
function isFrameStreamResponse(response) {
|
|
2671
2675
|
return response.headers.has(FRAME_STREAM_HEADER);
|
|
2672
2676
|
}
|
|
2673
|
-
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("
|
|
2674
|
-
const SERVER_COMPONENT_SOURCE = /*#__PURE__*/Symbol.for("
|
|
2675
|
-
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("
|
|
2677
|
+
const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
|
|
2678
|
+
const SERVER_COMPONENT_SOURCE = /*#__PURE__*/Symbol.for("solid.server-component-source");
|
|
2679
|
+
const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
|
|
2676
2680
|
let serverComponentRegistryExpr;
|
|
2677
2681
|
function setServerComponentBootstrap(resolve) {
|
|
2678
2682
|
serverComponentRegistryExpr = resolve;
|
|
@@ -2684,7 +2688,7 @@ function parseServerComponent(value, ctx) {
|
|
|
2684
2688
|
};
|
|
2685
2689
|
}
|
|
2686
2690
|
const ServerComponentPlugin = {
|
|
2687
|
-
tag: "
|
|
2691
|
+
tag: "solid/server-component",
|
|
2688
2692
|
test(value) {
|
|
2689
2693
|
return typeof value === "function" && SERVER_COMPONENT in value;
|
|
2690
2694
|
},
|
|
@@ -2717,6 +2721,12 @@ function flightCodec(codec) {
|
|
|
2717
2721
|
};
|
|
2718
2722
|
}
|
|
2719
2723
|
|
|
2724
|
+
const runWithHydrationScope = (id, fn) => solidJs.runWithOwner(solidJs.createOwner({
|
|
2725
|
+
id
|
|
2726
|
+
}), fn);
|
|
2727
|
+
const ssrAsyncValue = value => solidJs.createMemo(() => value, {
|
|
2728
|
+
serialize: false
|
|
2729
|
+
});
|
|
2720
2730
|
const scopeStamp = typeof solidJs.creationStamp === "function" ? solidJs.creationStamp : () => 0;
|
|
2721
2731
|
function serverOwned(render) {
|
|
2722
2732
|
return solidJs.NoHydration ? solidJs.NoHydration({
|
|
@@ -3295,7 +3305,7 @@ function createDocumentSlotProps(clientProps, frameId) {
|
|
|
3295
3305
|
}
|
|
3296
3306
|
});
|
|
3297
3307
|
}
|
|
3298
|
-
const FRAME_TAG = "
|
|
3308
|
+
const FRAME_TAG = "solid-frame";
|
|
3299
3309
|
const FRAME_ID_ATTR = "data-fid";
|
|
3300
3310
|
function frameElementOpen(id) {
|
|
3301
3311
|
const escaped = solidJs.sharedConfig.context ? solidJs.sharedConfig.context.escape(String(id), true) : String(id);
|