@solidjs/web 2.0.0-rc.6 → 2.0.0-rc.7
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.cjs +105 -35
- package/dist/server.dev.cjs +3794 -0
- package/dist/server.dev.js +3627 -0
- package/dist/server.js +106 -36
- package/dist/web.cjs +39 -385
- package/dist/{dev.cjs → web.dev.cjs} +91 -396
- package/dist/{dev.js → web.dev.js} +93 -393
- package/dist/web.js +41 -382
- package/frames/dist/client.cjs +11 -3
- package/frames/dist/client.dev.cjs +11 -3
- package/frames/dist/client.dev.js +11 -3
- package/frames/dist/client.js +11 -3
- package/frames/dist/server.cjs +234 -32
- package/frames/dist/server.dev.cjs +4584 -0
- package/frames/dist/server.dev.js +4571 -0
- package/frames/dist/server.js +234 -32
- package/frames/package.json +10 -0
- package/package.json +78 -8
- package/serialization/dist/decode.cjs +18 -4
- package/serialization/dist/decode.js +18 -4
- package/serialization/dist/serialization.cjs +18 -4
- package/serialization/dist/serialization.js +18 -4
- package/server-functions/dist/client.cjs +13 -14
- package/server-functions/dist/client.js +13 -14
- package/server-functions/dist/server.cjs +331 -83
- package/server-functions/dist/server.dev.cjs +338 -82
- package/server-functions/dist/server.dev.js +338 -82
- package/server-functions/dist/server.js +331 -83
- package/types/client.d.ts +0 -3
- package/types/frames/frame-client.d.ts +1 -1
- package/types/head.d.ts +3 -0
- package/types/index.d.ts +18 -7
- package/types/index.server.d.ts +31 -9
- package/types/render.d.ts +3 -1
- package/types/server-functions/flash.d.ts +12 -3
- package/types/server-functions/server.d.ts +27 -3
- package/types/server-mock.d.ts +43 -7
- package/types/server.d.ts +47 -5
- package/types-cjs/client.d.cts +0 -3
- package/types-cjs/frames/frame-client.d.cts +1 -1
- package/types-cjs/head.d.cts +3 -0
- package/types-cjs/index.d.cts +18 -7
- package/types-cjs/index.server.d.cts +31 -9
- package/types-cjs/render.d.cts +3 -1
- package/types-cjs/server-functions/flash.d.cts +12 -3
- package/types-cjs/server-functions/server.d.cts +27 -3
- package/types-cjs/server-mock.d.cts +43 -7
- package/types-cjs/server.d.cts +47 -5
- package/types/patch-driver.d.ts +0 -3
- package/types-cjs/patch-driver.d.cts +0 -3
package/dist/web.cjs
CHANGED
|
@@ -59,11 +59,12 @@ const syncOptions = {
|
|
|
59
59
|
sync: true
|
|
60
60
|
};
|
|
61
61
|
function effect(fn, effectFn, options) {
|
|
62
|
-
|
|
62
|
+
const nodeOptions = options ? {
|
|
63
63
|
sync: true,
|
|
64
64
|
...options,
|
|
65
65
|
transparent: !options.scope
|
|
66
|
-
} : transparentOptions
|
|
66
|
+
} : transparentOptions;
|
|
67
|
+
solidJs.createRenderEffect(fn, effectFn, nodeOptions);
|
|
67
68
|
}
|
|
68
69
|
function memo(fn) {
|
|
69
70
|
return solidJs.createMemo(() => fn(), syncOptions);
|
|
@@ -212,12 +213,24 @@ function classifyHeadTag(desc) {
|
|
|
212
213
|
resource: false
|
|
213
214
|
};
|
|
214
215
|
}
|
|
216
|
+
function qualifierValue(name, value) {
|
|
217
|
+
if (value == null || value === false) return null;
|
|
218
|
+
if (name === "imagesrcset" || name === "imagesizes") return typeof value === "string" && value !== "" ? value : null;
|
|
219
|
+
const v = value === true ? "" : String(value);
|
|
220
|
+
if (name === "as") return asciiLowerCase(v);
|
|
221
|
+
if (name !== "crossorigin") return v;
|
|
222
|
+
return v.length === 15 && v.toLowerCase() === "use-credentials" ? v.toLowerCase() : "anonymous";
|
|
223
|
+
}
|
|
224
|
+
function asciiLowerCase(value) {
|
|
225
|
+
return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
|
|
226
|
+
}
|
|
215
227
|
function resourceIdentity(tag, props) {
|
|
216
|
-
|
|
228
|
+
const url = String(props.href || props.src || "");
|
|
229
|
+
let id = "res:" + tag + ":" + (props.rel || "") + ":" + url.length + ":" + url;
|
|
217
230
|
for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
|
|
218
231
|
const q = RESOURCE_QUALIFIERS[i];
|
|
219
|
-
const value = props[q];
|
|
220
|
-
if (value
|
|
232
|
+
const value = qualifierValue(q, props[q]);
|
|
233
|
+
if (value !== null) id += ":" + q + "=" + value.length + ":" + value;
|
|
221
234
|
}
|
|
222
235
|
return id;
|
|
223
236
|
}
|
|
@@ -336,10 +349,6 @@ const waitAsset = promise => {
|
|
|
336
349
|
}
|
|
337
350
|
gate();
|
|
338
351
|
};
|
|
339
|
-
exports.listDriver = void 0;
|
|
340
|
-
function installListDriver(driver) {
|
|
341
|
-
exports.listDriver = driver;
|
|
342
|
-
}
|
|
343
352
|
const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
|
|
344
353
|
const $$EVENT_TUPLE = Symbol();
|
|
345
354
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -618,9 +627,9 @@ function setStyleProperty(node, name, value) {
|
|
|
618
627
|
if (isHydrating(node)) return;
|
|
619
628
|
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
620
629
|
}
|
|
621
|
-
function spread(node, props
|
|
630
|
+
function spread(node, props, skipChildren) {
|
|
622
631
|
const prevProps = {};
|
|
623
|
-
const get = typeof props === "function" ? props :
|
|
632
|
+
const get = () => (typeof props === "function" ? props() : props) ?? {};
|
|
624
633
|
if (!skipChildren) insert(node, () => {
|
|
625
634
|
const source = get();
|
|
626
635
|
return hasOwn.call(source, "children") ? source.children : undefined;
|
|
@@ -666,19 +675,6 @@ function scope(fn) {
|
|
|
666
675
|
const SCOPE_OPTIONS = {
|
|
667
676
|
scope: true
|
|
668
677
|
};
|
|
669
|
-
let insertionParent = null;
|
|
670
|
-
function getInsertionParent() {
|
|
671
|
-
return insertionParent;
|
|
672
|
-
}
|
|
673
|
-
function withInsertionParent(parent, fn) {
|
|
674
|
-
const prev = insertionParent;
|
|
675
|
-
insertionParent = parent;
|
|
676
|
-
try {
|
|
677
|
-
return fn();
|
|
678
|
-
} finally {
|
|
679
|
-
insertionParent = prev;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
678
|
let hydrationRt = null;
|
|
683
679
|
function installHydrationRuntime() {
|
|
684
680
|
hydrationRt = {
|
|
@@ -740,13 +736,8 @@ function insert(parent, accessor, marker, initial, options) {
|
|
|
740
736
|
const host = options && options.host;
|
|
741
737
|
if (multi && !initial) initial = [];
|
|
742
738
|
if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
|
|
743
|
-
if (exports.listDriver !== undefined && typeof accessor === "function" && accessor.$ll !== undefined) {
|
|
744
|
-
const listAccessor = accessor;
|
|
745
|
-
const owner = solidJs.getOwner();
|
|
746
|
-
if (exports.listDriver(parent, accessor, marker, () => solidJs.runWithOwner(owner, () => insert(parent, () => listAccessor(), marker, marker !== undefined ? [] : undefined, options)))) return;
|
|
747
|
-
}
|
|
748
739
|
if (typeof accessor !== "function") {
|
|
749
|
-
accessor =
|
|
740
|
+
accessor = normalize(accessor, initial, multi, true);
|
|
750
741
|
if (typeof accessor !== "function") {
|
|
751
742
|
insertExpression(parent, accessor, initial, marker);
|
|
752
743
|
host && tagHost(accessor, host);
|
|
@@ -761,9 +752,9 @@ function insert(parent, accessor, marker, initial, options) {
|
|
|
761
752
|
let current = initial;
|
|
762
753
|
effect(prev => {
|
|
763
754
|
if (hydrationRt !== null) current = hydrationRt.reclaimRegion(current, parent, marker);
|
|
764
|
-
const value =
|
|
755
|
+
const value = normalize(accessor(), current, multi, true);
|
|
765
756
|
if (typeof value !== "function") return value;
|
|
766
|
-
effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)),
|
|
757
|
+
effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
|
|
767
758
|
current = insertExpression(parent, inner, current, marker);
|
|
768
759
|
host && tagHost(current, host);
|
|
769
760
|
}, prev !== undefined && !(options && options.schedule) ? {
|
|
@@ -804,10 +795,16 @@ function assetEntryKey(descriptor) {
|
|
|
804
795
|
if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
|
|
805
796
|
return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
|
|
806
797
|
}
|
|
807
|
-
function findAssetElement(selector, attr, value) {
|
|
798
|
+
function findAssetElement(selector, attr, value, qualifiers) {
|
|
808
799
|
const nodes = document.querySelectorAll(selector);
|
|
809
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
810
|
-
if (nodes[i].getAttribute(attr)
|
|
800
|
+
outer: for (let i = 0; i < nodes.length; i++) {
|
|
801
|
+
if (nodes[i].getAttribute(attr) !== value) continue;
|
|
802
|
+
if (!qualifiers) return nodes[i];
|
|
803
|
+
for (let q = 0; q < RESOURCE_QUALIFIERS.length; q++) {
|
|
804
|
+
const name = RESOURCE_QUALIFIERS[q];
|
|
805
|
+
if (qualifierValue(name, qualifiers[name]) !== qualifierValue(name, nodes[i].getAttribute(name))) continue outer;
|
|
806
|
+
}
|
|
807
|
+
return nodes[i];
|
|
811
808
|
}
|
|
812
809
|
return null;
|
|
813
810
|
}
|
|
@@ -1111,8 +1108,8 @@ function mountHeadResource(tag, props) {
|
|
|
1111
1108
|
headMountedResources.add(identity);
|
|
1112
1109
|
const url = props.href || props.src;
|
|
1113
1110
|
let el = null;
|
|
1114
|
-
if (url != null) {
|
|
1115
|
-
if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
|
|
1111
|
+
if (tag === "link" && url == null && typeof props.imagesrcset === "string") el = findAssetElement(`link[rel="${props.rel}"]`, "href", null, props);else if (url != null) {
|
|
1112
|
+
if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url, props);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
|
|
1116
1113
|
}
|
|
1117
1114
|
if (!el) document.head.appendChild(createHeadElement(tag, props));
|
|
1118
1115
|
}
|
|
@@ -1689,322 +1686,6 @@ function getHydrationKey() {
|
|
|
1689
1686
|
}
|
|
1690
1687
|
const RequestContext = Symbol();
|
|
1691
1688
|
|
|
1692
|
-
const PURE_ROW = Symbol.for("solid.pure-row");
|
|
1693
|
-
const arm = () => {
|
|
1694
|
-
installListDriver(driveList);
|
|
1695
|
-
};
|
|
1696
|
-
function rowProof(fn) {
|
|
1697
|
-
arm();
|
|
1698
|
-
fn[PURE_ROW] = true;
|
|
1699
|
-
return fn;
|
|
1700
|
-
}
|
|
1701
|
-
let rowCollector = null;
|
|
1702
|
-
const lisPositions = sources => {
|
|
1703
|
-
const n = sources.length;
|
|
1704
|
-
const tails = [];
|
|
1705
|
-
const tailsIdx = [];
|
|
1706
|
-
const prev = new Array(n).fill(-1);
|
|
1707
|
-
for (let j = 0; j < n; j++) {
|
|
1708
|
-
const v = sources[j];
|
|
1709
|
-
if (v === -1) continue;
|
|
1710
|
-
let lo = 0,
|
|
1711
|
-
hi = tails.length;
|
|
1712
|
-
while (lo < hi) {
|
|
1713
|
-
const mid = lo + hi >> 1;
|
|
1714
|
-
if (tails[mid] < v) lo = mid + 1;else hi = mid;
|
|
1715
|
-
}
|
|
1716
|
-
if (lo > 0) prev[j] = tailsIdx[lo - 1];
|
|
1717
|
-
tails[lo] = v;
|
|
1718
|
-
tailsIdx[lo] = j;
|
|
1719
|
-
}
|
|
1720
|
-
const stable = new Set();
|
|
1721
|
-
let k = tailsIdx.length ? tailsIdx[tails.length - 1] : -1;
|
|
1722
|
-
while (k >= 0) {
|
|
1723
|
-
stable.add(k);
|
|
1724
|
-
k = prev[k];
|
|
1725
|
-
}
|
|
1726
|
-
return stable;
|
|
1727
|
-
};
|
|
1728
|
-
const driveList = (parent, listFn, marker, lateClassic) => {
|
|
1729
|
-
const meta = listFn.$ll;
|
|
1730
|
-
if (meta.row?.[PURE_ROW] !== true) return false;
|
|
1731
|
-
if (typeof meta.keyed === "function") return false;
|
|
1732
|
-
const evalOwner = solidJs.createOwner({
|
|
1733
|
-
id: "&each"
|
|
1734
|
-
});
|
|
1735
|
-
let subject = solidJs.runWithOwner(evalOwner, () => solidJs.untrack(meta.each));
|
|
1736
|
-
evalOwner.dispose();
|
|
1737
|
-
let raw = subject != null ? solidJs.patchableRaw(subject) : undefined;
|
|
1738
|
-
if (raw === undefined || !Array.isArray(raw)) return false;
|
|
1739
|
-
const optimistic = solidJs.storeHasOptimisticFamily(subject);
|
|
1740
|
-
if (optimistic) raw = solidJs.untrack(() => Array.from(subject));
|
|
1741
|
-
const hydrating = !!solidJs.sharedConfig.hydrating;
|
|
1742
|
-
if (hydrating && raw.length === 0) return false;
|
|
1743
|
-
let domRows;
|
|
1744
|
-
let rowIds;
|
|
1745
|
-
if (hydrating) {
|
|
1746
|
-
if (marker !== undefined) return false;
|
|
1747
|
-
domRows = Array.from(parent.children);
|
|
1748
|
-
if (domRows.length !== raw.length) return false;
|
|
1749
|
-
rowIds = new Array(raw.length);
|
|
1750
|
-
for (let i = 0; i < domRows.length; i++) {
|
|
1751
|
-
const key = domRows[i].getAttribute("_hk");
|
|
1752
|
-
if (key === null || !key.endsWith("0") || key.length < 2) return false;
|
|
1753
|
-
rowIds[i] = key.slice(0, -1);
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
const rowFn = meta.row;
|
|
1757
|
-
const endAnchor = marker ?? null;
|
|
1758
|
-
const shallow = solidJs.storeIsShallow(subject);
|
|
1759
|
-
let lastBodies = null;
|
|
1760
|
-
let lastUnbinds = null;
|
|
1761
|
-
const collectBind = (abs, build) => {
|
|
1762
|
-
const prevC = rowCollector;
|
|
1763
|
-
rowCollector = {
|
|
1764
|
-
row: shallow ? subject[abs] : undefined,
|
|
1765
|
-
bodies: [],
|
|
1766
|
-
unbinds: []
|
|
1767
|
-
};
|
|
1768
|
-
try {
|
|
1769
|
-
return build();
|
|
1770
|
-
} finally {
|
|
1771
|
-
lastBodies = rowCollector.bodies;
|
|
1772
|
-
lastUnbinds = rowCollector.unbinds;
|
|
1773
|
-
rowCollector = prevC;
|
|
1774
|
-
}
|
|
1775
|
-
};
|
|
1776
|
-
const listOwner = solidJs.createOwner();
|
|
1777
|
-
let declined = false;
|
|
1778
|
-
const bindRow = (abs, claimId) => {
|
|
1779
|
-
return collectBind(abs, () => solidJs.runWithOwner(listOwner, () => claimId !== undefined ? solidJs.runWithOwner(solidJs.createOwner({
|
|
1780
|
-
id: claimId
|
|
1781
|
-
}), () => solidJs.untrack(() => rowFn(subject[abs]))) : solidJs.untrack(() => rowFn(subject[abs]))));
|
|
1782
|
-
};
|
|
1783
|
-
let entries = new Array(raw.length);
|
|
1784
|
-
let rowBodies = shallow ? new Array(raw.length) : null;
|
|
1785
|
-
let rowUnbinds = new Array(raw.length);
|
|
1786
|
-
const runUnbinds = list => {
|
|
1787
|
-
if (list !== undefined) for (let u = 0; u < list.length; u++) list[u]();
|
|
1788
|
-
};
|
|
1789
|
-
const unbindAllRows = () => {
|
|
1790
|
-
for (let j = 0; j < rowUnbinds.length; j++) runUnbinds(rowUnbinds[j]);
|
|
1791
|
-
rowUnbinds = [];
|
|
1792
|
-
};
|
|
1793
|
-
let prevRaws = raw.slice();
|
|
1794
|
-
try {
|
|
1795
|
-
if (hydrating) {
|
|
1796
|
-
for (let i = 0; i < raw.length; i++) {
|
|
1797
|
-
entries[i] = bindRow(i, rowIds[i]);
|
|
1798
|
-
if (rowBodies !== null) rowBodies[i] = lastBodies;
|
|
1799
|
-
rowUnbinds[i] = lastUnbinds;
|
|
1800
|
-
}
|
|
1801
|
-
} else {
|
|
1802
|
-
for (let i = 0; i < raw.length; i++) {
|
|
1803
|
-
const node = bindRow(i);
|
|
1804
|
-
entries[i] = node;
|
|
1805
|
-
if (rowBodies !== null) rowBodies[i] = lastBodies;
|
|
1806
|
-
rowUnbinds[i] = lastUnbinds;
|
|
1807
|
-
parent.insertBefore(node, endAnchor);
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
} catch (err) {
|
|
1811
|
-
unbindAllRows();
|
|
1812
|
-
runUnbinds(lastUnbinds ?? undefined);
|
|
1813
|
-
for (let j = 0; j < entries.length; j++) {
|
|
1814
|
-
const n = entries[j];
|
|
1815
|
-
if (n !== undefined && n.parentNode === parent) n.remove();
|
|
1816
|
-
}
|
|
1817
|
-
listOwner.dispose();
|
|
1818
|
-
throw err;
|
|
1819
|
-
}
|
|
1820
|
-
const identityOps = nextArr => {
|
|
1821
|
-
const keyOf = r => {
|
|
1822
|
-
const w = r != null ? solidJs.patchableRaw(r) : undefined;
|
|
1823
|
-
return w !== undefined ? w : r;
|
|
1824
|
-
};
|
|
1825
|
-
const oldIndex = new Map();
|
|
1826
|
-
for (let j = 0; j < prevRaws.length; j++) {
|
|
1827
|
-
const k = keyOf(prevRaws[j]);
|
|
1828
|
-
const existing = oldIndex.get(k);
|
|
1829
|
-
if (existing === undefined) oldIndex.set(k, j);else if (Array.isArray(existing)) existing.push(j);else oldIndex.set(k, [existing, j]);
|
|
1830
|
-
}
|
|
1831
|
-
const sources = new Array(nextArr.length);
|
|
1832
|
-
for (let k = 0; k < nextArr.length; k++) {
|
|
1833
|
-
const m = oldIndex.get(keyOf(nextArr[k]));
|
|
1834
|
-
if (m === undefined) sources[k] = -1;else if (Array.isArray(m)) {
|
|
1835
|
-
sources[k] = m.shift();
|
|
1836
|
-
if (m.length === 1) oldIndex.set(keyOf(nextArr[k]), m[0]);
|
|
1837
|
-
} else {
|
|
1838
|
-
sources[k] = m;
|
|
1839
|
-
oldIndex.delete(keyOf(nextArr[k]));
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
return {
|
|
1843
|
-
prefix: 0,
|
|
1844
|
-
sources
|
|
1845
|
-
};
|
|
1846
|
-
};
|
|
1847
|
-
let resyncNeeded = false;
|
|
1848
|
-
const applyOps = (next, ops) => {
|
|
1849
|
-
if (declined) return;
|
|
1850
|
-
if (resyncNeeded) ops = null;
|
|
1851
|
-
if (ops === null) ops = identityOps(next);
|
|
1852
|
-
const {
|
|
1853
|
-
prefix,
|
|
1854
|
-
sources
|
|
1855
|
-
} = ops;
|
|
1856
|
-
const built = new Array(sources.length);
|
|
1857
|
-
const builtBodies = rowBodies !== null ? new Array(sources.length) : null;
|
|
1858
|
-
const builtUnbinds = new Array(sources.length);
|
|
1859
|
-
let j = 0;
|
|
1860
|
-
try {
|
|
1861
|
-
for (; j < sources.length; j++) {
|
|
1862
|
-
const abs = prefix + j;
|
|
1863
|
-
const src = sources[j];
|
|
1864
|
-
if (src === -1 || refRebuild && src >= 0 && next[abs] !== prevRaws[src]) {
|
|
1865
|
-
built[j] = bindRow(abs);
|
|
1866
|
-
if (builtBodies !== null) builtBodies[j] = lastBodies;
|
|
1867
|
-
builtUnbinds[j] = lastUnbinds;
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
} catch (err) {
|
|
1871
|
-
for (let k = 0; k < j; k++) runUnbinds(builtUnbinds[k]);
|
|
1872
|
-
runUnbinds(lastUnbinds ?? undefined);
|
|
1873
|
-
resyncNeeded = true;
|
|
1874
|
-
throw err;
|
|
1875
|
-
}
|
|
1876
|
-
const retained = new Set();
|
|
1877
|
-
for (let k = 0; k < sources.length; k++) {
|
|
1878
|
-
if (sources[k] >= 0 && built[k] === undefined) retained.add(sources[k]);
|
|
1879
|
-
}
|
|
1880
|
-
for (let k = prefix; k < entries.length; k++) {
|
|
1881
|
-
if (!retained.has(k)) {
|
|
1882
|
-
entries[k].remove();
|
|
1883
|
-
runUnbinds(rowUnbinds[k]);
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
const newEntries = new Array(prefix + sources.length);
|
|
1887
|
-
const newBodies = rowBodies !== null ? new Array(prefix + sources.length) : null;
|
|
1888
|
-
const newUnbinds = new Array(prefix + sources.length);
|
|
1889
|
-
for (let i = 0; i < prefix; i++) {
|
|
1890
|
-
newEntries[i] = entries[i];
|
|
1891
|
-
if (newBodies !== null) newBodies[i] = rowBodies[i];
|
|
1892
|
-
newUnbinds[i] = rowUnbinds[i];
|
|
1893
|
-
}
|
|
1894
|
-
const stable = lisPositions(sources);
|
|
1895
|
-
let anchor = endAnchor;
|
|
1896
|
-
for (let k = sources.length - 1; k >= 0; k--) {
|
|
1897
|
-
const abs = prefix + k;
|
|
1898
|
-
const src = sources[k];
|
|
1899
|
-
let node;
|
|
1900
|
-
if (built[k] !== undefined) {
|
|
1901
|
-
node = built[k];
|
|
1902
|
-
if (newBodies !== null) newBodies[abs] = builtBodies[k];
|
|
1903
|
-
newUnbinds[abs] = builtUnbinds[k];
|
|
1904
|
-
parent.insertBefore(node, anchor);
|
|
1905
|
-
} else {
|
|
1906
|
-
node = entries[src];
|
|
1907
|
-
if (newBodies !== null) newBodies[abs] = rowBodies[src];
|
|
1908
|
-
newUnbinds[abs] = rowUnbinds[src];
|
|
1909
|
-
if (!stable.has(k)) parent.insertBefore(node, anchor);
|
|
1910
|
-
}
|
|
1911
|
-
newEntries[abs] = node;
|
|
1912
|
-
anchor = node;
|
|
1913
|
-
}
|
|
1914
|
-
entries = newEntries;
|
|
1915
|
-
if (newBodies !== null) rowBodies = newBodies;
|
|
1916
|
-
rowUnbinds = newUnbinds;
|
|
1917
|
-
prevRaws = next.slice();
|
|
1918
|
-
resyncNeeded = false;
|
|
1919
|
-
};
|
|
1920
|
-
let unbindOps = solidJs.runWithOwner(listOwner, () => solidJs.registerRowOps(subject, applyOps));
|
|
1921
|
-
const refRebuild = shallow && typeof meta.keyed !== "function";
|
|
1922
|
-
const rebuildSlot = i => {
|
|
1923
|
-
runUnbinds(rowUnbinds[i]);
|
|
1924
|
-
const old = entries[i];
|
|
1925
|
-
const node = bindRow(i);
|
|
1926
|
-
rowBodies[i] = lastBodies;
|
|
1927
|
-
rowUnbinds[i] = lastUnbinds;
|
|
1928
|
-
parent.insertBefore(node, old);
|
|
1929
|
-
old.remove();
|
|
1930
|
-
entries[i] = node;
|
|
1931
|
-
};
|
|
1932
|
-
const applySlot = (i, next, prev) => {
|
|
1933
|
-
if (declined) return;
|
|
1934
|
-
if (resyncNeeded) {
|
|
1935
|
-
const live = subject != null ? solidJs.patchableRaw(subject) : undefined;
|
|
1936
|
-
if (live !== undefined && Array.isArray(live)) applyOps(live, null);
|
|
1937
|
-
return;
|
|
1938
|
-
}
|
|
1939
|
-
if (refRebuild) {
|
|
1940
|
-
rebuildSlot(i);
|
|
1941
|
-
prevRaws[i] = next;
|
|
1942
|
-
return;
|
|
1943
|
-
}
|
|
1944
|
-
const bodies = rowBodies[i];
|
|
1945
|
-
if (bodies !== undefined) {
|
|
1946
|
-
for (let b = 0; b < bodies.length; b++) bodies[b](next, prev, false);
|
|
1947
|
-
}
|
|
1948
|
-
prevRaws[i] = next;
|
|
1949
|
-
};
|
|
1950
|
-
let unbindSlots = shallow ? solidJs.runWithOwner(listOwner, () => solidJs.registerSlotPatch(subject, applySlot)) : null;
|
|
1951
|
-
solidJs.runWithOwner(listOwner, () => effect(() => meta.each(), value => {
|
|
1952
|
-
if (declined || value === subject) return;
|
|
1953
|
-
const nextRaw = value != null ? solidJs.patchableRaw(value) : undefined;
|
|
1954
|
-
unbindOps();
|
|
1955
|
-
unbindSlots?.();
|
|
1956
|
-
if (nextRaw !== undefined && Array.isArray(nextRaw) && solidJs.storeIsShallow(value) !== shallow) {
|
|
1957
|
-
for (let j = 0; j < entries.length; j++) entries[j].remove();
|
|
1958
|
-
entries = [];
|
|
1959
|
-
prevRaws = [];
|
|
1960
|
-
unbindAllRows();
|
|
1961
|
-
subject = value;
|
|
1962
|
-
declined = true;
|
|
1963
|
-
listOwner.dispose();
|
|
1964
|
-
lateClassic?.();
|
|
1965
|
-
return;
|
|
1966
|
-
}
|
|
1967
|
-
if (nextRaw === undefined || !Array.isArray(nextRaw)) {
|
|
1968
|
-
for (let j = 0; j < entries.length; j++) entries[j].remove();
|
|
1969
|
-
entries = [];
|
|
1970
|
-
prevRaws = [];
|
|
1971
|
-
unbindAllRows();
|
|
1972
|
-
subject = value;
|
|
1973
|
-
declined = true;
|
|
1974
|
-
listOwner.dispose();
|
|
1975
|
-
lateClassic?.();
|
|
1976
|
-
return;
|
|
1977
|
-
}
|
|
1978
|
-
const swapOps = identityOps(nextRaw);
|
|
1979
|
-
subject = value;
|
|
1980
|
-
unbindOps = solidJs.runWithOwner(listOwner, () => solidJs.registerRowOps(subject, applyOps));
|
|
1981
|
-
if (shallow) unbindSlots = solidJs.runWithOwner(listOwner, () => solidJs.registerSlotPatch(subject, applySlot));
|
|
1982
|
-
applyOps(nextRaw, swapOps);
|
|
1983
|
-
}));
|
|
1984
|
-
solidJs.onCleanup(() => {
|
|
1985
|
-
unbindOps();
|
|
1986
|
-
unbindSlots?.();
|
|
1987
|
-
unbindAllRows();
|
|
1988
|
-
listOwner.dispose();
|
|
1989
|
-
});
|
|
1990
|
-
return true;
|
|
1991
|
-
};
|
|
1992
|
-
const patchDriver = (subject, body) => {
|
|
1993
|
-
const raw = solidJs.patchableRaw(subject);
|
|
1994
|
-
if (raw !== undefined) {
|
|
1995
|
-
if (!solidJs.sharedConfig.hydrating) body(raw, undefined, true);
|
|
1996
|
-
const unbind = solidJs.registerPatch(subject, body);
|
|
1997
|
-
if (rowCollector !== null) rowCollector.unbinds.push(unbind);
|
|
1998
|
-
else solidJs.onCleanup(unbind);
|
|
1999
|
-
} else if (rowCollector !== null && subject === rowCollector.row) {
|
|
2000
|
-
rowCollector.bodies.push(body);
|
|
2001
|
-
if (!solidJs.sharedConfig.hydrating) body(subject, undefined, true);
|
|
2002
|
-
} else {
|
|
2003
|
-
effect(() => body(subject, subject, false),
|
|
2004
|
-
() => solidJs.untrack(() => body(subject, undefined, true)));
|
|
2005
|
-
}
|
|
2006
|
-
};
|
|
2007
|
-
|
|
2008
1689
|
function throwInBrowser(func) {
|
|
2009
1690
|
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
2010
1691
|
console.error(err);
|
|
@@ -2222,7 +1903,7 @@ const COMPONENT_BINDING = Symbol.for("solid.component-binding");
|
|
|
2222
1903
|
function bindingOf(value) {
|
|
2223
1904
|
return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
|
|
2224
1905
|
}
|
|
2225
|
-
function dynamic(source) {
|
|
1906
|
+
function dynamic(source, _options) {
|
|
2226
1907
|
let latest = 0;
|
|
2227
1908
|
const sites = new Set();
|
|
2228
1909
|
let deliveredAddress;
|
|
@@ -2263,24 +1944,9 @@ function dynamic(source) {
|
|
|
2263
1944
|
return solidJs.untrack(() => component(props));
|
|
2264
1945
|
}
|
|
2265
1946
|
case "string":
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
spread(el, props);
|
|
2270
|
-
return el;
|
|
2271
|
-
}
|
|
2272
|
-
const owner = solidJs.getOwner();
|
|
2273
|
-
let el;
|
|
2274
|
-
return () => {
|
|
2275
|
-
if (!el) {
|
|
2276
|
-
solidJs.runWithOwner(owner, () => {
|
|
2277
|
-
el = createElement(component, solidJs.untrack(() => props.is));
|
|
2278
|
-
spread(el, props);
|
|
2279
|
-
});
|
|
2280
|
-
}
|
|
2281
|
-
return el;
|
|
2282
|
-
};
|
|
2283
|
-
}
|
|
1947
|
+
const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, solidJs.untrack(() => props.is));
|
|
1948
|
+
spread(el, props);
|
|
1949
|
+
return el;
|
|
2284
1950
|
}
|
|
2285
1951
|
});
|
|
2286
1952
|
};
|
|
@@ -2289,15 +1955,8 @@ function Dynamic(props) {
|
|
|
2289
1955
|
const Comp = dynamic(() => props.component);
|
|
2290
1956
|
return solidJs.createComponent(Comp, solidJs.omit(props, "component"));
|
|
2291
1957
|
}
|
|
2292
|
-
const AmbiguousSVGElements = /*#__PURE__*/new Set(["a", "script", "style", "title"]);
|
|
2293
1958
|
function createElement(tagName, is = undefined) {
|
|
2294
|
-
|
|
2295
|
-
if (MathMLElements.has(tagName)) return document.createElementNS(Namespaces.mathml, tagName);
|
|
2296
|
-
if (AmbiguousSVGElements.has(tagName)) {
|
|
2297
|
-
const parent = getInsertionParent();
|
|
2298
|
-
if (parent && parent.namespaceURI === Namespaces.svg && parent.localName !== "foreignObject") return document.createElementNS(Namespaces.svg, tagName);
|
|
2299
|
-
}
|
|
2300
|
-
return document.createElement(tagName, {
|
|
1959
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
2301
1960
|
is
|
|
2302
1961
|
});
|
|
2303
1962
|
}
|
|
@@ -2419,7 +2078,6 @@ exports.createRequestEvent = createRequestEvent;
|
|
|
2419
2078
|
exports.createResponseStub = createResponseStub;
|
|
2420
2079
|
exports.createSSRResponse = createSSRResponse;
|
|
2421
2080
|
exports.delegateEvents = delegateEvents;
|
|
2422
|
-
exports.driveList = driveList;
|
|
2423
2081
|
exports.dynamic = dynamic;
|
|
2424
2082
|
exports.dynamicProperty = dynamicProperty;
|
|
2425
2083
|
exports.effect = effect;
|
|
@@ -2429,7 +2087,6 @@ exports.getDelegatedRoot = getDelegatedRoot;
|
|
|
2429
2087
|
exports.getExpectedRedirectStatus = getExpectedRedirectStatus;
|
|
2430
2088
|
exports.getFirstChild = getFirstChild;
|
|
2431
2089
|
exports.getHydrationKey = getHydrationKey;
|
|
2432
|
-
exports.getInsertionParent = getInsertionParent;
|
|
2433
2090
|
exports.getNextElement = getNextElement;
|
|
2434
2091
|
exports.getNextMarker = getNextMarker;
|
|
2435
2092
|
exports.getNextMatch = getNextMatch;
|
|
@@ -2443,7 +2100,6 @@ exports.httpStatus = httpStatus;
|
|
|
2443
2100
|
exports.hydrate = hydrate;
|
|
2444
2101
|
exports.insert = insert;
|
|
2445
2102
|
exports.installHydrationRuntime = installHydrationRuntime;
|
|
2446
|
-
exports.installListDriver = installListDriver;
|
|
2447
2103
|
exports.isDev = isDev;
|
|
2448
2104
|
exports.isHref = isHref;
|
|
2449
2105
|
exports.isResponseEnvelope = isResponseEnvelope;
|
|
@@ -2453,7 +2109,6 @@ exports.isServerFunction = isServerFunction;
|
|
|
2453
2109
|
exports.markSafeError = markSafeError;
|
|
2454
2110
|
exports.memo = memo;
|
|
2455
2111
|
exports.parseCookieHeader = parseCookieHeader;
|
|
2456
|
-
exports.patchDriver = patchDriver;
|
|
2457
2112
|
exports.redirect = redirect;
|
|
2458
2113
|
exports.ref = ref;
|
|
2459
2114
|
exports.registerDelegatedContainer = registerDelegatedContainer;
|
|
@@ -2465,7 +2120,6 @@ exports.renderToStream = renderToStream;
|
|
|
2465
2120
|
exports.renderToString = renderToString;
|
|
2466
2121
|
exports.resolveSSRNode = resolveSSRNode;
|
|
2467
2122
|
exports.respond = respond;
|
|
2468
|
-
exports.rowProof = rowProof;
|
|
2469
2123
|
exports.runHydrationEvents = runHydrationEvents;
|
|
2470
2124
|
exports.scope = scope;
|
|
2471
2125
|
exports.serializeCookie = serializeCookie;
|