solid-js 1.9.4 → 1.9.6
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/LICENSE +1 -1
- package/dist/dev.cjs +57 -42
- package/dist/dev.js +65 -50
- package/dist/solid.cjs +38 -34
- package/dist/solid.js +49 -41
- package/h/jsx-runtime/types/jsx.d.ts +2975 -1021
- package/html/dist/html.cjs +5 -5
- package/html/dist/html.js +5 -5
- package/package.json +1 -1
- package/store/types/store.d.ts +1 -0
- package/types/index.d.ts +3 -0
- package/types/jsx.d.ts +2126 -281
- package/types/reactive/observable.d.ts +11 -11
- package/types/reactive/signal.d.ts +4 -0
- package/types/server/reactive.d.ts +6 -1
- package/universal/dist/dev.cjs +3 -1
- package/universal/dist/dev.js +4 -2
- package/universal/dist/universal.cjs +3 -1
- package/universal/dist/universal.js +4 -2
- package/web/dist/dev.cjs +21 -14
- package/web/dist/dev.js +25 -12
- package/web/dist/server.cjs +18 -11
- package/web/dist/server.js +22 -8
- package/web/dist/web.cjs +21 -14
- package/web/dist/web.js +23 -10
- package/web/types/core.d.ts +1 -1
- package/web/types/index.d.ts +16 -0
|
@@ -28,15 +28,15 @@ export type ObservableObserver<T> =
|
|
|
28
28
|
* description https://docs.solidjs.com/reference/reactive-utilities/observable
|
|
29
29
|
*/
|
|
30
30
|
export declare function observable<T>(input: Accessor<T>): Observable<T>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
): Accessor<T | undefined>;
|
|
31
|
+
type Producer<T> =
|
|
32
|
+
| ((setter: Setter<T>) => () => void)
|
|
33
|
+
| {
|
|
34
|
+
subscribe: (fn: (v: T) => void) =>
|
|
35
|
+
| (() => void)
|
|
36
|
+
| {
|
|
37
|
+
unsubscribe: () => void;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare function from<T>(producer: Producer<T>, initalValue: T): Accessor<T>;
|
|
41
|
+
export declare function from<T>(producer: Producer<T | undefined>): Accessor<T | undefined>;
|
|
42
42
|
export {};
|
|
@@ -24,6 +24,7 @@ SOFTWARE.
|
|
|
24
24
|
import { requestCallback } from "./scheduler.js";
|
|
25
25
|
import type { JSX } from "../jsx.js";
|
|
26
26
|
import type { FlowComponent } from "../render/index.js";
|
|
27
|
+
export declare const IS_DEV: string | boolean;
|
|
27
28
|
export declare const equalFn: <T>(a: T, b: T) => boolean;
|
|
28
29
|
export declare const $PROXY: unique symbol;
|
|
29
30
|
export declare const SUPPORTS_PROXY: boolean;
|
|
@@ -35,7 +36,9 @@ export declare let Transition: TransitionState | null;
|
|
|
35
36
|
export declare const DevHooks: {
|
|
36
37
|
afterUpdate: (() => void) | null;
|
|
37
38
|
afterCreateOwner: ((owner: Owner) => void) | null;
|
|
39
|
+
/** @deprecated use `afterRegisterGraph` */
|
|
38
40
|
afterCreateSignal: ((signal: SignalState<any>) => void) | null;
|
|
41
|
+
afterRegisterGraph: ((sourceMapValue: SourceMapValue) => void) | null;
|
|
39
42
|
};
|
|
40
43
|
export type ComputationState = 0 | 1 | 2;
|
|
41
44
|
export interface SourceMapValue {
|
|
@@ -49,6 +52,7 @@ export interface SignalState<T> extends SourceMapValue {
|
|
|
49
52
|
observerSlots: number[] | null;
|
|
50
53
|
tValue?: T;
|
|
51
54
|
comparator?: (prev: T, next: T) => boolean;
|
|
55
|
+
internal?: true;
|
|
52
56
|
}
|
|
53
57
|
export interface Owner {
|
|
54
58
|
owned: Computation<any>[] | null;
|
|
@@ -103,7 +103,12 @@ export declare function observable<T>(input: Accessor<T>): {
|
|
|
103
103
|
subscribe(observer: ObservableObserver<T>): {
|
|
104
104
|
unsubscribe(): void;
|
|
105
105
|
};
|
|
106
|
-
[Symbol.observable]():
|
|
106
|
+
[Symbol.observable](): {
|
|
107
|
+
subscribe(observer: ObservableObserver<T>): {
|
|
108
|
+
unsubscribe(): void;
|
|
109
|
+
};
|
|
110
|
+
[Symbol.observable](): /*elided*/ any;
|
|
111
|
+
};
|
|
107
112
|
};
|
|
108
113
|
export declare function from<T>(
|
|
109
114
|
producer:
|
package/universal/dist/dev.cjs
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var solidJs = require('solid-js');
|
|
4
4
|
|
|
5
|
+
const memo = fn => solidJs.createMemo(() => fn());
|
|
6
|
+
|
|
5
7
|
function createRenderer$1({
|
|
6
8
|
createElement,
|
|
7
9
|
createTextNode,
|
|
@@ -226,7 +228,7 @@ function createRenderer$1({
|
|
|
226
228
|
},
|
|
227
229
|
mergeProps: solidJs.mergeProps,
|
|
228
230
|
effect: solidJs.createRenderEffect,
|
|
229
|
-
memo
|
|
231
|
+
memo,
|
|
230
232
|
createComponent: solidJs.createComponent,
|
|
231
233
|
use(fn, element, arg) {
|
|
232
234
|
return solidJs.untrack(() => fn(element, arg));
|
package/universal/dist/dev.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
createMemo,
|
|
2
3
|
createRoot,
|
|
3
4
|
createRenderEffect,
|
|
4
5
|
mergeProps,
|
|
5
|
-
createMemo,
|
|
6
6
|
createComponent,
|
|
7
7
|
untrack
|
|
8
8
|
} from "solid-js";
|
|
9
9
|
|
|
10
|
+
const memo = fn => createMemo(() => fn());
|
|
11
|
+
|
|
10
12
|
function createRenderer$1({
|
|
11
13
|
createElement,
|
|
12
14
|
createTextNode,
|
|
@@ -240,7 +242,7 @@ function createRenderer$1({
|
|
|
240
242
|
},
|
|
241
243
|
mergeProps,
|
|
242
244
|
effect: createRenderEffect,
|
|
243
|
-
memo
|
|
245
|
+
memo,
|
|
244
246
|
createComponent,
|
|
245
247
|
use(fn, element, arg) {
|
|
246
248
|
return untrack(() => fn(element, arg));
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var solidJs = require('solid-js');
|
|
4
4
|
|
|
5
|
+
const memo = fn => solidJs.createMemo(() => fn());
|
|
6
|
+
|
|
5
7
|
function createRenderer$1({
|
|
6
8
|
createElement,
|
|
7
9
|
createTextNode,
|
|
@@ -226,7 +228,7 @@ function createRenderer$1({
|
|
|
226
228
|
},
|
|
227
229
|
mergeProps: solidJs.mergeProps,
|
|
228
230
|
effect: solidJs.createRenderEffect,
|
|
229
|
-
memo
|
|
231
|
+
memo,
|
|
230
232
|
createComponent: solidJs.createComponent,
|
|
231
233
|
use(fn, element, arg) {
|
|
232
234
|
return solidJs.untrack(() => fn(element, arg));
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
createMemo,
|
|
2
3
|
createRoot,
|
|
3
4
|
createRenderEffect,
|
|
4
5
|
mergeProps,
|
|
5
|
-
createMemo,
|
|
6
6
|
createComponent,
|
|
7
7
|
untrack
|
|
8
8
|
} from "solid-js";
|
|
9
9
|
|
|
10
|
+
const memo = fn => createMemo(() => fn());
|
|
11
|
+
|
|
10
12
|
function createRenderer$1({
|
|
11
13
|
createElement,
|
|
12
14
|
createTextNode,
|
|
@@ -240,7 +242,7 @@ function createRenderer$1({
|
|
|
240
242
|
},
|
|
241
243
|
mergeProps,
|
|
242
244
|
effect: createRenderEffect,
|
|
243
|
-
memo
|
|
245
|
+
memo,
|
|
244
246
|
createComponent,
|
|
245
247
|
use(fn, element, arg) {
|
|
246
248
|
return untrack(() => fn(element, arg));
|
package/web/dist/dev.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var solidJs = require('solid-js');
|
|
4
4
|
|
|
5
5
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
6
|
-
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
6
|
+
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
7
7
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
8
8
|
const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
9
9
|
className: "class",
|
|
@@ -11,6 +11,10 @@ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
|
11
11
|
});
|
|
12
12
|
const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
13
13
|
class: "className",
|
|
14
|
+
novalidate: {
|
|
15
|
+
$: "noValidate",
|
|
16
|
+
FORM: 1
|
|
17
|
+
},
|
|
14
18
|
formnovalidate: {
|
|
15
19
|
$: "formNoValidate",
|
|
16
20
|
BUTTON: 1,
|
|
@@ -50,6 +54,8 @@ const SVGNamespace = {
|
|
|
50
54
|
};
|
|
51
55
|
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", "h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
52
56
|
|
|
57
|
+
const memo = fn => solidJs.createMemo(() => fn());
|
|
58
|
+
|
|
53
59
|
function reconcileArrays(parentNode, a, b) {
|
|
54
60
|
let bLength = b.length,
|
|
55
61
|
aEnd = a.length,
|
|
@@ -122,13 +128,13 @@ function render(code, element, init, options = {}) {
|
|
|
122
128
|
element.textContent = "";
|
|
123
129
|
};
|
|
124
130
|
}
|
|
125
|
-
function template(html, isImportNode, isSVG) {
|
|
131
|
+
function template(html, isImportNode, isSVG, isMathML) {
|
|
126
132
|
let node;
|
|
127
133
|
const create = () => {
|
|
128
134
|
if (isHydrating()) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
129
|
-
const t = document.createElement("template");
|
|
135
|
+
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
130
136
|
t.innerHTML = html;
|
|
131
|
-
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
137
|
+
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
132
138
|
};
|
|
133
139
|
const fn = isImportNode ? () => solidJs.untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
134
140
|
fn.cloneNode = fn;
|
|
@@ -385,7 +391,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
|
|
|
385
391
|
setAttribute(node, prop.slice(5), value);
|
|
386
392
|
} else if (prop.slice(0, 5) === "bool:") {
|
|
387
393
|
setBoolAttribute(node, prop.slice(5), value);
|
|
388
|
-
} else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") ||
|
|
394
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
|
|
389
395
|
if (forceProp) {
|
|
390
396
|
prop = prop.slice(5);
|
|
391
397
|
isProp = true;
|
|
@@ -669,9 +675,8 @@ function Portal(props) {
|
|
|
669
675
|
});
|
|
670
676
|
return marker;
|
|
671
677
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
674
|
-
const cached = solidJs.createMemo(() => p.component);
|
|
678
|
+
function createDynamic(component, props) {
|
|
679
|
+
const cached = solidJs.createMemo(component);
|
|
675
680
|
return solidJs.createMemo(() => {
|
|
676
681
|
const component = cached();
|
|
677
682
|
switch (typeof component) {
|
|
@@ -679,15 +684,19 @@ function Dynamic(props) {
|
|
|
679
684
|
Object.assign(component, {
|
|
680
685
|
[solidJs.$DEVCOMP]: true
|
|
681
686
|
});
|
|
682
|
-
return solidJs.untrack(() => component(
|
|
687
|
+
return solidJs.untrack(() => component(props));
|
|
683
688
|
case "string":
|
|
684
689
|
const isSvg = SVGElements.has(component);
|
|
685
690
|
const el = solidJs.sharedConfig.context ? getNextElement() : createElement(component, isSvg);
|
|
686
|
-
spread(el,
|
|
691
|
+
spread(el, props, isSvg);
|
|
687
692
|
return el;
|
|
688
693
|
}
|
|
689
694
|
});
|
|
690
695
|
}
|
|
696
|
+
function Dynamic(props) {
|
|
697
|
+
const [, others] = solidJs.splitProps(props, ["component"]);
|
|
698
|
+
return createDynamic(() => props.component, others);
|
|
699
|
+
}
|
|
691
700
|
|
|
692
701
|
Object.defineProperty(exports, "ErrorBoundary", {
|
|
693
702
|
enumerable: true,
|
|
@@ -733,10 +742,6 @@ Object.defineProperty(exports, "getOwner", {
|
|
|
733
742
|
enumerable: true,
|
|
734
743
|
get: function () { return solidJs.getOwner; }
|
|
735
744
|
});
|
|
736
|
-
Object.defineProperty(exports, "memo", {
|
|
737
|
-
enumerable: true,
|
|
738
|
-
get: function () { return solidJs.createMemo; }
|
|
739
|
-
});
|
|
740
745
|
Object.defineProperty(exports, "mergeProps", {
|
|
741
746
|
enumerable: true,
|
|
742
747
|
get: function () { return solidJs.mergeProps; }
|
|
@@ -764,6 +769,7 @@ exports.assign = assign;
|
|
|
764
769
|
exports.classList = classList;
|
|
765
770
|
exports.className = className;
|
|
766
771
|
exports.clearDelegatedEvents = clearDelegatedEvents;
|
|
772
|
+
exports.createDynamic = createDynamic;
|
|
767
773
|
exports.delegateEvents = delegateEvents;
|
|
768
774
|
exports.dynamicProperty = dynamicProperty;
|
|
769
775
|
exports.escape = escape;
|
|
@@ -780,6 +786,7 @@ exports.innerHTML = innerHTML;
|
|
|
780
786
|
exports.insert = insert;
|
|
781
787
|
exports.isDev = isDev;
|
|
782
788
|
exports.isServer = isServer;
|
|
789
|
+
exports.memo = memo;
|
|
783
790
|
exports.render = render;
|
|
784
791
|
exports.renderToStream = renderToStream;
|
|
785
792
|
exports.renderToString = renderToString;
|
package/web/dist/dev.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
createMemo,
|
|
2
3
|
createRoot,
|
|
3
4
|
createRenderEffect,
|
|
4
5
|
untrack,
|
|
@@ -7,11 +8,10 @@ import {
|
|
|
7
8
|
getOwner,
|
|
8
9
|
createEffect,
|
|
9
10
|
runWithOwner,
|
|
10
|
-
createMemo,
|
|
11
11
|
createSignal,
|
|
12
12
|
onCleanup,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
$DEVCOMP,
|
|
14
|
+
splitProps
|
|
15
15
|
} from "solid-js";
|
|
16
16
|
export {
|
|
17
17
|
ErrorBoundary,
|
|
@@ -25,7 +25,6 @@ export {
|
|
|
25
25
|
createComponent,
|
|
26
26
|
createRenderEffect as effect,
|
|
27
27
|
getOwner,
|
|
28
|
-
createMemo as memo,
|
|
29
28
|
mergeProps,
|
|
30
29
|
untrack
|
|
31
30
|
} from "solid-js";
|
|
@@ -61,6 +60,7 @@ const Properties = /*#__PURE__*/ new Set([
|
|
|
61
60
|
"className",
|
|
62
61
|
"value",
|
|
63
62
|
"readOnly",
|
|
63
|
+
"noValidate",
|
|
64
64
|
"formNoValidate",
|
|
65
65
|
"isMap",
|
|
66
66
|
"noModule",
|
|
@@ -79,6 +79,10 @@ const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
|
79
79
|
});
|
|
80
80
|
const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
81
81
|
class: "className",
|
|
82
|
+
novalidate: {
|
|
83
|
+
$: "noValidate",
|
|
84
|
+
FORM: 1
|
|
85
|
+
},
|
|
82
86
|
formnovalidate: {
|
|
83
87
|
$: "formNoValidate",
|
|
84
88
|
BUTTON: 1,
|
|
@@ -495,6 +499,8 @@ const DOMElements = /*#__PURE__*/ new Set([
|
|
|
495
499
|
"h6"
|
|
496
500
|
]);
|
|
497
501
|
|
|
502
|
+
const memo = fn => createMemo(() => fn());
|
|
503
|
+
|
|
498
504
|
function reconcileArrays(parentNode, a, b) {
|
|
499
505
|
let bLength = b.length,
|
|
500
506
|
aEnd = a.length,
|
|
@@ -571,16 +577,18 @@ function render(code, element, init, options = {}) {
|
|
|
571
577
|
element.textContent = "";
|
|
572
578
|
};
|
|
573
579
|
}
|
|
574
|
-
function template(html, isImportNode, isSVG) {
|
|
580
|
+
function template(html, isImportNode, isSVG, isMathML) {
|
|
575
581
|
let node;
|
|
576
582
|
const create = () => {
|
|
577
583
|
if (isHydrating())
|
|
578
584
|
throw new Error(
|
|
579
585
|
"Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration."
|
|
580
586
|
);
|
|
581
|
-
const t =
|
|
587
|
+
const t = isMathML
|
|
588
|
+
? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template")
|
|
589
|
+
: document.createElement("template");
|
|
582
590
|
t.innerHTML = html;
|
|
583
|
-
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
591
|
+
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
584
592
|
};
|
|
585
593
|
const fn = isImportNode
|
|
586
594
|
? () => untrack(() => document.importNode(node || (node = create()), true))
|
|
@@ -1160,9 +1168,8 @@ function Portal(props) {
|
|
|
1160
1168
|
);
|
|
1161
1169
|
return marker;
|
|
1162
1170
|
}
|
|
1163
|
-
function
|
|
1164
|
-
const
|
|
1165
|
-
const cached = createMemo(() => p.component);
|
|
1171
|
+
function createDynamic(component, props) {
|
|
1172
|
+
const cached = createMemo(component);
|
|
1166
1173
|
return createMemo(() => {
|
|
1167
1174
|
const component = cached();
|
|
1168
1175
|
switch (typeof component) {
|
|
@@ -1170,15 +1177,19 @@ function Dynamic(props) {
|
|
|
1170
1177
|
Object.assign(component, {
|
|
1171
1178
|
[$DEVCOMP]: true
|
|
1172
1179
|
});
|
|
1173
|
-
return untrack(() => component(
|
|
1180
|
+
return untrack(() => component(props));
|
|
1174
1181
|
case "string":
|
|
1175
1182
|
const isSvg = SVGElements.has(component);
|
|
1176
1183
|
const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);
|
|
1177
|
-
spread(el,
|
|
1184
|
+
spread(el, props, isSvg);
|
|
1178
1185
|
return el;
|
|
1179
1186
|
}
|
|
1180
1187
|
});
|
|
1181
1188
|
}
|
|
1189
|
+
function Dynamic(props) {
|
|
1190
|
+
const [, others] = splitProps(props, ["component"]);
|
|
1191
|
+
return createDynamic(() => props.component, others);
|
|
1192
|
+
}
|
|
1182
1193
|
|
|
1183
1194
|
export {
|
|
1184
1195
|
Aliases,
|
|
@@ -1200,6 +1211,7 @@ export {
|
|
|
1200
1211
|
classList,
|
|
1201
1212
|
className,
|
|
1202
1213
|
clearDelegatedEvents,
|
|
1214
|
+
createDynamic,
|
|
1203
1215
|
delegateEvents,
|
|
1204
1216
|
dynamicProperty,
|
|
1205
1217
|
escape,
|
|
@@ -1216,6 +1228,7 @@ export {
|
|
|
1216
1228
|
insert,
|
|
1217
1229
|
isDev,
|
|
1218
1230
|
isServer,
|
|
1231
|
+
memo,
|
|
1219
1232
|
render,
|
|
1220
1233
|
renderToStream,
|
|
1221
1234
|
renderToString,
|
package/web/dist/server.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var web = require('seroval-plugins/web');
|
|
|
6
6
|
|
|
7
7
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
8
8
|
const BooleanAttributes = /*#__PURE__*/new Set(booleans);
|
|
9
|
-
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
9
|
+
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
10
10
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
11
11
|
const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
12
12
|
className: "class",
|
|
@@ -14,6 +14,10 @@ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
|
14
14
|
});
|
|
15
15
|
const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
16
16
|
class: "className",
|
|
17
|
+
novalidate: {
|
|
18
|
+
$: "noValidate",
|
|
19
|
+
FORM: 1
|
|
20
|
+
},
|
|
17
21
|
formnovalidate: {
|
|
18
22
|
$: "formNoValidate",
|
|
19
23
|
BUTTON: 1,
|
|
@@ -53,6 +57,8 @@ const SVGNamespace = {
|
|
|
53
57
|
};
|
|
54
58
|
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", "h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
55
59
|
|
|
60
|
+
const memo = fn => solidJs.createMemo(() => fn());
|
|
61
|
+
|
|
56
62
|
const ES2017FLAG = seroval.Feature.AggregateError
|
|
57
63
|
| seroval.Feature.BigIntTypedArray;
|
|
58
64
|
const GLOBAL_IDENTIFIER = '_$HY.r';
|
|
@@ -408,7 +414,7 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
408
414
|
for (let i = 0; i < keys.length; i++) {
|
|
409
415
|
const prop = keys[i];
|
|
410
416
|
if (ChildProperties.has(prop)) {
|
|
411
|
-
if (children === undefined && !skipChildren) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
417
|
+
if (children === undefined && !skipChildren) children = tag === "script" || tag === "style" || prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
412
418
|
continue;
|
|
413
419
|
}
|
|
414
420
|
const value = props[prop];
|
|
@@ -668,16 +674,19 @@ function notSup() {
|
|
|
668
674
|
|
|
669
675
|
const isServer = true;
|
|
670
676
|
const isDev = false;
|
|
671
|
-
function
|
|
672
|
-
const
|
|
673
|
-
const comp = p.component,
|
|
677
|
+
function createDynamic(component, props) {
|
|
678
|
+
const comp = component(),
|
|
674
679
|
t = typeof comp;
|
|
675
680
|
if (comp) {
|
|
676
|
-
if (t === "function") return comp(
|
|
677
|
-
return ssrElement(comp,
|
|
681
|
+
if (t === "function") return comp(props);else if (t === "string") {
|
|
682
|
+
return ssrElement(comp, props, undefined, true);
|
|
678
683
|
}
|
|
679
684
|
}
|
|
680
685
|
}
|
|
686
|
+
function Dynamic(props) {
|
|
687
|
+
const [, others] = solidJs.splitProps(props, ["component"]);
|
|
688
|
+
return createDynamic(() => props.component, others);
|
|
689
|
+
}
|
|
681
690
|
function Portal(props) {
|
|
682
691
|
return "";
|
|
683
692
|
}
|
|
@@ -726,10 +735,6 @@ Object.defineProperty(exports, "getOwner", {
|
|
|
726
735
|
enumerable: true,
|
|
727
736
|
get: function () { return solidJs.getOwner; }
|
|
728
737
|
});
|
|
729
|
-
Object.defineProperty(exports, "memo", {
|
|
730
|
-
enumerable: true,
|
|
731
|
-
get: function () { return solidJs.createMemo; }
|
|
732
|
-
});
|
|
733
738
|
Object.defineProperty(exports, "mergeProps", {
|
|
734
739
|
enumerable: true,
|
|
735
740
|
get: function () { return solidJs.mergeProps; }
|
|
@@ -756,6 +761,7 @@ exports.addEventListener = notSup;
|
|
|
756
761
|
exports.assign = notSup;
|
|
757
762
|
exports.classList = notSup;
|
|
758
763
|
exports.className = notSup;
|
|
764
|
+
exports.createDynamic = createDynamic;
|
|
759
765
|
exports.delegateEvents = notSup;
|
|
760
766
|
exports.dynamicProperty = notSup;
|
|
761
767
|
exports.escape = escape;
|
|
@@ -771,6 +777,7 @@ exports.hydrate = notSup;
|
|
|
771
777
|
exports.insert = notSup;
|
|
772
778
|
exports.isDev = isDev;
|
|
773
779
|
exports.isServer = isServer;
|
|
780
|
+
exports.memo = memo;
|
|
774
781
|
exports.pipeToNodeWritable = pipeToNodeWritable;
|
|
775
782
|
exports.pipeToWritable = pipeToWritable;
|
|
776
783
|
exports.render = notSup;
|
package/web/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sharedConfig, createRoot, splitProps } from "solid-js";
|
|
1
|
+
import { createMemo, sharedConfig, createRoot, splitProps } from "solid-js";
|
|
2
2
|
export {
|
|
3
3
|
ErrorBoundary,
|
|
4
4
|
For,
|
|
@@ -11,7 +11,6 @@ export {
|
|
|
11
11
|
createComponent,
|
|
12
12
|
createRenderEffect as effect,
|
|
13
13
|
getOwner,
|
|
14
|
-
createMemo as memo,
|
|
15
14
|
mergeProps,
|
|
16
15
|
untrack
|
|
17
16
|
} from "solid-js";
|
|
@@ -61,6 +60,7 @@ const Properties = /*#__PURE__*/ new Set([
|
|
|
61
60
|
"className",
|
|
62
61
|
"value",
|
|
63
62
|
"readOnly",
|
|
63
|
+
"noValidate",
|
|
64
64
|
"formNoValidate",
|
|
65
65
|
"isMap",
|
|
66
66
|
"noModule",
|
|
@@ -79,6 +79,10 @@ const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
|
79
79
|
});
|
|
80
80
|
const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
81
81
|
class: "className",
|
|
82
|
+
novalidate: {
|
|
83
|
+
$: "noValidate",
|
|
84
|
+
FORM: 1
|
|
85
|
+
},
|
|
82
86
|
formnovalidate: {
|
|
83
87
|
$: "formNoValidate",
|
|
84
88
|
BUTTON: 1,
|
|
@@ -495,6 +499,8 @@ const DOMElements = /*#__PURE__*/ new Set([
|
|
|
495
499
|
"h6"
|
|
496
500
|
]);
|
|
497
501
|
|
|
502
|
+
const memo = fn => createMemo(() => fn());
|
|
503
|
+
|
|
498
504
|
const ES2017FLAG = Feature.AggregateError | Feature.BigIntTypedArray;
|
|
499
505
|
const GLOBAL_IDENTIFIER = "_$HY.r";
|
|
500
506
|
function createSerializer({ onData, onDone, scopeId, onError }) {
|
|
@@ -858,7 +864,10 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
858
864
|
const prop = keys[i];
|
|
859
865
|
if (ChildProperties.has(prop)) {
|
|
860
866
|
if (children === undefined && !skipChildren)
|
|
861
|
-
children =
|
|
867
|
+
children =
|
|
868
|
+
tag === "script" || tag === "style" || prop === "innerHTML"
|
|
869
|
+
? props[prop]
|
|
870
|
+
: escape(props[prop]);
|
|
862
871
|
continue;
|
|
863
872
|
}
|
|
864
873
|
const value = props[prop];
|
|
@@ -1142,17 +1151,20 @@ function notSup() {
|
|
|
1142
1151
|
|
|
1143
1152
|
const isServer = true;
|
|
1144
1153
|
const isDev = false;
|
|
1145
|
-
function
|
|
1146
|
-
const
|
|
1147
|
-
const comp = p.component,
|
|
1154
|
+
function createDynamic(component, props) {
|
|
1155
|
+
const comp = component(),
|
|
1148
1156
|
t = typeof comp;
|
|
1149
1157
|
if (comp) {
|
|
1150
|
-
if (t === "function") return comp(
|
|
1158
|
+
if (t === "function") return comp(props);
|
|
1151
1159
|
else if (t === "string") {
|
|
1152
|
-
return ssrElement(comp,
|
|
1160
|
+
return ssrElement(comp, props, undefined, true);
|
|
1153
1161
|
}
|
|
1154
1162
|
}
|
|
1155
1163
|
}
|
|
1164
|
+
function Dynamic(props) {
|
|
1165
|
+
const [, others] = splitProps(props, ["component"]);
|
|
1166
|
+
return createDynamic(() => props.component, others);
|
|
1167
|
+
}
|
|
1156
1168
|
function Portal(props) {
|
|
1157
1169
|
return "";
|
|
1158
1170
|
}
|
|
@@ -1176,6 +1188,7 @@ export {
|
|
|
1176
1188
|
notSup as assign,
|
|
1177
1189
|
notSup as classList,
|
|
1178
1190
|
notSup as className,
|
|
1191
|
+
createDynamic,
|
|
1179
1192
|
notSup as delegateEvents,
|
|
1180
1193
|
notSup as dynamicProperty,
|
|
1181
1194
|
escape,
|
|
@@ -1191,6 +1204,7 @@ export {
|
|
|
1191
1204
|
notSup as insert,
|
|
1192
1205
|
isDev,
|
|
1193
1206
|
isServer,
|
|
1207
|
+
memo,
|
|
1194
1208
|
pipeToNodeWritable,
|
|
1195
1209
|
pipeToWritable,
|
|
1196
1210
|
notSup as render,
|