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 CHANGED
@@ -516,6 +516,7 @@ function startTransition(fn) {
516
516
  t.running = true;
517
517
  }
518
518
  batch(fn);
519
+ Listener = Owner = null;
519
520
  return t ? t.done : undefined;
520
521
  });
521
522
  }
package/dist/dev.js CHANGED
@@ -512,6 +512,7 @@ function startTransition(fn) {
512
512
  t.running = true;
513
513
  }
514
514
  batch(fn);
515
+ Listener = Owner = null;
515
516
  return t ? t.done : undefined;
516
517
  });
517
518
  }
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
@@ -513,6 +513,7 @@ function startTransition(fn) {
513
513
  t.running = true;
514
514
  }
515
515
  batch(fn);
516
+ Listener = Owner = null;
516
517
  return t ? t.done : undefined;
517
518
  });
518
519
  }
package/dist/solid.js CHANGED
@@ -509,6 +509,7 @@ function startTransition(fn) {
509
509
  t.running = true;
510
510
  }
511
511
  batch(fn);
512
+ Listener = Owner = null;
512
513
  return t ? t.done : undefined;
513
514
  });
514
515
  }
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 (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
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 r.insert(e, l, multiExpression ? null : undefined);
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 (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
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 r.insert(e, l, multiExpression ? null : undefined);
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "solid-js/jsx-runtime",
2
+ "name": "solid-js/h/jsx-runtime",
3
3
  "main": "./dist/jsx.cjs",
4
4
  "module": "./dist/jsx.js",
5
5
  "types": "./types/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import h from "solid-js/h";
2
- export type { JSX } from "solid-js";
3
- import type { JSX } from "solid-js";
2
+ export type { JSX } from "./jsx";
3
+ import type { JSX } from "./jsx";
4
4
  declare function Fragment(props: {
5
5
  children: JSX.Element;
6
6
  }): JSX.Element;