solid-js 1.5.7 → 1.6.0-beta.0
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 +44 -28
- package/dist/dev.js +44 -28
- package/dist/solid.cjs +44 -28
- package/dist/solid.js +44 -28
- package/html/dist/html.cjs +30 -10
- package/html/dist/html.js +30 -10
- package/package.json +1 -1
- package/types/reactive/signal.d.ts +1 -1
- package/universal/dist/dev.cjs +4 -20
- package/universal/dist/dev.js +5 -21
- package/universal/dist/universal.cjs +4 -20
- package/universal/dist/universal.js +5 -21
- package/web/dist/dev.cjs +31 -39
- package/web/dist/dev.js +29 -41
- package/web/dist/server.cjs +34 -20
- package/web/dist/server.js +34 -21
- package/web/dist/web.cjs +31 -39
- package/web/dist/web.js +29 -41
- package/web/types/client.d.ts +6 -5
- package/web/types/core.d.ts +1 -3
- package/web/types/server.d.ts +11 -4
|
@@ -4,12 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var solidJs = require('solid-js');
|
|
6
6
|
|
|
7
|
-
function memo(fn, equals) {
|
|
8
|
-
return solidJs.createMemo(fn, undefined, !equals ? {
|
|
9
|
-
equals
|
|
10
|
-
} : undefined);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
7
|
function createRenderer$1({
|
|
14
8
|
createElement,
|
|
15
9
|
createTextNode,
|
|
@@ -195,10 +189,10 @@ function createRenderer$1({
|
|
|
195
189
|
}
|
|
196
190
|
function spreadExpression(node, props, prevProps = {}, skipChildren) {
|
|
197
191
|
props || (props = {});
|
|
198
|
-
if (!skipChildren
|
|
192
|
+
if (!skipChildren) {
|
|
199
193
|
solidJs.createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
200
194
|
}
|
|
201
|
-
props.ref && props.ref(node);
|
|
195
|
+
solidJs.createRenderEffect(() => props.ref && props.ref(node));
|
|
202
196
|
solidJs.createRenderEffect(() => {
|
|
203
197
|
for (const prop in props) {
|
|
204
198
|
if (prop === "children" || prop === "ref") continue;
|
|
@@ -232,25 +226,15 @@ function createRenderer$1({
|
|
|
232
226
|
setProperty(node, name, value, prev);
|
|
233
227
|
return value;
|
|
234
228
|
},
|
|
235
|
-
mergeProps,
|
|
229
|
+
mergeProps: solidJs.mergeProps,
|
|
236
230
|
effect: solidJs.createRenderEffect,
|
|
237
|
-
memo,
|
|
231
|
+
memo: solidJs.createMemo,
|
|
238
232
|
createComponent: solidJs.createComponent,
|
|
239
233
|
use(fn, element, arg) {
|
|
240
234
|
return solidJs.untrack(() => fn(element, arg));
|
|
241
235
|
}
|
|
242
236
|
};
|
|
243
237
|
}
|
|
244
|
-
function mergeProps(...sources) {
|
|
245
|
-
const target = {};
|
|
246
|
-
for (let i = 0; i < sources.length; i++) {
|
|
247
|
-
let source = sources[i];
|
|
248
|
-
if (typeof source === "function") source = source();
|
|
249
|
-
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
250
|
-
Object.defineProperties(target, descriptors);
|
|
251
|
-
}
|
|
252
|
-
return target;
|
|
253
|
-
}
|
|
254
238
|
|
|
255
239
|
function createRenderer(options) {
|
|
256
240
|
const renderer = createRenderer$1(options);
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function memo(fn, equals) {
|
|
4
|
-
return createMemo(fn, undefined, !equals ? {
|
|
5
|
-
equals
|
|
6
|
-
} : undefined);
|
|
7
|
-
}
|
|
1
|
+
import { createRoot, createRenderEffect, mergeProps, createMemo, createComponent, untrack } from 'solid-js';
|
|
8
2
|
|
|
9
3
|
function createRenderer$1({
|
|
10
4
|
createElement,
|
|
@@ -191,10 +185,10 @@ function createRenderer$1({
|
|
|
191
185
|
}
|
|
192
186
|
function spreadExpression(node, props, prevProps = {}, skipChildren) {
|
|
193
187
|
props || (props = {});
|
|
194
|
-
if (!skipChildren
|
|
188
|
+
if (!skipChildren) {
|
|
195
189
|
createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
196
190
|
}
|
|
197
|
-
props.ref && props.ref(node);
|
|
191
|
+
createRenderEffect(() => props.ref && props.ref(node));
|
|
198
192
|
createRenderEffect(() => {
|
|
199
193
|
for (const prop in props) {
|
|
200
194
|
if (prop === "children" || prop === "ref") continue;
|
|
@@ -230,27 +224,17 @@ function createRenderer$1({
|
|
|
230
224
|
},
|
|
231
225
|
mergeProps,
|
|
232
226
|
effect: createRenderEffect,
|
|
233
|
-
memo,
|
|
227
|
+
memo: createMemo,
|
|
234
228
|
createComponent,
|
|
235
229
|
use(fn, element, arg) {
|
|
236
230
|
return untrack(() => fn(element, arg));
|
|
237
231
|
}
|
|
238
232
|
};
|
|
239
233
|
}
|
|
240
|
-
function mergeProps(...sources) {
|
|
241
|
-
const target = {};
|
|
242
|
-
for (let i = 0; i < sources.length; i++) {
|
|
243
|
-
let source = sources[i];
|
|
244
|
-
if (typeof source === "function") source = source();
|
|
245
|
-
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
246
|
-
Object.defineProperties(target, descriptors);
|
|
247
|
-
}
|
|
248
|
-
return target;
|
|
249
|
-
}
|
|
250
234
|
|
|
251
235
|
function createRenderer(options) {
|
|
252
236
|
const renderer = createRenderer$1(options);
|
|
253
|
-
renderer.mergeProps = mergeProps
|
|
237
|
+
renderer.mergeProps = mergeProps;
|
|
254
238
|
return renderer;
|
|
255
239
|
}
|
|
256
240
|
|
package/web/dist/dev.cjs
CHANGED
|
@@ -7,18 +7,16 @@ var solidJs = require('solid-js');
|
|
|
7
7
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
8
8
|
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
9
9
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
10
|
-
const Aliases =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
readonly: "readOnly"
|
|
21
|
-
};
|
|
10
|
+
const Aliases = Object.create(null);
|
|
11
|
+
Aliases.className = "class";
|
|
12
|
+
Aliases.htmlFor = "for";
|
|
13
|
+
const PropAliases = Object.create(null);
|
|
14
|
+
PropAliases.class = "className";
|
|
15
|
+
PropAliases.formnovalidate = "formNoValidate";
|
|
16
|
+
PropAliases.ismap = "isMap";
|
|
17
|
+
PropAliases.nomodule = "noModule";
|
|
18
|
+
PropAliases.playsinline = "playsInline";
|
|
19
|
+
PropAliases.readonly = "readOnly";
|
|
22
20
|
const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
23
21
|
const SVGElements = /*#__PURE__*/new Set([
|
|
24
22
|
"altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
|
|
@@ -31,12 +29,6 @@ const SVGNamespace = {
|
|
|
31
29
|
};
|
|
32
30
|
const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
|
|
33
31
|
|
|
34
|
-
function memo(fn, equals) {
|
|
35
|
-
return solidJs.createMemo(fn, undefined, !equals ? {
|
|
36
|
-
equals
|
|
37
|
-
} : undefined);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
32
|
function reconcileArrays(parentNode, a, b) {
|
|
41
33
|
let bLength = b.length,
|
|
42
34
|
aEnd = a.length,
|
|
@@ -95,12 +87,12 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
95
87
|
}
|
|
96
88
|
|
|
97
89
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
98
|
-
function render(code, element, init) {
|
|
90
|
+
function render(code, element, init, options = {}) {
|
|
99
91
|
let disposer;
|
|
100
92
|
solidJs.createRoot(dispose => {
|
|
101
93
|
disposer = dispose;
|
|
102
94
|
element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
|
|
103
|
-
});
|
|
95
|
+
}, options.owner);
|
|
104
96
|
return () => {
|
|
105
97
|
disposer();
|
|
106
98
|
element.textContent = "";
|
|
@@ -190,10 +182,14 @@ function style(node, value, prev) {
|
|
|
190
182
|
}
|
|
191
183
|
return prev;
|
|
192
184
|
}
|
|
193
|
-
function spread(node,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
185
|
+
function spread(node, props = {}, isSVG, skipChildren) {
|
|
186
|
+
const prevProps = {};
|
|
187
|
+
if (!skipChildren) {
|
|
188
|
+
solidJs.createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
189
|
+
}
|
|
190
|
+
solidJs.createRenderEffect(() => props.ref && props.ref(node));
|
|
191
|
+
solidJs.createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
192
|
+
return prevProps;
|
|
197
193
|
}
|
|
198
194
|
function dynamicProperty(props, key) {
|
|
199
195
|
const src = props[key];
|
|
@@ -244,7 +240,7 @@ function hydrate$1(code, element, options = {}) {
|
|
|
244
240
|
count: 0
|
|
245
241
|
};
|
|
246
242
|
gatherHydratable(element, options.renderId);
|
|
247
|
-
const dispose = render(code, element, [...element.childNodes]);
|
|
243
|
+
const dispose = render(code, element, [...element.childNodes], options);
|
|
248
244
|
solidJs.sharedConfig.context = null;
|
|
249
245
|
return dispose;
|
|
250
246
|
}
|
|
@@ -313,9 +309,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
313
309
|
if (prop === "classList") return classList(node, value, prev);
|
|
314
310
|
if (value === prev) return prev;
|
|
315
311
|
if (prop === "ref") {
|
|
316
|
-
if (!skipRef)
|
|
317
|
-
value(node);
|
|
318
|
-
}
|
|
312
|
+
if (!skipRef) value(node);
|
|
319
313
|
} else if (prop.slice(0, 3) === "on:") {
|
|
320
314
|
const e = prop.slice(3);
|
|
321
315
|
prev && node.removeEventListener(e, prev);
|
|
@@ -372,15 +366,6 @@ function eventHandler(e) {
|
|
|
372
366
|
node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
|
|
373
367
|
}
|
|
374
368
|
}
|
|
375
|
-
function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
376
|
-
props || (props = {});
|
|
377
|
-
if (!skipChildren) {
|
|
378
|
-
solidJs.createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
379
|
-
}
|
|
380
|
-
solidJs.createRenderEffect(() => props.ref && props.ref(node));
|
|
381
|
-
solidJs.createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
382
|
-
return prevProps;
|
|
383
|
-
}
|
|
384
369
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
385
370
|
if (solidJs.sharedConfig.context && !current) current = [...parent.childNodes];
|
|
386
371
|
while (typeof current === "function") current = current();
|
|
@@ -475,7 +460,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
475
460
|
}
|
|
476
461
|
return dynamic;
|
|
477
462
|
}
|
|
478
|
-
function appendNodes(parent, array, marker) {
|
|
463
|
+
function appendNodes(parent, array, marker = null) {
|
|
479
464
|
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
480
465
|
}
|
|
481
466
|
function cleanChildren(parent, current, marker, replacement) {
|
|
@@ -508,6 +493,9 @@ function getHydrationKey() {
|
|
|
508
493
|
function NoHydration(props) {
|
|
509
494
|
return solidJs.sharedConfig.context ? undefined : props.children;
|
|
510
495
|
}
|
|
496
|
+
function Hydration(props) {
|
|
497
|
+
return props.children;
|
|
498
|
+
}
|
|
511
499
|
function voidFn() {}
|
|
512
500
|
|
|
513
501
|
function throwInBrowser(func) {
|
|
@@ -643,6 +631,10 @@ Object.defineProperty(exports, 'getOwner', {
|
|
|
643
631
|
enumerable: true,
|
|
644
632
|
get: function () { return solidJs.getOwner; }
|
|
645
633
|
});
|
|
634
|
+
Object.defineProperty(exports, 'memo', {
|
|
635
|
+
enumerable: true,
|
|
636
|
+
get: function () { return solidJs.createMemo; }
|
|
637
|
+
});
|
|
646
638
|
Object.defineProperty(exports, 'mergeProps', {
|
|
647
639
|
enumerable: true,
|
|
648
640
|
get: function () { return solidJs.mergeProps; }
|
|
@@ -657,6 +649,7 @@ exports.ChildProperties = ChildProperties;
|
|
|
657
649
|
exports.DOMElements = DOMElements;
|
|
658
650
|
exports.DelegatedEvents = DelegatedEvents;
|
|
659
651
|
exports.Dynamic = Dynamic;
|
|
652
|
+
exports.Hydration = Hydration;
|
|
660
653
|
exports.HydrationScript = voidFn;
|
|
661
654
|
exports.NoHydration = NoHydration;
|
|
662
655
|
exports.Portal = Portal;
|
|
@@ -682,7 +675,6 @@ exports.hydrate = hydrate;
|
|
|
682
675
|
exports.innerHTML = innerHTML;
|
|
683
676
|
exports.insert = insert;
|
|
684
677
|
exports.isServer = isServer;
|
|
685
|
-
exports.memo = memo;
|
|
686
678
|
exports.render = render;
|
|
687
679
|
exports.renderToStream = renderToStream;
|
|
688
680
|
exports.renderToString = renderToString;
|
package/web/dist/dev.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
|
|
1
|
+
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js';
|
|
2
|
+
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
5
|
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
6
6
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
7
|
-
const Aliases =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
readonly: "readOnly"
|
|
18
|
-
};
|
|
7
|
+
const Aliases = Object.create(null);
|
|
8
|
+
Aliases.className = "class";
|
|
9
|
+
Aliases.htmlFor = "for";
|
|
10
|
+
const PropAliases = Object.create(null);
|
|
11
|
+
PropAliases.class = "className";
|
|
12
|
+
PropAliases.formnovalidate = "formNoValidate";
|
|
13
|
+
PropAliases.ismap = "isMap";
|
|
14
|
+
PropAliases.nomodule = "noModule";
|
|
15
|
+
PropAliases.playsinline = "playsInline";
|
|
16
|
+
PropAliases.readonly = "readOnly";
|
|
19
17
|
const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
20
18
|
const SVGElements = /*#__PURE__*/new Set([
|
|
21
19
|
"altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
|
|
@@ -28,12 +26,6 @@ const SVGNamespace = {
|
|
|
28
26
|
};
|
|
29
27
|
const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
|
|
30
28
|
|
|
31
|
-
function memo(fn, equals) {
|
|
32
|
-
return createMemo(fn, undefined, !equals ? {
|
|
33
|
-
equals
|
|
34
|
-
} : undefined);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
29
|
function reconcileArrays(parentNode, a, b) {
|
|
38
30
|
let bLength = b.length,
|
|
39
31
|
aEnd = a.length,
|
|
@@ -92,12 +84,12 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
92
84
|
}
|
|
93
85
|
|
|
94
86
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
95
|
-
function render(code, element, init) {
|
|
87
|
+
function render(code, element, init, options = {}) {
|
|
96
88
|
let disposer;
|
|
97
89
|
createRoot(dispose => {
|
|
98
90
|
disposer = dispose;
|
|
99
91
|
element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
|
|
100
|
-
});
|
|
92
|
+
}, options.owner);
|
|
101
93
|
return () => {
|
|
102
94
|
disposer();
|
|
103
95
|
element.textContent = "";
|
|
@@ -187,10 +179,14 @@ function style(node, value, prev) {
|
|
|
187
179
|
}
|
|
188
180
|
return prev;
|
|
189
181
|
}
|
|
190
|
-
function spread(node,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
182
|
+
function spread(node, props = {}, isSVG, skipChildren) {
|
|
183
|
+
const prevProps = {};
|
|
184
|
+
if (!skipChildren) {
|
|
185
|
+
createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
186
|
+
}
|
|
187
|
+
createRenderEffect(() => props.ref && props.ref(node));
|
|
188
|
+
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
189
|
+
return prevProps;
|
|
194
190
|
}
|
|
195
191
|
function dynamicProperty(props, key) {
|
|
196
192
|
const src = props[key];
|
|
@@ -241,7 +237,7 @@ function hydrate$1(code, element, options = {}) {
|
|
|
241
237
|
count: 0
|
|
242
238
|
};
|
|
243
239
|
gatherHydratable(element, options.renderId);
|
|
244
|
-
const dispose = render(code, element, [...element.childNodes]);
|
|
240
|
+
const dispose = render(code, element, [...element.childNodes], options);
|
|
245
241
|
sharedConfig.context = null;
|
|
246
242
|
return dispose;
|
|
247
243
|
}
|
|
@@ -310,9 +306,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
310
306
|
if (prop === "classList") return classList(node, value, prev);
|
|
311
307
|
if (value === prev) return prev;
|
|
312
308
|
if (prop === "ref") {
|
|
313
|
-
if (!skipRef)
|
|
314
|
-
value(node);
|
|
315
|
-
}
|
|
309
|
+
if (!skipRef) value(node);
|
|
316
310
|
} else if (prop.slice(0, 3) === "on:") {
|
|
317
311
|
const e = prop.slice(3);
|
|
318
312
|
prev && node.removeEventListener(e, prev);
|
|
@@ -369,15 +363,6 @@ function eventHandler(e) {
|
|
|
369
363
|
node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
|
|
370
364
|
}
|
|
371
365
|
}
|
|
372
|
-
function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
373
|
-
props || (props = {});
|
|
374
|
-
if (!skipChildren) {
|
|
375
|
-
createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
376
|
-
}
|
|
377
|
-
createRenderEffect(() => props.ref && props.ref(node));
|
|
378
|
-
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
379
|
-
return prevProps;
|
|
380
|
-
}
|
|
381
366
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
382
367
|
if (sharedConfig.context && !current) current = [...parent.childNodes];
|
|
383
368
|
while (typeof current === "function") current = current();
|
|
@@ -472,7 +457,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
472
457
|
}
|
|
473
458
|
return dynamic;
|
|
474
459
|
}
|
|
475
|
-
function appendNodes(parent, array, marker) {
|
|
460
|
+
function appendNodes(parent, array, marker = null) {
|
|
476
461
|
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
477
462
|
}
|
|
478
463
|
function cleanChildren(parent, current, marker, replacement) {
|
|
@@ -505,6 +490,9 @@ function getHydrationKey() {
|
|
|
505
490
|
function NoHydration(props) {
|
|
506
491
|
return sharedConfig.context ? undefined : props.children;
|
|
507
492
|
}
|
|
493
|
+
function Hydration(props) {
|
|
494
|
+
return props.children;
|
|
495
|
+
}
|
|
508
496
|
function voidFn() {}
|
|
509
497
|
|
|
510
498
|
function throwInBrowser(func) {
|
|
@@ -596,4 +584,4 @@ function Dynamic(props) {
|
|
|
596
584
|
});
|
|
597
585
|
}
|
|
598
586
|
|
|
599
|
-
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer,
|
|
587
|
+
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };
|
package/web/dist/server.cjs
CHANGED
|
@@ -8,10 +8,16 @@ const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked"
|
|
|
8
8
|
const BooleanAttributes = /*#__PURE__*/new Set(booleans);
|
|
9
9
|
/*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
10
10
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
11
|
-
const Aliases =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const Aliases = Object.create(null);
|
|
12
|
+
Aliases.className = "class";
|
|
13
|
+
Aliases.htmlFor = "for";
|
|
14
|
+
const PropAliases = Object.create(null);
|
|
15
|
+
PropAliases.class = "className";
|
|
16
|
+
PropAliases.formnovalidate = "formNoValidate";
|
|
17
|
+
PropAliases.ismap = "isMap";
|
|
18
|
+
PropAliases.nomodule = "noModule";
|
|
19
|
+
PropAliases.playsinline = "playsInline";
|
|
20
|
+
PropAliases.readonly = "readOnly";
|
|
15
21
|
|
|
16
22
|
const {
|
|
17
23
|
hasOwnProperty
|
|
@@ -273,6 +279,7 @@ function renderToString(code, options = {}) {
|
|
|
273
279
|
assets: [],
|
|
274
280
|
nonce: options.nonce,
|
|
275
281
|
writeResource(id, p, error) {
|
|
282
|
+
if (solidJs.sharedConfig.context.noHydrate) return;
|
|
276
283
|
if (error) return scripts += `_$HY.set("${id}", ${serializeError(p)});`;
|
|
277
284
|
scripts += `_$HY.set("${id}", ${stringify(p)});`;
|
|
278
285
|
}
|
|
@@ -365,9 +372,11 @@ function renderToStream(code, options = {}) {
|
|
|
365
372
|
html = html.replace(html.slice(first, last + placeholder.length + 1), resolveSSRNode(payloadFn()));
|
|
366
373
|
},
|
|
367
374
|
writeResource(id, p, error, wait) {
|
|
368
|
-
|
|
369
|
-
if (
|
|
370
|
-
if (!
|
|
375
|
+
const serverOnly = solidJs.sharedConfig.context.noHydrate;
|
|
376
|
+
if (error) return !serverOnly && pushTask(serializeSet(dedupe, id, p, serializeError));
|
|
377
|
+
if (!p || typeof p !== "object" || !("then" in p)) return !serverOnly && pushTask(serializeSet(dedupe, id, p));
|
|
378
|
+
if (!firstFlushed) wait && blockingResources.push(p);else !serverOnly && pushTask(`_$HY.init("${id}")`);
|
|
379
|
+
if (serverOnly) return;
|
|
371
380
|
p.then(d => {
|
|
372
381
|
!completed && pushTask(serializeSet(dedupe, id, d));
|
|
373
382
|
}).catch(() => {
|
|
@@ -466,9 +475,6 @@ function renderToStream(code, options = {}) {
|
|
|
466
475
|
}
|
|
467
476
|
};
|
|
468
477
|
}
|
|
469
|
-
function Assets(props) {
|
|
470
|
-
useAssets(() => props.children);
|
|
471
|
-
}
|
|
472
478
|
function HydrationScript(props) {
|
|
473
479
|
const {
|
|
474
480
|
nonce
|
|
@@ -478,13 +484,6 @@ function HydrationScript(props) {
|
|
|
478
484
|
...props
|
|
479
485
|
}));
|
|
480
486
|
}
|
|
481
|
-
function NoHydration(props) {
|
|
482
|
-
const c = solidJs.sharedConfig.context;
|
|
483
|
-
c.noHydrate = true;
|
|
484
|
-
const children = props.children;
|
|
485
|
-
c.noHydrate = false;
|
|
486
|
-
return children;
|
|
487
|
-
}
|
|
488
487
|
function ssr(t, ...nodes) {
|
|
489
488
|
if (nodes.length) {
|
|
490
489
|
let result = "";
|
|
@@ -506,7 +505,7 @@ function ssrClassList(value) {
|
|
|
506
505
|
for (let i = 0, len = classKeys.length; i < len; i++) {
|
|
507
506
|
const key = classKeys[i],
|
|
508
507
|
classValue = !!value[key];
|
|
509
|
-
if (!key || !classValue) continue;
|
|
508
|
+
if (!key || key === "undefined" || !classValue) continue;
|
|
510
509
|
i && (result += " ");
|
|
511
510
|
result += key;
|
|
512
511
|
}
|
|
@@ -519,8 +518,11 @@ function ssrStyle(value) {
|
|
|
519
518
|
const k = Object.keys(value);
|
|
520
519
|
for (let i = 0; i < k.length; i++) {
|
|
521
520
|
const s = k[i];
|
|
522
|
-
|
|
523
|
-
|
|
521
|
+
const v = value[s];
|
|
522
|
+
if (v != undefined) {
|
|
523
|
+
if (i) result += ";";
|
|
524
|
+
result += `${s}:${escape(v, true)}`;
|
|
525
|
+
}
|
|
524
526
|
}
|
|
525
527
|
return result;
|
|
526
528
|
}
|
|
@@ -644,6 +646,14 @@ function generateHydrationScript({
|
|
|
644
646
|
} = {}) {
|
|
645
647
|
return `<script${nonce ? ` nonce="${nonce}"` : ""}>var e,t;e=window._$HY||(_$HY={events:[],completed:new WeakSet,r:{}}),t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host instanceof Node?e.host:e.parentNode)),["${eventNames.join('","')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])})))),e.init=(t,o)=>{e.r[t]=[new Promise(((e,t)=>o=e)),o]},e.set=(t,o,s)=>{(s=e.r[t])&&s[1](o),e.r[t]=[o]},e.unset=t=>{delete e.r[t]},e.load=t=>e.r[t];</script><!--xs-->`;
|
|
646
648
|
}
|
|
649
|
+
function Hydration(props) {
|
|
650
|
+
solidJs.sharedConfig.context.noHydrate = false;
|
|
651
|
+
return props.children;
|
|
652
|
+
}
|
|
653
|
+
function NoHydration(props) {
|
|
654
|
+
solidJs.sharedConfig.context.noHydrate = true;
|
|
655
|
+
return props.children;
|
|
656
|
+
}
|
|
647
657
|
function injectAssets(assets, html) {
|
|
648
658
|
if (!assets || !assets.length) return html;
|
|
649
659
|
let out = "";
|
|
@@ -705,6 +715,9 @@ function replacePlaceholder(html, key, value) {
|
|
|
705
715
|
}
|
|
706
716
|
return html.slice(0, first) + value + html.slice(nextRegex.lastIndex);
|
|
707
717
|
}
|
|
718
|
+
function Assets(props) {
|
|
719
|
+
useAssets(() => props.children);
|
|
720
|
+
}
|
|
708
721
|
function pipeToNodeWritable(code, writable, options = {}) {
|
|
709
722
|
if (options.onReady) {
|
|
710
723
|
options.onCompleteShell = ({
|
|
@@ -829,6 +842,7 @@ Object.defineProperty(exports, 'mergeProps', {
|
|
|
829
842
|
});
|
|
830
843
|
exports.Assets = Assets;
|
|
831
844
|
exports.Dynamic = Dynamic;
|
|
845
|
+
exports.Hydration = Hydration;
|
|
832
846
|
exports.HydrationScript = HydrationScript;
|
|
833
847
|
exports.NoHydration = NoHydration;
|
|
834
848
|
exports.Portal = Portal;
|