solid-js 1.9.11 → 1.10.0-beta.0

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
@@ -159,11 +159,7 @@ let runEffects = runQueue;
159
159
  const STALE = 1;
160
160
  const PENDING = 2;
161
161
  const UNOWNED = {
162
- owned: null,
163
- cleanups: null,
164
- context: null,
165
- owner: null
166
- };
162
+ };
167
163
  const NO_INIT = {};
168
164
  var Owner = null;
169
165
  let Transition = null;
@@ -197,7 +193,7 @@ function createRoot(fn, detachedOwner) {
197
193
  },
198
194
  updateFn = unowned ? () => fn(() => {
199
195
  throw new Error("Dispose method must be an explicit argument to createRoot function");
200
- }) : () => fn(() => untrack(() => cleanNode(root)));
196
+ }) : () => fn(() => untrack(() => cleanupRoot(root)));
201
197
  DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
202
198
  Owner = root;
203
199
  Listener = null;
@@ -213,7 +209,7 @@ function createSignal(value, options) {
213
209
  const s = {
214
210
  value,
215
211
  observers: null,
216
- observerSlots: null,
212
+ observersTail: null,
217
213
  comparator: options.equals || undefined
218
214
  };
219
215
  {
@@ -267,7 +263,7 @@ function createMemo(fn, value, options) {
267
263
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
268
264
  const c = createComputation(fn, value, true, 0, options );
269
265
  c.observers = null;
270
- c.observerSlots = null;
266
+ c.observersTail = null;
271
267
  c.comparator = options.equals || undefined;
272
268
  if (Scheduler && Transition && Transition.running) {
273
269
  c.tState = STALE;
@@ -589,7 +585,7 @@ function devComponent(Comp, props) {
589
585
  }), undefined, true, 0);
590
586
  c.props = props;
591
587
  c.observers = null;
592
- c.observerSlots = null;
588
+ c.observersTail = null;
593
589
  c.name = Comp.name;
594
590
  c.component = Comp;
595
591
  updateComputation(c);
@@ -667,25 +663,46 @@ function readSignal() {
667
663
  }
668
664
  }
669
665
  if (Listener) {
670
- const sSlot = this.observers ? this.observers.length : 0;
671
- if (!Listener.sources) {
672
- Listener.sources = [this];
673
- Listener.sourceSlots = [sSlot];
674
- } else {
675
- Listener.sources.push(this);
676
- Listener.sourceSlots.push(sSlot);
677
- }
678
- if (!this.observers) {
679
- this.observers = [Listener];
680
- this.observerSlots = [Listener.sources.length - 1];
681
- } else {
682
- this.observers.push(Listener);
683
- this.observerSlots.push(Listener.sources.length - 1);
684
- }
666
+ link(this, Listener);
685
667
  }
686
668
  if (runningTransition && Transition.sources.has(this)) return this.tValue;
687
669
  return this.value;
688
670
  }
671
+ function link(source, observer) {
672
+ const prevSource = observer.sourcesTail;
673
+ if (prevSource !== null && prevSource.source === source) {
674
+ return;
675
+ }
676
+ const nextSource = prevSource !== null ? prevSource.nextSource : observer.sources;
677
+ const time = observer.relinkTime;
678
+ if (nextSource !== null && nextSource.source === source) {
679
+ nextSource.version = time;
680
+ observer.sourcesTail = nextSource;
681
+ return;
682
+ }
683
+ const prevObserver = source.observersTail;
684
+ if (prevObserver !== null && prevObserver.version === observer.relinkTime && prevObserver.observer === observer) {
685
+ return;
686
+ }
687
+ const newLink = observer.sourcesTail = source.observersTail = {
688
+ source: source,
689
+ observer: observer,
690
+ nextSource: nextSource,
691
+ prevObserver: prevObserver,
692
+ nextObserver: null,
693
+ version: time
694
+ };
695
+ if (prevSource !== null) {
696
+ prevSource.nextSource = newLink;
697
+ } else {
698
+ observer.sources = newLink;
699
+ }
700
+ if (prevObserver !== null) {
701
+ prevObserver.nextObserver = newLink;
702
+ } else {
703
+ source.observers = newLink;
704
+ }
705
+ }
689
706
  function writeSignal(node, value, isComp) {
690
707
  let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
691
708
  if (!node.comparator || !node.comparator(current, value)) {
@@ -697,10 +714,11 @@ function writeSignal(node, value, isComp) {
697
714
  }
698
715
  if (!TransitionRunning) node.value = value;
699
716
  } else node.value = value;
700
- if (node.observers && node.observers.length) {
717
+ if (node.observers && node.observers) {
701
718
  runUpdates(() => {
702
- for (let i = 0; i < node.observers.length; i += 1) {
703
- const o = node.observers[i];
719
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
720
+ const o = link.observer;
721
+ if (link.version < o.relinkTime) continue;
704
722
  const TransitionRunning = Transition && Transition.running;
705
723
  if (TransitionRunning && Transition.disposed.has(o)) continue;
706
724
  if (TransitionRunning ? !o.tState : !o.state) {
@@ -721,9 +739,12 @@ function writeSignal(node, value, isComp) {
721
739
  }
722
740
  function updateComputation(node) {
723
741
  if (!node.fn) return;
724
- cleanNode(node);
742
+ node.sourcesTail = null;
743
+ node.relinkTime = ExecCount;
744
+ cleanupRoot(node);
725
745
  const time = ExecCount;
726
746
  runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
747
+ afterComputation(node);
727
748
  if (Transition && !Transition.running && Transition.sources.has(node)) {
728
749
  queueMicrotask(() => {
729
750
  runUpdates(() => {
@@ -746,11 +767,11 @@ function runComputation(node, value, time) {
746
767
  if (node.pure) {
747
768
  if (Transition && Transition.running) {
748
769
  node.tState = STALE;
749
- node.tOwned && node.tOwned.forEach(cleanNode);
770
+ node.tOwned && node.tOwned.forEach(destroyNode);
750
771
  node.tOwned = undefined;
751
772
  } else {
752
773
  node.state = STALE;
753
- node.owned && node.owned.forEach(cleanNode);
774
+ node.owned && node.owned.forEach(destroyNode);
754
775
  node.owned = null;
755
776
  }
756
777
  }
@@ -777,10 +798,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
777
798
  updatedAt: null,
778
799
  owned: null,
779
800
  sources: null,
780
- sourceSlots: null,
801
+ sourcesTail: null,
781
802
  cleanups: null,
782
803
  value: init,
783
804
  owner: Owner,
805
+ relinkTime: 0,
784
806
  context: Owner ? Owner.context : null,
785
807
  pure
786
808
  };
@@ -876,11 +898,11 @@ function completeUpdates(wait) {
876
898
  }
877
899
  Transition = null;
878
900
  runUpdates(() => {
879
- for (const d of disposed) cleanNode(d);
901
+ for (const d of disposed) destroyNode(d);
880
902
  for (const v of sources) {
881
903
  v.value = v.tValue;
882
904
  if (v.owned) {
883
- for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
905
+ for (let i = 0, len = v.owned.length; i < len; i++) destroyNode(v.owned[i]);
884
906
  }
885
907
  if (v.tOwned) v.owned = v.tOwned;
886
908
  delete v.tValue;
@@ -947,8 +969,8 @@ function runUserEffects(queue) {
947
969
  function lookUpstream(node, ignore) {
948
970
  const runningTransition = Transition && Transition.running;
949
971
  if (runningTransition) node.tState = 0;else node.state = 0;
950
- for (let i = 0; i < node.sources.length; i += 1) {
951
- const source = node.sources[i];
972
+ for (let link = node.sources; link !== null; link = link.nextSource) {
973
+ const source = link.source;
952
974
  if (source.sources) {
953
975
  const state = runningTransition ? source.tState : source.state;
954
976
  if (state === STALE) {
@@ -959,8 +981,9 @@ function lookUpstream(node, ignore) {
959
981
  }
960
982
  function markDownstream(node) {
961
983
  const runningTransition = Transition && Transition.running;
962
- for (let i = 0; i < node.observers.length; i += 1) {
963
- const o = node.observers[i];
984
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
985
+ const o = link.observer;
986
+ if (link.version < o.relinkTime) continue;
964
987
  if (runningTransition ? !o.tState : !o.state) {
965
988
  if (runningTransition) o.tState = PENDING;else o.state = PENDING;
966
989
  if (o.pure) Updates.push(o);else Effects.push(o);
@@ -968,41 +991,65 @@ function markDownstream(node) {
968
991
  }
969
992
  }
970
993
  }
971
- function cleanNode(node) {
994
+ function cleanupRoot(node) {
972
995
  let i;
973
- if (node.sources) {
974
- while (node.sources.length) {
975
- const source = node.sources.pop(),
976
- index = node.sourceSlots.pop(),
977
- obs = source.observers;
978
- if (obs && obs.length) {
979
- const n = obs.pop(),
980
- s = source.observerSlots.pop();
981
- if (index < obs.length) {
982
- n.sourceSlots[s] = index;
983
- obs[index] = n;
984
- source.observerSlots[index] = s;
985
- }
986
- }
987
- }
988
- }
989
996
  if (node.tOwned) {
990
- for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
997
+ for (i = node.tOwned.length - 1; i >= 0; i--) destroyNode(node.tOwned[i]);
991
998
  delete node.tOwned;
992
999
  }
993
1000
  if (Transition && Transition.running && node.pure) {
994
1001
  reset(node, true);
995
1002
  } else if (node.owned) {
996
- for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
1003
+ for (i = node.owned.length - 1; i >= 0; i--) destroyNode(node.owned[i]);
997
1004
  node.owned = null;
998
1005
  }
999
1006
  if (node.cleanups) {
1000
- for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1007
+ for (let i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1001
1008
  node.cleanups = null;
1002
1009
  }
1003
1010
  if (Transition && Transition.running) node.tState = 0;else node.state = 0;
1004
1011
  delete node.sourceMap;
1005
1012
  }
1013
+ function afterComputation(node) {
1014
+ const sourcesTail = node.sourcesTail;
1015
+ let toRemove = sourcesTail !== null ? sourcesTail.nextSource : node.sources;
1016
+ if (toRemove !== null) {
1017
+ do {
1018
+ toRemove = unlinkFromObservers(toRemove);
1019
+ } while (toRemove !== null);
1020
+ if (sourcesTail !== null) {
1021
+ sourcesTail.nextSource = null;
1022
+ } else {
1023
+ node.sources = null;
1024
+ }
1025
+ }
1026
+ }
1027
+ function unlinkFromObservers(link) {
1028
+ const source = link.source;
1029
+ const nextSource = link.nextSource;
1030
+ const nextObserver = link.nextObserver;
1031
+ const prevObserver = link.prevObserver;
1032
+ if (nextObserver !== null) {
1033
+ nextObserver.prevObserver = prevObserver;
1034
+ } else {
1035
+ source.observersTail = prevObserver;
1036
+ }
1037
+ if (prevObserver !== null) {
1038
+ prevObserver.nextObserver = nextObserver;
1039
+ } else {
1040
+ source.observers = nextObserver;
1041
+ }
1042
+ return nextSource;
1043
+ }
1044
+ function destroyNode(node) {
1045
+ let link = node.sources;
1046
+ while (link) {
1047
+ link = unlinkFromObservers(link);
1048
+ }
1049
+ node.sources = null;
1050
+ node.sourcesTail = null;
1051
+ cleanupRoot(node);
1052
+ }
1006
1053
  function reset(node, top) {
1007
1054
  if (!top) {
1008
1055
  node.tState = 0;
@@ -1033,6 +1080,7 @@ function handleError(err, owner = Owner) {
1033
1080
  fn() {
1034
1081
  runErrors(error, fns, owner);
1035
1082
  },
1083
+ sources: null,
1036
1084
  state: STALE
1037
1085
  });else runErrors(error, fns, owner);
1038
1086
  }
package/dist/dev.js CHANGED
@@ -157,11 +157,7 @@ let runEffects = runQueue;
157
157
  const STALE = 1;
158
158
  const PENDING = 2;
159
159
  const UNOWNED = {
160
- owned: null,
161
- cleanups: null,
162
- context: null,
163
- owner: null
164
- };
160
+ };
165
161
  const NO_INIT = {};
166
162
  var Owner = null;
167
163
  let Transition = null;
@@ -195,7 +191,7 @@ function createRoot(fn, detachedOwner) {
195
191
  },
196
192
  updateFn = unowned ? () => fn(() => {
197
193
  throw new Error("Dispose method must be an explicit argument to createRoot function");
198
- }) : () => fn(() => untrack(() => cleanNode(root)));
194
+ }) : () => fn(() => untrack(() => cleanupRoot(root)));
199
195
  DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
200
196
  Owner = root;
201
197
  Listener = null;
@@ -211,7 +207,7 @@ function createSignal(value, options) {
211
207
  const s = {
212
208
  value,
213
209
  observers: null,
214
- observerSlots: null,
210
+ observersTail: null,
215
211
  comparator: options.equals || undefined
216
212
  };
217
213
  {
@@ -265,7 +261,7 @@ function createMemo(fn, value, options) {
265
261
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
266
262
  const c = createComputation(fn, value, true, 0, options );
267
263
  c.observers = null;
268
- c.observerSlots = null;
264
+ c.observersTail = null;
269
265
  c.comparator = options.equals || undefined;
270
266
  if (Scheduler && Transition && Transition.running) {
271
267
  c.tState = STALE;
@@ -587,7 +583,7 @@ function devComponent(Comp, props) {
587
583
  }), undefined, true, 0);
588
584
  c.props = props;
589
585
  c.observers = null;
590
- c.observerSlots = null;
586
+ c.observersTail = null;
591
587
  c.name = Comp.name;
592
588
  c.component = Comp;
593
589
  updateComputation(c);
@@ -665,25 +661,46 @@ function readSignal() {
665
661
  }
666
662
  }
667
663
  if (Listener) {
668
- const sSlot = this.observers ? this.observers.length : 0;
669
- if (!Listener.sources) {
670
- Listener.sources = [this];
671
- Listener.sourceSlots = [sSlot];
672
- } else {
673
- Listener.sources.push(this);
674
- Listener.sourceSlots.push(sSlot);
675
- }
676
- if (!this.observers) {
677
- this.observers = [Listener];
678
- this.observerSlots = [Listener.sources.length - 1];
679
- } else {
680
- this.observers.push(Listener);
681
- this.observerSlots.push(Listener.sources.length - 1);
682
- }
664
+ link(this, Listener);
683
665
  }
684
666
  if (runningTransition && Transition.sources.has(this)) return this.tValue;
685
667
  return this.value;
686
668
  }
669
+ function link(source, observer) {
670
+ const prevSource = observer.sourcesTail;
671
+ if (prevSource !== null && prevSource.source === source) {
672
+ return;
673
+ }
674
+ const nextSource = prevSource !== null ? prevSource.nextSource : observer.sources;
675
+ const time = observer.relinkTime;
676
+ if (nextSource !== null && nextSource.source === source) {
677
+ nextSource.version = time;
678
+ observer.sourcesTail = nextSource;
679
+ return;
680
+ }
681
+ const prevObserver = source.observersTail;
682
+ if (prevObserver !== null && prevObserver.version === observer.relinkTime && prevObserver.observer === observer) {
683
+ return;
684
+ }
685
+ const newLink = observer.sourcesTail = source.observersTail = {
686
+ source: source,
687
+ observer: observer,
688
+ nextSource: nextSource,
689
+ prevObserver: prevObserver,
690
+ nextObserver: null,
691
+ version: time
692
+ };
693
+ if (prevSource !== null) {
694
+ prevSource.nextSource = newLink;
695
+ } else {
696
+ observer.sources = newLink;
697
+ }
698
+ if (prevObserver !== null) {
699
+ prevObserver.nextObserver = newLink;
700
+ } else {
701
+ source.observers = newLink;
702
+ }
703
+ }
687
704
  function writeSignal(node, value, isComp) {
688
705
  let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
689
706
  if (!node.comparator || !node.comparator(current, value)) {
@@ -695,10 +712,11 @@ function writeSignal(node, value, isComp) {
695
712
  }
696
713
  if (!TransitionRunning) node.value = value;
697
714
  } else node.value = value;
698
- if (node.observers && node.observers.length) {
715
+ if (node.observers && node.observers) {
699
716
  runUpdates(() => {
700
- for (let i = 0; i < node.observers.length; i += 1) {
701
- const o = node.observers[i];
717
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
718
+ const o = link.observer;
719
+ if (link.version < o.relinkTime) continue;
702
720
  const TransitionRunning = Transition && Transition.running;
703
721
  if (TransitionRunning && Transition.disposed.has(o)) continue;
704
722
  if (TransitionRunning ? !o.tState : !o.state) {
@@ -719,9 +737,12 @@ function writeSignal(node, value, isComp) {
719
737
  }
720
738
  function updateComputation(node) {
721
739
  if (!node.fn) return;
722
- cleanNode(node);
740
+ node.sourcesTail = null;
741
+ node.relinkTime = ExecCount;
742
+ cleanupRoot(node);
723
743
  const time = ExecCount;
724
744
  runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
745
+ afterComputation(node);
725
746
  if (Transition && !Transition.running && Transition.sources.has(node)) {
726
747
  queueMicrotask(() => {
727
748
  runUpdates(() => {
@@ -744,11 +765,11 @@ function runComputation(node, value, time) {
744
765
  if (node.pure) {
745
766
  if (Transition && Transition.running) {
746
767
  node.tState = STALE;
747
- node.tOwned && node.tOwned.forEach(cleanNode);
768
+ node.tOwned && node.tOwned.forEach(destroyNode);
748
769
  node.tOwned = undefined;
749
770
  } else {
750
771
  node.state = STALE;
751
- node.owned && node.owned.forEach(cleanNode);
772
+ node.owned && node.owned.forEach(destroyNode);
752
773
  node.owned = null;
753
774
  }
754
775
  }
@@ -775,10 +796,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
775
796
  updatedAt: null,
776
797
  owned: null,
777
798
  sources: null,
778
- sourceSlots: null,
799
+ sourcesTail: null,
779
800
  cleanups: null,
780
801
  value: init,
781
802
  owner: Owner,
803
+ relinkTime: 0,
782
804
  context: Owner ? Owner.context : null,
783
805
  pure
784
806
  };
@@ -874,11 +896,11 @@ function completeUpdates(wait) {
874
896
  }
875
897
  Transition = null;
876
898
  runUpdates(() => {
877
- for (const d of disposed) cleanNode(d);
899
+ for (const d of disposed) destroyNode(d);
878
900
  for (const v of sources) {
879
901
  v.value = v.tValue;
880
902
  if (v.owned) {
881
- for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
903
+ for (let i = 0, len = v.owned.length; i < len; i++) destroyNode(v.owned[i]);
882
904
  }
883
905
  if (v.tOwned) v.owned = v.tOwned;
884
906
  delete v.tValue;
@@ -945,8 +967,8 @@ function runUserEffects(queue) {
945
967
  function lookUpstream(node, ignore) {
946
968
  const runningTransition = Transition && Transition.running;
947
969
  if (runningTransition) node.tState = 0;else node.state = 0;
948
- for (let i = 0; i < node.sources.length; i += 1) {
949
- const source = node.sources[i];
970
+ for (let link = node.sources; link !== null; link = link.nextSource) {
971
+ const source = link.source;
950
972
  if (source.sources) {
951
973
  const state = runningTransition ? source.tState : source.state;
952
974
  if (state === STALE) {
@@ -957,8 +979,9 @@ function lookUpstream(node, ignore) {
957
979
  }
958
980
  function markDownstream(node) {
959
981
  const runningTransition = Transition && Transition.running;
960
- for (let i = 0; i < node.observers.length; i += 1) {
961
- const o = node.observers[i];
982
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
983
+ const o = link.observer;
984
+ if (link.version < o.relinkTime) continue;
962
985
  if (runningTransition ? !o.tState : !o.state) {
963
986
  if (runningTransition) o.tState = PENDING;else o.state = PENDING;
964
987
  if (o.pure) Updates.push(o);else Effects.push(o);
@@ -966,41 +989,65 @@ function markDownstream(node) {
966
989
  }
967
990
  }
968
991
  }
969
- function cleanNode(node) {
992
+ function cleanupRoot(node) {
970
993
  let i;
971
- if (node.sources) {
972
- while (node.sources.length) {
973
- const source = node.sources.pop(),
974
- index = node.sourceSlots.pop(),
975
- obs = source.observers;
976
- if (obs && obs.length) {
977
- const n = obs.pop(),
978
- s = source.observerSlots.pop();
979
- if (index < obs.length) {
980
- n.sourceSlots[s] = index;
981
- obs[index] = n;
982
- source.observerSlots[index] = s;
983
- }
984
- }
985
- }
986
- }
987
994
  if (node.tOwned) {
988
- for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
995
+ for (i = node.tOwned.length - 1; i >= 0; i--) destroyNode(node.tOwned[i]);
989
996
  delete node.tOwned;
990
997
  }
991
998
  if (Transition && Transition.running && node.pure) {
992
999
  reset(node, true);
993
1000
  } else if (node.owned) {
994
- for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
1001
+ for (i = node.owned.length - 1; i >= 0; i--) destroyNode(node.owned[i]);
995
1002
  node.owned = null;
996
1003
  }
997
1004
  if (node.cleanups) {
998
- for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1005
+ for (let i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
999
1006
  node.cleanups = null;
1000
1007
  }
1001
1008
  if (Transition && Transition.running) node.tState = 0;else node.state = 0;
1002
1009
  delete node.sourceMap;
1003
1010
  }
1011
+ function afterComputation(node) {
1012
+ const sourcesTail = node.sourcesTail;
1013
+ let toRemove = sourcesTail !== null ? sourcesTail.nextSource : node.sources;
1014
+ if (toRemove !== null) {
1015
+ do {
1016
+ toRemove = unlinkFromObservers(toRemove);
1017
+ } while (toRemove !== null);
1018
+ if (sourcesTail !== null) {
1019
+ sourcesTail.nextSource = null;
1020
+ } else {
1021
+ node.sources = null;
1022
+ }
1023
+ }
1024
+ }
1025
+ function unlinkFromObservers(link) {
1026
+ const source = link.source;
1027
+ const nextSource = link.nextSource;
1028
+ const nextObserver = link.nextObserver;
1029
+ const prevObserver = link.prevObserver;
1030
+ if (nextObserver !== null) {
1031
+ nextObserver.prevObserver = prevObserver;
1032
+ } else {
1033
+ source.observersTail = prevObserver;
1034
+ }
1035
+ if (prevObserver !== null) {
1036
+ prevObserver.nextObserver = nextObserver;
1037
+ } else {
1038
+ source.observers = nextObserver;
1039
+ }
1040
+ return nextSource;
1041
+ }
1042
+ function destroyNode(node) {
1043
+ let link = node.sources;
1044
+ while (link) {
1045
+ link = unlinkFromObservers(link);
1046
+ }
1047
+ node.sources = null;
1048
+ node.sourcesTail = null;
1049
+ cleanupRoot(node);
1050
+ }
1004
1051
  function reset(node, top) {
1005
1052
  if (!top) {
1006
1053
  node.tState = 0;
@@ -1031,6 +1078,7 @@ function handleError(err, owner = Owner) {
1031
1078
  fn() {
1032
1079
  runErrors(error, fns, owner);
1033
1080
  },
1081
+ sources: null,
1034
1082
  state: STALE
1035
1083
  });else runErrors(error, fns, owner);
1036
1084
  }
package/dist/solid.cjs CHANGED
@@ -184,7 +184,7 @@ function createRoot(fn, detachedOwner) {
184
184
  context: current ? current.context : null,
185
185
  owner: current
186
186
  },
187
- updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
187
+ updateFn = unowned ? fn : () => fn(() => untrack(() => cleanupRoot(root)));
188
188
  Owner = root;
189
189
  Listener = null;
190
190
  try {
@@ -199,7 +199,7 @@ function createSignal(value, options) {
199
199
  const s = {
200
200
  value,
201
201
  observers: null,
202
- observerSlots: null,
202
+ observersTail: null,
203
203
  comparator: options.equals || undefined
204
204
  };
205
205
  const setter = value => {
@@ -244,7 +244,7 @@ function createMemo(fn, value, options) {
244
244
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
245
245
  const c = createComputation(fn, value, true, 0);
246
246
  c.observers = null;
247
- c.observerSlots = null;
247
+ c.observersTail = null;
248
248
  c.comparator = options.equals || undefined;
249
249
  if (Scheduler && Transition && Transition.running) {
250
250
  c.tState = STALE;
@@ -620,25 +620,46 @@ function readSignal() {
620
620
  }
621
621
  }
622
622
  if (Listener) {
623
- const sSlot = this.observers ? this.observers.length : 0;
624
- if (!Listener.sources) {
625
- Listener.sources = [this];
626
- Listener.sourceSlots = [sSlot];
627
- } else {
628
- Listener.sources.push(this);
629
- Listener.sourceSlots.push(sSlot);
630
- }
631
- if (!this.observers) {
632
- this.observers = [Listener];
633
- this.observerSlots = [Listener.sources.length - 1];
634
- } else {
635
- this.observers.push(Listener);
636
- this.observerSlots.push(Listener.sources.length - 1);
637
- }
623
+ link(this, Listener);
638
624
  }
639
625
  if (runningTransition && Transition.sources.has(this)) return this.tValue;
640
626
  return this.value;
641
627
  }
628
+ function link(source, observer) {
629
+ const prevSource = observer.sourcesTail;
630
+ if (prevSource !== null && prevSource.source === source) {
631
+ return;
632
+ }
633
+ const nextSource = prevSource !== null ? prevSource.nextSource : observer.sources;
634
+ const time = observer.relinkTime;
635
+ if (nextSource !== null && nextSource.source === source) {
636
+ nextSource.version = time;
637
+ observer.sourcesTail = nextSource;
638
+ return;
639
+ }
640
+ const prevObserver = source.observersTail;
641
+ if (prevObserver !== null && prevObserver.version === observer.relinkTime && prevObserver.observer === observer) {
642
+ return;
643
+ }
644
+ const newLink = observer.sourcesTail = source.observersTail = {
645
+ source: source,
646
+ observer: observer,
647
+ nextSource: nextSource,
648
+ prevObserver: prevObserver,
649
+ nextObserver: null,
650
+ version: time
651
+ };
652
+ if (prevSource !== null) {
653
+ prevSource.nextSource = newLink;
654
+ } else {
655
+ observer.sources = newLink;
656
+ }
657
+ if (prevObserver !== null) {
658
+ prevObserver.nextObserver = newLink;
659
+ } else {
660
+ source.observers = newLink;
661
+ }
662
+ }
642
663
  function writeSignal(node, value, isComp) {
643
664
  let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
644
665
  if (!node.comparator || !node.comparator(current, value)) {
@@ -650,10 +671,11 @@ function writeSignal(node, value, isComp) {
650
671
  }
651
672
  if (!TransitionRunning) node.value = value;
652
673
  } else node.value = value;
653
- if (node.observers && node.observers.length) {
674
+ if (node.observers && node.observers) {
654
675
  runUpdates(() => {
655
- for (let i = 0; i < node.observers.length; i += 1) {
656
- const o = node.observers[i];
676
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
677
+ const o = link.observer;
678
+ if (link.version < o.relinkTime) continue;
657
679
  const TransitionRunning = Transition && Transition.running;
658
680
  if (TransitionRunning && Transition.disposed.has(o)) continue;
659
681
  if (TransitionRunning ? !o.tState : !o.state) {
@@ -674,9 +696,12 @@ function writeSignal(node, value, isComp) {
674
696
  }
675
697
  function updateComputation(node) {
676
698
  if (!node.fn) return;
677
- cleanNode(node);
699
+ node.sourcesTail = null;
700
+ node.relinkTime = ExecCount;
701
+ cleanupRoot(node);
678
702
  const time = ExecCount;
679
703
  runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
704
+ afterComputation(node);
680
705
  if (Transition && !Transition.running && Transition.sources.has(node)) {
681
706
  queueMicrotask(() => {
682
707
  runUpdates(() => {
@@ -699,11 +724,11 @@ function runComputation(node, value, time) {
699
724
  if (node.pure) {
700
725
  if (Transition && Transition.running) {
701
726
  node.tState = STALE;
702
- node.tOwned && node.tOwned.forEach(cleanNode);
727
+ node.tOwned && node.tOwned.forEach(destroyNode);
703
728
  node.tOwned = undefined;
704
729
  } else {
705
730
  node.state = STALE;
706
- node.owned && node.owned.forEach(cleanNode);
731
+ node.owned && node.owned.forEach(destroyNode);
707
732
  node.owned = null;
708
733
  }
709
734
  }
@@ -730,10 +755,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
730
755
  updatedAt: null,
731
756
  owned: null,
732
757
  sources: null,
733
- sourceSlots: null,
758
+ sourcesTail: null,
734
759
  cleanups: null,
735
760
  value: init,
736
761
  owner: Owner,
762
+ relinkTime: 0,
737
763
  context: Owner ? Owner.context : null,
738
764
  pure
739
765
  };
@@ -827,11 +853,11 @@ function completeUpdates(wait) {
827
853
  }
828
854
  Transition = null;
829
855
  runUpdates(() => {
830
- for (const d of disposed) cleanNode(d);
856
+ for (const d of disposed) destroyNode(d);
831
857
  for (const v of sources) {
832
858
  v.value = v.tValue;
833
859
  if (v.owned) {
834
- for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
860
+ for (let i = 0, len = v.owned.length; i < len; i++) destroyNode(v.owned[i]);
835
861
  }
836
862
  if (v.tOwned) v.owned = v.tOwned;
837
863
  delete v.tValue;
@@ -898,8 +924,8 @@ function runUserEffects(queue) {
898
924
  function lookUpstream(node, ignore) {
899
925
  const runningTransition = Transition && Transition.running;
900
926
  if (runningTransition) node.tState = 0;else node.state = 0;
901
- for (let i = 0; i < node.sources.length; i += 1) {
902
- const source = node.sources[i];
927
+ for (let link = node.sources; link !== null; link = link.nextSource) {
928
+ const source = link.source;
903
929
  if (source.sources) {
904
930
  const state = runningTransition ? source.tState : source.state;
905
931
  if (state === STALE) {
@@ -910,8 +936,9 @@ function lookUpstream(node, ignore) {
910
936
  }
911
937
  function markDownstream(node) {
912
938
  const runningTransition = Transition && Transition.running;
913
- for (let i = 0; i < node.observers.length; i += 1) {
914
- const o = node.observers[i];
939
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
940
+ const o = link.observer;
941
+ if (link.version < o.relinkTime) continue;
915
942
  if (runningTransition ? !o.tState : !o.state) {
916
943
  if (runningTransition) o.tState = PENDING;else o.state = PENDING;
917
944
  if (o.pure) Updates.push(o);else Effects.push(o);
@@ -919,40 +946,64 @@ function markDownstream(node) {
919
946
  }
920
947
  }
921
948
  }
922
- function cleanNode(node) {
949
+ function cleanupRoot(node) {
923
950
  let i;
924
- if (node.sources) {
925
- while (node.sources.length) {
926
- const source = node.sources.pop(),
927
- index = node.sourceSlots.pop(),
928
- obs = source.observers;
929
- if (obs && obs.length) {
930
- const n = obs.pop(),
931
- s = source.observerSlots.pop();
932
- if (index < obs.length) {
933
- n.sourceSlots[s] = index;
934
- obs[index] = n;
935
- source.observerSlots[index] = s;
936
- }
937
- }
938
- }
939
- }
940
951
  if (node.tOwned) {
941
- for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
952
+ for (i = node.tOwned.length - 1; i >= 0; i--) destroyNode(node.tOwned[i]);
942
953
  delete node.tOwned;
943
954
  }
944
955
  if (Transition && Transition.running && node.pure) {
945
956
  reset(node, true);
946
957
  } else if (node.owned) {
947
- for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
958
+ for (i = node.owned.length - 1; i >= 0; i--) destroyNode(node.owned[i]);
948
959
  node.owned = null;
949
960
  }
950
961
  if (node.cleanups) {
951
- for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
962
+ for (let i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
952
963
  node.cleanups = null;
953
964
  }
954
965
  if (Transition && Transition.running) node.tState = 0;else node.state = 0;
955
966
  }
967
+ function afterComputation(node) {
968
+ const sourcesTail = node.sourcesTail;
969
+ let toRemove = sourcesTail !== null ? sourcesTail.nextSource : node.sources;
970
+ if (toRemove !== null) {
971
+ do {
972
+ toRemove = unlinkFromObservers(toRemove);
973
+ } while (toRemove !== null);
974
+ if (sourcesTail !== null) {
975
+ sourcesTail.nextSource = null;
976
+ } else {
977
+ node.sources = null;
978
+ }
979
+ }
980
+ }
981
+ function unlinkFromObservers(link) {
982
+ const source = link.source;
983
+ const nextSource = link.nextSource;
984
+ const nextObserver = link.nextObserver;
985
+ const prevObserver = link.prevObserver;
986
+ if (nextObserver !== null) {
987
+ nextObserver.prevObserver = prevObserver;
988
+ } else {
989
+ source.observersTail = prevObserver;
990
+ }
991
+ if (prevObserver !== null) {
992
+ prevObserver.nextObserver = nextObserver;
993
+ } else {
994
+ source.observers = nextObserver;
995
+ }
996
+ return nextSource;
997
+ }
998
+ function destroyNode(node) {
999
+ let link = node.sources;
1000
+ while (link) {
1001
+ link = unlinkFromObservers(link);
1002
+ }
1003
+ node.sources = null;
1004
+ node.sourcesTail = null;
1005
+ cleanupRoot(node);
1006
+ }
956
1007
  function reset(node, top) {
957
1008
  if (!top) {
958
1009
  node.tState = 0;
@@ -983,6 +1034,7 @@ function handleError(err, owner = Owner) {
983
1034
  fn() {
984
1035
  runErrors(error, fns, owner);
985
1036
  },
1037
+ sources: null,
986
1038
  state: STALE
987
1039
  });else runErrors(error, fns, owner);
988
1040
  }
package/dist/solid.js CHANGED
@@ -182,7 +182,7 @@ function createRoot(fn, detachedOwner) {
182
182
  context: current ? current.context : null,
183
183
  owner: current
184
184
  },
185
- updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
185
+ updateFn = unowned ? fn : () => fn(() => untrack(() => cleanupRoot(root)));
186
186
  Owner = root;
187
187
  Listener = null;
188
188
  try {
@@ -197,7 +197,7 @@ function createSignal(value, options) {
197
197
  const s = {
198
198
  value,
199
199
  observers: null,
200
- observerSlots: null,
200
+ observersTail: null,
201
201
  comparator: options.equals || undefined
202
202
  };
203
203
  const setter = value => {
@@ -242,7 +242,7 @@ function createMemo(fn, value, options) {
242
242
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
243
243
  const c = createComputation(fn, value, true, 0);
244
244
  c.observers = null;
245
- c.observerSlots = null;
245
+ c.observersTail = null;
246
246
  c.comparator = options.equals || undefined;
247
247
  if (Scheduler && Transition && Transition.running) {
248
248
  c.tState = STALE;
@@ -618,25 +618,46 @@ function readSignal() {
618
618
  }
619
619
  }
620
620
  if (Listener) {
621
- const sSlot = this.observers ? this.observers.length : 0;
622
- if (!Listener.sources) {
623
- Listener.sources = [this];
624
- Listener.sourceSlots = [sSlot];
625
- } else {
626
- Listener.sources.push(this);
627
- Listener.sourceSlots.push(sSlot);
628
- }
629
- if (!this.observers) {
630
- this.observers = [Listener];
631
- this.observerSlots = [Listener.sources.length - 1];
632
- } else {
633
- this.observers.push(Listener);
634
- this.observerSlots.push(Listener.sources.length - 1);
635
- }
621
+ link(this, Listener);
636
622
  }
637
623
  if (runningTransition && Transition.sources.has(this)) return this.tValue;
638
624
  return this.value;
639
625
  }
626
+ function link(source, observer) {
627
+ const prevSource = observer.sourcesTail;
628
+ if (prevSource !== null && prevSource.source === source) {
629
+ return;
630
+ }
631
+ const nextSource = prevSource !== null ? prevSource.nextSource : observer.sources;
632
+ const time = observer.relinkTime;
633
+ if (nextSource !== null && nextSource.source === source) {
634
+ nextSource.version = time;
635
+ observer.sourcesTail = nextSource;
636
+ return;
637
+ }
638
+ const prevObserver = source.observersTail;
639
+ if (prevObserver !== null && prevObserver.version === observer.relinkTime && prevObserver.observer === observer) {
640
+ return;
641
+ }
642
+ const newLink = observer.sourcesTail = source.observersTail = {
643
+ source: source,
644
+ observer: observer,
645
+ nextSource: nextSource,
646
+ prevObserver: prevObserver,
647
+ nextObserver: null,
648
+ version: time
649
+ };
650
+ if (prevSource !== null) {
651
+ prevSource.nextSource = newLink;
652
+ } else {
653
+ observer.sources = newLink;
654
+ }
655
+ if (prevObserver !== null) {
656
+ prevObserver.nextObserver = newLink;
657
+ } else {
658
+ source.observers = newLink;
659
+ }
660
+ }
640
661
  function writeSignal(node, value, isComp) {
641
662
  let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
642
663
  if (!node.comparator || !node.comparator(current, value)) {
@@ -648,10 +669,11 @@ function writeSignal(node, value, isComp) {
648
669
  }
649
670
  if (!TransitionRunning) node.value = value;
650
671
  } else node.value = value;
651
- if (node.observers && node.observers.length) {
672
+ if (node.observers && node.observers) {
652
673
  runUpdates(() => {
653
- for (let i = 0; i < node.observers.length; i += 1) {
654
- const o = node.observers[i];
674
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
675
+ const o = link.observer;
676
+ if (link.version < o.relinkTime) continue;
655
677
  const TransitionRunning = Transition && Transition.running;
656
678
  if (TransitionRunning && Transition.disposed.has(o)) continue;
657
679
  if (TransitionRunning ? !o.tState : !o.state) {
@@ -672,9 +694,12 @@ function writeSignal(node, value, isComp) {
672
694
  }
673
695
  function updateComputation(node) {
674
696
  if (!node.fn) return;
675
- cleanNode(node);
697
+ node.sourcesTail = null;
698
+ node.relinkTime = ExecCount;
699
+ cleanupRoot(node);
676
700
  const time = ExecCount;
677
701
  runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
702
+ afterComputation(node);
678
703
  if (Transition && !Transition.running && Transition.sources.has(node)) {
679
704
  queueMicrotask(() => {
680
705
  runUpdates(() => {
@@ -697,11 +722,11 @@ function runComputation(node, value, time) {
697
722
  if (node.pure) {
698
723
  if (Transition && Transition.running) {
699
724
  node.tState = STALE;
700
- node.tOwned && node.tOwned.forEach(cleanNode);
725
+ node.tOwned && node.tOwned.forEach(destroyNode);
701
726
  node.tOwned = undefined;
702
727
  } else {
703
728
  node.state = STALE;
704
- node.owned && node.owned.forEach(cleanNode);
729
+ node.owned && node.owned.forEach(destroyNode);
705
730
  node.owned = null;
706
731
  }
707
732
  }
@@ -728,10 +753,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
728
753
  updatedAt: null,
729
754
  owned: null,
730
755
  sources: null,
731
- sourceSlots: null,
756
+ sourcesTail: null,
732
757
  cleanups: null,
733
758
  value: init,
734
759
  owner: Owner,
760
+ relinkTime: 0,
735
761
  context: Owner ? Owner.context : null,
736
762
  pure
737
763
  };
@@ -825,11 +851,11 @@ function completeUpdates(wait) {
825
851
  }
826
852
  Transition = null;
827
853
  runUpdates(() => {
828
- for (const d of disposed) cleanNode(d);
854
+ for (const d of disposed) destroyNode(d);
829
855
  for (const v of sources) {
830
856
  v.value = v.tValue;
831
857
  if (v.owned) {
832
- for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
858
+ for (let i = 0, len = v.owned.length; i < len; i++) destroyNode(v.owned[i]);
833
859
  }
834
860
  if (v.tOwned) v.owned = v.tOwned;
835
861
  delete v.tValue;
@@ -896,8 +922,8 @@ function runUserEffects(queue) {
896
922
  function lookUpstream(node, ignore) {
897
923
  const runningTransition = Transition && Transition.running;
898
924
  if (runningTransition) node.tState = 0;else node.state = 0;
899
- for (let i = 0; i < node.sources.length; i += 1) {
900
- const source = node.sources[i];
925
+ for (let link = node.sources; link !== null; link = link.nextSource) {
926
+ const source = link.source;
901
927
  if (source.sources) {
902
928
  const state = runningTransition ? source.tState : source.state;
903
929
  if (state === STALE) {
@@ -908,8 +934,9 @@ function lookUpstream(node, ignore) {
908
934
  }
909
935
  function markDownstream(node) {
910
936
  const runningTransition = Transition && Transition.running;
911
- for (let i = 0; i < node.observers.length; i += 1) {
912
- const o = node.observers[i];
937
+ for (let link = node.observers; link !== null; link = link.nextObserver) {
938
+ const o = link.observer;
939
+ if (link.version < o.relinkTime) continue;
913
940
  if (runningTransition ? !o.tState : !o.state) {
914
941
  if (runningTransition) o.tState = PENDING;else o.state = PENDING;
915
942
  if (o.pure) Updates.push(o);else Effects.push(o);
@@ -917,40 +944,64 @@ function markDownstream(node) {
917
944
  }
918
945
  }
919
946
  }
920
- function cleanNode(node) {
947
+ function cleanupRoot(node) {
921
948
  let i;
922
- if (node.sources) {
923
- while (node.sources.length) {
924
- const source = node.sources.pop(),
925
- index = node.sourceSlots.pop(),
926
- obs = source.observers;
927
- if (obs && obs.length) {
928
- const n = obs.pop(),
929
- s = source.observerSlots.pop();
930
- if (index < obs.length) {
931
- n.sourceSlots[s] = index;
932
- obs[index] = n;
933
- source.observerSlots[index] = s;
934
- }
935
- }
936
- }
937
- }
938
949
  if (node.tOwned) {
939
- for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
950
+ for (i = node.tOwned.length - 1; i >= 0; i--) destroyNode(node.tOwned[i]);
940
951
  delete node.tOwned;
941
952
  }
942
953
  if (Transition && Transition.running && node.pure) {
943
954
  reset(node, true);
944
955
  } else if (node.owned) {
945
- for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
956
+ for (i = node.owned.length - 1; i >= 0; i--) destroyNode(node.owned[i]);
946
957
  node.owned = null;
947
958
  }
948
959
  if (node.cleanups) {
949
- for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
960
+ for (let i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
950
961
  node.cleanups = null;
951
962
  }
952
963
  if (Transition && Transition.running) node.tState = 0;else node.state = 0;
953
964
  }
965
+ function afterComputation(node) {
966
+ const sourcesTail = node.sourcesTail;
967
+ let toRemove = sourcesTail !== null ? sourcesTail.nextSource : node.sources;
968
+ if (toRemove !== null) {
969
+ do {
970
+ toRemove = unlinkFromObservers(toRemove);
971
+ } while (toRemove !== null);
972
+ if (sourcesTail !== null) {
973
+ sourcesTail.nextSource = null;
974
+ } else {
975
+ node.sources = null;
976
+ }
977
+ }
978
+ }
979
+ function unlinkFromObservers(link) {
980
+ const source = link.source;
981
+ const nextSource = link.nextSource;
982
+ const nextObserver = link.nextObserver;
983
+ const prevObserver = link.prevObserver;
984
+ if (nextObserver !== null) {
985
+ nextObserver.prevObserver = prevObserver;
986
+ } else {
987
+ source.observersTail = prevObserver;
988
+ }
989
+ if (prevObserver !== null) {
990
+ prevObserver.nextObserver = nextObserver;
991
+ } else {
992
+ source.observers = nextObserver;
993
+ }
994
+ return nextSource;
995
+ }
996
+ function destroyNode(node) {
997
+ let link = node.sources;
998
+ while (link) {
999
+ link = unlinkFromObservers(link);
1000
+ }
1001
+ node.sources = null;
1002
+ node.sourcesTail = null;
1003
+ cleanupRoot(node);
1004
+ }
954
1005
  function reset(node, top) {
955
1006
  if (!top) {
956
1007
  node.tState = 0;
@@ -981,6 +1032,7 @@ function handleError(err, owner = Owner) {
981
1032
  fn() {
982
1033
  runErrors(error, fns, owner);
983
1034
  },
1035
+ sources: null,
984
1036
  state: STALE
985
1037
  });else runErrors(error, fns, owner);
986
1038
  }
package/h/dist/h.js CHANGED
@@ -1,4 +1,4 @@
1
- import { spread, assign, insert, createComponent, dynamicProperty, SVGElements } from 'solid-js/web';
1
+ import { SVGElements, dynamicProperty, createComponent, insert, assign, spread } from 'solid-js/web';
2
2
 
3
3
  const $ELEMENT = Symbol("hyper-element");
4
4
  function createHyperScript(r) {
@@ -64,7 +64,7 @@ function parseTag(tag) {
64
64
  }
65
65
  function pushTextNode(list, html, start) {
66
66
  const end = html.indexOf('<', start);
67
- const content = html.slice(start, end === -1 ? undefined : end);
67
+ const content = html.slice(start, end === -1 ? void 0 : end);
68
68
  if (!/^\s*$/.test(content)) {
69
69
  list.push({
70
70
  type: 'text',
@@ -83,7 +83,7 @@ function pushCommentNode(list, tag) {
83
83
  }
84
84
  function parse(html) {
85
85
  const result = [];
86
- let current = undefined;
86
+ let current = void 0;
87
87
  let level = -1;
88
88
  const arr = [];
89
89
  const byTag = {};
@@ -92,7 +92,7 @@ function parse(html) {
92
92
  const isComment = tag.slice(0, 4) === '<!--';
93
93
  const start = index + tag.length;
94
94
  const nextChar = html.charAt(start);
95
- let parent = undefined;
95
+ let parent = void 0;
96
96
  if (isOpen && !isComment) {
97
97
  level++;
98
98
  current = parseTag(tag);
package/html/dist/html.js CHANGED
@@ -1,4 +1,4 @@
1
- import { effect, style, insert, untrack, spread, createComponent, delegateEvents, classList, mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, getPropAlias, Properties, ChildProperties, DelegatedEvents, SVGElements, SVGNamespace } from 'solid-js/web';
1
+ import { SVGNamespace, SVGElements, DelegatedEvents, ChildProperties, Properties, getPropAlias, Aliases, addEventListener, setAttributeNS, setAttribute, dynamicProperty, mergeProps, classList, delegateEvents, createComponent, spread, untrack, insert, style, effect } from 'solid-js/web';
2
2
 
3
3
  const tagRE = /(?:<!--[\S\s]*?-->|<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)/g;
4
4
  const attrRE = /(?:\s(?<boolean>[^/\s><=]+?)(?=[\s/>]))|(?:(?<name>\S+?)(?:\s*=\s*(?:(['"])(?<quotedValue>[\s\S]*?)\3|(?<unquotedValue>[^\s>]+))))/g;
@@ -62,7 +62,7 @@ function parseTag(tag) {
62
62
  }
63
63
  function pushTextNode(list, html, start) {
64
64
  const end = html.indexOf('<', start);
65
- const content = html.slice(start, end === -1 ? undefined : end);
65
+ const content = html.slice(start, end === -1 ? void 0 : end);
66
66
  if (!/^\s*$/.test(content)) {
67
67
  list.push({
68
68
  type: 'text',
@@ -81,7 +81,7 @@ function pushCommentNode(list, tag) {
81
81
  }
82
82
  function parse(html) {
83
83
  const result = [];
84
- let current = undefined;
84
+ let current = void 0;
85
85
  let level = -1;
86
86
  const arr = [];
87
87
  const byTag = {};
@@ -90,7 +90,7 @@ function parse(html) {
90
90
  const isComment = tag.slice(0, 4) === '<!--';
91
91
  const start = index + tag.length;
92
92
  const nextChar = html.charAt(start);
93
- let parent = undefined;
93
+ let parent = void 0;
94
94
  if (isOpen && !isComment) {
95
95
  level++;
96
96
  current = parseTag(tag);
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.9.11",
4
+ "version": "1.10.0-beta.0",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
package/store/dist/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DEV as DEV$1, $PROXY, $TRACK, getListener, batch, createSignal } from 'solid-js';
1
+ import { $PROXY, DEV as DEV$1, batch, $TRACK, getListener, createSignal } from 'solid-js';
2
2
 
3
3
  const $RAW = Symbol("store-raw"),
4
4
  $NODE = Symbol("store-node"),
@@ -1,4 +1,4 @@
1
- import { $PROXY, $TRACK, getListener, batch, createSignal } from 'solid-js';
1
+ import { batch, $PROXY, $TRACK, getListener, createSignal } from 'solid-js';
2
2
 
3
3
  const $RAW = Symbol("store-raw"),
4
4
  $NODE = Symbol("store-node"),
@@ -48,8 +48,8 @@ export interface SourceMapValue {
48
48
  }
49
49
  export interface SignalState<T> extends SourceMapValue {
50
50
  value: T;
51
- observers: Computation<any>[] | null;
52
- observerSlots: number[] | null;
51
+ observers: ReactiveLink | null;
52
+ observersTail: ReactiveLink | null;
53
53
  tValue?: T;
54
54
  comparator?: (prev: T, next: T) => boolean;
55
55
  internal?: true;
@@ -62,15 +62,24 @@ export interface Owner {
62
62
  sourceMap?: SourceMapValue[];
63
63
  name?: string;
64
64
  }
65
+ interface ReactiveLink {
66
+ source: SignalState<unknown> | Memo<any>;
67
+ observer: Computation<any>;
68
+ nextSource: ReactiveLink | null;
69
+ prevObserver: ReactiveLink | null;
70
+ nextObserver: ReactiveLink | null;
71
+ version: number;
72
+ }
65
73
  export interface Computation<Init, Next extends Init = Init> extends Owner {
66
74
  fn: EffectFunction<Init, Next>;
67
75
  state: ComputationState;
68
76
  tState?: ComputationState;
69
- sources: SignalState<Next>[] | null;
70
- sourceSlots: number[] | null;
77
+ sources: ReactiveLink | null;
78
+ sourcesTail: ReactiveLink | null;
71
79
  value?: Init;
72
80
  updatedAt: number | null;
73
81
  pure: boolean;
82
+ relinkTime: number;
74
83
  user?: boolean;
75
84
  suspense?: SuspenseContextType;
76
85
  }
@@ -1,4 +1,4 @@
1
- import { createMemo, createRoot, createRenderEffect, mergeProps, createComponent, untrack } from 'solid-js';
1
+ import { createMemo, createComponent, createRenderEffect, mergeProps, untrack, createRoot } from 'solid-js';
2
2
 
3
3
  const memo = fn => createMemo(() => fn());
4
4
 
@@ -1,4 +1,4 @@
1
- import { createMemo, createRoot, createRenderEffect, mergeProps, createComponent, untrack } from 'solid-js';
1
+ import { createMemo, createComponent, createRenderEffect, mergeProps, untrack, createRoot } from 'solid-js';
2
2
 
3
3
  const memo = fn => createMemo(() => fn());
4
4
 
package/web/dist/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createMemo, createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, $DEVCOMP, splitProps } from 'solid-js';
1
+ import { createMemo, sharedConfig, createRenderEffect, createRoot, untrack, splitProps, getOwner, createEffect, runWithOwner, createSignal, onCleanup, $DEVCOMP, enableHydration } from 'solid-js';
2
2
  export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
3
3
 
4
4
  const booleans = ["allowfullscreen", "async", "alpha",
@@ -1,6 +1,6 @@
1
1
  import { createMemo, sharedConfig, createRoot, splitProps } from 'solid-js';
2
2
  export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
3
- import { Feature, Serializer, getCrossReferenceHeader } from 'seroval';
3
+ import { Serializer, Feature, getCrossReferenceHeader } from 'seroval';
4
4
  import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
5
5
 
6
6
  const booleans = ["allowfullscreen", "async", "alpha",
package/web/dist/web.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createMemo, createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps } from 'solid-js';
1
+ import { createMemo, sharedConfig, createRenderEffect, createRoot, untrack, splitProps, getOwner, createEffect, runWithOwner, createSignal, onCleanup, enableHydration } from 'solid-js';
2
2
  export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
3
3
 
4
4
  const booleans = ["allowfullscreen", "async", "alpha",