solid-js 1.4.0-beta.3 → 1.4.0-beta.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/dist/dev.cjs +1 -0
- package/dist/dev.js +1 -0
- package/dist/server.cjs +2 -1
- package/dist/server.js +2 -1
- package/dist/solid.cjs +1 -0
- package/dist/solid.js +1 -0
- package/h/dist/h.cjs +22 -5
- package/h/dist/h.js +22 -5
- package/{jsx-runtime → h/jsx-runtime}/dist/jsx.cjs +0 -0
- package/{jsx-runtime → h/jsx-runtime}/dist/jsx.js +0 -0
- package/{jsx-runtime → h/jsx-runtime}/package.json +1 -1
- package/{jsx-runtime → h/jsx-runtime}/types/index.d.ts +2 -2
- package/h/jsx-runtime/types/jsx.d.ts +3394 -0
- package/jsx-runtime.d.ts +1 -0
- package/package.json +13 -12
- package/store/dist/dev.cjs +27 -17
- package/store/dist/dev.js +27 -17
- package/store/dist/store.cjs +27 -17
- package/store/dist/store.js +27 -17
- package/store/types/store.d.ts +1 -4
package/dist/dev.cjs
CHANGED
package/dist/dev.js
CHANGED
package/dist/server.cjs
CHANGED
|
@@ -398,7 +398,7 @@ function createResource(source, fetcher, options = {}) {
|
|
|
398
398
|
value
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
-
if (p && "then" in p) {
|
|
401
|
+
if (p != undefined && typeof p === "object" && "then" in p) {
|
|
402
402
|
read.loading = true;
|
|
403
403
|
if (ctx.writeResource) ctx.writeResource(id, p, undefined, options.deferStream);
|
|
404
404
|
return p.then(res => {
|
|
@@ -415,6 +415,7 @@ function createResource(source, fetcher, options = {}) {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
ctx.resources[id].data = p;
|
|
418
|
+
if (ctx.writeResource) ctx.writeResource(id, p);
|
|
418
419
|
p = null;
|
|
419
420
|
return ctx.resources[id].data;
|
|
420
421
|
}
|
package/dist/server.js
CHANGED
|
@@ -394,7 +394,7 @@ function createResource(source, fetcher, options = {}) {
|
|
|
394
394
|
value
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
if (p && "then" in p) {
|
|
397
|
+
if (p != undefined && typeof p === "object" && "then" in p) {
|
|
398
398
|
read.loading = true;
|
|
399
399
|
if (ctx.writeResource) ctx.writeResource(id, p, undefined, options.deferStream);
|
|
400
400
|
return p.then(res => {
|
|
@@ -411,6 +411,7 @@ function createResource(source, fetcher, options = {}) {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
ctx.resources[id].data = p;
|
|
414
|
+
if (ctx.writeResource) ctx.writeResource(id, p);
|
|
414
415
|
p = null;
|
|
415
416
|
return ctx.resources[id].data;
|
|
416
417
|
}
|
package/dist/solid.cjs
CHANGED
package/dist/solid.js
CHANGED
package/h/dist/h.cjs
CHANGED
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
var web = require('solid-js/web');
|
|
4
4
|
|
|
5
|
+
const $ELEMENT = Symbol("hyper-element");
|
|
5
6
|
function createHyperScript(r) {
|
|
6
7
|
function h() {
|
|
7
8
|
let args = [].slice.call(arguments),
|
|
8
9
|
e,
|
|
9
10
|
multiExpression = false;
|
|
11
|
+
typeof args[0] === "string" && detectMultiExpression(args);
|
|
12
|
+
const ret = () => {
|
|
13
|
+
while (args.length) item(args.shift());
|
|
14
|
+
return e;
|
|
15
|
+
};
|
|
16
|
+
ret[$ELEMENT] = true;
|
|
17
|
+
return ret;
|
|
10
18
|
function item(l) {
|
|
11
19
|
const type = typeof l;
|
|
12
20
|
if (l == null) ;else if ("string" === type) {
|
|
@@ -38,16 +46,25 @@ function createHyperScript(r) {
|
|
|
38
46
|
}
|
|
39
47
|
const d = Object.getOwnPropertyDescriptors(props);
|
|
40
48
|
for (const k in d) {
|
|
41
|
-
if (
|
|
49
|
+
if (Array.isArray(d[k].value)) {
|
|
50
|
+
const list = d[k].value;
|
|
51
|
+
props[k] = () => {
|
|
52
|
+
for (let i = 0; i < list.length; i++) {
|
|
53
|
+
while (list[i][$ELEMENT]) list[i] = list[i]();
|
|
54
|
+
}
|
|
55
|
+
return list;
|
|
56
|
+
};
|
|
57
|
+
r.dynamicProperty(props, k);
|
|
58
|
+
} else if (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
|
|
42
59
|
}
|
|
43
60
|
e = r.createComponent(l, props);
|
|
44
61
|
args = [];
|
|
45
|
-
} else
|
|
62
|
+
} else {
|
|
63
|
+
while (l[$ELEMENT]) l = l();
|
|
64
|
+
r.insert(e, l, multiExpression ? null : undefined);
|
|
65
|
+
}
|
|
46
66
|
}
|
|
47
67
|
}
|
|
48
|
-
typeof args[0] === "string" && detectMultiExpression(args);
|
|
49
|
-
while (args.length) item(args.shift());
|
|
50
|
-
return e;
|
|
51
68
|
function parseClass(string) {
|
|
52
69
|
const m = string.split(/([\.#]?[^\s#.]+)/);
|
|
53
70
|
if (/^\.|#/.test(m[1])) e = document.createElement("div");
|
package/h/dist/h.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { spread, assign, insert, createComponent, dynamicProperty, SVGElements } from 'solid-js/web';
|
|
2
2
|
|
|
3
|
+
const $ELEMENT = Symbol("hyper-element");
|
|
3
4
|
function createHyperScript(r) {
|
|
4
5
|
function h() {
|
|
5
6
|
let args = [].slice.call(arguments),
|
|
6
7
|
e,
|
|
7
8
|
multiExpression = false;
|
|
9
|
+
typeof args[0] === "string" && detectMultiExpression(args);
|
|
10
|
+
const ret = () => {
|
|
11
|
+
while (args.length) item(args.shift());
|
|
12
|
+
return e;
|
|
13
|
+
};
|
|
14
|
+
ret[$ELEMENT] = true;
|
|
15
|
+
return ret;
|
|
8
16
|
function item(l) {
|
|
9
17
|
const type = typeof l;
|
|
10
18
|
if (l == null) ;else if ("string" === type) {
|
|
@@ -36,16 +44,25 @@ function createHyperScript(r) {
|
|
|
36
44
|
}
|
|
37
45
|
const d = Object.getOwnPropertyDescriptors(props);
|
|
38
46
|
for (const k in d) {
|
|
39
|
-
if (
|
|
47
|
+
if (Array.isArray(d[k].value)) {
|
|
48
|
+
const list = d[k].value;
|
|
49
|
+
props[k] = () => {
|
|
50
|
+
for (let i = 0; i < list.length; i++) {
|
|
51
|
+
while (list[i][$ELEMENT]) list[i] = list[i]();
|
|
52
|
+
}
|
|
53
|
+
return list;
|
|
54
|
+
};
|
|
55
|
+
r.dynamicProperty(props, k);
|
|
56
|
+
} else if (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
|
|
40
57
|
}
|
|
41
58
|
e = r.createComponent(l, props);
|
|
42
59
|
args = [];
|
|
43
|
-
} else
|
|
60
|
+
} else {
|
|
61
|
+
while (l[$ELEMENT]) l = l();
|
|
62
|
+
r.insert(e, l, multiExpression ? null : undefined);
|
|
63
|
+
}
|
|
44
64
|
}
|
|
45
65
|
}
|
|
46
|
-
typeof args[0] === "string" && detectMultiExpression(args);
|
|
47
|
-
while (args.length) item(args.shift());
|
|
48
|
-
return e;
|
|
49
66
|
function parseClass(string) {
|
|
50
67
|
const m = string.split(/([\.#]?[^\s#.]+)/);
|
|
51
68
|
if (/^\.|#/.test(m[1])) e = document.createElement("div");
|
|
File without changes
|
|
File without changes
|