solid-js 1.4.0-beta.2 → 1.4.0-beta.5

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
@@ -273,9 +273,9 @@ function createResource(source, fetcher, options) {
273
273
  if (pr === p) {
274
274
  pr = null;
275
275
  resolved = true;
276
- if (initP && p === initP && options.onHydrated) options.onHydrated(key, {
276
+ if (initP && (p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
277
277
  value: v
278
- });
278
+ }));
279
279
  initP = null;
280
280
  setError(err = e);
281
281
  if (Transition && p && loadedUnderTransition) {
@@ -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
@@ -269,9 +269,9 @@ function createResource(source, fetcher, options) {
269
269
  if (pr === p) {
270
270
  pr = null;
271
271
  resolved = true;
272
- if (initP && p === initP && options.onHydrated) options.onHydrated(key, {
272
+ if (initP && (p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
273
273
  value: v
274
- });
274
+ }));
275
275
  initP = null;
276
276
  setError(err = e);
277
277
  if (Transition && p && loadedUnderTransition) {
@@ -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/solid.cjs CHANGED
@@ -270,9 +270,9 @@ function createResource(source, fetcher, options) {
270
270
  if (pr === p) {
271
271
  pr = null;
272
272
  resolved = true;
273
- if (initP && p === initP && options.onHydrated) options.onHydrated(key, {
273
+ if (initP && (p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
274
274
  value: v
275
- });
275
+ }));
276
276
  initP = null;
277
277
  setError(err = e);
278
278
  if (Transition && p && loadedUnderTransition) {
@@ -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
@@ -266,9 +266,9 @@ function createResource(source, fetcher, options) {
266
266
  if (pr === p) {
267
267
  pr = null;
268
268
  resolved = true;
269
- if (initP && p === initP && options.onHydrated) options.onHydrated(key, {
269
+ if (initP && (p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
270
270
  value: v
271
- });
271
+ }));
272
272
  initP = null;
273
273
  setError(err = e);
274
274
  if (Transition && p && loadedUnderTransition) {
@@ -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");
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var h = require('solid-js/h');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var h__default = /*#__PURE__*/_interopDefaultLegacy(h);
10
+
11
+ function Fragment(props) {
12
+ return props.children;
13
+ }
14
+
15
+ Object.defineProperty(exports, 'jsx', {
16
+ enumerable: true,
17
+ get: function () { return h__default["default"]; }
18
+ });
19
+ Object.defineProperty(exports, 'jsxDEV', {
20
+ enumerable: true,
21
+ get: function () { return h__default["default"]; }
22
+ });
23
+ Object.defineProperty(exports, 'jsxs', {
24
+ enumerable: true,
25
+ get: function () { return h__default["default"]; }
26
+ });
27
+ exports.Fragment = Fragment;
@@ -0,0 +1,7 @@
1
+ export { default as jsx, default as jsxDEV, default as jsxs } from 'solid-js/h';
2
+
3
+ function Fragment(props) {
4
+ return props.children;
5
+ }
6
+
7
+ export { Fragment };
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "solid-js/h/jsx-runtime",
3
+ "main": "./dist/jsx.cjs",
4
+ "module": "./dist/jsx.js",
5
+ "types": "./types/index.d.ts",
6
+ "type": "module",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,7 @@
1
+ import h from "solid-js/h";
2
+ export type { JSX } from "./jsx";
3
+ import type { JSX } from "./jsx";
4
+ declare function Fragment(props: {
5
+ children: JSX.Element;
6
+ }): JSX.Element;
7
+ export { h as jsx, h as jsxs, h as jsxDEV, Fragment };