solid-js 2.0.0-experimental.13 → 2.0.0-experimental.15

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
@@ -39,8 +39,15 @@ function devComponent(Comp, props) {
39
39
  Object.assign(Comp, {
40
40
  [$DEVCOMP]: true
41
41
  });
42
- return Comp(props);
42
+ signals.setStrictRead(`<${Comp.name || "Anonymous"}>`);
43
+ try {
44
+ return Comp(props);
45
+ } finally {
46
+ signals.setStrictRead(false);
47
+ }
43
48
  });
49
+ }, {
50
+ transparent: true
44
51
  });
45
52
  }
46
53
  function registerGraph(value) {
@@ -50,27 +57,6 @@ function registerGraph(value) {
50
57
  value.graph = owner;
51
58
  }
52
59
 
53
- function tryCatch(fn) {
54
- try {
55
- const v = fn();
56
- if (v instanceof Promise) {
57
- return v.then(v => [undefined, v], e => {
58
- if (e instanceof signals.NotReadyError) throw e;
59
- return [e];
60
- });
61
- }
62
- return [undefined, v];
63
- } catch (e) {
64
- if (e instanceof signals.NotReadyError) throw e;
65
- return [e];
66
- }
67
- }
68
- function reducer(source, reducerFn) {
69
- return [source[0], action => {
70
- source[1](s => reducerFn(s, action));
71
- }];
72
- }
73
-
74
60
  const sharedConfig = {
75
61
  hydrating: false,
76
62
  registry: undefined,
@@ -81,50 +67,496 @@ const sharedConfig = {
81
67
  return signals.getNextChildId(o);
82
68
  }
83
69
  };
70
+ let _hydrationEndCallbacks = null;
71
+ let _pendingBoundaries = 0;
72
+ let _hydrationDone = false;
73
+ let _snapshotRootOwner = null;
74
+ function markTopLevelSnapshotScope() {
75
+ if (_snapshotRootOwner) return;
76
+ let owner = signals.getOwner();
77
+ if (!owner) return;
78
+ while (owner._parent) owner = owner._parent;
79
+ signals.markSnapshotScope(owner);
80
+ _snapshotRootOwner = owner;
81
+ }
82
+ function drainHydrationCallbacks() {
83
+ if (_hydrationDone) return;
84
+ _hydrationDone = true;
85
+ _doneValue = true;
86
+ signals.clearSnapshots();
87
+ signals.setSnapshotCapture(false);
88
+ signals.flush();
89
+ const cbs = _hydrationEndCallbacks;
90
+ _hydrationEndCallbacks = null;
91
+ if (cbs) for (const cb of cbs) cb();
92
+ setTimeout(() => {
93
+ if (globalThis._$HY) globalThis._$HY.done = true;
94
+ });
95
+ }
96
+ function checkHydrationComplete() {
97
+ if (_pendingBoundaries === 0) drainHydrationCallbacks();
98
+ }
99
+ let _hydratingValue = false;
100
+ let _doneValue = false;
101
+ let _createMemo;
102
+ let _createSignal;
103
+ let _createErrorBoundary;
104
+ let _createOptimistic;
105
+ let _createProjection;
106
+ let _createStore;
107
+ let _createOptimisticStore;
108
+ class MockPromise {
109
+ static all() {
110
+ return new MockPromise();
111
+ }
112
+ static allSettled() {
113
+ return new MockPromise();
114
+ }
115
+ static any() {
116
+ return new MockPromise();
117
+ }
118
+ static race() {
119
+ return new MockPromise();
120
+ }
121
+ static reject() {
122
+ return new MockPromise();
123
+ }
124
+ static resolve() {
125
+ return new MockPromise();
126
+ }
127
+ catch() {
128
+ return new MockPromise();
129
+ }
130
+ then() {
131
+ return new MockPromise();
132
+ }
133
+ finally() {
134
+ return new MockPromise();
135
+ }
136
+ }
137
+ function subFetch(fn, prev) {
138
+ const ogFetch = fetch;
139
+ const ogPromise = Promise;
140
+ try {
141
+ window.fetch = () => new MockPromise();
142
+ Promise = MockPromise;
143
+ const result = fn(prev);
144
+ if (result && typeof result[Symbol.asyncIterator] === "function") {
145
+ result[Symbol.asyncIterator]().next();
146
+ }
147
+ return result;
148
+ } finally {
149
+ window.fetch = ogFetch;
150
+ Promise = ogPromise;
151
+ }
152
+ }
153
+ function consumeFirstSync(ai) {
154
+ const iter = ai[Symbol.asyncIterator]();
155
+ const r = iter.next();
156
+ const value = !(r instanceof Promise) && !r.done ? r.value : undefined;
157
+ return [value, iter];
158
+ }
159
+ function applyPatches(target, patches) {
160
+ for (const patch of patches) {
161
+ const path = patch[0];
162
+ let current = target;
163
+ for (let i = 0; i < path.length - 1; i++) current = current[path[i]];
164
+ const key = path[path.length - 1];
165
+ if (patch.length === 1) {
166
+ Array.isArray(current) ? current.splice(key, 1) : delete current[key];
167
+ } else if (patch.length === 3) {
168
+ current.splice(key, 0, patch[1]);
169
+ } else {
170
+ current[key] = patch[1];
171
+ }
172
+ }
173
+ }
174
+ function scheduleIteratorConsumption(iter, apply) {
175
+ const consume = () => {
176
+ while (true) {
177
+ const n = iter.next();
178
+ if (n instanceof Promise) {
179
+ n.then(r => {
180
+ if (r.done) return;
181
+ apply(r.value);
182
+ consume();
183
+ });
184
+ return;
185
+ }
186
+ if (n.done) break;
187
+ apply(n.value);
188
+ }
189
+ };
190
+ consume();
191
+ }
192
+ function isAsyncIterable(v) {
193
+ return v != null && typeof v[Symbol.asyncIterator] === "function";
194
+ }
195
+ function hydrateSignalFromAsyncIterable(coreFn, compute, value, options) {
196
+ const parent = signals.getOwner();
197
+ const expectedId = signals.peekNextChildId(parent);
198
+ if (!sharedConfig.has(expectedId)) return null;
199
+ const initP = sharedConfig.load(expectedId);
200
+ if (!isAsyncIterable(initP)) return null;
201
+ const [firstValue, iter] = consumeFirstSync(initP);
202
+ const [get, set] = signals.createSignal(firstValue);
203
+ const result = coreFn(() => get(), firstValue, options);
204
+ scheduleIteratorConsumption(iter, v => {
205
+ set(() => v);
206
+ signals.flush();
207
+ });
208
+ return result;
209
+ }
210
+ function hydrateStoreFromAsyncIterable(coreFn, initialValue, options) {
211
+ const parent = signals.getOwner();
212
+ const expectedId = signals.peekNextChildId(parent);
213
+ if (!sharedConfig.has(expectedId)) return null;
214
+ const initP = sharedConfig.load(expectedId);
215
+ if (!isAsyncIterable(initP)) return null;
216
+ const [firstState, iter] = consumeFirstSync(initP);
217
+ const [store, setStore] = coreFn(() => {}, firstState ?? initialValue, options);
218
+ scheduleIteratorConsumption(iter, patches => {
219
+ setStore(d => {
220
+ applyPatches(d, patches);
221
+ });
222
+ });
223
+ return [store, setStore];
224
+ }
225
+ function hydratedCreateMemo(compute, value, options) {
226
+ if (!sharedConfig.hydrating) return signals.createMemo(compute, value, options);
227
+ markTopLevelSnapshotScope();
228
+ const ssrSource = options?.ssrSource;
229
+ if (ssrSource === "client") {
230
+ const [hydrated, setHydrated] = signals.createSignal(false);
231
+ const memo = signals.createMemo(prev => {
232
+ if (!hydrated()) return prev ?? value;
233
+ return compute(prev);
234
+ }, value, options);
235
+ setHydrated(true);
236
+ return memo;
237
+ }
238
+ if (ssrSource === "initial") {
239
+ return signals.createMemo(prev => {
240
+ if (!sharedConfig.hydrating) return compute(prev);
241
+ subFetch(compute, prev);
242
+ return prev ?? value;
243
+ }, value, options);
244
+ }
245
+ const aiResult = hydrateSignalFromAsyncIterable(signals.createMemo, compute, value, options);
246
+ if (aiResult !== null) return aiResult;
247
+ return signals.createMemo(prev => {
248
+ const o = signals.getOwner();
249
+ if (!sharedConfig.hydrating) return compute(prev);
250
+ let initP;
251
+ if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
252
+ const init = initP?.v ?? initP;
253
+ return init != null ? (subFetch(compute, prev), init) : compute(prev);
254
+ }, value, options);
255
+ }
256
+ function hydratedCreateSignal(fn, second, third) {
257
+ if (typeof fn !== "function" || !sharedConfig.hydrating) return signals.createSignal(fn, second, third);
258
+ markTopLevelSnapshotScope();
259
+ const ssrSource = third?.ssrSource;
260
+ if (ssrSource === "client") {
261
+ const [hydrated, setHydrated] = signals.createSignal(false);
262
+ const sig = signals.createSignal(prev => {
263
+ if (!hydrated()) return prev ?? second;
264
+ return fn(prev);
265
+ }, second, third);
266
+ setHydrated(true);
267
+ return sig;
268
+ }
269
+ if (ssrSource === "initial") {
270
+ return signals.createSignal(prev => {
271
+ if (!sharedConfig.hydrating) return fn(prev);
272
+ subFetch(fn, prev);
273
+ return prev ?? second;
274
+ }, second, third);
275
+ }
276
+ const aiResult = hydrateSignalFromAsyncIterable(signals.createSignal, fn, second, third);
277
+ if (aiResult !== null) return aiResult;
278
+ return signals.createSignal(prev => {
279
+ if (!sharedConfig.hydrating) return fn(prev);
280
+ const o = signals.getOwner();
281
+ let initP;
282
+ if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
283
+ const init = initP?.v ?? initP;
284
+ return init != null ? (subFetch(fn, prev), init) : fn(prev);
285
+ }, second, third);
286
+ }
287
+ function hydratedCreateErrorBoundary(fn, fallback) {
288
+ if (!sharedConfig.hydrating) return signals.createErrorBoundary(fn, fallback);
289
+ markTopLevelSnapshotScope();
290
+ const parent = signals.getOwner();
291
+ const expectedId = signals.peekNextChildId(parent);
292
+ if (sharedConfig.has(expectedId)) {
293
+ const err = sharedConfig.load(expectedId);
294
+ if (err !== undefined) {
295
+ let hydrated = true;
296
+ return signals.createErrorBoundary(() => {
297
+ if (hydrated) {
298
+ hydrated = false;
299
+ throw err;
300
+ }
301
+ return fn();
302
+ }, fallback);
303
+ }
304
+ }
305
+ return signals.createErrorBoundary(fn, fallback);
306
+ }
307
+ function hydratedCreateOptimistic(fn, second, third) {
308
+ if (typeof fn !== "function" || !sharedConfig.hydrating) return signals.createOptimistic(fn, second, third);
309
+ markTopLevelSnapshotScope();
310
+ const ssrSource = third?.ssrSource;
311
+ if (ssrSource === "client") {
312
+ const [hydrated, setHydrated] = signals.createSignal(false);
313
+ const sig = signals.createOptimistic(prev => {
314
+ if (!hydrated()) return prev ?? second;
315
+ return fn(prev);
316
+ }, second, third);
317
+ setHydrated(true);
318
+ return sig;
319
+ }
320
+ if (ssrSource === "initial") {
321
+ return signals.createOptimistic(prev => {
322
+ if (!sharedConfig.hydrating) return fn(prev);
323
+ subFetch(fn, prev);
324
+ return prev ?? second;
325
+ }, second, third);
326
+ }
327
+ const aiResult = hydrateSignalFromAsyncIterable(signals.createOptimistic, fn, second, third);
328
+ if (aiResult !== null) return aiResult;
329
+ return signals.createOptimistic(prev => {
330
+ const o = signals.getOwner();
331
+ if (!sharedConfig.hydrating) return fn(prev);
332
+ let initP;
333
+ if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
334
+ const init = initP?.v ?? initP;
335
+ return init != null ? (subFetch(fn, prev), init) : fn(prev);
336
+ }, second, third);
337
+ }
338
+ function wrapStoreFn(fn, ssrSource) {
339
+ if (ssrSource === "initial") {
340
+ return draft => {
341
+ if (!sharedConfig.hydrating) return fn(draft);
342
+ subFetch(fn, draft);
343
+ return undefined;
344
+ };
345
+ }
346
+ return draft => {
347
+ const o = signals.getOwner();
348
+ if (!sharedConfig.hydrating) return fn(draft);
349
+ let initP;
350
+ if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
351
+ const init = initP?.v ?? initP;
352
+ return init != null ? (subFetch(fn, draft), init) : fn(draft);
353
+ };
354
+ }
355
+ function hydratedCreateStore(first, second, third) {
356
+ if (typeof first !== "function" || !sharedConfig.hydrating) return signals.createStore(first, second, third);
357
+ markTopLevelSnapshotScope();
358
+ const ssrSource = third?.ssrSource;
359
+ if (ssrSource === "client" || ssrSource === "initial") {
360
+ return signals.createStore(second ?? {}, undefined, third);
361
+ }
362
+ const aiResult = hydrateStoreFromAsyncIterable(signals.createStore, second ?? {}, third);
363
+ if (aiResult !== null) return aiResult;
364
+ return signals.createStore(wrapStoreFn(first, ssrSource), second, third);
365
+ }
366
+ function hydratedCreateOptimisticStore(first, second, third) {
367
+ if (typeof first !== "function" || !sharedConfig.hydrating) return signals.createOptimisticStore(first, second, third);
368
+ markTopLevelSnapshotScope();
369
+ const ssrSource = third?.ssrSource;
370
+ if (ssrSource === "client" || ssrSource === "initial") {
371
+ return signals.createOptimisticStore(second ?? {}, undefined, third);
372
+ }
373
+ const aiResult = hydrateStoreFromAsyncIterable(signals.createOptimisticStore, second ?? {}, third);
374
+ if (aiResult !== null) return aiResult;
375
+ return signals.createOptimisticStore(wrapStoreFn(first, ssrSource), second, third);
376
+ }
377
+ function hydratedCreateProjection(fn, initialValue, options) {
378
+ if (!sharedConfig.hydrating) return signals.createProjection(fn, initialValue, options);
379
+ markTopLevelSnapshotScope();
380
+ const ssrSource = options?.ssrSource;
381
+ if (ssrSource === "client" || ssrSource === "initial") {
382
+ return signals.createProjection(draft => draft, initialValue, options);
383
+ }
384
+ const aiResult = hydrateStoreFromAsyncIterable(signals.createStore, initialValue, options);
385
+ if (aiResult !== null) return aiResult[0];
386
+ return signals.createProjection(wrapStoreFn(fn, ssrSource), initialValue, options);
387
+ }
388
+ function enableHydration() {
389
+ _createMemo = hydratedCreateMemo;
390
+ _createSignal = hydratedCreateSignal;
391
+ _createErrorBoundary = hydratedCreateErrorBoundary;
392
+ _createOptimistic = hydratedCreateOptimistic;
393
+ _createProjection = hydratedCreateProjection;
394
+ _createStore = hydratedCreateStore;
395
+ _createOptimisticStore = hydratedCreateOptimisticStore;
396
+ _hydratingValue = sharedConfig.hydrating;
397
+ _doneValue = sharedConfig.done;
398
+ Object.defineProperty(sharedConfig, "hydrating", {
399
+ get() {
400
+ return _hydratingValue;
401
+ },
402
+ set(v) {
403
+ const was = _hydratingValue;
404
+ _hydratingValue = v;
405
+ if (!was && v) {
406
+ _hydrationDone = false;
407
+ _doneValue = false;
408
+ _pendingBoundaries = 0;
409
+ signals.setSnapshotCapture(true);
410
+ _snapshotRootOwner = null;
411
+ } else if (was && !v) {
412
+ if (_snapshotRootOwner) {
413
+ signals.releaseSnapshotScope(_snapshotRootOwner);
414
+ _snapshotRootOwner = null;
415
+ }
416
+ checkHydrationComplete();
417
+ }
418
+ },
419
+ configurable: true,
420
+ enumerable: true
421
+ });
422
+ Object.defineProperty(sharedConfig, "done", {
423
+ get() {
424
+ return _doneValue;
425
+ },
426
+ set(v) {
427
+ _doneValue = v;
428
+ if (v) drainHydrationCallbacks();
429
+ },
430
+ configurable: true,
431
+ enumerable: true
432
+ });
433
+ }
434
+ const createMemo = (...args) => (_createMemo || signals.createMemo)(...args);
435
+ const createSignal = (...args) => (_createSignal || signals.createSignal)(...args);
436
+ const createErrorBoundary = (...args) => (_createErrorBoundary || signals.createErrorBoundary)(...args);
437
+ const createOptimistic = (...args) => (_createOptimistic || signals.createOptimistic)(...args);
438
+ const createProjection = (...args) => (_createProjection || signals.createProjection)(...args);
439
+ const createStore = (...args) => (_createStore || signals.createStore)(...args);
440
+ const createOptimisticStore = (...args) => (_createOptimisticStore || signals.createOptimisticStore)(...args);
441
+ function loadModuleAssets(mapping) {
442
+ const hy = globalThis._$HY;
443
+ if (!hy) return;
444
+ if (!hy.modules) hy.modules = {};
445
+ if (!hy.loading) hy.loading = {};
446
+ const pending = [];
447
+ for (const moduleUrl in mapping) {
448
+ if (hy.modules[moduleUrl]) continue;
449
+ const entryUrl = mapping[moduleUrl];
450
+ if (!hy.loading[moduleUrl]) {
451
+ hy.loading[moduleUrl] = import(entryUrl).then(mod => {
452
+ hy.modules[moduleUrl] = mod;
453
+ });
454
+ }
455
+ pending.push(hy.loading[moduleUrl]);
456
+ }
457
+ return pending.length ? Promise.all(pending).then(() => {}) : undefined;
458
+ }
459
+ function createBoundaryTrigger() {
460
+ signals.setSnapshotCapture(false);
461
+ const [s, set] = signals.createSignal(undefined, {
462
+ equals: false
463
+ });
464
+ s();
465
+ signals.setSnapshotCapture(true);
466
+ return set;
467
+ }
468
+ function resumeBoundaryHydration(o, id, set) {
469
+ _pendingBoundaries--;
470
+ if (signals.isDisposed(o)) {
471
+ checkHydrationComplete();
472
+ return;
473
+ }
474
+ sharedConfig.gather(id);
475
+ _hydratingValue = true;
476
+ signals.markSnapshotScope(o);
477
+ _snapshotRootOwner = o;
478
+ set();
479
+ signals.flush();
480
+ _snapshotRootOwner = null;
481
+ _hydratingValue = false;
482
+ signals.releaseSnapshotScope(o);
483
+ signals.flush();
484
+ checkHydrationComplete();
485
+ }
84
486
  function Loading(props) {
85
487
  if (!sharedConfig.hydrating) return signals.createLoadBoundary(() => props.children, () => props.fallback);
86
488
  return signals.createMemo(() => {
87
489
  const o = signals.getOwner();
88
490
  const id = o.id;
491
+ let assetPromise;
492
+ if (sharedConfig.hydrating && sharedConfig.has(id + "_assets")) {
493
+ const mapping = sharedConfig.load(id + "_assets");
494
+ if (mapping && typeof mapping === "object") assetPromise = loadModuleAssets(mapping);
495
+ }
89
496
  if (sharedConfig.hydrating && sharedConfig.has(id)) {
90
497
  let ref = sharedConfig.load(id);
91
498
  let p;
92
499
  if (ref) {
93
- if (typeof ref !== "object" || ref.s !== "success") p = ref;else sharedConfig.gather(id);
500
+ if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(id);
94
501
  }
95
502
  if (p) {
96
- const [s, set] = signals.createSignal(undefined, {
97
- equals: false
503
+ _pendingBoundaries++;
504
+ signals.onCleanup(() => {
505
+ if (!signals.isDisposed(o)) return;
506
+ sharedConfig.cleanupFragment?.(id);
98
507
  });
99
- s();
508
+ const set = createBoundaryTrigger();
100
509
  if (p !== "$$f") {
101
- p.then(() => {
102
- sharedConfig.gather(id);
103
- sharedConfig.hydrating = true;
510
+ const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
511
+ waitFor.then(() => resumeBoundaryHydration(o, id, set), err => {
512
+ _pendingBoundaries--;
513
+ checkHydrationComplete();
514
+ signals.runWithOwner(o, () => {
515
+ throw err;
516
+ });
517
+ });
518
+ } else {
519
+ const afterAssets = () => {
520
+ _pendingBoundaries--;
104
521
  set();
105
- signals.flush();
106
- sharedConfig.hydrating = false;
107
- }, err => signals.runWithOwner(o, () => {
108
- throw err;
109
- }));
110
- } else queueMicrotask(set);
522
+ checkHydrationComplete();
523
+ };
524
+ if (assetPromise) assetPromise.then(() => queueMicrotask(afterAssets));else queueMicrotask(afterAssets);
525
+ }
111
526
  return props.fallback;
112
527
  }
113
528
  }
529
+ if (assetPromise) {
530
+ _pendingBoundaries++;
531
+ const set = createBoundaryTrigger();
532
+ assetPromise.then(() => resumeBoundaryHydration(o, id, set));
533
+ return undefined;
534
+ }
114
535
  return signals.createLoadBoundary(() => props.children, () => props.fallback);
115
536
  });
116
537
  }
117
538
 
118
- function enableHydration() {
119
- }
120
539
  function createComponent(Comp, props) {
121
540
  return devComponent(Comp, props || {});
122
541
  }
123
- function lazy(fn) {
542
+ function lazy(fn, moduleUrl) {
124
543
  let comp;
125
544
  let p;
126
545
  const wrap = props => {
127
- comp = signals.createMemo(() => (p || (p = fn())).then(mod => mod.default));
546
+ if (sharedConfig.hydrating && moduleUrl) {
547
+ const cached = globalThis._$HY?.modules?.[moduleUrl];
548
+ if (!cached) {
549
+ throw new Error(`lazy() module "${moduleUrl}" was not preloaded before hydration. ` + "Ensure it is inside a Loading boundary.");
550
+ }
551
+ comp = () => cached.default;
552
+ }
553
+ if (!comp) {
554
+ p || (p = fn());
555
+ p.then(mod => {
556
+ comp = () => mod.default;
557
+ });
558
+ comp = signals.createMemo(() => p.then(mod => mod.default));
559
+ }
128
560
  let Comp;
129
561
  return signals.createMemo(() => (Comp = comp()) ? signals.untrack(() => {
130
562
  Object.assign(Comp, {
@@ -149,6 +581,7 @@ function For(props) {
149
581
  } : {
150
582
  keyed: props.keyed
151
583
  };
584
+ options.name = "<For>";
152
585
  return signals.mapArray(() => props.each, props.children, options);
153
586
  }
154
587
  function Repeat(props) {
@@ -156,6 +589,7 @@ function Repeat(props) {
156
589
  fallback: () => props.fallback
157
590
  } : {};
158
591
  options.from = () => props.from;
592
+ options.name = "<Repeat>";
159
593
  return signals.repeat(() => props.count, index => typeof props.children === "function" ? props.children(index) : props.children, options);
160
594
  }
161
595
  function Show(props) {
@@ -172,10 +606,17 @@ function Show(props) {
172
606
  if (c) {
173
607
  const child = props.children;
174
608
  const fn = typeof child === "function" && child.length > 0;
175
- return fn ? signals.untrack(() => child(() => {
176
- if (!signals.untrack(condition)) throw narrowedError("Show");
177
- return conditionValue();
178
- })) : child;
609
+ return fn ? signals.untrack(() => {
610
+ signals.setStrictRead("<Show>");
611
+ try {
612
+ return child(() => {
613
+ if (!signals.untrack(condition)) throw narrowedError("Show");
614
+ return conditionValue();
615
+ });
616
+ } finally {
617
+ signals.setStrictRead(false);
618
+ }
619
+ }) : child;
179
620
  }
180
621
  return props.fallback;
181
622
  }, undefined, {
@@ -208,10 +649,17 @@ function Switch(props) {
208
649
  const [index, conditionValue, mp] = sel;
209
650
  const child = mp.children;
210
651
  const fn = typeof child === "function" && child.length > 0;
211
- return fn ? signals.untrack(() => child(() => {
212
- if (signals.untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
213
- return conditionValue();
214
- })) : child;
652
+ return fn ? signals.untrack(() => {
653
+ signals.setStrictRead("<Match>");
654
+ try {
655
+ return child(() => {
656
+ if (signals.untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
657
+ return conditionValue();
658
+ });
659
+ } finally {
660
+ signals.setStrictRead(false);
661
+ }
662
+ }) : child;
215
663
  }, undefined, {
216
664
  name: "eval conditions"
217
665
  } );
@@ -220,15 +668,12 @@ function Match(props) {
220
668
  return props;
221
669
  }
222
670
  function Errored(props) {
223
- return signals.createErrorBoundary(() => props.children, (err, reset) => {
671
+ return createErrorBoundary(() => props.children, (err, reset) => {
224
672
  const f = props.fallback;
225
673
  if ((typeof f !== "function" || f.length == 0)) console.error(err);
226
674
  return typeof f === "function" && f.length ? f(err, reset) : f;
227
675
  });
228
676
  }
229
- function Boundary(props) {
230
- return signals.createBoundary(() => props.children, () => props.mode);
231
- }
232
677
 
233
678
  function ssrHandleError() {}
234
679
  function ssrRunInScope() {}
@@ -249,6 +694,10 @@ Object.defineProperty(exports, "$TRACK", {
249
694
  enumerable: true,
250
695
  get: function () { return signals.$TRACK; }
251
696
  });
697
+ Object.defineProperty(exports, "NotReadyError", {
698
+ enumerable: true,
699
+ get: function () { return signals.NotReadyError; }
700
+ });
252
701
  Object.defineProperty(exports, "action", {
253
702
  enumerable: true,
254
703
  get: function () { return signals.action; }
@@ -257,22 +706,6 @@ Object.defineProperty(exports, "createEffect", {
257
706
  enumerable: true,
258
707
  get: function () { return signals.createEffect; }
259
708
  });
260
- Object.defineProperty(exports, "createMemo", {
261
- enumerable: true,
262
- get: function () { return signals.createMemo; }
263
- });
264
- Object.defineProperty(exports, "createOptimistic", {
265
- enumerable: true,
266
- get: function () { return signals.createOptimistic; }
267
- });
268
- Object.defineProperty(exports, "createOptimisticStore", {
269
- enumerable: true,
270
- get: function () { return signals.createOptimisticStore; }
271
- });
272
- Object.defineProperty(exports, "createProjection", {
273
- enumerable: true,
274
- get: function () { return signals.createProjection; }
275
- });
276
709
  Object.defineProperty(exports, "createReaction", {
277
710
  enumerable: true,
278
711
  get: function () { return signals.createReaction; }
@@ -285,14 +718,6 @@ Object.defineProperty(exports, "createRoot", {
285
718
  enumerable: true,
286
719
  get: function () { return signals.createRoot; }
287
720
  });
288
- Object.defineProperty(exports, "createSignal", {
289
- enumerable: true,
290
- get: function () { return signals.createSignal; }
291
- });
292
- Object.defineProperty(exports, "createStore", {
293
- enumerable: true,
294
- get: function () { return signals.createStore; }
295
- });
296
721
  Object.defineProperty(exports, "createTrackedEffect", {
297
722
  enumerable: true,
298
723
  get: function () { return signals.createTrackedEffect; }
@@ -386,7 +811,6 @@ Object.defineProperty(exports, "untrack", {
386
811
  get: function () { return signals.untrack; }
387
812
  });
388
813
  exports.$DEVCOMP = $DEVCOMP;
389
- exports.Boundary = Boundary;
390
814
  exports.DEV = DEV;
391
815
  exports.Errored = Errored;
392
816
  exports.For = For;
@@ -398,12 +822,16 @@ exports.Switch = Switch;
398
822
  exports.children = children;
399
823
  exports.createComponent = createComponent;
400
824
  exports.createContext = createContext;
825
+ exports.createMemo = createMemo;
826
+ exports.createOptimistic = createOptimistic;
827
+ exports.createOptimisticStore = createOptimisticStore;
828
+ exports.createProjection = createProjection;
829
+ exports.createSignal = createSignal;
830
+ exports.createStore = createStore;
401
831
  exports.createUniqueId = createUniqueId;
402
832
  exports.enableHydration = enableHydration;
403
833
  exports.lazy = lazy;
404
- exports.reducer = reducer;
405
834
  exports.sharedConfig = sharedConfig;
406
835
  exports.ssrHandleError = ssrHandleError;
407
836
  exports.ssrRunInScope = ssrRunInScope;
408
- exports.tryCatch = tryCatch;
409
837
  exports.useContext = useContext;