@solidjs/signals 2.0.0-rc.15 → 2.0.0-rc.16

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.
Files changed (89) hide show
  1. package/dist/dev-shared.js +785 -367
  2. package/dist/dev.attribution.js +75 -52
  3. package/dist/dev.js +1120 -567
  4. package/dist/observe/affects-marks.js +86 -0
  5. package/dist/observe/affects.js +22 -73
  6. package/dist/observe/boundaries.js +191 -189
  7. package/dist/observe/core/async.js +175 -131
  8. package/dist/observe/core/attribution-queries.js +1 -1
  9. package/dist/observe/core/attribution.js +176 -159
  10. package/dist/observe/core/constants.js +17 -3
  11. package/dist/observe/core/context.js +3 -3
  12. package/dist/observe/core/core.js +503 -363
  13. package/dist/observe/core/dev.js +66 -38
  14. package/dist/observe/core/effect.js +48 -48
  15. package/dist/observe/core/error.js +5 -3
  16. package/dist/observe/core/external.js +5 -6
  17. package/dist/observe/core/graph.js +57 -43
  18. package/dist/observe/core/heap.js +33 -33
  19. package/dist/observe/core/identities.js +62 -0
  20. package/dist/observe/core/lanes.js +226 -259
  21. package/dist/observe/core/owner.js +62 -50
  22. package/dist/observe/core/scheduler.js +319 -171
  23. package/dist/observe/core/truth.js +45 -0
  24. package/dist/observe/core/verdict.js +88 -50
  25. package/dist/observe/deferred.js +184 -0
  26. package/dist/observe/index.js +7 -1
  27. package/dist/observe/map.js +345 -260
  28. package/dist/observe/reveal.js +76 -76
  29. package/dist/observe/signals.js +41 -30
  30. package/dist/observe/store/affects.js +6 -6
  31. package/dist/observe/store/edges.js +39 -0
  32. package/dist/observe/store/optimistic.js +41 -36
  33. package/dist/observe/store/projection.js +68 -55
  34. package/dist/observe/store/store.js +157 -104
  35. package/dist/prod/affects-marks.js +86 -0
  36. package/dist/prod/affects.js +23 -72
  37. package/dist/prod/boundaries.js +155 -153
  38. package/dist/prod/core/async.js +171 -127
  39. package/dist/prod/core/constants.js +17 -3
  40. package/dist/prod/core/context.js +3 -3
  41. package/dist/prod/core/core.js +478 -342
  42. package/dist/prod/core/effect.js +68 -68
  43. package/dist/prod/core/error.js +5 -3
  44. package/dist/prod/core/external.js +5 -6
  45. package/dist/prod/core/graph.js +57 -43
  46. package/dist/prod/core/heap.js +38 -38
  47. package/dist/prod/core/identities.js +62 -0
  48. package/dist/prod/core/lanes.js +217 -250
  49. package/dist/prod/core/owner.js +62 -51
  50. package/dist/prod/core/scheduler.js +310 -162
  51. package/dist/prod/core/truth.js +45 -0
  52. package/dist/prod/core/verdict.js +87 -49
  53. package/dist/prod/deferred.js +182 -0
  54. package/dist/prod/index.js +7 -1
  55. package/dist/prod/map.js +360 -275
  56. package/dist/prod/reveal.js +76 -76
  57. package/dist/prod/signals.js +41 -30
  58. package/dist/prod/store/affects.js +6 -6
  59. package/dist/prod/store/edges.js +39 -0
  60. package/dist/prod/store/optimistic.js +37 -33
  61. package/dist/prod/store/projection.js +25 -19
  62. package/dist/prod/store/store.js +142 -96
  63. package/dist/types/affects-marks.d.ts +14 -0
  64. package/dist/types/boundaries.d.ts +1 -1
  65. package/dist/types/core/async.d.ts +10 -0
  66. package/dist/types/core/constants.d.ts +13 -1
  67. package/dist/types/core/core.d.ts +44 -2
  68. package/dist/types/core/dev.d.ts +43 -13
  69. package/dist/types/core/graph.d.ts +11 -0
  70. package/dist/types/core/identities.d.ts +17 -0
  71. package/dist/types/core/index.d.ts +2 -1
  72. package/dist/types/core/lanes.d.ts +2 -14
  73. package/dist/types/core/owner.d.ts +5 -3
  74. package/dist/types/core/scheduler.d.ts +47 -28
  75. package/dist/types/core/truth.d.ts +16 -0
  76. package/dist/types/core/types.d.ts +21 -0
  77. package/dist/types/core/verdict.d.ts +32 -0
  78. package/dist/types/deferred.d.ts +28 -0
  79. package/dist/types/index.d.ts +6 -0
  80. package/dist/types/map.d.ts +2 -2
  81. package/dist/types/signals.d.ts +28 -7
  82. package/dist/types/store/edges.d.ts +9 -0
  83. package/dist/types/store/index.d.ts +10 -3
  84. package/dist/types/store/optimistic.d.ts +3 -2
  85. package/dist/types/store/projection.d.ts +4 -3
  86. package/dist/types/store/store.d.ts +1 -1
  87. package/dist/types/store/target.d.ts +16 -8
  88. package/dist/types/store/types.d.ts +14 -0
  89. package/package.json +1 -1
@@ -139,6 +139,9 @@ const CONFIG_SYNC = 1 << 6;
139
139
  * leaf twin of REACTIVE_MANUAL_WRITE). Set by the user setter, cleared by
140
140
  * the derive's own write to the key. */ const CONFIG_MANUAL_WRITE = 1 << 18;
141
141
 
142
+ /** D-41: the staged value in `_pendingValue` is an error — an
143
+ * answer of the held frame, published at its landing like a value. */ const CONFIG_STAGED_ERROR = 1 << 21;
144
+
142
145
  /** Lanes — the node carries a written guess (`optimisticWrite`): its own
143
146
  * source recomputing it, or a plain write landing on it, is the truth
144
147
  * (`supersede`). A lane's derived staging is not. */ const CONFIG_GUESS = 1 << 13;
@@ -147,14 +150,20 @@ const CONFIG_SYNC = 1 << 6;
147
150
  * pending is a question for its next pass — the verdict changed — so the
148
151
  * propagation re-derives it instead of marking it pending (as a kept-tail
149
152
  * link does, A30). Set at the window, never cleared: a reader that stopped
150
- * asking re-derives once and goes pending through its own read. */ const CONFIG_VERDICT = 1 << 14;
153
+ * asking re-derives once and goes pending through its own read. The same
154
+ * bit as REACTIVE_PROBED: a pass's probe (or a read of a verdict memo,
155
+ * core.ts `read`) carries into the config at its end without a shift. */ const CONFIG_VERDICT = 1 << 15;
151
156
 
152
157
  /** A dependency's status is a question for this node's pass, not a fact
153
158
  * about its current one: the propagation re-derives it instead of marking
154
159
  * it, for errors as for pending (as CONFIG_VERDICT). A boundary's output
155
160
  * (show the content, or the fallback) and its `on` node (boundaries.ts); a
156
161
  * promise over an expression (`resolve`/`until`, signals.ts: the pass reads
157
- * the error and rejects, or re-asks a pending source). */ const CONFIG_REDERIVE = 1 << 15;
162
+ * the error and rejects, or re-asks a pending source). */ const CONFIG_REDERIVE = 1 << 14;
163
+
164
+ /** An answered `createDeferred` node (deferred.ts): held because a
165
+ * downstream hold staged its landing, its re-pass is a lagging question,
166
+ * not an answer, and joins no transaction (D-40). */ const CONFIG_LAGS = 1 << 19;
158
167
 
159
168
  /** The reader wants the truth, not the lane's guess (`until`, signals.ts):
160
169
  * a read of displayed optimism serves the base the guess covers, makes the
@@ -186,12 +195,17 @@ const CONFIG_HAS_SNAPSHOT = 1 << 9;
186
195
  * a write is promoted at that recompute's end: readers in the same block see
187
196
  * it. Cleared when the next flush begins; set only on that rare path. */ const CONFIG_PROMOTED = 1 << 22;
188
197
 
198
+ const STATUS_NONE = 0;
199
+
189
200
  const STATUS_PENDING = 1 << 0;
190
201
 
191
202
  const STATUS_ERROR = 1 << 1;
192
203
 
193
204
  const STATUS_UNINITIALIZED = 1 << 2;
194
205
 
206
+ /** `catchHook`'s answer when the catcher is a boundary re-armed by
207
+ * `on` (truthy, as any catch): what it collects is its own, not the hold's. */ const CAUGHT_REARMED = 2;
208
+
195
209
  const EFFECT_RENDER = 1;
196
210
 
197
211
  const EFFECT_USER = 2;
@@ -214,4 +228,4 @@ const defaultContext = {};
214
228
  * @internal
215
229
  */ const $REFRESH = Symbol("refresh");
216
230
 
217
- export { $REFRESH, CONFIG_AUTHORITATIVE, CONFIG_AUTO_DISPOSE, CONFIG_CHILDREN_FORBIDDEN, CONFIG_FRESH_READ, CONFIG_GUESS, CONFIG_HAS_SNAPSHOT, CONFIG_HELD, CONFIG_HELD_FRAME, CONFIG_INPUTS_PUBLISHED, CONFIG_IN_SNAPSHOT_SCOPE, CONFIG_MANUAL_WRITE, CONFIG_NO_SNAPSHOT, CONFIG_OVERRIDE, CONFIG_OWNED_WRITE, CONFIG_PROMOTED, CONFIG_REDERIVE, CONFIG_SLOT_NODE, CONFIG_STAGED, CONFIG_SYNC, CONFIG_TRANSPARENT, CONFIG_VERDICT, EFFECT_RENDER, EFFECT_TRACKED, EFFECT_USER, NOT_PENDING, NO_SNAPSHOT, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_DISPOSED, REACTIVE_FRAME_READ, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_JOINED, REACTIVE_LANE_DIRTY, REACTIVE_LANE_READ, REACTIVE_LAZY, REACTIVE_MANUAL_WRITE, REACTIVE_MISSED_WAKE, REACTIVE_NONE, REACTIVE_PROBED, REACTIVE_PROBE_UNANSWERED, REACTIVE_REASK, REACTIVE_RECOMPUTING_DEPS, REACTIVE_SCREEN_READ, REACTIVE_SNAPSHOT_STALE, REACTIVE_STAGED_READ, REACTIVE_ZOMBIE, STATUS_ERROR, STATUS_PENDING, STATUS_UNINITIALIZED, SUPPORTS_PROXY, defaultContext };
231
+ export { $REFRESH, CAUGHT_REARMED, CONFIG_AUTHORITATIVE, CONFIG_AUTO_DISPOSE, CONFIG_CHILDREN_FORBIDDEN, CONFIG_FRESH_READ, CONFIG_GUESS, CONFIG_HAS_SNAPSHOT, CONFIG_HELD, CONFIG_HELD_FRAME, CONFIG_INPUTS_PUBLISHED, CONFIG_IN_SNAPSHOT_SCOPE, CONFIG_LAGS, CONFIG_MANUAL_WRITE, CONFIG_NO_SNAPSHOT, CONFIG_OVERRIDE, CONFIG_OWNED_WRITE, CONFIG_PROMOTED, CONFIG_REDERIVE, CONFIG_SLOT_NODE, CONFIG_STAGED, CONFIG_STAGED_ERROR, CONFIG_SYNC, CONFIG_TRANSPARENT, CONFIG_VERDICT, EFFECT_RENDER, EFFECT_TRACKED, EFFECT_USER, NOT_PENDING, NO_SNAPSHOT, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_DISPOSED, REACTIVE_FRAME_READ, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_JOINED, REACTIVE_LANE_DIRTY, REACTIVE_LANE_READ, REACTIVE_LAZY, REACTIVE_MANUAL_WRITE, REACTIVE_MISSED_WAKE, REACTIVE_NONE, REACTIVE_PROBED, REACTIVE_PROBE_UNANSWERED, REACTIVE_REASK, REACTIVE_RECOMPUTING_DEPS, REACTIVE_SCREEN_READ, REACTIVE_SNAPSHOT_STALE, REACTIVE_STAGED_READ, REACTIVE_ZOMBIE, STATUS_ERROR, STATUS_NONE, STATUS_PENDING, STATUS_UNINITIALIZED, SUPPORTS_PROXY, defaultContext };
@@ -30,7 +30,7 @@ import { getOwner } from "./owner.js";
30
30
  throw new NoOwnerError;
31
31
  }
32
32
  // `undefined` alone means unset — a provided `null` is a value (no `??`).
33
- let r = t.D[e.id];
33
+ let r = t.A[e.id];
34
34
  if (r === undefined) r = e.defaultValue;
35
35
  if (r === undefined) {
36
36
  throw new ContextNotFoundError;
@@ -52,8 +52,8 @@ import { getOwner } from "./owner.js";
52
52
  }
53
53
  // We're creating a new object to avoid child context values being exposed to parent owners. If
54
54
  // we don't do this, everything will be a singleton and all hell will break lose.
55
- r.D = {
56
- ...r.D,
55
+ r.A = {
56
+ ...r.A,
57
57
  [e.id]: t === undefined ? e.defaultValue : t
58
58
  };
59
59
  }