solid-js 2.0.0-beta.5 → 2.0.0-beta.7

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/solid.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, createOwner, runWithOwner, createEffect as createEffect$1, createErrorBoundary as createErrorBoundary$1, createLoadingBoundary as createLoadingBoundary$1, getOwner, onCleanup, isDisposed, createOptimistic as createOptimistic$1, createOptimisticStore as createOptimisticStore$1, createProjection as createProjection$1, createRenderEffect as createRenderEffect$1, createSignal as createSignal$1, createStore as createStore$1, setSnapshotCapture, releaseSnapshotScope, getNextChildId, markSnapshotScope, flush, peekNextChildId, clearSnapshots, untrack, mapArray, repeat } from '@solidjs/signals';
2
- export { $PROXY, $REFRESH, $TRACK, NotReadyError, action, createOwner, createReaction, createRoot, createTrackedEffect, deep, enableExternalSource, enforceLoadingBoundary, flatten, flush, getNextChildId, getObserver, getOwner, isEqual, isPending, isRefreshing, isWrappable, latest, mapArray, merge, omit, onCleanup, onSettled, reconcile, refresh, repeat, resolve, runWithOwner, snapshot, storePath, untrack } from '@solidjs/signals';
1
+ import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, createOwner, runWithOwner, createEffect as createEffect$1, createErrorBoundary as createErrorBoundary$1, createLoadingBoundary as createLoadingBoundary$1, getOwner, createOptimistic as createOptimistic$1, createOptimisticStore as createOptimisticStore$1, createProjection as createProjection$1, createRenderEffect as createRenderEffect$1, createSignal as createSignal$1, createStore as createStore$1, setSnapshotCapture, releaseSnapshotScope, getNextChildId, onCleanup, isDisposed, peekNextChildId, clearSnapshots, flush, markSnapshotScope, untrack, mapArray, repeat, createRevealOrder } from '@solidjs/signals';
2
+ export { $PROXY, $REFRESH, $TRACK, NotReadyError, action, createOwner, createReaction, createRevealOrder, createRoot, createTrackedEffect, deep, enableExternalSource, enforceLoadingBoundary, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, isEqual, isPending, isRefreshing, isWrappable, latest, mapArray, merge, omit, onCleanup, onSettled, reconcile, refresh, repeat, resolve, runWithOwner, snapshot, storePath, untrack } from '@solidjs/signals';
3
3
 
4
4
  const IS_DEV = false;
5
5
  const $DEVCOMP = Symbol(0);
@@ -19,10 +19,10 @@ function useContext(context) {
19
19
  return getContext(context);
20
20
  }
21
21
  function children(fn) {
22
- const c = createMemo$1(fn, undefined, {
22
+ const c = createMemo$1(fn, {
23
23
  lazy: true
24
24
  });
25
- const memo = createMemo$1(() => flatten(c()), undefined, {
25
+ const memo = createMemo$1(() => flatten(c()), {
26
26
  lazy: true
27
27
  });
28
28
  memo.toArray = () => {
@@ -264,7 +264,7 @@ function wrapFirstYield(iterable, activate) {
264
264
  }
265
265
  };
266
266
  }
267
- function hydrateSignalFromAsyncIterable(coreFn, compute, value, options) {
267
+ function hydrateSignalFromAsyncIterable(coreFn, compute, options) {
268
268
  const parent = getOwner();
269
269
  const expectedId = peekNextChildId(parent);
270
270
  if (!sharedConfig.has(expectedId)) return null;
@@ -276,7 +276,7 @@ function hydrateSignalFromAsyncIterable(coreFn, compute, value, options) {
276
276
  return it;
277
277
  }
278
278
  };
279
- return coreFn(() => iterable, value, options);
279
+ return coreFn(() => iterable, options);
280
280
  }
281
281
  function hydrateStoreFromAsyncIterable(coreFn, initialValue, options) {
282
282
  const parent = getOwner();
@@ -351,20 +351,20 @@ function hydrateStoreFromAsyncIterable(coreFn, initialValue, options) {
351
351
  };
352
352
  }, initialValue, options);
353
353
  }
354
- function hydratedCreateMemo(compute, value, options) {
354
+ function hydratedCreateMemo(compute, options) {
355
355
  if (!sharedConfig.hydrating || options?.transparent) {
356
- return createMemo$1(compute, value, options);
356
+ return createMemo$1(compute, options);
357
357
  }
358
358
  markTopLevelSnapshotScope();
359
359
  const ssrSource = options?.ssrSource;
360
360
  if (ssrSource === "client") {
361
361
  const [hydrated, setHydrated] = createSignal$1(false, {
362
- pureWrite: true
362
+ ownedWrite: true
363
363
  });
364
364
  const memo = createMemo$1(prev => {
365
- if (!hydrated()) return prev ?? value;
365
+ if (!hydrated()) return prev;
366
366
  return compute(prev);
367
- }, value, options);
367
+ }, options);
368
368
  setHydrated(true);
369
369
  return memo;
370
370
  }
@@ -372,25 +372,25 @@ function hydratedCreateMemo(compute, value, options) {
372
372
  return createMemo$1(prev => {
373
373
  if (!sharedConfig.hydrating) return compute(prev);
374
374
  subFetch(compute, prev);
375
- return prev ?? value;
376
- }, value, options);
375
+ return prev;
376
+ }, options);
377
377
  }
378
- const aiResult = hydrateSignalFromAsyncIterable(createMemo$1, compute, value, options);
378
+ const aiResult = hydrateSignalFromAsyncIterable(createMemo$1, compute, options);
379
379
  if (aiResult !== null) return aiResult;
380
- return createMemo$1(prev => readSerializedOrCompute(compute, prev), value, options);
380
+ return createMemo$1(prev => readSerializedOrCompute(compute, prev), options);
381
381
  }
382
- function hydratedCreateSignal(fn, second, third) {
383
- if (typeof fn !== "function" || !sharedConfig.hydrating) return createSignal$1(fn, second, third);
382
+ function hydratedCreateSignal(fn, second) {
383
+ if (typeof fn !== "function" || !sharedConfig.hydrating) return createSignal$1(fn, second);
384
384
  markTopLevelSnapshotScope();
385
- const ssrSource = third?.ssrSource;
385
+ const ssrSource = second?.ssrSource;
386
386
  if (ssrSource === "client") {
387
387
  const [hydrated, setHydrated] = createSignal$1(false, {
388
- pureWrite: true
388
+ ownedWrite: true
389
389
  });
390
390
  const sig = createSignal$1(prev => {
391
- if (!hydrated()) return prev ?? second;
391
+ if (!hydrated()) return prev;
392
392
  return fn(prev);
393
- }, second, third);
393
+ }, second);
394
394
  setHydrated(true);
395
395
  return sig;
396
396
  }
@@ -398,12 +398,12 @@ function hydratedCreateSignal(fn, second, third) {
398
398
  return createSignal$1(prev => {
399
399
  if (!sharedConfig.hydrating) return fn(prev);
400
400
  subFetch(fn, prev);
401
- return prev ?? second;
402
- }, second, third);
401
+ return prev;
402
+ }, second);
403
403
  }
404
- const aiResult = hydrateSignalFromAsyncIterable(createSignal$1, fn, second, third);
404
+ const aiResult = hydrateSignalFromAsyncIterable(createSignal$1, fn, second);
405
405
  if (aiResult !== null) return aiResult;
406
- return createSignal$1(prev => readSerializedOrCompute(fn, prev), second, third);
406
+ return createSignal$1(prev => readSerializedOrCompute(fn, prev), second);
407
407
  }
408
408
  function hydratedCreateErrorBoundary(fn, fallback) {
409
409
  if (!sharedConfig.hydrating) return createErrorBoundary$1(fn, fallback);
@@ -425,18 +425,18 @@ function hydratedCreateErrorBoundary(fn, fallback) {
425
425
  }
426
426
  return createErrorBoundary$1(fn, fallback);
427
427
  }
428
- function hydratedCreateOptimistic(fn, second, third) {
429
- if (typeof fn !== "function" || !sharedConfig.hydrating) return createOptimistic$1(fn, second, third);
428
+ function hydratedCreateOptimistic(fn, second) {
429
+ if (typeof fn !== "function" || !sharedConfig.hydrating) return createOptimistic$1(fn, second);
430
430
  markTopLevelSnapshotScope();
431
- const ssrSource = third?.ssrSource;
431
+ const ssrSource = second?.ssrSource;
432
432
  if (ssrSource === "client") {
433
433
  const [hydrated, setHydrated] = createSignal$1(false, {
434
- pureWrite: true
434
+ ownedWrite: true
435
435
  });
436
436
  const sig = createOptimistic$1(prev => {
437
- if (!hydrated()) return prev ?? second;
437
+ if (!hydrated()) return prev;
438
438
  return fn(prev);
439
- }, second, third);
439
+ }, second);
440
440
  setHydrated(true);
441
441
  return sig;
442
442
  }
@@ -444,12 +444,12 @@ function hydratedCreateOptimistic(fn, second, third) {
444
444
  return createOptimistic$1(prev => {
445
445
  if (!sharedConfig.hydrating) return fn(prev);
446
446
  subFetch(fn, prev);
447
- return prev ?? second;
448
- }, second, third);
447
+ return prev;
448
+ }, second);
449
449
  }
450
- const aiResult = hydrateSignalFromAsyncIterable(createOptimistic$1, fn, second, third);
450
+ const aiResult = hydrateSignalFromAsyncIterable(createOptimistic$1, fn, second);
451
451
  if (aiResult !== null) return aiResult;
452
- return createOptimistic$1(prev => readSerializedOrCompute(fn, prev), second, third);
452
+ return createOptimistic$1(prev => readSerializedOrCompute(fn, prev), second);
453
453
  }
454
454
  function wrapStoreFn(fn) {
455
455
  return draft => readSerializedOrCompute(() => fn(draft), draft);
@@ -457,7 +457,7 @@ function wrapStoreFn(fn) {
457
457
  function hydrateStoreLikeFn(coreFn, fn, initialValue, options, ssrSource) {
458
458
  if (ssrSource === "client") {
459
459
  const [hydrated, setHydrated] = createSignal$1(false, {
460
- pureWrite: true
460
+ ownedWrite: true
461
461
  });
462
462
  const result = coreFn(draft => {
463
463
  if (!hydrated()) return;
@@ -468,7 +468,7 @@ function hydrateStoreLikeFn(coreFn, fn, initialValue, options, ssrSource) {
468
468
  }
469
469
  if (ssrSource === "hybrid") {
470
470
  const [hydrated, setHydrated] = createSignal$1(false, {
471
- pureWrite: true
471
+ ownedWrite: true
472
472
  });
473
473
  const result = coreFn(draft => {
474
474
  const o = getOwner();
@@ -498,14 +498,14 @@ function hydratedCreateStore(first, second, third) {
498
498
  if (typeof first !== "function" || !sharedConfig.hydrating) return createStore$1(first, second, third);
499
499
  markTopLevelSnapshotScope();
500
500
  const ssrSource = third?.ssrSource;
501
- if (ssrSource === "initial") return createStore$1(second ?? {}, undefined, third);
501
+ if (ssrSource === "initial") return createStore$1(second ?? {});
502
502
  return hydrateStoreLikeFn(createStore$1, first, second ?? {}, third, ssrSource);
503
503
  }
504
504
  function hydratedCreateOptimisticStore(first, second, third) {
505
505
  if (typeof first !== "function" || !sharedConfig.hydrating) return createOptimisticStore$1(first, second, third);
506
506
  markTopLevelSnapshotScope();
507
507
  const ssrSource = third?.ssrSource;
508
- if (ssrSource === "initial") return createOptimisticStore$1(second ?? {}, undefined, third);
508
+ if (ssrSource === "initial") return createOptimisticStore$1(second ?? {});
509
509
  return hydrateStoreLikeFn(createOptimisticStore$1, first, second ?? {}, third, ssrSource);
510
510
  }
511
511
  function hydratedCreateProjection(fn, initialValue, options) {
@@ -515,22 +515,22 @@ function hydratedCreateProjection(fn, initialValue, options) {
515
515
  if (ssrSource === "initial") return createProjection$1(draft => draft, initialValue, options);
516
516
  return hydrateStoreLikeFn(createProjection$1, fn, initialValue, options, ssrSource);
517
517
  }
518
- function hydratedEffect(coreFn, compute, effectFn, value, options) {
519
- if (!sharedConfig.hydrating) return coreFn(compute, effectFn, value, options);
518
+ function hydratedEffect(coreFn, compute, effectFn, options) {
519
+ if (!sharedConfig.hydrating || options?.transparent) return coreFn(compute, effectFn, options);
520
520
  const ssrSource = options?.ssrSource;
521
521
  if (ssrSource === "client") {
522
522
  const [hydrated, setHydrated] = createSignal$1(false, {
523
- pureWrite: true
523
+ ownedWrite: true
524
524
  });
525
525
  let active = false;
526
526
  coreFn(prev => {
527
- if (!hydrated()) return value;
527
+ if (!hydrated()) return prev;
528
528
  active = true;
529
529
  return compute(prev);
530
530
  }, (next, prev) => {
531
531
  if (!active) return;
532
532
  return effectFn(next, prev);
533
- }, value, options);
533
+ }, options);
534
534
  setHydrated(true);
535
535
  return;
536
536
  }
@@ -538,18 +538,18 @@ function hydratedEffect(coreFn, compute, effectFn, value, options) {
538
538
  coreFn(prev => {
539
539
  if (!sharedConfig.hydrating) return compute(prev);
540
540
  subFetch(compute, prev);
541
- return prev ?? value;
542
- }, effectFn, value, options);
541
+ return prev;
542
+ }, effectFn, options);
543
543
  return;
544
544
  }
545
545
  markTopLevelSnapshotScope();
546
- coreFn(prev => readSerializedOrCompute(compute, prev), effectFn, value, options);
546
+ coreFn(prev => readSerializedOrCompute(compute, prev), effectFn, options);
547
547
  }
548
- function hydratedCreateRenderEffect(compute, effectFn, value, options) {
549
- return hydratedEffect(createRenderEffect$1, compute, effectFn, value, options);
548
+ function hydratedCreateRenderEffect(compute, effectFn, options) {
549
+ return hydratedEffect(createRenderEffect$1, compute, effectFn, options);
550
550
  }
551
- function hydratedCreateEffect(compute, effectFn, value, options) {
552
- return hydratedEffect(createEffect$1, compute, effectFn, value, options);
551
+ function hydratedCreateEffect(compute, effectFn, options) {
552
+ return hydratedEffect(createEffect$1, compute, effectFn, options);
553
553
  }
554
554
  function enableHydration() {
555
555
  _createMemo = hydratedCreateMemo;
@@ -608,24 +608,6 @@ const createStore = (...args) => (_createStore || createStore$1)(...args);
608
608
  const createOptimisticStore = (...args) => (_createOptimisticStore || createOptimisticStore$1)(...args);
609
609
  const createRenderEffect = (...args) => (_createRenderEffect || createRenderEffect$1)(...args);
610
610
  const createEffect = (...args) => (_createEffect || createEffect$1)(...args);
611
- function loadModuleAssets(mapping) {
612
- const hy = globalThis._$HY;
613
- if (!hy) return;
614
- if (!hy.modules) hy.modules = {};
615
- if (!hy.loading) hy.loading = {};
616
- const pending = [];
617
- for (const moduleUrl in mapping) {
618
- if (hy.modules[moduleUrl]) continue;
619
- const entryUrl = mapping[moduleUrl];
620
- if (!hy.loading[moduleUrl]) {
621
- hy.loading[moduleUrl] = import(entryUrl).then(mod => {
622
- hy.modules[moduleUrl] = mod;
623
- });
624
- }
625
- pending.push(hy.loading[moduleUrl]);
626
- }
627
- return pending.length ? Promise.all(pending).then(() => {}) : undefined;
628
- }
629
611
  function createBoundaryTrigger() {
630
612
  setSnapshotCapture(false);
631
613
  const [s, set] = createSignal$1(undefined, {
@@ -653,6 +635,38 @@ function resumeBoundaryHydration(o, id, set) {
653
635
  flush();
654
636
  checkHydrationComplete();
655
637
  }
638
+ function initBoundaryResume(o, id) {
639
+ _pendingBoundaries++;
640
+ onCleanup(() => {
641
+ if (!isDisposed(o)) return;
642
+ sharedConfig.cleanupFragment?.(id);
643
+ });
644
+ const set = createBoundaryTrigger();
645
+ return [set, () => resumeBoundaryHydration(o, id, set)];
646
+ }
647
+ function waitAndResume(p, resume, assetPromise) {
648
+ const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
649
+ waitFor.then(() => {
650
+ if (p && typeof p === "object") p.s = 1;
651
+ resume();
652
+ }, err => {
653
+ if (p && typeof p === "object") {
654
+ p.s = 2;
655
+ p.v = err;
656
+ }
657
+ resume();
658
+ });
659
+ }
660
+ function scheduleResumeAfterAssets(id, resume, assetPromise) {
661
+ sharedConfig.gather?.(id);
662
+ const doResume = () => queueMicrotask(resume);
663
+ if (assetPromise) {
664
+ assetPromise.then(doResume);
665
+ return true;
666
+ }
667
+ doResume();
668
+ return false;
669
+ }
656
670
  function createLoadingBoundary(fn, fallback, options) {
657
671
  if (!sharedConfig.hydrating) return createLoadingBoundary$1(fn, fallback, options);
658
672
  let settledSerializationResumeQueued = false;
@@ -662,7 +676,7 @@ function createLoadingBoundary(fn, fallback, options) {
662
676
  let assetPromise;
663
677
  if (sharedConfig.hydrating && sharedConfig.has(id + "_assets")) {
664
678
  const mapping = sharedConfig.load(id + "_assets");
665
- if (mapping && typeof mapping === "object") assetPromise = loadModuleAssets(mapping);
679
+ if (mapping && typeof mapping === "object") assetPromise = sharedConfig.loadModuleAssets?.(mapping);
666
680
  }
667
681
  if (sharedConfig.hydrating && sharedConfig.has(id)) {
668
682
  const ref = sharedConfig.load(id);
@@ -672,41 +686,14 @@ function createLoadingBoundary(fn, fallback, options) {
672
686
  }
673
687
  if (ref && typeof ref === "object" && ref.s === 1 && p == null && !settledSerializationResumeQueued) {
674
688
  settledSerializationResumeQueued = true;
675
- _pendingBoundaries++;
676
- onCleanup(() => {
677
- if (!isDisposed(o)) return;
678
- sharedConfig.cleanupFragment?.(id);
679
- });
680
- const set = createBoundaryTrigger();
681
- const scheduleResume = () => queueMicrotask(() => resumeBoundaryHydration(o, id, set));
682
- if (assetPromise) {
683
- assetPromise.then(scheduleResume);
684
- return undefined;
685
- }
686
- scheduleResume();
689
+ const [, resume] = initBoundaryResume(o, id);
690
+ if (scheduleResumeAfterAssets(id, resume, assetPromise)) return undefined;
687
691
  return fallback();
688
692
  }
689
693
  if (p) {
690
- _pendingBoundaries++;
691
- onCleanup(() => {
692
- if (!isDisposed(o)) return;
693
- sharedConfig.cleanupFragment?.(id);
694
- });
695
- const set = createBoundaryTrigger();
694
+ const [set, resume] = initBoundaryResume(o, id);
696
695
  if (p !== "$$f") {
697
- const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
698
- waitFor.then(() => {
699
- if (p && typeof p === "object") {
700
- p.s = 1;
701
- }
702
- resumeBoundaryHydration(o, id, set);
703
- }, err => {
704
- if (p && typeof p === "object") {
705
- p.s = 2;
706
- p.v = err;
707
- }
708
- resumeBoundaryHydration(o, id, set);
709
- });
696
+ waitAndResume(p, resume, assetPromise);
710
697
  } else {
711
698
  const afterAssets = () => {
712
699
  _pendingBoundaries--;
@@ -718,10 +705,20 @@ function createLoadingBoundary(fn, fallback, options) {
718
705
  return fallback();
719
706
  }
720
707
  }
708
+ if (sharedConfig.hydrating && sharedConfig.has(id + "_fr") && !settledSerializationResumeQueued) {
709
+ settledSerializationResumeQueued = true;
710
+ const fr = sharedConfig.load(id + "_fr");
711
+ const [, resume] = initBoundaryResume(o, id);
712
+ if (fr && typeof fr === "object" && (fr.s === 1 || fr.s === 2)) {
713
+ if (scheduleResumeAfterAssets(id, resume, assetPromise)) return undefined;
714
+ return fallback();
715
+ }
716
+ waitAndResume(fr, resume, assetPromise);
717
+ return fallback();
718
+ }
721
719
  if (assetPromise && !sharedConfig.has(id)) {
722
- _pendingBoundaries++;
723
- const set = createBoundaryTrigger();
724
- assetPromise.then(() => resumeBoundaryHydration(o, id, set));
720
+ const [, resume] = initBoundaryResume(o, id);
721
+ assetPromise.then(resume);
725
722
  return undefined;
726
723
  }
727
724
  return createLoadingBoundary$1(fn, fallback, options);
@@ -793,8 +790,8 @@ function Repeat(props) {
793
790
  }
794
791
  function Show(props) {
795
792
  const keyed = props.keyed;
796
- const conditionValue = createMemo$1(() => props.when, undefined, undefined);
797
- const condition = keyed ? conditionValue : createMemo$1(conditionValue, undefined, {
793
+ const conditionValue = createMemo$1(() => props.when, undefined);
794
+ const condition = keyed ? conditionValue : createMemo$1(conditionValue, {
798
795
  equals: (a, b) => !a === !b
799
796
  });
800
797
  return createMemo$1(() => {
@@ -808,7 +805,7 @@ function Show(props) {
808
805
  }), IS_DEV) : child;
809
806
  }
810
807
  return props.fallback;
811
- }, undefined, undefined);
808
+ }, undefined);
812
809
  }
813
810
  function Switch(props) {
814
811
  const chs = children(() => props.children);
@@ -819,8 +816,8 @@ function Switch(props) {
819
816
  const index = i;
820
817
  const mp = mps[i];
821
818
  const prevFunc = func;
822
- const conditionValue = createMemo$1(() => prevFunc() ? undefined : mp.when, undefined, undefined);
823
- const condition = mp.keyed ? conditionValue : createMemo$1(conditionValue, undefined, {
819
+ const conditionValue = createMemo$1(() => prevFunc() ? undefined : mp.when, undefined);
820
+ const condition = mp.keyed ? conditionValue : createMemo$1(conditionValue, {
824
821
  equals: (a, b) => !a === !b
825
822
  });
826
823
  func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
@@ -837,7 +834,7 @@ function Switch(props) {
837
834
  if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
838
835
  return conditionValue();
839
836
  }), IS_DEV) : child;
840
- }, undefined, undefined);
837
+ }, undefined);
841
838
  }
842
839
  function Match(props) {
843
840
  return props;
@@ -854,9 +851,15 @@ function Loading(props) {
854
851
  } : undefined;
855
852
  return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
856
853
  }
854
+ function Reveal(props) {
855
+ return createRevealOrder(() => props.children, {
856
+ together: () => !!props.together,
857
+ collapsed: () => !!props.collapsed
858
+ });
859
+ }
857
860
 
858
861
  function ssrHandleError() {}
859
862
  function ssrRunInScope() {}
860
863
  const DEV = undefined;
861
864
 
862
- export { $DEVCOMP, DEV, Errored, For, Hydration, Loading, Match, NoHydrateContext, NoHydration, Repeat, Show, Switch, children, createComponent, createContext, createEffect, createErrorBoundary, createLoadingBoundary, createMemo, createOptimistic, createOptimisticStore, createProjection, createRenderEffect, createSignal, createStore, createUniqueId, enableHydration, lazy, sharedConfig, ssrHandleError, ssrRunInScope, useContext };
865
+ export { $DEVCOMP, DEV, Errored, For, Hydration, Loading, Match, NoHydrateContext, NoHydration, Repeat, Reveal, Show, Switch, children, createComponent, createContext, createEffect, createErrorBoundary, createLoadingBoundary, createMemo, createOptimistic, createOptimisticStore, createProjection, createRenderEffect, createSignal, createStore, createUniqueId, enableHydration, lazy, sharedConfig, ssrHandleError, ssrRunInScope, useContext };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-js",
3
3
  "description": "A declarative JavaScript library for building user interfaces.",
4
- "version": "2.0.0-beta.5",
4
+ "version": "2.0.0-beta.7",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -18,54 +18,101 @@
18
18
  "files": [
19
19
  "dist",
20
20
  "types",
21
+ "types-cjs",
21
22
  "jsx-runtime.d.ts",
22
23
  "package.json"
23
24
  ],
24
25
  "exports": {
25
26
  ".": {
26
27
  "worker": {
27
- "types": "./types/index.d.ts",
28
- "import": "./dist/server.js",
29
- "require": "./dist/server.cjs"
28
+ "import": {
29
+ "types": "./types/index.d.ts",
30
+ "default": "./dist/server.js"
31
+ },
32
+ "require": {
33
+ "types": "./types-cjs/index.d.cts",
34
+ "default": "./dist/server.cjs"
35
+ }
30
36
  },
31
37
  "browser": {
32
38
  "development": {
39
+ "import": {
40
+ "types": "./types/index.d.ts",
41
+ "default": "./dist/dev.js"
42
+ },
43
+ "require": {
44
+ "types": "./types-cjs/index.d.cts",
45
+ "default": "./dist/dev.cjs"
46
+ }
47
+ },
48
+ "import": {
33
49
  "types": "./types/index.d.ts",
34
- "import": "./dist/dev.js",
35
- "require": "./dist/dev.cjs"
50
+ "default": "./dist/solid.js"
36
51
  },
37
- "types": "./types/index.d.ts",
38
- "import": "./dist/solid.js",
39
- "require": "./dist/solid.cjs"
52
+ "require": {
53
+ "types": "./types-cjs/index.d.cts",
54
+ "default": "./dist/solid.cjs"
55
+ }
40
56
  },
41
57
  "deno": {
42
- "types": "./types/index.d.ts",
43
- "import": "./dist/server.js",
44
- "require": "./dist/server.cjs"
58
+ "import": {
59
+ "types": "./types/index.d.ts",
60
+ "default": "./dist/server.js"
61
+ },
62
+ "require": {
63
+ "types": "./types-cjs/index.d.cts",
64
+ "default": "./dist/server.cjs"
65
+ }
45
66
  },
46
67
  "node": {
47
- "types": "./types/index.d.ts",
48
- "import": "./dist/server.js",
49
- "require": "./dist/server.cjs"
68
+ "import": {
69
+ "types": "./types/index.d.ts",
70
+ "default": "./dist/server.js"
71
+ },
72
+ "require": {
73
+ "types": "./types-cjs/index.d.cts",
74
+ "default": "./dist/server.cjs"
75
+ }
50
76
  },
51
77
  "development": {
78
+ "import": {
79
+ "types": "./types/index.d.ts",
80
+ "default": "./dist/dev.js"
81
+ },
82
+ "require": {
83
+ "types": "./types-cjs/index.d.cts",
84
+ "default": "./dist/dev.cjs"
85
+ }
86
+ },
87
+ "import": {
52
88
  "types": "./types/index.d.ts",
53
- "import": "./dist/dev.js",
54
- "require": "./dist/dev.cjs"
89
+ "default": "./dist/solid.js"
55
90
  },
56
- "types": "./types/index.d.ts",
57
- "import": "./dist/solid.js",
58
- "require": "./dist/solid.cjs"
91
+ "require": {
92
+ "types": "./types-cjs/index.d.cts",
93
+ "default": "./dist/solid.cjs"
94
+ }
59
95
  },
60
- "./dist/*": "./dist/*",
61
96
  "./types/*": "./types/*",
62
97
  "./jsx-runtime": {
63
- "types": "./types/jsx.d.ts",
64
- "default": "./dist/solid.js"
98
+ "import": {
99
+ "types": "./types/jsx.d.ts",
100
+ "default": "./dist/solid.js"
101
+ },
102
+ "require": {
103
+ "types": "./types-cjs/jsx.d.cts",
104
+ "default": "./dist/solid.cjs"
105
+ }
65
106
  },
66
107
  "./jsx-dev-runtime": {
67
- "types": "./types/jsx.d.ts",
68
- "default": "./dist/solid.js"
108
+ "import": {
109
+ "types": "./types/jsx.d.ts",
110
+ "default": "./dist/solid.js"
111
+ },
112
+ "require": {
113
+ "types": "./types-cjs/jsx.d.cts",
114
+ "default": "./dist/solid.cjs"
115
+ }
69
116
  },
70
117
  "./package.json": "./package.json"
71
118
  },
@@ -79,7 +126,7 @@
79
126
  "performance"
80
127
  ],
81
128
  "dependencies": {
82
- "@solidjs/signals": "^0.13.9",
129
+ "@solidjs/signals": "^2.0.0-beta.7",
83
130
  "csstype": "^3.1.0",
84
131
  "seroval": "~1.5.0",
85
132
  "seroval-plugins": "~1.5.0"
@@ -88,10 +135,11 @@
88
135
  "build": "npm-run-all -nl build:*",
89
136
  "build:clean": "rimraf dist/ coverage/",
90
137
  "build:js": "rollup -c",
91
- "types": "npm-run-all -nl types:*",
92
- "types:clean": "rimraf types/",
93
- "types:copy": "ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./src/jsx.d.ts",
94
- "types:src": "tsc --project ./tsconfig.build.json && ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./types/jsx.d.ts",
138
+ "types": "npm-run-all -nl types:clean types:copy types:src types:cjs",
139
+ "types:clean": "rimraf types/ types-cjs/",
140
+ "types:copy": "ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./src/jsx.d.ts && ncp ../../node_modules/dom-expressions/src/jsx-properties.d.ts ./src/jsx-properties.d.ts",
141
+ "types:src": "tsc --project ./tsconfig.build.json && ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./types/jsx.d.ts && ncp ../../node_modules/dom-expressions/src/jsx-properties.d.ts ./types/jsx-properties.d.ts",
142
+ "types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs",
95
143
  "test": "vitest run",
96
144
  "coverage": "vitest run --coverage",
97
145
  "test-types": "tsc --project tsconfig.test.json"
@@ -1,4 +1,4 @@
1
- import type { Accessor, Owner, EffectOptions } from "@solidjs/signals";
1
+ import type { Accessor, EffectOptions } from "@solidjs/signals";
2
2
  import type { JSX } from "../jsx.js";
3
3
  import { FlowComponent } from "./component.js";
4
4
  export declare const IS_DEV: string | boolean;
@@ -56,10 +56,3 @@ export type ChildrenReturn = Accessor<ResolvedChildren> & {
56
56
  */
57
57
  export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn;
58
58
  export declare function devComponent<P, V>(Comp: (props: P) => V, props: P): V;
59
- interface SourceMapValue {
60
- value: unknown;
61
- name?: string;
62
- graph?: Owner;
63
- }
64
- export declare function registerGraph(value: SourceMapValue): void;
65
- export {};
@@ -117,4 +117,26 @@ export declare function Loading(props: {
117
117
  on?: any;
118
118
  children: JSX.Element;
119
119
  }): JSX.Element;
120
+ /**
121
+ * Coordinates the reveal timing of sibling `<Loading>` boundaries.
122
+ *
123
+ * - **Sequential** (default): boundaries reveal in DOM order as each resolves.
124
+ * - **Together** (`together`): all boundaries wait until the group is ready, then reveal at once.
125
+ * - **Collapsed** (`collapsed`, sequential only): only the frontier boundary shows its fallback;
126
+ * later boundaries produce nothing until their turn.
127
+ *
128
+ * ```typescript
129
+ * <Reveal>
130
+ * <Loading fallback={<Skeleton />}><ProfileHeader /></Loading>
131
+ * <Loading fallback={<Skeleton />}><Posts /></Loading>
132
+ * </Reveal>
133
+ * ```
134
+ *
135
+ * @description https://docs.solidjs.com/reference/components/reveal
136
+ */
137
+ export declare function Reveal(props: {
138
+ together?: boolean;
139
+ collapsed?: boolean;
140
+ children: JSX.Element;
141
+ }): JSX.Element;
120
142
  export {};