solid-js 1.9.3 → 2.0.0-experimental.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.
Files changed (76) hide show
  1. package/dist/dev.cjs +213 -1603
  2. package/dist/dev.js +159 -1749
  3. package/dist/server.cjs +88 -11
  4. package/dist/server.js +91 -11
  5. package/dist/solid.cjs +196 -1558
  6. package/dist/solid.js +139 -1682
  7. package/package.json +8 -154
  8. package/types/{render → client}/component.d.ts +0 -61
  9. package/types/client/core.d.ts +75 -0
  10. package/types/client/flow.d.ts +114 -0
  11. package/types/{render → client}/hydration.d.ts +0 -2
  12. package/types/{reactive → client}/observable.d.ts +1 -1
  13. package/types/index.d.ts +44 -55
  14. package/types/jsx.d.ts +1944 -174
  15. package/types/server/index.d.ts +1 -1
  16. package/types/server/reactive.d.ts +6 -1
  17. package/types/server/store.d.ts +6 -0
  18. package/h/dist/h.cjs +0 -115
  19. package/h/dist/h.js +0 -144
  20. package/h/jsx-dev-runtime/package.json +0 -8
  21. package/h/jsx-runtime/dist/jsx.cjs +0 -15
  22. package/h/jsx-runtime/dist/jsx.js +0 -10
  23. package/h/jsx-runtime/package.json +0 -8
  24. package/h/jsx-runtime/types/index.d.ts +0 -14
  25. package/h/jsx-runtime/types/jsx.d.ts +0 -2276
  26. package/h/package.json +0 -8
  27. package/h/types/hyperscript.d.ts +0 -20
  28. package/h/types/index.d.ts +0 -3
  29. package/html/dist/html.cjs +0 -583
  30. package/html/dist/html.js +0 -706
  31. package/html/package.json +0 -8
  32. package/html/types/index.d.ts +0 -3
  33. package/html/types/lit.d.ts +0 -60
  34. package/store/dist/dev.cjs +0 -454
  35. package/store/dist/dev.js +0 -525
  36. package/store/dist/server.cjs +0 -126
  37. package/store/dist/server.js +0 -126
  38. package/store/dist/store.cjs +0 -434
  39. package/store/dist/store.js +0 -499
  40. package/store/package.json +0 -46
  41. package/store/types/index.d.ts +0 -26
  42. package/store/types/modifiers.d.ts +0 -9
  43. package/store/types/mutable.d.ts +0 -8
  44. package/store/types/server.d.ts +0 -37
  45. package/store/types/store.d.ts +0 -263
  46. package/types/reactive/array.d.ts +0 -52
  47. package/types/reactive/scheduler.d.ts +0 -13
  48. package/types/reactive/signal.d.ts +0 -664
  49. package/types/render/Suspense.d.ts +0 -26
  50. package/types/render/flow.d.ts +0 -130
  51. package/types/render/index.d.ts +0 -4
  52. package/universal/dist/dev.cjs +0 -243
  53. package/universal/dist/dev.js +0 -257
  54. package/universal/dist/universal.cjs +0 -243
  55. package/universal/dist/universal.js +0 -257
  56. package/universal/package.json +0 -20
  57. package/universal/types/index.d.ts +0 -4
  58. package/universal/types/universal.d.ts +0 -29
  59. package/web/dist/dev.cjs +0 -804
  60. package/web/dist/dev.js +0 -1241
  61. package/web/dist/server.cjs +0 -793
  62. package/web/dist/server.js +0 -1214
  63. package/web/dist/web.cjs +0 -793
  64. package/web/dist/web.js +0 -1220
  65. package/web/package.json +0 -46
  66. package/web/storage/dist/storage.cjs +0 -12
  67. package/web/storage/dist/storage.js +0 -10
  68. package/web/storage/package.json +0 -15
  69. package/web/storage/types/index.d.ts +0 -2
  70. package/web/storage/types/index.js +0 -13
  71. package/web/types/client.d.ts +0 -79
  72. package/web/types/core.d.ts +0 -10
  73. package/web/types/index.d.ts +0 -54
  74. package/web/types/jsx.d.ts +0 -1
  75. package/web/types/server-mock.d.ts +0 -80
  76. package/web/types/server.d.ts +0 -177
package/dist/dev.cjs CHANGED
@@ -1,602 +1,29 @@
1
1
  'use strict';
2
2
 
3
- let taskIdCounter = 1,
4
- isCallbackScheduled = false,
5
- isPerformingWork = false,
6
- taskQueue = [],
7
- currentTask = null,
8
- shouldYieldToHost = null,
9
- yieldInterval = 5,
10
- deadline = 0,
11
- maxYieldInterval = 300,
12
- scheduleCallback = null,
13
- scheduledCallback = null;
14
- const maxSigned31BitInt = 1073741823;
15
- function setupScheduler() {
16
- const channel = new MessageChannel(),
17
- port = channel.port2;
18
- scheduleCallback = () => port.postMessage(null);
19
- channel.port1.onmessage = () => {
20
- if (scheduledCallback !== null) {
21
- const currentTime = performance.now();
22
- deadline = currentTime + yieldInterval;
23
- const hasTimeRemaining = true;
24
- try {
25
- const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);
26
- if (!hasMoreWork) {
27
- scheduledCallback = null;
28
- } else port.postMessage(null);
29
- } catch (error) {
30
- port.postMessage(null);
31
- throw error;
32
- }
33
- }
34
- };
35
- if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {
36
- const scheduling = navigator.scheduling;
37
- shouldYieldToHost = () => {
38
- const currentTime = performance.now();
39
- if (currentTime >= deadline) {
40
- if (scheduling.isInputPending()) {
41
- return true;
42
- }
43
- return currentTime >= maxYieldInterval;
44
- } else {
45
- return false;
46
- }
47
- };
48
- } else {
49
- shouldYieldToHost = () => performance.now() >= deadline;
50
- }
51
- }
52
- function enqueue(taskQueue, task) {
53
- function findIndex() {
54
- let m = 0;
55
- let n = taskQueue.length - 1;
56
- while (m <= n) {
57
- const k = n + m >> 1;
58
- const cmp = task.expirationTime - taskQueue[k].expirationTime;
59
- if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;
60
- }
61
- return m;
62
- }
63
- taskQueue.splice(findIndex(), 0, task);
64
- }
65
- function requestCallback(fn, options) {
66
- if (!scheduleCallback) setupScheduler();
67
- let startTime = performance.now(),
68
- timeout = maxSigned31BitInt;
69
- if (options && options.timeout) timeout = options.timeout;
70
- const newTask = {
71
- id: taskIdCounter++,
72
- fn,
73
- startTime,
74
- expirationTime: startTime + timeout
75
- };
76
- enqueue(taskQueue, newTask);
77
- if (!isCallbackScheduled && !isPerformingWork) {
78
- isCallbackScheduled = true;
79
- scheduledCallback = flushWork;
80
- scheduleCallback();
81
- }
82
- return newTask;
83
- }
84
- function cancelCallback(task) {
85
- task.fn = null;
86
- }
87
- function flushWork(hasTimeRemaining, initialTime) {
88
- isCallbackScheduled = false;
89
- isPerformingWork = true;
90
- try {
91
- return workLoop(hasTimeRemaining, initialTime);
92
- } finally {
93
- currentTask = null;
94
- isPerformingWork = false;
95
- }
96
- }
97
- function workLoop(hasTimeRemaining, initialTime) {
98
- let currentTime = initialTime;
99
- currentTask = taskQueue[0] || null;
100
- while (currentTask !== null) {
101
- if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
102
- break;
103
- }
104
- const callback = currentTask.fn;
105
- if (callback !== null) {
106
- currentTask.fn = null;
107
- const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
108
- callback(didUserCallbackTimeout);
109
- currentTime = performance.now();
110
- if (currentTask === taskQueue[0]) {
111
- taskQueue.shift();
112
- }
113
- } else taskQueue.shift();
114
- currentTask = taskQueue[0] || null;
115
- }
116
- return currentTask !== null;
117
- }
118
-
119
- const sharedConfig = {
120
- context: undefined,
121
- registry: undefined,
122
- effects: undefined,
123
- done: false,
124
- getContextId() {
125
- return getContextId(this.context.count);
126
- },
127
- getNextContextId() {
128
- return getContextId(this.context.count++);
129
- }
130
- };
131
- function getContextId(count) {
132
- const num = String(count),
133
- len = num.length - 1;
134
- return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num;
135
- }
136
- function setHydrateContext(context) {
137
- sharedConfig.context = context;
138
- }
139
- function nextHydrateContext() {
140
- return {
141
- ...sharedConfig.context,
142
- id: sharedConfig.getNextContextId(),
143
- count: 0
144
- };
145
- }
3
+ var signals = require('@solidjs/signals');
146
4
 
147
- const equalFn = (a, b) => a === b;
148
- const $PROXY = Symbol("solid-proxy");
149
- const SUPPORTS_PROXY = typeof Proxy === "function";
150
- const $TRACK = Symbol("solid-track");
151
- const $DEVCOMP = Symbol("solid-dev-component");
152
- const signalOptions = {
153
- equals: equalFn
154
- };
155
- let ERROR = null;
156
- let runEffects = runQueue;
157
- const STALE = 1;
158
- const PENDING = 2;
159
- const UNOWNED = {
160
- owned: null,
161
- cleanups: null,
162
- context: null,
163
- owner: null
164
- };
165
- const NO_INIT = {};
166
- var Owner = null;
167
- let Transition = null;
168
- let Scheduler = null;
169
- let ExternalSourceConfig = null;
170
- let Listener = null;
171
- let Updates = null;
172
- let Effects = null;
173
- let ExecCount = 0;
174
- const DevHooks = {
175
- afterUpdate: null,
176
- afterCreateOwner: null,
177
- afterCreateSignal: null
178
- };
179
- function createRoot(fn, detachedOwner) {
180
- const listener = Listener,
181
- owner = Owner,
182
- unowned = fn.length === 0,
183
- current = detachedOwner === undefined ? owner : detachedOwner,
184
- root = unowned ? {
185
- owned: null,
186
- cleanups: null,
187
- context: null,
188
- owner: null
189
- } : {
190
- owned: null,
191
- cleanups: null,
192
- context: current ? current.context : null,
193
- owner: current
194
- },
195
- updateFn = unowned ? () => fn(() => {
196
- throw new Error("Dispose method must be an explicit argument to createRoot function");
197
- }) : () => fn(() => untrack(() => cleanNode(root)));
198
- DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
199
- Owner = root;
200
- Listener = null;
201
- try {
202
- return runUpdates(updateFn, true);
203
- } finally {
204
- Listener = listener;
205
- Owner = owner;
206
- }
207
- }
208
- function createSignal(value, options) {
209
- options = options ? Object.assign({}, signalOptions, options) : signalOptions;
210
- const s = {
211
- value,
212
- observers: null,
213
- observerSlots: null,
214
- comparator: options.equals || undefined
215
- };
216
- {
217
- if (options.name) s.name = options.name;
218
- if (DevHooks.afterCreateSignal) DevHooks.afterCreateSignal(s);
219
- if (!options.internal) registerGraph(s);
220
- }
221
- const setter = value => {
222
- if (typeof value === "function") {
223
- if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);
224
- }
225
- return writeSignal(s, value);
226
- };
227
- return [readSignal.bind(s), setter];
228
- }
229
- function createComputed(fn, value, options) {
230
- const c = createComputation(fn, value, true, STALE, options );
231
- if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
232
- }
233
- function createRenderEffect(fn, value, options) {
234
- const c = createComputation(fn, value, false, STALE, options );
235
- if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
236
- }
237
- function createEffect(fn, value, options) {
238
- runEffects = runUserEffects;
239
- const c = createComputation(fn, value, false, STALE, options ),
240
- s = SuspenseContext && useContext(SuspenseContext);
241
- if (s) c.suspense = s;
242
- if (!options || !options.render) c.user = true;
243
- Effects ? Effects.push(c) : updateComputation(c);
244
- }
245
- function createReaction(onInvalidate, options) {
246
- let fn;
247
- const c = createComputation(() => {
248
- fn ? fn() : untrack(onInvalidate);
249
- fn = undefined;
250
- }, undefined, false, 0, options ),
251
- s = SuspenseContext && useContext(SuspenseContext);
252
- if (s) c.suspense = s;
253
- c.user = true;
254
- return tracking => {
255
- fn = tracking;
256
- updateComputation(c);
257
- };
258
- }
259
- function createMemo(fn, value, options) {
260
- options = options ? Object.assign({}, signalOptions, options) : signalOptions;
261
- const c = createComputation(fn, value, true, 0, options );
262
- c.observers = null;
263
- c.observerSlots = null;
264
- c.comparator = options.equals || undefined;
265
- if (Scheduler && Transition && Transition.running) {
266
- c.tState = STALE;
267
- Updates.push(c);
268
- } else updateComputation(c);
269
- return readSignal.bind(c);
270
- }
271
- function isPromise(v) {
272
- return v && typeof v === "object" && "then" in v;
273
- }
274
- function createResource(pSource, pFetcher, pOptions) {
275
- let source;
276
- let fetcher;
277
- let options;
278
- if (arguments.length === 2 && typeof pFetcher === "object" || arguments.length === 1) {
279
- source = true;
280
- fetcher = pSource;
281
- options = pFetcher || {};
282
- } else {
283
- source = pSource;
284
- fetcher = pFetcher;
285
- options = pOptions || {};
286
- }
287
- let pr = null,
288
- initP = NO_INIT,
289
- id = null,
290
- loadedUnderTransition = false,
291
- scheduled = false,
292
- resolved = "initialValue" in options,
293
- dynamic = typeof source === "function" && createMemo(source);
294
- const contexts = new Set(),
295
- [value, setValue] = (options.storage || createSignal)(options.initialValue),
296
- [error, setError] = createSignal(undefined),
297
- [track, trigger] = createSignal(undefined, {
298
- equals: false
299
- }),
300
- [state, setState] = createSignal(resolved ? "ready" : "unresolved");
301
- if (sharedConfig.context) {
302
- id = sharedConfig.getNextContextId();
303
- if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
304
- }
305
- function loadEnd(p, v, error, key) {
306
- if (pr === p) {
307
- pr = null;
308
- key !== undefined && (resolved = true);
309
- if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
310
- value: v
311
- }));
312
- initP = NO_INIT;
313
- if (Transition && p && loadedUnderTransition) {
314
- Transition.promises.delete(p);
315
- loadedUnderTransition = false;
316
- runUpdates(() => {
317
- Transition.running = true;
318
- completeLoad(v, error);
319
- }, false);
320
- } else completeLoad(v, error);
321
- }
322
- return v;
323
- }
324
- function completeLoad(v, err) {
325
- runUpdates(() => {
326
- if (err === undefined) setValue(() => v);
327
- setState(err !== undefined ? "errored" : resolved ? "ready" : "unresolved");
328
- setError(err);
329
- for (const c of contexts.keys()) c.decrement();
330
- contexts.clear();
331
- }, false);
332
- }
333
- function read() {
334
- const c = SuspenseContext && useContext(SuspenseContext),
335
- v = value(),
336
- err = error();
337
- if (err !== undefined && !pr) throw err;
338
- if (Listener && !Listener.user && c) {
339
- createComputed(() => {
340
- track();
341
- if (pr) {
342
- if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {
343
- c.increment();
344
- contexts.add(c);
345
- }
346
- }
347
- });
348
- }
349
- return v;
350
- }
351
- function load(refetching = true) {
352
- if (refetching !== false && scheduled) return;
353
- scheduled = false;
354
- const lookup = dynamic ? dynamic() : source;
355
- loadedUnderTransition = Transition && Transition.running;
356
- if (lookup == null || lookup === false) {
357
- loadEnd(pr, untrack(value));
358
- return;
359
- }
360
- if (Transition && pr) Transition.promises.delete(pr);
361
- const p = initP !== NO_INIT ? initP : untrack(() => fetcher(lookup, {
362
- value: value(),
363
- refetching
364
- }));
365
- if (!isPromise(p)) {
366
- loadEnd(pr, p, undefined, lookup);
367
- return p;
368
- }
369
- pr = p;
370
- if ("value" in p) {
371
- if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);else loadEnd(pr, undefined, castError(p.value), lookup);
372
- return p;
373
- }
374
- scheduled = true;
375
- queueMicrotask(() => scheduled = false);
376
- runUpdates(() => {
377
- setState(resolved ? "refreshing" : "pending");
378
- trigger();
379
- }, false);
380
- return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
381
- }
382
- Object.defineProperties(read, {
383
- state: {
384
- get: () => state()
385
- },
386
- error: {
387
- get: () => error()
388
- },
389
- loading: {
390
- get() {
391
- const s = state();
392
- return s === "pending" || s === "refreshing";
393
- }
394
- },
395
- latest: {
396
- get() {
397
- if (!resolved) return read();
398
- const err = error();
399
- if (err && !pr) throw err;
400
- return value();
401
- }
402
- }
403
- });
404
- if (dynamic) createComputed(() => load(false));else load(false);
405
- return [read, {
406
- refetch: load,
407
- mutate: setValue
408
- }];
409
- }
410
- function createDeferred(source, options) {
411
- let t,
412
- timeout = options ? options.timeoutMs : undefined;
413
- const node = createComputation(() => {
414
- if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {
415
- timeout
416
- } : undefined);
417
- return source();
418
- }, undefined, true);
419
- const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);
420
- updateComputation(node);
421
- setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
422
- return deferred;
423
- }
424
- function createSelector(source, fn = equalFn, options) {
425
- const subs = new Map();
426
- const node = createComputation(p => {
427
- const v = source();
428
- for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {
429
- for (const c of val.values()) {
430
- c.state = STALE;
431
- if (c.pure) Updates.push(c);else Effects.push(c);
432
- }
433
- }
434
- return v;
435
- }, undefined, true, STALE, options );
436
- updateComputation(node);
437
- return key => {
438
- const listener = Listener;
439
- if (listener) {
440
- let l;
441
- if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
442
- onCleanup(() => {
443
- l.delete(listener);
444
- !l.size && subs.delete(key);
445
- });
446
- }
447
- return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
448
- };
449
- }
450
- function batch(fn) {
451
- return runUpdates(fn, false);
452
- }
453
- function untrack(fn) {
454
- if (!ExternalSourceConfig && Listener === null) return fn();
455
- const listener = Listener;
456
- Listener = null;
457
- try {
458
- if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
459
- return fn();
460
- } finally {
461
- Listener = listener;
462
- }
463
- }
464
- function on(deps, fn, options) {
465
- const isArray = Array.isArray(deps);
466
- let prevInput;
467
- let defer = options && options.defer;
468
- return prevValue => {
469
- let input;
470
- if (isArray) {
471
- input = Array(deps.length);
472
- for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
473
- } else input = deps();
474
- if (defer) {
475
- defer = false;
476
- return prevValue;
477
- }
478
- const result = untrack(() => fn(input, prevInput, prevValue));
479
- prevInput = input;
480
- return result;
481
- };
482
- }
5
+ const $DEVCOMP = Symbol("COMPONENT_DEV" );
483
6
  function onMount(fn) {
484
- createEffect(() => untrack(fn));
485
- }
486
- function onCleanup(fn) {
487
- if (Owner === null) console.warn("cleanups created outside a `createRoot` or `render` will never be run");else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);
488
- return fn;
489
- }
490
- function catchError(fn, handler) {
491
- ERROR || (ERROR = Symbol("error"));
492
- Owner = createComputation(undefined, undefined, true);
493
- Owner.context = {
494
- ...Owner.context,
495
- [ERROR]: [handler]
496
- };
497
- if (Transition && Transition.running) Transition.sources.add(Owner);
498
- try {
499
- return fn();
500
- } catch (err) {
501
- handleError(err);
502
- } finally {
503
- Owner = Owner.owner;
504
- }
505
- }
506
- function getListener() {
507
- return Listener;
508
- }
509
- function getOwner() {
510
- return Owner;
511
- }
512
- function runWithOwner(o, fn) {
513
- const prev = Owner;
514
- const prevListener = Listener;
515
- Owner = o;
516
- Listener = null;
517
- try {
518
- return runUpdates(fn, true);
519
- } catch (err) {
520
- handleError(err);
521
- } finally {
522
- Owner = prev;
523
- Listener = prevListener;
524
- }
525
- }
526
- function enableScheduling(scheduler = requestCallback) {
527
- Scheduler = scheduler;
528
- }
529
- function startTransition(fn) {
530
- if (Transition && Transition.running) {
531
- fn();
532
- return Transition.done;
533
- }
534
- const l = Listener;
535
- const o = Owner;
536
- return Promise.resolve().then(() => {
537
- Listener = l;
538
- Owner = o;
539
- let t;
540
- if (Scheduler || SuspenseContext) {
541
- t = Transition || (Transition = {
542
- sources: new Set(),
543
- effects: [],
544
- promises: new Set(),
545
- disposed: new Set(),
546
- queue: new Set(),
547
- running: true
548
- });
549
- t.done || (t.done = new Promise(res => t.resolve = res));
550
- t.running = true;
551
- }
552
- runUpdates(fn, false);
553
- Listener = Owner = null;
554
- return t ? t.done : undefined;
555
- });
556
- }
557
- const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
558
- function useTransition() {
559
- return [transPending, startTransition];
560
- }
561
- function resumeEffects(e) {
562
- Effects.push.apply(Effects, e);
563
- e.length = 0;
564
- }
565
- function devComponent(Comp, props) {
566
- const c = createComputation(() => untrack(() => {
567
- Object.assign(Comp, {
568
- [$DEVCOMP]: true
569
- });
570
- return Comp(props);
571
- }), undefined, true, 0);
572
- c.props = props;
573
- c.observers = null;
574
- c.observerSlots = null;
575
- c.name = Comp.name;
576
- c.component = Comp;
577
- updateComputation(c);
578
- return c.tValue !== undefined ? c.tValue : c.value;
579
- }
580
- function registerGraph(value) {
581
- if (!Owner) return;
582
- if (Owner.sourceMap) Owner.sourceMap.push(value);else Owner.sourceMap = [value];
583
- value.graph = Owner;
7
+ signals.createEffect(() => null, fn);
584
8
  }
585
9
  function createContext(defaultValue, options) {
586
- const id = Symbol("context");
587
- return {
588
- id,
589
- Provider: createProvider(id, options),
590
- defaultValue
591
- };
10
+ const id = Symbol(options && options.name || "");
11
+ function provider(props) {
12
+ return signals.createMemo(() => {
13
+ signals.setContext(provider, signals.untrack(() => props.value));
14
+ return children(() => props.children);
15
+ });
16
+ }
17
+ provider.id = id;
18
+ provider.defaultValue = defaultValue;
19
+ return provider;
592
20
  }
593
21
  function useContext(context) {
594
- let value;
595
- return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined ? value : context.defaultValue;
22
+ return signals.getContext(context);
596
23
  }
597
24
  function children(fn) {
598
- const children = createMemo(fn);
599
- const memo = createMemo(() => resolveChildren(children()), undefined, {
25
+ const children = signals.createMemo(fn);
26
+ const memo = signals.createMemo(() => signals.flatten(children()), undefined, {
600
27
  name: "children"
601
28
  }) ;
602
29
  memo.toArray = () => {
@@ -605,465 +32,25 @@ function children(fn) {
605
32
  };
606
33
  return memo;
607
34
  }
608
- let SuspenseContext;
609
- function getSuspenseContext() {
610
- return SuspenseContext || (SuspenseContext = createContext());
611
- }
612
- function enableExternalSource(factory, untrack = fn => fn()) {
613
- if (ExternalSourceConfig) {
614
- const {
615
- factory: oldFactory,
616
- untrack: oldUntrack
617
- } = ExternalSourceConfig;
618
- ExternalSourceConfig = {
619
- factory: (fn, trigger) => {
620
- const oldSource = oldFactory(fn, trigger);
621
- const source = factory(x => oldSource.track(x), trigger);
622
- return {
623
- track: x => source.track(x),
624
- dispose() {
625
- source.dispose();
626
- oldSource.dispose();
627
- }
628
- };
629
- },
630
- untrack: fn => oldUntrack(() => untrack(fn))
631
- };
632
- } else {
633
- ExternalSourceConfig = {
634
- factory,
635
- untrack
636
- };
637
- }
638
- }
639
- function readSignal() {
640
- const runningTransition = Transition && Transition.running;
641
- if (this.sources && (runningTransition ? this.tState : this.state)) {
642
- if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {
643
- const updates = Updates;
644
- Updates = null;
645
- runUpdates(() => lookUpstream(this), false);
646
- Updates = updates;
647
- }
648
- }
649
- if (Listener) {
650
- const sSlot = this.observers ? this.observers.length : 0;
651
- if (!Listener.sources) {
652
- Listener.sources = [this];
653
- Listener.sourceSlots = [sSlot];
654
- } else {
655
- Listener.sources.push(this);
656
- Listener.sourceSlots.push(sSlot);
657
- }
658
- if (!this.observers) {
659
- this.observers = [Listener];
660
- this.observerSlots = [Listener.sources.length - 1];
661
- } else {
662
- this.observers.push(Listener);
663
- this.observerSlots.push(Listener.sources.length - 1);
664
- }
665
- }
666
- if (runningTransition && Transition.sources.has(this)) return this.tValue;
667
- return this.value;
668
- }
669
- function writeSignal(node, value, isComp) {
670
- let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
671
- if (!node.comparator || !node.comparator(current, value)) {
672
- if (Transition) {
673
- const TransitionRunning = Transition.running;
674
- if (TransitionRunning || !isComp && Transition.sources.has(node)) {
675
- Transition.sources.add(node);
676
- node.tValue = value;
677
- }
678
- if (!TransitionRunning) node.value = value;
679
- } else node.value = value;
680
- if (node.observers && node.observers.length) {
681
- runUpdates(() => {
682
- for (let i = 0; i < node.observers.length; i += 1) {
683
- const o = node.observers[i];
684
- const TransitionRunning = Transition && Transition.running;
685
- if (TransitionRunning && Transition.disposed.has(o)) continue;
686
- if (TransitionRunning ? !o.tState : !o.state) {
687
- if (o.pure) Updates.push(o);else Effects.push(o);
688
- if (o.observers) markDownstream(o);
689
- }
690
- if (!TransitionRunning) o.state = STALE;else o.tState = STALE;
691
- }
692
- if (Updates.length > 10e5) {
693
- Updates = [];
694
- if (true) throw new Error("Potential Infinite Loop Detected.");
695
- throw new Error();
696
- }
697
- }, false);
698
- }
699
- }
700
- return value;
701
- }
702
- function updateComputation(node) {
703
- if (!node.fn) return;
704
- cleanNode(node);
705
- const time = ExecCount;
706
- runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
707
- if (Transition && !Transition.running && Transition.sources.has(node)) {
708
- queueMicrotask(() => {
709
- runUpdates(() => {
710
- Transition && (Transition.running = true);
711
- Listener = Owner = node;
712
- runComputation(node, node.tValue, time);
713
- Listener = Owner = null;
714
- }, false);
715
- });
716
- }
717
- }
718
- function runComputation(node, value, time) {
719
- let nextValue;
720
- const owner = Owner,
721
- listener = Listener;
722
- Listener = Owner = node;
723
- try {
724
- nextValue = node.fn(value);
725
- } catch (err) {
726
- if (node.pure) {
727
- if (Transition && Transition.running) {
728
- node.tState = STALE;
729
- node.tOwned && node.tOwned.forEach(cleanNode);
730
- node.tOwned = undefined;
731
- } else {
732
- node.state = STALE;
733
- node.owned && node.owned.forEach(cleanNode);
734
- node.owned = null;
735
- }
736
- }
737
- node.updatedAt = time + 1;
738
- return handleError(err);
739
- } finally {
740
- Listener = listener;
741
- Owner = owner;
742
- }
743
- if (!node.updatedAt || node.updatedAt <= time) {
744
- if (node.updatedAt != null && "observers" in node) {
745
- writeSignal(node, nextValue, true);
746
- } else if (Transition && Transition.running && node.pure) {
747
- Transition.sources.add(node);
748
- node.tValue = nextValue;
749
- } else node.value = nextValue;
750
- node.updatedAt = time;
751
- }
752
- }
753
- function createComputation(fn, init, pure, state = STALE, options) {
754
- const c = {
755
- fn,
756
- state: state,
757
- updatedAt: null,
758
- owned: null,
759
- sources: null,
760
- sourceSlots: null,
761
- cleanups: null,
762
- value: init,
763
- owner: Owner,
764
- context: Owner ? Owner.context : null,
765
- pure
766
- };
767
- if (Transition && Transition.running) {
768
- c.state = 0;
769
- c.tState = state;
770
- }
771
- if (Owner === null) console.warn("computations created outside a `createRoot` or `render` will never be disposed");else if (Owner !== UNOWNED) {
772
- if (Transition && Transition.running && Owner.pure) {
773
- if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);
774
- } else {
775
- if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);
776
- }
777
- }
778
- if (options && options.name) c.name = options.name;
779
- if (ExternalSourceConfig && c.fn) {
780
- const [track, trigger] = createSignal(undefined, {
781
- equals: false
782
- });
783
- const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
784
- onCleanup(() => ordinary.dispose());
785
- const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
786
- const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
787
- c.fn = x => {
788
- track();
789
- return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
790
- };
791
- }
792
- DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(c);
793
- return c;
794
- }
795
- function runTop(node) {
796
- const runningTransition = Transition && Transition.running;
797
- if ((runningTransition ? node.tState : node.state) === 0) return;
798
- if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
799
- if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
800
- const ancestors = [node];
801
- while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
802
- if (runningTransition && Transition.disposed.has(node)) return;
803
- if (runningTransition ? node.tState : node.state) ancestors.push(node);
804
- }
805
- for (let i = ancestors.length - 1; i >= 0; i--) {
806
- node = ancestors[i];
807
- if (runningTransition) {
808
- let top = node,
809
- prev = ancestors[i + 1];
810
- while ((top = top.owner) && top !== prev) {
811
- if (Transition.disposed.has(top)) return;
812
- }
813
- }
814
- if ((runningTransition ? node.tState : node.state) === STALE) {
815
- updateComputation(node);
816
- } else if ((runningTransition ? node.tState : node.state) === PENDING) {
817
- const updates = Updates;
818
- Updates = null;
819
- runUpdates(() => lookUpstream(node, ancestors[0]), false);
820
- Updates = updates;
821
- }
822
- }
823
- }
824
- function runUpdates(fn, init) {
825
- if (Updates) return fn();
826
- let wait = false;
827
- if (!init) Updates = [];
828
- if (Effects) wait = true;else Effects = [];
829
- ExecCount++;
830
- try {
831
- const res = fn();
832
- completeUpdates(wait);
833
- return res;
834
- } catch (err) {
835
- if (!wait) Effects = null;
836
- Updates = null;
837
- handleError(err);
838
- }
839
- }
840
- function completeUpdates(wait) {
841
- if (Updates) {
842
- if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);
843
- Updates = null;
844
- }
845
- if (wait) return;
846
- let res;
847
- if (Transition) {
848
- if (!Transition.promises.size && !Transition.queue.size) {
849
- const sources = Transition.sources;
850
- const disposed = Transition.disposed;
851
- Effects.push.apply(Effects, Transition.effects);
852
- res = Transition.resolve;
853
- for (const e of Effects) {
854
- "tState" in e && (e.state = e.tState);
855
- delete e.tState;
856
- }
857
- Transition = null;
858
- runUpdates(() => {
859
- for (const d of disposed) cleanNode(d);
860
- for (const v of sources) {
861
- v.value = v.tValue;
862
- if (v.owned) {
863
- for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
864
- }
865
- if (v.tOwned) v.owned = v.tOwned;
866
- delete v.tValue;
867
- delete v.tOwned;
868
- v.tState = 0;
869
- }
870
- setTransPending(false);
871
- }, false);
872
- } else if (Transition.running) {
873
- Transition.running = false;
874
- Transition.effects.push.apply(Transition.effects, Effects);
875
- Effects = null;
876
- setTransPending(true);
877
- return;
878
- }
879
- }
880
- const e = Effects;
881
- Effects = null;
882
- if (e.length) runUpdates(() => runEffects(e), false);else DevHooks.afterUpdate && DevHooks.afterUpdate();
883
- if (res) res();
884
- }
885
- function runQueue(queue) {
886
- for (let i = 0; i < queue.length; i++) runTop(queue[i]);
887
- }
888
- function scheduleQueue(queue) {
889
- for (let i = 0; i < queue.length; i++) {
890
- const item = queue[i];
891
- const tasks = Transition.queue;
892
- if (!tasks.has(item)) {
893
- tasks.add(item);
894
- Scheduler(() => {
895
- tasks.delete(item);
896
- runUpdates(() => {
897
- Transition.running = true;
898
- runTop(item);
899
- }, false);
900
- Transition && (Transition.running = false);
35
+ function devComponent(Comp, props) {
36
+ return signals.createRoot(() => {
37
+ const owner = signals.getOwner();
38
+ owner._props = props;
39
+ owner._name = Comp.name;
40
+ owner._component = Comp;
41
+ return signals.untrack(() => {
42
+ Object.assign(Comp, {
43
+ [$DEVCOMP]: true
901
44
  });
902
- }
903
- }
904
- }
905
- function runUserEffects(queue) {
906
- let i,
907
- userLength = 0;
908
- for (i = 0; i < queue.length; i++) {
909
- const e = queue[i];
910
- if (!e.user) runTop(e);else queue[userLength++] = e;
911
- }
912
- if (sharedConfig.context) {
913
- if (sharedConfig.count) {
914
- sharedConfig.effects || (sharedConfig.effects = []);
915
- sharedConfig.effects.push(...queue.slice(0, userLength));
916
- return;
917
- }
918
- setHydrateContext();
919
- }
920
- if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {
921
- queue = [...sharedConfig.effects, ...queue];
922
- userLength += sharedConfig.effects.length;
923
- delete sharedConfig.effects;
924
- }
925
- for (i = 0; i < userLength; i++) runTop(queue[i]);
926
- }
927
- function lookUpstream(node, ignore) {
928
- const runningTransition = Transition && Transition.running;
929
- if (runningTransition) node.tState = 0;else node.state = 0;
930
- for (let i = 0; i < node.sources.length; i += 1) {
931
- const source = node.sources[i];
932
- if (source.sources) {
933
- const state = runningTransition ? source.tState : source.state;
934
- if (state === STALE) {
935
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
936
- } else if (state === PENDING) lookUpstream(source, ignore);
937
- }
938
- }
939
- }
940
- function markDownstream(node) {
941
- const runningTransition = Transition && Transition.running;
942
- for (let i = 0; i < node.observers.length; i += 1) {
943
- const o = node.observers[i];
944
- if (runningTransition ? !o.tState : !o.state) {
945
- if (runningTransition) o.tState = PENDING;else o.state = PENDING;
946
- if (o.pure) Updates.push(o);else Effects.push(o);
947
- o.observers && markDownstream(o);
948
- }
949
- }
950
- }
951
- function cleanNode(node) {
952
- let i;
953
- if (node.sources) {
954
- while (node.sources.length) {
955
- const source = node.sources.pop(),
956
- index = node.sourceSlots.pop(),
957
- obs = source.observers;
958
- if (obs && obs.length) {
959
- const n = obs.pop(),
960
- s = source.observerSlots.pop();
961
- if (index < obs.length) {
962
- n.sourceSlots[s] = index;
963
- obs[index] = n;
964
- source.observerSlots[index] = s;
965
- }
966
- }
967
- }
968
- }
969
- if (node.tOwned) {
970
- for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
971
- delete node.tOwned;
972
- }
973
- if (Transition && Transition.running && node.pure) {
974
- reset(node, true);
975
- } else if (node.owned) {
976
- for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
977
- node.owned = null;
978
- }
979
- if (node.cleanups) {
980
- for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
981
- node.cleanups = null;
982
- }
983
- if (Transition && Transition.running) node.tState = 0;else node.state = 0;
984
- delete node.sourceMap;
985
- }
986
- function reset(node, top) {
987
- if (!top) {
988
- node.tState = 0;
989
- Transition.disposed.add(node);
990
- }
991
- if (node.owned) {
992
- for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
993
- }
994
- }
995
- function castError(err) {
996
- if (err instanceof Error) return err;
997
- return new Error(typeof err === "string" ? err : "Unknown error", {
998
- cause: err
45
+ return Comp(props);
46
+ });
999
47
  });
1000
48
  }
1001
- function runErrors(err, fns, owner) {
1002
- try {
1003
- for (const f of fns) f(err);
1004
- } catch (e) {
1005
- handleError(e, owner && owner.owner || null);
1006
- }
1007
- }
1008
- function handleError(err, owner = Owner) {
1009
- const fns = ERROR && owner && owner.context && owner.context[ERROR];
1010
- const error = castError(err);
1011
- if (!fns) throw error;
1012
- if (Effects) Effects.push({
1013
- fn() {
1014
- runErrors(error, fns, owner);
1015
- },
1016
- state: STALE
1017
- });else runErrors(error, fns, owner);
1018
- }
1019
- function resolveChildren(children) {
1020
- if (typeof children === "function" && !children.length) return resolveChildren(children());
1021
- if (Array.isArray(children)) {
1022
- const results = [];
1023
- for (let i = 0; i < children.length; i++) {
1024
- const result = resolveChildren(children[i]);
1025
- Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
1026
- }
1027
- return results;
1028
- }
1029
- return children;
1030
- }
1031
- function createProvider(id, options) {
1032
- return function provider(props) {
1033
- let res;
1034
- createRenderEffect(() => res = untrack(() => {
1035
- Owner.context = {
1036
- ...Owner.context,
1037
- [id]: props.value
1038
- };
1039
- return children(() => props.children);
1040
- }), undefined, options);
1041
- return res;
1042
- };
1043
- }
1044
- function onError(fn) {
1045
- ERROR || (ERROR = Symbol("error"));
1046
- if (Owner === null) console.warn("error handlers created outside a `createRoot` or `render` will never be run");else if (Owner.context === null || !Owner.context[ERROR]) {
1047
- Owner.context = {
1048
- ...Owner.context,
1049
- [ERROR]: [fn]
1050
- };
1051
- mutateContext(Owner, ERROR, [fn]);
1052
- } else Owner.context[ERROR].push(fn);
1053
- }
1054
- function mutateContext(o, key, value) {
1055
- if (o.owned) {
1056
- for (let i = 0; i < o.owned.length; i++) {
1057
- if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);
1058
- if (!o.owned[i].context) {
1059
- o.owned[i].context = o.context;
1060
- mutateContext(o.owned[i], key, value);
1061
- } else if (!o.owned[i].context[key]) {
1062
- o.owned[i].context[key] = value;
1063
- mutateContext(o.owned[i], key, value);
1064
- }
1065
- }
1066
- }
49
+ function registerGraph(value) {
50
+ const owner = signals.getOwner();
51
+ if (!owner) return;
52
+ if (owner.sourceMap) owner.sourceMap.push(value);else owner.sourceMap = [value];
53
+ value.graph = owner;
1067
54
  }
1068
55
 
1069
56
  function observable(input) {
@@ -1078,14 +65,13 @@ function observable(input) {
1078
65
  unsubscribe() {}
1079
66
  };
1080
67
  }
1081
- const dispose = createRoot(disposer => {
1082
- createEffect(() => {
1083
- const v = input();
1084
- untrack(() => handler(v));
68
+ const dispose = signals.createRoot(disposer => {
69
+ signals.createEffect(() => input(), v => {
70
+ handler(v);
1085
71
  });
1086
72
  return disposer;
1087
73
  });
1088
- if (getOwner()) onCleanup(dispose);
74
+ if (signals.getOwner()) signals.onCleanup(dispose);
1089
75
  return {
1090
76
  unsubscribe() {
1091
77
  dispose();
@@ -1098,181 +84,43 @@ function observable(input) {
1098
84
  };
1099
85
  }
1100
86
  function from(producer) {
1101
- const [s, set] = createSignal(undefined, {
87
+ const [s, set] = signals.createSignal(undefined, {
1102
88
  equals: false
1103
89
  });
1104
90
  if ("subscribe" in producer) {
1105
91
  const unsub = producer.subscribe(v => set(() => v));
1106
- onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
92
+ signals.onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
1107
93
  } else {
1108
94
  const clean = producer(set);
1109
- onCleanup(clean);
95
+ signals.onCleanup(clean);
1110
96
  }
1111
97
  return s;
1112
98
  }
1113
99
 
1114
- const FALLBACK = Symbol("fallback");
1115
- function dispose(d) {
1116
- for (let i = 0; i < d.length; i++) d[i]();
100
+ const sharedConfig = {
101
+ context: undefined,
102
+ registry: undefined,
103
+ done: false,
104
+ getContextId() {
105
+ return getContextId(this.context.count);
106
+ },
107
+ getNextContextId() {
108
+ return getContextId(this.context.count++);
109
+ }
110
+ };
111
+ function getContextId(count) {
112
+ const num = String(count),
113
+ len = num.length - 1;
114
+ return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num;
1117
115
  }
1118
- function mapArray(list, mapFn, options = {}) {
1119
- let items = [],
1120
- mapped = [],
1121
- disposers = [],
1122
- len = 0,
1123
- indexes = mapFn.length > 1 ? [] : null;
1124
- onCleanup(() => dispose(disposers));
1125
- return () => {
1126
- let newItems = list() || [],
1127
- newLen = newItems.length,
1128
- i,
1129
- j;
1130
- newItems[$TRACK];
1131
- return untrack(() => {
1132
- let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
1133
- if (newLen === 0) {
1134
- if (len !== 0) {
1135
- dispose(disposers);
1136
- disposers = [];
1137
- items = [];
1138
- mapped = [];
1139
- len = 0;
1140
- indexes && (indexes = []);
1141
- }
1142
- if (options.fallback) {
1143
- items = [FALLBACK];
1144
- mapped[0] = createRoot(disposer => {
1145
- disposers[0] = disposer;
1146
- return options.fallback();
1147
- });
1148
- len = 1;
1149
- }
1150
- }
1151
- else if (len === 0) {
1152
- mapped = new Array(newLen);
1153
- for (j = 0; j < newLen; j++) {
1154
- items[j] = newItems[j];
1155
- mapped[j] = createRoot(mapper);
1156
- }
1157
- len = newLen;
1158
- } else {
1159
- temp = new Array(newLen);
1160
- tempdisposers = new Array(newLen);
1161
- indexes && (tempIndexes = new Array(newLen));
1162
- for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
1163
- for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
1164
- temp[newEnd] = mapped[end];
1165
- tempdisposers[newEnd] = disposers[end];
1166
- indexes && (tempIndexes[newEnd] = indexes[end]);
1167
- }
1168
- newIndices = new Map();
1169
- newIndicesNext = new Array(newEnd + 1);
1170
- for (j = newEnd; j >= start; j--) {
1171
- item = newItems[j];
1172
- i = newIndices.get(item);
1173
- newIndicesNext[j] = i === undefined ? -1 : i;
1174
- newIndices.set(item, j);
1175
- }
1176
- for (i = start; i <= end; i++) {
1177
- item = items[i];
1178
- j = newIndices.get(item);
1179
- if (j !== undefined && j !== -1) {
1180
- temp[j] = mapped[i];
1181
- tempdisposers[j] = disposers[i];
1182
- indexes && (tempIndexes[j] = indexes[i]);
1183
- j = newIndicesNext[j];
1184
- newIndices.set(item, j);
1185
- } else disposers[i]();
1186
- }
1187
- for (j = start; j < newLen; j++) {
1188
- if (j in temp) {
1189
- mapped[j] = temp[j];
1190
- disposers[j] = tempdisposers[j];
1191
- if (indexes) {
1192
- indexes[j] = tempIndexes[j];
1193
- indexes[j](j);
1194
- }
1195
- } else mapped[j] = createRoot(mapper);
1196
- }
1197
- mapped = mapped.slice(0, len = newLen);
1198
- items = newItems.slice(0);
1199
- }
1200
- return mapped;
1201
- });
1202
- function mapper(disposer) {
1203
- disposers[j] = disposer;
1204
- if (indexes) {
1205
- const [s, set] = createSignal(j, {
1206
- name: "index"
1207
- }) ;
1208
- indexes[j] = set;
1209
- return mapFn(newItems[j], s);
1210
- }
1211
- return mapFn(newItems[j]);
1212
- }
1213
- };
116
+ function setHydrateContext(context) {
117
+ sharedConfig.context = context;
1214
118
  }
1215
- function indexArray(list, mapFn, options = {}) {
1216
- let items = [],
1217
- mapped = [],
1218
- disposers = [],
1219
- signals = [],
1220
- len = 0,
1221
- i;
1222
- onCleanup(() => dispose(disposers));
1223
- return () => {
1224
- const newItems = list() || [],
1225
- newLen = newItems.length;
1226
- newItems[$TRACK];
1227
- return untrack(() => {
1228
- if (newLen === 0) {
1229
- if (len !== 0) {
1230
- dispose(disposers);
1231
- disposers = [];
1232
- items = [];
1233
- mapped = [];
1234
- len = 0;
1235
- signals = [];
1236
- }
1237
- if (options.fallback) {
1238
- items = [FALLBACK];
1239
- mapped[0] = createRoot(disposer => {
1240
- disposers[0] = disposer;
1241
- return options.fallback();
1242
- });
1243
- len = 1;
1244
- }
1245
- return mapped;
1246
- }
1247
- if (items[0] === FALLBACK) {
1248
- disposers[0]();
1249
- disposers = [];
1250
- items = [];
1251
- mapped = [];
1252
- len = 0;
1253
- }
1254
- for (i = 0; i < newLen; i++) {
1255
- if (i < items.length && items[i] !== newItems[i]) {
1256
- signals[i](() => newItems[i]);
1257
- } else if (i >= items.length) {
1258
- mapped[i] = createRoot(mapper);
1259
- }
1260
- }
1261
- for (; i < items.length; i++) {
1262
- disposers[i]();
1263
- }
1264
- len = signals.length = disposers.length = newLen;
1265
- items = newItems.slice(0);
1266
- return mapped = mapped.slice(0, len);
1267
- });
1268
- function mapper(disposer) {
1269
- disposers[i] = disposer;
1270
- const [s, set] = createSignal(newItems[i], {
1271
- name: "value"
1272
- }) ;
1273
- signals[i] = set;
1274
- return mapFn(s, i);
1275
- }
119
+ function nextHydrateContext() {
120
+ return {
121
+ ...sharedConfig.context,
122
+ id: sharedConfig.getNextContextId(),
123
+ count: 0
1276
124
  };
1277
125
  }
1278
126
 
@@ -1292,161 +140,13 @@ function createComponent(Comp, props) {
1292
140
  }
1293
141
  return devComponent(Comp, props || {});
1294
142
  }
1295
- function trueFn() {
1296
- return true;
1297
- }
1298
- const propTraps = {
1299
- get(_, property, receiver) {
1300
- if (property === $PROXY) return receiver;
1301
- return _.get(property);
1302
- },
1303
- has(_, property) {
1304
- if (property === $PROXY) return true;
1305
- return _.has(property);
1306
- },
1307
- set: trueFn,
1308
- deleteProperty: trueFn,
1309
- getOwnPropertyDescriptor(_, property) {
1310
- return {
1311
- configurable: true,
1312
- enumerable: true,
1313
- get() {
1314
- return _.get(property);
1315
- },
1316
- set: trueFn,
1317
- deleteProperty: trueFn
1318
- };
1319
- },
1320
- ownKeys(_) {
1321
- return _.keys();
1322
- }
1323
- };
1324
- function resolveSource(s) {
1325
- return !(s = typeof s === "function" ? s() : s) ? {} : s;
1326
- }
1327
- function resolveSources() {
1328
- for (let i = 0, length = this.length; i < length; ++i) {
1329
- const v = this[i]();
1330
- if (v !== undefined) return v;
1331
- }
1332
- }
1333
- function mergeProps(...sources) {
1334
- let proxy = false;
1335
- for (let i = 0; i < sources.length; i++) {
1336
- const s = sources[i];
1337
- proxy = proxy || !!s && $PROXY in s;
1338
- sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1339
- }
1340
- if (SUPPORTS_PROXY && proxy) {
1341
- return new Proxy({
1342
- get(property) {
1343
- for (let i = sources.length - 1; i >= 0; i--) {
1344
- const v = resolveSource(sources[i])[property];
1345
- if (v !== undefined) return v;
1346
- }
1347
- },
1348
- has(property) {
1349
- for (let i = sources.length - 1; i >= 0; i--) {
1350
- if (property in resolveSource(sources[i])) return true;
1351
- }
1352
- return false;
1353
- },
1354
- keys() {
1355
- const keys = [];
1356
- for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
1357
- return [...new Set(keys)];
1358
- }
1359
- }, propTraps);
1360
- }
1361
- const sourcesMap = {};
1362
- const defined = Object.create(null);
1363
- for (let i = sources.length - 1; i >= 0; i--) {
1364
- const source = sources[i];
1365
- if (!source) continue;
1366
- const sourceKeys = Object.getOwnPropertyNames(source);
1367
- for (let i = sourceKeys.length - 1; i >= 0; i--) {
1368
- const key = sourceKeys[i];
1369
- if (key === "__proto__" || key === "constructor") continue;
1370
- const desc = Object.getOwnPropertyDescriptor(source, key);
1371
- if (!defined[key]) {
1372
- defined[key] = desc.get ? {
1373
- enumerable: true,
1374
- configurable: true,
1375
- get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
1376
- } : desc.value !== undefined ? desc : undefined;
1377
- } else {
1378
- const sources = sourcesMap[key];
1379
- if (sources) {
1380
- if (desc.get) sources.push(desc.get.bind(source));else if (desc.value !== undefined) sources.push(() => desc.value);
1381
- }
1382
- }
1383
- }
1384
- }
1385
- const target = {};
1386
- const definedKeys = Object.keys(defined);
1387
- for (let i = definedKeys.length - 1; i >= 0; i--) {
1388
- const key = definedKeys[i],
1389
- desc = defined[key];
1390
- if (desc && desc.get) Object.defineProperty(target, key, desc);else target[key] = desc ? desc.value : undefined;
1391
- }
1392
- return target;
1393
- }
1394
- function splitProps(props, ...keys) {
1395
- if (SUPPORTS_PROXY && $PROXY in props) {
1396
- const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1397
- const res = keys.map(k => {
1398
- return new Proxy({
1399
- get(property) {
1400
- return k.includes(property) ? props[property] : undefined;
1401
- },
1402
- has(property) {
1403
- return k.includes(property) && property in props;
1404
- },
1405
- keys() {
1406
- return k.filter(property => property in props);
1407
- }
1408
- }, propTraps);
1409
- });
1410
- res.push(new Proxy({
1411
- get(property) {
1412
- return blocked.has(property) ? undefined : props[property];
1413
- },
1414
- has(property) {
1415
- return blocked.has(property) ? false : property in props;
1416
- },
1417
- keys() {
1418
- return Object.keys(props).filter(k => !blocked.has(k));
1419
- }
1420
- }, propTraps));
1421
- return res;
1422
- }
1423
- const otherObject = {};
1424
- const objects = keys.map(() => ({}));
1425
- for (const propName of Object.getOwnPropertyNames(props)) {
1426
- const desc = Object.getOwnPropertyDescriptor(props, propName);
1427
- const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1428
- let blocked = false;
1429
- let objectIndex = 0;
1430
- for (const k of keys) {
1431
- if (k.includes(propName)) {
1432
- blocked = true;
1433
- isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
1434
- }
1435
- ++objectIndex;
1436
- }
1437
- if (!blocked) {
1438
- isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
1439
- }
1440
- }
1441
- return [...objects, otherObject];
1442
- }
1443
143
  function lazy(fn) {
1444
144
  let comp;
1445
145
  let p;
1446
146
  const wrap = props => {
1447
147
  const ctx = sharedConfig.context;
1448
148
  if (ctx) {
1449
- const [s, set] = createSignal();
149
+ const [s, set] = signals.createSignal();
1450
150
  sharedConfig.count || (sharedConfig.count = 0);
1451
151
  sharedConfig.count++;
1452
152
  (p || (p = fn())).then(mod => {
@@ -1457,12 +157,12 @@ function lazy(fn) {
1457
157
  });
1458
158
  comp = s;
1459
159
  } else if (!comp) {
1460
- const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));
160
+ const s = signals.createAsync(() => (p || (p = fn())).then(mod => mod.default));
1461
161
  comp = s;
1462
162
  }
1463
163
  let Comp;
1464
- return createMemo(() => (Comp = comp()) ? untrack(() => {
1465
- if (true) Object.assign(Comp, {
164
+ return signals.createMemo(() => (Comp = comp()) ? signals.untrack(() => {
165
+ Object.assign(Comp, {
1466
166
  [$DEVCOMP]: true
1467
167
  });
1468
168
  if (!ctx || sharedConfig.done) return Comp(props);
@@ -1484,34 +184,37 @@ function createUniqueId() {
1484
184
 
1485
185
  const narrowedError = name => `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.` ;
1486
186
  function For(props) {
1487
- const fallback = "fallback" in props && {
187
+ const options = "fallback" in props ? {
188
+ keyed: props.keyed,
1488
189
  fallback: () => props.fallback
190
+ } : {
191
+ keyed: props.keyed
1489
192
  };
1490
- return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
193
+ return signals.createMemo(signals.mapArray(() => props.each, props.children, options), undefined, {
1491
194
  name: "value"
1492
195
  }) ;
1493
196
  }
1494
- function Index(props) {
1495
- const fallback = "fallback" in props && {
197
+ function Repeat(props) {
198
+ const options = "fallback" in props ? {
1496
199
  fallback: () => props.fallback
1497
- };
1498
- return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
200
+ } : {};
201
+ return signals.createMemo(signals.repeat(() => props.count, index => typeof props.children === "function" ? props.children(index) : props.children, options), undefined, {
1499
202
  name: "value"
1500
203
  }) ;
1501
204
  }
1502
205
  function Show(props) {
1503
206
  const keyed = props.keyed;
1504
- const condition = createMemo(() => props.when, undefined, {
207
+ const condition = signals.createMemo(() => props.when, undefined, {
1505
208
  equals: (a, b) => keyed ? a === b : !a === !b,
1506
209
  name: "condition"
1507
210
  } );
1508
- return createMemo(() => {
211
+ return signals.createMemo(() => {
1509
212
  const c = condition();
1510
213
  if (c) {
1511
214
  const child = props.children;
1512
215
  const fn = typeof child === "function" && child.length > 0;
1513
- return fn ? untrack(() => child(keyed ? c : () => {
1514
- if (!untrack(condition)) throw narrowedError("Show");
216
+ return fn ? signals.untrack(() => child(() => {
217
+ if (!signals.untrack(condition)) throw narrowedError("Show");
1515
218
  return props.when;
1516
219
  })) : child;
1517
220
  }
@@ -1524,7 +227,7 @@ function Switch(props) {
1524
227
  let keyed = false;
1525
228
  const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
1526
229
  const conditions = children(() => props.children),
1527
- evalConditions = createMemo(() => {
230
+ evalConditions = signals.createMemo(() => {
1528
231
  let conds = conditions();
1529
232
  if (!Array.isArray(conds)) conds = [conds];
1530
233
  for (let i = 0; i < conds.length; i++) {
@@ -1539,13 +242,13 @@ function Switch(props) {
1539
242
  equals,
1540
243
  name: "eval conditions"
1541
244
  } );
1542
- return createMemo(() => {
245
+ return signals.createMemo(() => {
1543
246
  const [index, when, cond] = evalConditions();
1544
247
  if (index < 0) return props.fallback;
1545
248
  const c = cond.children;
1546
249
  const fn = typeof c === "function" && c.length > 0;
1547
- return fn ? untrack(() => c(keyed ? when : () => {
1548
- if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
250
+ return fn ? signals.untrack(() => c(() => {
251
+ if (signals.untrack(evalConditions)[0] !== index) throw narrowedError("Match");
1549
252
  return cond.when;
1550
253
  })) : c;
1551
254
  }, undefined, {
@@ -1555,260 +258,167 @@ function Switch(props) {
1555
258
  function Match(props) {
1556
259
  return props;
1557
260
  }
1558
- let Errors;
1559
- function resetErrorBoundaries() {
1560
- Errors && [...Errors].forEach(fn => fn());
1561
- }
1562
261
  function ErrorBoundary(props) {
1563
- let err;
1564
- if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.getContextId());
1565
- const [errored, setErrored] = createSignal(err, {
1566
- name: "errored"
1567
- } );
1568
- Errors || (Errors = new Set());
1569
- Errors.add(setErrored);
1570
- onCleanup(() => Errors.delete(setErrored));
1571
- return createMemo(() => {
1572
- let e;
1573
- if (e = errored()) {
1574
- const f = props.fallback;
1575
- if ((typeof f !== "function" || f.length == 0)) console.error(e);
1576
- return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1577
- }
1578
- return catchError(() => props.children, setErrored);
1579
- }, undefined, {
1580
- name: "value"
1581
- } );
1582
- }
1583
-
1584
- const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
1585
- const SuspenseListContext = /* #__PURE__ */createContext();
1586
- function SuspenseList(props) {
1587
- let [wrapper, setWrapper] = createSignal(() => ({
1588
- inFallback: false
1589
- })),
1590
- show;
1591
- const listContext = useContext(SuspenseListContext);
1592
- const [registry, setRegistry] = createSignal([]);
1593
- if (listContext) {
1594
- show = listContext.register(createMemo(() => wrapper()().inFallback));
1595
- }
1596
- const resolved = createMemo(prev => {
1597
- const reveal = props.revealOrder,
1598
- tail = props.tail,
1599
- {
1600
- showContent = true,
1601
- showFallback = true
1602
- } = show ? show() : {},
1603
- reg = registry(),
1604
- reverse = reveal === "backwards";
1605
- if (reveal === "together") {
1606
- const all = reg.every(inFallback => !inFallback());
1607
- const res = reg.map(() => ({
1608
- showContent: all && showContent,
1609
- showFallback
1610
- }));
1611
- res.inFallback = !all;
1612
- return res;
1613
- }
1614
- let stop = false;
1615
- let inFallback = prev.inFallback;
1616
- const res = [];
1617
- for (let i = 0, len = reg.length; i < len; i++) {
1618
- const n = reverse ? len - i - 1 : i,
1619
- s = reg[n]();
1620
- if (!stop && !s) {
1621
- res[n] = {
1622
- showContent,
1623
- showFallback
1624
- };
1625
- } else {
1626
- const next = !stop;
1627
- if (next) inFallback = true;
1628
- res[n] = {
1629
- showContent: next,
1630
- showFallback: !tail || next && tail === "collapsed" ? showFallback : false
1631
- };
1632
- stop = true;
1633
- }
1634
- }
1635
- if (!stop) inFallback = false;
1636
- res.inFallback = inFallback;
1637
- return res;
1638
- }, {
1639
- inFallback: false
1640
- });
1641
- setWrapper(() => resolved);
1642
- return createComponent(SuspenseListContext.Provider, {
1643
- value: {
1644
- register: inFallback => {
1645
- let index;
1646
- setRegistry(registry => {
1647
- index = registry.length;
1648
- return [...registry, inFallback];
1649
- });
1650
- return createMemo(() => resolved()[index], undefined, {
1651
- equals: suspenseListEquals
1652
- });
1653
- }
1654
- },
1655
- get children() {
1656
- return props.children;
1657
- }
262
+ return signals.createErrorBoundary(() => props.children, (err, reset) => {
263
+ const f = props.fallback;
264
+ if ((typeof f !== "function" || f.length == 0)) console.error(err);
265
+ return typeof f === "function" && f.length ? f(err, reset) : f;
1658
266
  });
1659
267
  }
1660
268
  function Suspense(props) {
1661
- let counter = 0,
1662
- show,
1663
- ctx,
1664
- p,
1665
- flicker,
1666
- error;
1667
- const [inFallback, setFallback] = createSignal(false),
1668
- SuspenseContext = getSuspenseContext(),
1669
- store = {
1670
- increment: () => {
1671
- if (++counter === 1) setFallback(true);
1672
- },
1673
- decrement: () => {
1674
- if (--counter === 0) setFallback(false);
1675
- },
1676
- inFallback,
1677
- effects: [],
1678
- resolved: false
1679
- },
1680
- owner = getOwner();
1681
- if (sharedConfig.context && sharedConfig.load) {
1682
- const key = sharedConfig.getContextId();
1683
- let ref = sharedConfig.load(key);
1684
- if (ref) {
1685
- if (typeof ref !== "object" || ref.status !== "success") p = ref;else sharedConfig.gather(key);
1686
- }
1687
- if (p && p !== "$$f") {
1688
- const [s, set] = createSignal(undefined, {
1689
- equals: false
1690
- });
1691
- flicker = s;
1692
- p.then(() => {
1693
- if (sharedConfig.done) return set();
1694
- sharedConfig.gather(key);
1695
- setHydrateContext(ctx);
1696
- set();
1697
- setHydrateContext();
1698
- }, err => {
1699
- error = err;
1700
- set();
1701
- });
1702
- }
1703
- }
1704
- const listContext = useContext(SuspenseListContext);
1705
- if (listContext) show = listContext.register(store.inFallback);
1706
- let dispose;
1707
- onCleanup(() => dispose && dispose());
1708
- return createComponent(SuspenseContext.Provider, {
1709
- value: store,
1710
- get children() {
1711
- return createMemo(() => {
1712
- if (error) throw error;
1713
- ctx = sharedConfig.context;
1714
- if (flicker) {
1715
- flicker();
1716
- return flicker = undefined;
1717
- }
1718
- if (ctx && p === "$$f") setHydrateContext();
1719
- const rendered = createMemo(() => props.children);
1720
- return createMemo(prev => {
1721
- const inFallback = store.inFallback(),
1722
- {
1723
- showContent = true,
1724
- showFallback = true
1725
- } = show ? show() : {};
1726
- if ((!inFallback || p && p !== "$$f") && showContent) {
1727
- store.resolved = true;
1728
- dispose && dispose();
1729
- dispose = ctx = p = undefined;
1730
- resumeEffects(store.effects);
1731
- return rendered();
1732
- }
1733
- if (!showFallback) return;
1734
- if (dispose) return prev;
1735
- return createRoot(disposer => {
1736
- dispose = disposer;
1737
- if (ctx) {
1738
- setHydrateContext({
1739
- id: ctx.id + "F",
1740
- count: 0
1741
- });
1742
- ctx = undefined;
1743
- }
1744
- return props.fallback;
1745
- }, owner);
1746
- });
1747
- });
1748
- }
1749
- });
269
+ return signals.createSuspense(() => props.children, () => props.fallback);
1750
270
  }
1751
271
 
272
+ const DevHooks = {};
1752
273
  const DEV = {
1753
274
  hooks: DevHooks,
1754
- writeSignal,
1755
275
  registerGraph
1756
276
  } ;
1757
277
  if (globalThis) {
1758
278
  if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
1759
279
  }
1760
280
 
281
+ Object.defineProperty(exports, "$PROXY", {
282
+ enumerable: true,
283
+ get: function () { return signals.$PROXY; }
284
+ });
285
+ Object.defineProperty(exports, "$RAW", {
286
+ enumerable: true,
287
+ get: function () { return signals.$RAW; }
288
+ });
289
+ Object.defineProperty(exports, "$TRACK", {
290
+ enumerable: true,
291
+ get: function () { return signals.$TRACK; }
292
+ });
293
+ Object.defineProperty(exports, "catchError", {
294
+ enumerable: true,
295
+ get: function () { return signals.catchError; }
296
+ });
297
+ Object.defineProperty(exports, "createAsync", {
298
+ enumerable: true,
299
+ get: function () { return signals.createAsync; }
300
+ });
301
+ Object.defineProperty(exports, "createEffect", {
302
+ enumerable: true,
303
+ get: function () { return signals.createEffect; }
304
+ });
305
+ Object.defineProperty(exports, "createMemo", {
306
+ enumerable: true,
307
+ get: function () { return signals.createMemo; }
308
+ });
309
+ Object.defineProperty(exports, "createProjection", {
310
+ enumerable: true,
311
+ get: function () { return signals.createProjection; }
312
+ });
313
+ Object.defineProperty(exports, "createReaction", {
314
+ enumerable: true,
315
+ get: function () { return signals.createReaction; }
316
+ });
317
+ Object.defineProperty(exports, "createRenderEffect", {
318
+ enumerable: true,
319
+ get: function () { return signals.createRenderEffect; }
320
+ });
321
+ Object.defineProperty(exports, "createRoot", {
322
+ enumerable: true,
323
+ get: function () { return signals.createRoot; }
324
+ });
325
+ Object.defineProperty(exports, "createSignal", {
326
+ enumerable: true,
327
+ get: function () { return signals.createSignal; }
328
+ });
329
+ Object.defineProperty(exports, "createStore", {
330
+ enumerable: true,
331
+ get: function () { return signals.createStore; }
332
+ });
333
+ Object.defineProperty(exports, "flatten", {
334
+ enumerable: true,
335
+ get: function () { return signals.flatten; }
336
+ });
337
+ Object.defineProperty(exports, "flushSync", {
338
+ enumerable: true,
339
+ get: function () { return signals.flushSync; }
340
+ });
341
+ Object.defineProperty(exports, "getObserver", {
342
+ enumerable: true,
343
+ get: function () { return signals.getObserver; }
344
+ });
345
+ Object.defineProperty(exports, "getOwner", {
346
+ enumerable: true,
347
+ get: function () { return signals.getOwner; }
348
+ });
349
+ Object.defineProperty(exports, "isEqual", {
350
+ enumerable: true,
351
+ get: function () { return signals.isEqual; }
352
+ });
353
+ Object.defineProperty(exports, "isStale", {
354
+ enumerable: true,
355
+ get: function () { return signals.isStale; }
356
+ });
357
+ Object.defineProperty(exports, "isWrappable", {
358
+ enumerable: true,
359
+ get: function () { return signals.isWrappable; }
360
+ });
361
+ Object.defineProperty(exports, "latest", {
362
+ enumerable: true,
363
+ get: function () { return signals.latest; }
364
+ });
365
+ Object.defineProperty(exports, "mapArray", {
366
+ enumerable: true,
367
+ get: function () { return signals.mapArray; }
368
+ });
369
+ Object.defineProperty(exports, "merge", {
370
+ enumerable: true,
371
+ get: function () { return signals.merge; }
372
+ });
373
+ Object.defineProperty(exports, "omit", {
374
+ enumerable: true,
375
+ get: function () { return signals.omit; }
376
+ });
377
+ Object.defineProperty(exports, "onCleanup", {
378
+ enumerable: true,
379
+ get: function () { return signals.onCleanup; }
380
+ });
381
+ Object.defineProperty(exports, "reconcile", {
382
+ enumerable: true,
383
+ get: function () { return signals.reconcile; }
384
+ });
385
+ Object.defineProperty(exports, "repeat", {
386
+ enumerable: true,
387
+ get: function () { return signals.repeat; }
388
+ });
389
+ Object.defineProperty(exports, "resolve", {
390
+ enumerable: true,
391
+ get: function () { return signals.resolve; }
392
+ });
393
+ Object.defineProperty(exports, "runWithOwner", {
394
+ enumerable: true,
395
+ get: function () { return signals.runWithOwner; }
396
+ });
397
+ Object.defineProperty(exports, "untrack", {
398
+ enumerable: true,
399
+ get: function () { return signals.untrack; }
400
+ });
401
+ Object.defineProperty(exports, "unwrap", {
402
+ enumerable: true,
403
+ get: function () { return signals.unwrap; }
404
+ });
1761
405
  exports.$DEVCOMP = $DEVCOMP;
1762
- exports.$PROXY = $PROXY;
1763
- exports.$TRACK = $TRACK;
1764
406
  exports.DEV = DEV;
1765
407
  exports.ErrorBoundary = ErrorBoundary;
1766
408
  exports.For = For;
1767
- exports.Index = Index;
1768
409
  exports.Match = Match;
410
+ exports.Repeat = Repeat;
1769
411
  exports.Show = Show;
1770
412
  exports.Suspense = Suspense;
1771
- exports.SuspenseList = SuspenseList;
1772
413
  exports.Switch = Switch;
1773
- exports.batch = batch;
1774
- exports.cancelCallback = cancelCallback;
1775
- exports.catchError = catchError;
1776
414
  exports.children = children;
1777
415
  exports.createComponent = createComponent;
1778
- exports.createComputed = createComputed;
1779
416
  exports.createContext = createContext;
1780
- exports.createDeferred = createDeferred;
1781
- exports.createEffect = createEffect;
1782
- exports.createMemo = createMemo;
1783
- exports.createReaction = createReaction;
1784
- exports.createRenderEffect = createRenderEffect;
1785
- exports.createResource = createResource;
1786
- exports.createRoot = createRoot;
1787
- exports.createSelector = createSelector;
1788
- exports.createSignal = createSignal;
1789
417
  exports.createUniqueId = createUniqueId;
1790
- exports.enableExternalSource = enableExternalSource;
1791
418
  exports.enableHydration = enableHydration;
1792
- exports.enableScheduling = enableScheduling;
1793
- exports.equalFn = equalFn;
1794
419
  exports.from = from;
1795
- exports.getListener = getListener;
1796
- exports.getOwner = getOwner;
1797
- exports.indexArray = indexArray;
1798
420
  exports.lazy = lazy;
1799
- exports.mapArray = mapArray;
1800
- exports.mergeProps = mergeProps;
1801
421
  exports.observable = observable;
1802
- exports.on = on;
1803
- exports.onCleanup = onCleanup;
1804
- exports.onError = onError;
1805
422
  exports.onMount = onMount;
1806
- exports.requestCallback = requestCallback;
1807
- exports.resetErrorBoundaries = resetErrorBoundaries;
1808
- exports.runWithOwner = runWithOwner;
1809
423
  exports.sharedConfig = sharedConfig;
1810
- exports.splitProps = splitProps;
1811
- exports.startTransition = startTransition;
1812
- exports.untrack = untrack;
1813
424
  exports.useContext = useContext;
1814
- exports.useTransition = useTransition;