solid-js 1.4.5 → 1.4.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
@@ -809,10 +809,8 @@ function runUpdates(fn, init) {
809
809
  completeUpdates(wait);
810
810
  return res;
811
811
  } catch (err) {
812
+ if (!Updates) Effects = null;
812
813
  handleError(err);
813
- } finally {
814
- Updates = null;
815
- if (!wait) Effects = null;
816
814
  }
817
815
  }
818
816
  function completeUpdates(wait) {
package/dist/dev.js CHANGED
@@ -805,10 +805,8 @@ function runUpdates(fn, init) {
805
805
  completeUpdates(wait);
806
806
  return res;
807
807
  } catch (err) {
808
+ if (!Updates) Effects = null;
808
809
  handleError(err);
809
- } finally {
810
- Updates = null;
811
- if (!wait) Effects = null;
812
810
  }
813
811
  }
814
812
  function completeUpdates(wait) {
package/dist/solid.cjs CHANGED
@@ -747,10 +747,8 @@ function runUpdates(fn, init) {
747
747
  completeUpdates(wait);
748
748
  return res;
749
749
  } catch (err) {
750
+ if (!Updates) Effects = null;
750
751
  handleError(err);
751
- } finally {
752
- Updates = null;
753
- if (!wait) Effects = null;
754
752
  }
755
753
  }
756
754
  function completeUpdates(wait) {
package/dist/solid.js CHANGED
@@ -743,10 +743,8 @@ function runUpdates(fn, init) {
743
743
  completeUpdates(wait);
744
744
  return res;
745
745
  } catch (err) {
746
+ if (!Updates) Effects = null;
746
747
  handleError(err);
747
- } finally {
748
- Updates = null;
749
- if (!wait) Effects = null;
750
748
  }
751
749
  }
752
750
  function completeUpdates(wait) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-js",
3
3
  "description": "A declarative JavaScript library for building user interfaces.",
4
- "version": "1.4.5",
4
+ "version": "1.4.6",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -151,5 +151,5 @@
151
151
  "compiler",
152
152
  "performance"
153
153
  ],
154
- "gitHead": "2c2252d6e4bd0d59f9164da32d6b6afc65dd4220"
154
+ "gitHead": "9dc1ba00f653c924cae926ef8a1f1c3da8f41bb5"
155
155
  }
@@ -238,11 +238,11 @@ const proxyTraps = {
238
238
  return isWrappable(value) ? wrap(value, target[$NAME] && `${target[$NAME]}:${property.toString()}`) : value;
239
239
  },
240
240
  set(target, property, value) {
241
- setProperty(target, property, unwrap(value));
241
+ solidJs.batch(() => setProperty(target, property, unwrap(value)));
242
242
  return true;
243
243
  },
244
244
  deleteProperty(target, property) {
245
- setProperty(target, property, undefined);
245
+ solidJs.batch(() => setProperty(target, property, undefined));
246
246
  return true;
247
247
  },
248
248
  ownKeys: ownKeys,
package/store/dist/dev.js CHANGED
@@ -234,11 +234,11 @@ const proxyTraps = {
234
234
  return isWrappable(value) ? wrap(value, target[$NAME] && `${target[$NAME]}:${property.toString()}`) : value;
235
235
  },
236
236
  set(target, property, value) {
237
- setProperty(target, property, unwrap(value));
237
+ batch(() => setProperty(target, property, unwrap(value)));
238
238
  return true;
239
239
  },
240
240
  deleteProperty(target, property) {
241
- setProperty(target, property, undefined);
241
+ batch(() => setProperty(target, property, undefined));
242
242
  return true;
243
243
  },
244
244
  ownKeys: ownKeys,
@@ -226,11 +226,11 @@ const proxyTraps = {
226
226
  return isWrappable(value) ? wrap(value) : value;
227
227
  },
228
228
  set(target, property, value) {
229
- setProperty(target, property, unwrap(value));
229
+ solidJs.batch(() => setProperty(target, property, unwrap(value)));
230
230
  return true;
231
231
  },
232
232
  deleteProperty(target, property) {
233
- setProperty(target, property, undefined);
233
+ solidJs.batch(() => setProperty(target, property, undefined));
234
234
  return true;
235
235
  },
236
236
  ownKeys: ownKeys,
@@ -222,11 +222,11 @@ const proxyTraps = {
222
222
  return isWrappable(value) ? wrap(value) : value;
223
223
  },
224
224
  set(target, property, value) {
225
- setProperty(target, property, unwrap(value));
225
+ batch(() => setProperty(target, property, unwrap(value)));
226
226
  return true;
227
227
  },
228
228
  deleteProperty(target, property) {
229
- setProperty(target, property, undefined);
229
+ batch(() => setProperty(target, property, undefined));
230
230
  return true;
231
231
  },
232
232
  ownKeys: ownKeys,
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createRoot, createSignal, createEffect, createRenderEffect, createComputed, createReaction, createDeferred, createSelector, createMemo, createResource, onMount, onCleanup, onError, untrack, batch, on, enableScheduling, enableExternalSource, startTransition, useTransition, createContext, useContext, children, getListener, getOwner, runWithOwner, equalFn, $DEVCOMP, $PROXY, $TRACK } from "./reactive/signal";
2
- export type { Accessor, Setter, Signal, Resource, ResourceReturn, ResourceFetcher, ResourceFetcherInfo, Context, ReturnTypes } from "./reactive/signal";
2
+ export type { Accessor, Setter, Signal, Resource, ResourceOptions, ResourceReturn, ResourceFetcher, ResourceFetcherInfo, Context, ReturnTypes, Owner } from "./reactive/signal";
3
3
  export * from "./reactive/observable";
4
4
  export * from "./reactive/scheduler";
5
5
  export * from "./reactive/array";
package/web/dist/dev.cjs CHANGED
@@ -446,13 +446,12 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
446
446
  let dynamic = false;
447
447
  for (let i = 0, len = array.length; i < len; i++) {
448
448
  let item = array[i],
449
- prev = current && current[i],
450
- t;
449
+ prev = current && current[i];
451
450
  if (item instanceof Node) {
452
451
  normalized.push(item);
453
452
  } else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {
454
453
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
455
- } else if ((t = typeof item) === "function") {
454
+ } else if ((typeof item) === "function") {
456
455
  if (unwrap) {
457
456
  while (typeof item === "function") item = item();
458
457
  dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
@@ -461,7 +460,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
461
460
  dynamic = true;
462
461
  }
463
462
  } else {
464
- const value = t === "string" ? item : item.string();
463
+ const value = String(item);
465
464
  if (prev && prev.nodeType === 3 && prev.data === value) {
466
465
  normalized.push(prev);
467
466
  } else normalized.push(document.createTextNode(value));
package/web/dist/dev.js CHANGED
@@ -443,13 +443,12 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
443
443
  let dynamic = false;
444
444
  for (let i = 0, len = array.length; i < len; i++) {
445
445
  let item = array[i],
446
- prev = current && current[i],
447
- t;
446
+ prev = current && current[i];
448
447
  if (item instanceof Node) {
449
448
  normalized.push(item);
450
449
  } else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {
451
450
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
452
- } else if ((t = typeof item) === "function") {
451
+ } else if ((typeof item) === "function") {
453
452
  if (unwrap) {
454
453
  while (typeof item === "function") item = item();
455
454
  dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
@@ -458,7 +457,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
458
457
  dynamic = true;
459
458
  }
460
459
  } else {
461
- const value = t === "string" ? item : item.string();
460
+ const value = String(item);
462
461
  if (prev && prev.nodeType === 3 && prev.data === value) {
463
462
  normalized.push(prev);
464
463
  } else normalized.push(document.createTextNode(value));
package/web/dist/web.cjs CHANGED
@@ -445,13 +445,12 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
445
445
  let dynamic = false;
446
446
  for (let i = 0, len = array.length; i < len; i++) {
447
447
  let item = array[i],
448
- prev = current && current[i],
449
- t;
448
+ prev = current && current[i];
450
449
  if (item instanceof Node) {
451
450
  normalized.push(item);
452
451
  } else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {
453
452
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
454
- } else if ((t = typeof item) === "function") {
453
+ } else if ((typeof item) === "function") {
455
454
  if (unwrap) {
456
455
  while (typeof item === "function") item = item();
457
456
  dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
@@ -460,7 +459,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
460
459
  dynamic = true;
461
460
  }
462
461
  } else {
463
- const value = t === "string" ? item : item.string();
462
+ const value = String(item);
464
463
  if (prev && prev.nodeType === 3 && prev.data === value) {
465
464
  normalized.push(prev);
466
465
  } else normalized.push(document.createTextNode(value));
package/web/dist/web.js CHANGED
@@ -442,13 +442,12 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
442
442
  let dynamic = false;
443
443
  for (let i = 0, len = array.length; i < len; i++) {
444
444
  let item = array[i],
445
- prev = current && current[i],
446
- t;
445
+ prev = current && current[i];
447
446
  if (item instanceof Node) {
448
447
  normalized.push(item);
449
448
  } else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {
450
449
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
451
- } else if ((t = typeof item) === "function") {
450
+ } else if ((typeof item) === "function") {
452
451
  if (unwrap) {
453
452
  while (typeof item === "function") item = item();
454
453
  dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
@@ -457,7 +456,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
457
456
  dynamic = true;
458
457
  }
459
458
  } else {
460
- const value = t === "string" ? item : item.string();
459
+ const value = String(item);
461
460
  if (prev && prev.nodeType === 3 && prev.data === value) {
462
461
  normalized.push(prev);
463
462
  } else normalized.push(document.createTextNode(value));