solid-js 1.6.10 → 1.6.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016-2019 Ryan Carniato
3
+ Copyright (c) 2016-2023 Ryan Carniato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/dev.cjs CHANGED
@@ -169,7 +169,7 @@ function createRoot(fn, detachedOwner) {
169
169
  owned: null,
170
170
  cleanups: null,
171
171
  context: null,
172
- owner: detachedOwner || owner
172
+ owner: detachedOwner === undefined ? owner : detachedOwner
173
173
  },
174
174
  updateFn = unowned ? () => fn(() => {
175
175
  throw new Error("Dispose method must be an explicit argument to createRoot function");
@@ -299,8 +299,8 @@ function createResource(pSource, pFetcher, pOptions) {
299
299
  }
300
300
  function completeLoad(v, err) {
301
301
  runUpdates(() => {
302
- if (!err) setValue(() => v);
303
- setState(err ? "errored" : "ready");
302
+ if (err === undefined) setValue(() => v);
303
+ setState(err !== undefined ? "errored" : "ready");
304
304
  setError(err);
305
305
  for (const c of contexts.keys()) c.decrement();
306
306
  contexts.clear();
@@ -310,7 +310,7 @@ function createResource(pSource, pFetcher, pOptions) {
310
310
  const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
311
311
  v = value(),
312
312
  err = error();
313
- if (err && !pr) throw err;
313
+ if (err !== undefined && !pr) throw err;
314
314
  if (Listener && !Listener.user && c) {
315
315
  createComputed(() => {
316
316
  track();
@@ -423,6 +423,7 @@ function batch(fn) {
423
423
  return runUpdates(fn, false);
424
424
  }
425
425
  function untrack(fn) {
426
+ if (Listener === null) return fn();
426
427
  const listener = Listener;
427
428
  Listener = null;
428
429
  try {
@@ -675,7 +676,7 @@ function writeSignal(node, value, isComp) {
675
676
  }
676
677
  if (Updates.length > 10e5) {
677
678
  Updates = [];
678
- if ("_SOLID_DEV_") throw new Error("Potential Infinite Loop Detected.");
679
+ if (true) throw new Error("Potential Infinite Loop Detected.");
679
680
  throw new Error();
680
681
  }
681
682
  }, false);
@@ -720,7 +721,8 @@ function runComputation(node, value, time) {
720
721
  node.owned = null;
721
722
  }
722
723
  }
723
- handleError(err);
724
+ node.updatedAt = time + 1;
725
+ return handleError(err);
724
726
  }
725
727
  if (!node.updatedAt || node.updatedAt <= time) {
726
728
  if (node.updatedAt != null && "observers" in node) {
@@ -813,7 +815,7 @@ function runUpdates(fn, init) {
813
815
  completeUpdates(wait);
814
816
  return res;
815
817
  } catch (err) {
816
- if (!Updates) Effects = null;
818
+ if (!wait) Effects = null;
817
819
  Updates = null;
818
820
  handleError(err);
819
821
  }
@@ -900,7 +902,7 @@ function lookUpstream(node, ignore) {
900
902
  const source = node.sources[i];
901
903
  if (source.sources) {
902
904
  if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {
903
- if (source !== ignore) runTop(source);
905
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
904
906
  } else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore);
905
907
  }
906
908
  }
@@ -965,11 +967,19 @@ function castError(err) {
965
967
  if (err instanceof Error || typeof err === "string") return err;
966
968
  return new Error("Unknown error");
967
969
  }
970
+ function runErrors(fns, err) {
971
+ for (const f of fns) f(err);
972
+ }
968
973
  function handleError(err) {
969
974
  err = castError(err);
970
975
  const fns = ERROR && lookup(Owner, ERROR);
971
976
  if (!fns) throw err;
972
- for (const f of fns) f(err);
977
+ if (Effects) Effects.push({
978
+ fn() {
979
+ runErrors(fns, err);
980
+ },
981
+ state: STALE
982
+ });else runErrors(fns, err);
973
983
  }
974
984
  function lookup(owner, key) {
975
985
  return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
@@ -1404,7 +1414,7 @@ function lazy(fn) {
1404
1414
  }
1405
1415
  let Comp;
1406
1416
  return createMemo(() => (Comp = comp()) && untrack(() => {
1407
- if ("_SOLID_DEV_") Object.assign(Comp, {
1417
+ if (true) Object.assign(Comp, {
1408
1418
  [$DEVCOMP]: true
1409
1419
  });
1410
1420
  if (!ctx) return Comp(props);
package/dist/dev.js CHANGED
@@ -167,7 +167,7 @@ function createRoot(fn, detachedOwner) {
167
167
  owned: null,
168
168
  cleanups: null,
169
169
  context: null,
170
- owner: detachedOwner || owner
170
+ owner: detachedOwner === undefined ? owner : detachedOwner
171
171
  },
172
172
  updateFn = unowned ? () => fn(() => {
173
173
  throw new Error("Dispose method must be an explicit argument to createRoot function");
@@ -297,8 +297,8 @@ function createResource(pSource, pFetcher, pOptions) {
297
297
  }
298
298
  function completeLoad(v, err) {
299
299
  runUpdates(() => {
300
- if (!err) setValue(() => v);
301
- setState(err ? "errored" : "ready");
300
+ if (err === undefined) setValue(() => v);
301
+ setState(err !== undefined ? "errored" : "ready");
302
302
  setError(err);
303
303
  for (const c of contexts.keys()) c.decrement();
304
304
  contexts.clear();
@@ -308,7 +308,7 @@ function createResource(pSource, pFetcher, pOptions) {
308
308
  const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
309
309
  v = value(),
310
310
  err = error();
311
- if (err && !pr) throw err;
311
+ if (err !== undefined && !pr) throw err;
312
312
  if (Listener && !Listener.user && c) {
313
313
  createComputed(() => {
314
314
  track();
@@ -421,6 +421,7 @@ function batch(fn) {
421
421
  return runUpdates(fn, false);
422
422
  }
423
423
  function untrack(fn) {
424
+ if (Listener === null) return fn();
424
425
  const listener = Listener;
425
426
  Listener = null;
426
427
  try {
@@ -673,7 +674,7 @@ function writeSignal(node, value, isComp) {
673
674
  }
674
675
  if (Updates.length > 10e5) {
675
676
  Updates = [];
676
- if ("_SOLID_DEV_") throw new Error("Potential Infinite Loop Detected.");
677
+ if (true) throw new Error("Potential Infinite Loop Detected.");
677
678
  throw new Error();
678
679
  }
679
680
  }, false);
@@ -718,7 +719,8 @@ function runComputation(node, value, time) {
718
719
  node.owned = null;
719
720
  }
720
721
  }
721
- handleError(err);
722
+ node.updatedAt = time + 1;
723
+ return handleError(err);
722
724
  }
723
725
  if (!node.updatedAt || node.updatedAt <= time) {
724
726
  if (node.updatedAt != null && "observers" in node) {
@@ -811,7 +813,7 @@ function runUpdates(fn, init) {
811
813
  completeUpdates(wait);
812
814
  return res;
813
815
  } catch (err) {
814
- if (!Updates) Effects = null;
816
+ if (!wait) Effects = null;
815
817
  Updates = null;
816
818
  handleError(err);
817
819
  }
@@ -898,7 +900,7 @@ function lookUpstream(node, ignore) {
898
900
  const source = node.sources[i];
899
901
  if (source.sources) {
900
902
  if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {
901
- if (source !== ignore) runTop(source);
903
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
902
904
  } else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore);
903
905
  }
904
906
  }
@@ -963,11 +965,19 @@ function castError(err) {
963
965
  if (err instanceof Error || typeof err === "string") return err;
964
966
  return new Error("Unknown error");
965
967
  }
968
+ function runErrors(fns, err) {
969
+ for (const f of fns) f(err);
970
+ }
966
971
  function handleError(err) {
967
972
  err = castError(err);
968
973
  const fns = ERROR && lookup(Owner, ERROR);
969
974
  if (!fns) throw err;
970
- for (const f of fns) f(err);
975
+ if (Effects) Effects.push({
976
+ fn() {
977
+ runErrors(fns, err);
978
+ },
979
+ state: STALE
980
+ });else runErrors(fns, err);
971
981
  }
972
982
  function lookup(owner, key) {
973
983
  return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
@@ -1402,7 +1412,7 @@ function lazy(fn) {
1402
1412
  }
1403
1413
  let Comp;
1404
1414
  return createMemo(() => (Comp = comp()) && untrack(() => {
1405
- if ("_SOLID_DEV_") Object.assign(Comp, {
1415
+ if (true) Object.assign(Comp, {
1406
1416
  [$DEVCOMP]: true
1407
1417
  });
1408
1418
  if (!ctx) return Comp(props);
package/dist/server.cjs CHANGED
@@ -23,11 +23,10 @@ const UNOWNED = {
23
23
  };
24
24
  let Owner = null;
25
25
  function createRoot(fn, detachedOwner) {
26
- detachedOwner && (Owner = detachedOwner);
27
26
  const owner = Owner,
28
27
  root = fn.length === 0 ? UNOWNED : {
29
28
  context: null,
30
- owner
29
+ owner: detachedOwner === undefined ? owner : detachedOwner
31
30
  };
32
31
  Owner = root;
33
32
  let result;
@@ -608,7 +607,7 @@ function Suspense(props) {
608
607
  setHydrateContext({
609
608
  ...ctx,
610
609
  count: 0,
611
- id: ctx.id + "0.f",
610
+ id: ctx.id + "0-f",
612
611
  noHydrate: true
613
612
  });
614
613
  const res = {
@@ -620,7 +619,7 @@ function Suspense(props) {
620
619
  setHydrateContext({
621
620
  ...ctx,
622
621
  count: 0,
623
- id: ctx.id + "0.f"
622
+ id: ctx.id + "0-f"
624
623
  });
625
624
  ctx.writeResource(id, "$$f");
626
625
  return props.fallback;
package/dist/server.js CHANGED
@@ -21,11 +21,10 @@ const UNOWNED = {
21
21
  };
22
22
  let Owner = null;
23
23
  function createRoot(fn, detachedOwner) {
24
- detachedOwner && (Owner = detachedOwner);
25
24
  const owner = Owner,
26
25
  root = fn.length === 0 ? UNOWNED : {
27
26
  context: null,
28
- owner
27
+ owner: detachedOwner === undefined ? owner : detachedOwner
29
28
  };
30
29
  Owner = root;
31
30
  let result;
@@ -606,7 +605,7 @@ function Suspense(props) {
606
605
  setHydrateContext({
607
606
  ...ctx,
608
607
  count: 0,
609
- id: ctx.id + "0.f",
608
+ id: ctx.id + "0-f",
610
609
  noHydrate: true
611
610
  });
612
611
  const res = {
@@ -618,7 +617,7 @@ function Suspense(props) {
618
617
  setHydrateContext({
619
618
  ...ctx,
620
619
  count: 0,
621
- id: ctx.id + "0.f"
620
+ id: ctx.id + "0-f"
622
621
  });
623
622
  ctx.writeResource(id, "$$f");
624
623
  return props.fallback;
package/dist/solid.cjs CHANGED
@@ -163,7 +163,7 @@ function createRoot(fn, detachedOwner) {
163
163
  owned: null,
164
164
  cleanups: null,
165
165
  context: null,
166
- owner: detachedOwner || owner
166
+ owner: detachedOwner === undefined ? owner : detachedOwner
167
167
  },
168
168
  updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
169
169
  Owner = root;
@@ -286,8 +286,8 @@ function createResource(pSource, pFetcher, pOptions) {
286
286
  }
287
287
  function completeLoad(v, err) {
288
288
  runUpdates(() => {
289
- if (!err) setValue(() => v);
290
- setState(err ? "errored" : "ready");
289
+ if (err === undefined) setValue(() => v);
290
+ setState(err !== undefined ? "errored" : "ready");
291
291
  setError(err);
292
292
  for (const c of contexts.keys()) c.decrement();
293
293
  contexts.clear();
@@ -297,7 +297,7 @@ function createResource(pSource, pFetcher, pOptions) {
297
297
  const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
298
298
  v = value(),
299
299
  err = error();
300
- if (err && !pr) throw err;
300
+ if (err !== undefined && !pr) throw err;
301
301
  if (Listener && !Listener.user && c) {
302
302
  createComputed(() => {
303
303
  track();
@@ -410,6 +410,7 @@ function batch(fn) {
410
410
  return runUpdates(fn, false);
411
411
  }
412
412
  function untrack(fn) {
413
+ if (Listener === null) return fn();
413
414
  const listener = Listener;
414
415
  Listener = null;
415
416
  try {
@@ -651,7 +652,8 @@ function runComputation(node, value, time) {
651
652
  node.owned = null;
652
653
  }
653
654
  }
654
- handleError(err);
655
+ node.updatedAt = time + 1;
656
+ return handleError(err);
655
657
  }
656
658
  if (!node.updatedAt || node.updatedAt <= time) {
657
659
  if (node.updatedAt != null && "observers" in node) {
@@ -743,7 +745,7 @@ function runUpdates(fn, init) {
743
745
  completeUpdates(wait);
744
746
  return res;
745
747
  } catch (err) {
746
- if (!Updates) Effects = null;
748
+ if (!wait) Effects = null;
747
749
  Updates = null;
748
750
  handleError(err);
749
751
  }
@@ -830,7 +832,7 @@ function lookUpstream(node, ignore) {
830
832
  const source = node.sources[i];
831
833
  if (source.sources) {
832
834
  if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {
833
- if (source !== ignore) runTop(source);
835
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
834
836
  } else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore);
835
837
  }
836
838
  }
@@ -894,11 +896,19 @@ function castError(err) {
894
896
  if (err instanceof Error || typeof err === "string") return err;
895
897
  return new Error("Unknown error");
896
898
  }
899
+ function runErrors(fns, err) {
900
+ for (const f of fns) f(err);
901
+ }
897
902
  function handleError(err) {
898
903
  err = castError(err);
899
904
  const fns = ERROR && lookup(Owner, ERROR);
900
905
  if (!fns) throw err;
901
- for (const f of fns) f(err);
906
+ if (Effects) Effects.push({
907
+ fn() {
908
+ runErrors(fns, err);
909
+ },
910
+ state: STALE
911
+ });else runErrors(fns, err);
902
912
  }
903
913
  function lookup(owner, key) {
904
914
  return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
package/dist/solid.js CHANGED
@@ -161,7 +161,7 @@ function createRoot(fn, detachedOwner) {
161
161
  owned: null,
162
162
  cleanups: null,
163
163
  context: null,
164
- owner: detachedOwner || owner
164
+ owner: detachedOwner === undefined ? owner : detachedOwner
165
165
  },
166
166
  updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
167
167
  Owner = root;
@@ -284,8 +284,8 @@ function createResource(pSource, pFetcher, pOptions) {
284
284
  }
285
285
  function completeLoad(v, err) {
286
286
  runUpdates(() => {
287
- if (!err) setValue(() => v);
288
- setState(err ? "errored" : "ready");
287
+ if (err === undefined) setValue(() => v);
288
+ setState(err !== undefined ? "errored" : "ready");
289
289
  setError(err);
290
290
  for (const c of contexts.keys()) c.decrement();
291
291
  contexts.clear();
@@ -295,7 +295,7 @@ function createResource(pSource, pFetcher, pOptions) {
295
295
  const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
296
296
  v = value(),
297
297
  err = error();
298
- if (err && !pr) throw err;
298
+ if (err !== undefined && !pr) throw err;
299
299
  if (Listener && !Listener.user && c) {
300
300
  createComputed(() => {
301
301
  track();
@@ -408,6 +408,7 @@ function batch(fn) {
408
408
  return runUpdates(fn, false);
409
409
  }
410
410
  function untrack(fn) {
411
+ if (Listener === null) return fn();
411
412
  const listener = Listener;
412
413
  Listener = null;
413
414
  try {
@@ -649,7 +650,8 @@ function runComputation(node, value, time) {
649
650
  node.owned = null;
650
651
  }
651
652
  }
652
- handleError(err);
653
+ node.updatedAt = time + 1;
654
+ return handleError(err);
653
655
  }
654
656
  if (!node.updatedAt || node.updatedAt <= time) {
655
657
  if (node.updatedAt != null && "observers" in node) {
@@ -741,7 +743,7 @@ function runUpdates(fn, init) {
741
743
  completeUpdates(wait);
742
744
  return res;
743
745
  } catch (err) {
744
- if (!Updates) Effects = null;
746
+ if (!wait) Effects = null;
745
747
  Updates = null;
746
748
  handleError(err);
747
749
  }
@@ -828,7 +830,7 @@ function lookUpstream(node, ignore) {
828
830
  const source = node.sources[i];
829
831
  if (source.sources) {
830
832
  if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {
831
- if (source !== ignore) runTop(source);
833
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
832
834
  } else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore);
833
835
  }
834
836
  }
@@ -892,11 +894,19 @@ function castError(err) {
892
894
  if (err instanceof Error || typeof err === "string") return err;
893
895
  return new Error("Unknown error");
894
896
  }
897
+ function runErrors(fns, err) {
898
+ for (const f of fns) f(err);
899
+ }
895
900
  function handleError(err) {
896
901
  err = castError(err);
897
902
  const fns = ERROR && lookup(Owner, ERROR);
898
903
  if (!fns) throw err;
899
- for (const f of fns) f(err);
904
+ if (Effects) Effects.push({
905
+ fn() {
906
+ runErrors(fns, err);
907
+ },
908
+ state: STALE
909
+ });else runErrors(fns, err);
900
910
  }
901
911
  function lookup(owner, key) {
902
912
  return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
@@ -5,8 +5,11 @@ var h = require('solid-js/h');
5
5
  function Fragment(props) {
6
6
  return props.children;
7
7
  }
8
+ function jsx(type, props) {
9
+ return h(type, props);
10
+ }
8
11
 
9
- exports.jsx = h;
10
- exports.jsxDEV = h;
11
- exports.jsxs = h;
12
12
  exports.Fragment = Fragment;
13
+ exports.jsx = jsx;
14
+ exports.jsxDEV = jsx;
15
+ exports.jsxs = jsx;
@@ -1,7 +1,10 @@
1
- export { default as jsx, default as jsxDEV, default as jsxs } from 'solid-js/h';
1
+ import h from 'solid-js/h';
2
2
 
3
3
  function Fragment(props) {
4
4
  return props.children;
5
5
  }
6
+ function jsx(type, props) {
7
+ return h(type, props);
8
+ }
6
9
 
7
- export { Fragment };
10
+ export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
@@ -1,7 +1,11 @@
1
- import h from "solid-js/h";
2
1
  export type { JSX } from "./jsx";
3
2
  import type { JSX } from "./jsx";
4
3
  declare function Fragment(props: {
5
4
  children: JSX.Element;
6
5
  }): JSX.Element;
7
- export { h as jsx, h as jsxs, h as jsxDEV, Fragment };
6
+ declare function jsx(type: any, props: any): () => (Node & {
7
+ [key: string]: any;
8
+ }) | (Node & {
9
+ [key: string]: any;
10
+ })[];
11
+ export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
@@ -1291,6 +1291,7 @@ export namespace JSX {
1291
1291
  gradientUnits?: FunctionMaybe<SVGUnits>;
1292
1292
  gradientTransform?: FunctionMaybe<string>;
1293
1293
  spreadMethod?: FunctionMaybe<"pad" | "reflect" | "repeat">;
1294
+ href?: FunctionMaybe<string>
1294
1295
  }
1295
1296
  interface GraphicsElementSVGAttributes<T>
1296
1297
  extends CoreSVGAttributes<T>,
@@ -1692,6 +1693,7 @@ export namespace JSX {
1692
1693
  patternUnits?: FunctionMaybe<SVGUnits>;
1693
1694
  patternContentUnits?: FunctionMaybe<SVGUnits>;
1694
1695
  patternTransform?: FunctionMaybe<string>;
1696
+ href?: string;
1695
1697
  }
1696
1698
  interface PolygonSVGAttributes<T>
1697
1699
  extends GraphicsElementSVGAttributes<T>,
@@ -300,7 +300,7 @@ function createHTML(r, {
300
300
  continue;
301
301
  }
302
302
  parseNode(child, childOptions);
303
- i++;
303
+ if (!childOptions.multi && child.type === "comment" && child.content === "#") node.children.splice(i, 1);else i++;
304
304
  }
305
305
  options.counter = childOptions.counter;
306
306
  options.templateId = childOptions.templateId;
@@ -390,8 +390,12 @@ function createHTML(r, {
390
390
  options.templateId = childOptions.templateId;
391
391
  } else if (child.type === "text") {
392
392
  parts.push(`"${child.content}"`);
393
- } else if (child.type === "comment" && child.content === "#") {
394
- parts.push(`exprs[${options.counter++}]`);
393
+ } else if (child.type === "comment") {
394
+ if (child.content === "#") parts.push(`exprs[${options.counter++}]`);else if (child.content) {
395
+ for (let i = 0; i < child.content.split("###").length - 1; i++) {
396
+ parts.push(`exprs[${options.counter++}]`);
397
+ }
398
+ }
395
399
  }
396
400
  });
397
401
  options.exprs.push(`return [${parts.join(", \n")}]`);
package/html/dist/html.js CHANGED
@@ -298,7 +298,7 @@ function createHTML(r, {
298
298
  continue;
299
299
  }
300
300
  parseNode(child, childOptions);
301
- i++;
301
+ if (!childOptions.multi && child.type === "comment" && child.content === "#") node.children.splice(i, 1);else i++;
302
302
  }
303
303
  options.counter = childOptions.counter;
304
304
  options.templateId = childOptions.templateId;
@@ -388,8 +388,12 @@ function createHTML(r, {
388
388
  options.templateId = childOptions.templateId;
389
389
  } else if (child.type === "text") {
390
390
  parts.push(`"${child.content}"`);
391
- } else if (child.type === "comment" && child.content === "#") {
392
- parts.push(`exprs[${options.counter++}]`);
391
+ } else if (child.type === "comment") {
392
+ if (child.content === "#") parts.push(`exprs[${options.counter++}]`);else if (child.content) {
393
+ for (let i = 0; i < child.content.split("###").length - 1; i++) {
394
+ parts.push(`exprs[${options.counter++}]`);
395
+ }
396
+ }
393
397
  }
394
398
  });
395
399
  options.exprs.push(`return [${parts.join(", \n")}]`);
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.6.10",
4
+ "version": "1.6.12",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -246,7 +246,8 @@
246
246
  },
247
247
  "require": "./html/dist/html.cjs"
248
248
  },
249
- "./html/dist/*": "./html/dist/*"
249
+ "./html/dist/*": "./html/dist/*",
250
+ "./package.json": "./package.json"
250
251
  },
251
252
  "keywords": [
252
253
  "solid",
@@ -320,11 +320,8 @@ const $ROOT = Symbol("store-root");
320
320
  function applyState(target, parent, property, merge, key) {
321
321
  const previous = parent[property];
322
322
  if (target === previous) return;
323
- if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
324
- if (target !== previous) {
325
- if (property === $ROOT) return target;
326
- setProperty(parent, property, target);
327
- }
323
+ if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key])) {
324
+ setProperty(parent, property, target);
328
325
  return;
329
326
  }
330
327
  if (Array.isArray(target)) {
package/store/dist/dev.js CHANGED
@@ -318,11 +318,8 @@ const $ROOT = Symbol("store-root");
318
318
  function applyState(target, parent, property, merge, key) {
319
319
  const previous = parent[property];
320
320
  if (target === previous) return;
321
- if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
322
- if (target !== previous) {
323
- if (property === $ROOT) return target;
324
- setProperty(parent, property, target);
325
- }
321
+ if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key])) {
322
+ setProperty(parent, property, target);
326
323
  return;
327
324
  }
328
325
  if (Array.isArray(target)) {
@@ -297,11 +297,8 @@ const $ROOT = Symbol("store-root");
297
297
  function applyState(target, parent, property, merge, key) {
298
298
  const previous = parent[property];
299
299
  if (target === previous) return;
300
- if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
301
- if (target !== previous) {
302
- if (property === $ROOT) return target;
303
- setProperty(parent, property, target);
304
- }
300
+ if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key])) {
301
+ setProperty(parent, property, target);
305
302
  return;
306
303
  }
307
304
  if (Array.isArray(target)) {
@@ -295,11 +295,8 @@ const $ROOT = Symbol("store-root");
295
295
  function applyState(target, parent, property, merge, key) {
296
296
  const previous = parent[property];
297
297
  if (target === previous) return;
298
- if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
299
- if (target !== previous) {
300
- if (property === $ROOT) return target;
301
- setProperty(parent, property, target);
302
- }
298
+ if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key])) {
299
+ setProperty(parent, property, target);
303
300
  return;
304
301
  }
305
302
  if (Array.isArray(target)) {
@@ -1,4 +1,4 @@
1
- export declare type ReconcileOptions = {
1
+ export type ReconcileOptions = {
2
2
  key?: string | null;
3
3
  merge?: boolean;
4
4
  };
@@ -6,11 +6,11 @@ export declare function setProperty(state: any, property: PropertyKey, value: an
6
6
  export declare function updatePath(current: any, path: any[], traversed?: PropertyKey[]): void;
7
7
  export declare function createStore<T>(state: T | Store<T>): [Store<T>, SetStoreFunction<T>];
8
8
  export declare function createMutable<T>(state: T | Store<T>): T;
9
- declare type ReconcileOptions = {
9
+ type ReconcileOptions = {
10
10
  key?: string | null;
11
11
  merge?: boolean;
12
12
  };
13
- export declare function reconcile<T extends U, U>(value: T, options?: ReconcileOptions): (state: U) => T;
13
+ export declare function reconcile<T extends U, U extends object>(value: T, options?: ReconcileOptions): (state: U) => T;
14
14
  export declare function produce<T>(fn: (state: T) => void): (state: T) => T;
15
15
  export declare const DEV: undefined;
16
16
  export {};