solid-js 2.0.0-experimental.10 → 2.0.0-experimental.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.cjs CHANGED
@@ -125,11 +125,11 @@ const sharedConfig = {
125
125
  getNextContextId() {
126
126
  const o = signals.getOwner();
127
127
  if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`);
128
- return o.getNextChildId();
128
+ return signals.getNextChildId(o);
129
129
  }
130
130
  };
131
- function Suspense(props) {
132
- if (!sharedConfig.hydrating) return signals.createSuspense(() => props.children, () => props.fallback);
131
+ function Loading(props) {
132
+ if (!sharedConfig.hydrating) return signals.createLoadBoundary(() => props.children, () => props.fallback);
133
133
  return signals.createMemo(() => {
134
134
  const o = signals.getOwner();
135
135
  const id = o.id;
@@ -158,7 +158,7 @@ function Suspense(props) {
158
158
  return props.fallback;
159
159
  }
160
160
  }
161
- return signals.createSuspense(() => props.children, () => props.fallback);
161
+ return signals.createLoadBoundary(() => props.children, () => props.fallback);
162
162
  });
163
163
  }
164
164
  function createAsync(compute, value, options) {
@@ -251,18 +251,14 @@ function For(props) {
251
251
  } : {
252
252
  keyed: props.keyed
253
253
  };
254
- return signals.createMemo(signals.mapArray(() => props.each, props.children, options), undefined, {
255
- name: "value"
256
- }) ;
254
+ return signals.mapArray(() => props.each, props.children, options);
257
255
  }
258
256
  function Repeat(props) {
259
257
  const options = "fallback" in props ? {
260
258
  fallback: () => props.fallback
261
259
  } : {};
262
260
  options.from = () => props.from;
263
- return signals.createMemo(signals.repeat(() => props.count, index => typeof props.children === "function" ? props.children(index) : props.children, options), undefined, {
264
- name: "value"
265
- }) ;
261
+ return signals.repeat(() => props.count, index => typeof props.children === "function" ? props.children(index) : props.children, options);
266
262
  }
267
263
  function Show(props) {
268
264
  const keyed = props.keyed;
@@ -291,8 +287,7 @@ function Show(props) {
291
287
  function Switch(props) {
292
288
  const chs = children(() => props.children);
293
289
  const switchFunc = signals.createMemo(() => {
294
- const ch = chs();
295
- const mps = Array.isArray(ch) ? ch : [ch];
290
+ const mps = chs.toArray();
296
291
  let func = () => undefined;
297
292
  for (let i = 0; i < mps.length; i++) {
298
293
  const index = i;
@@ -326,7 +321,7 @@ function Switch(props) {
326
321
  function Match(props) {
327
322
  return props;
328
323
  }
329
- function ErrorBoundary(props) {
324
+ function Errored(props) {
330
325
  return signals.createErrorBoundary(() => props.children, (err, reset) => {
331
326
  const f = props.fallback;
332
327
  if ((typeof f !== "function" || f.length == 0)) console.error(err);
@@ -432,10 +427,6 @@ Object.defineProperty(exports, "isWrappable", {
432
427
  enumerable: true,
433
428
  get: function () { return signals.isWrappable; }
434
429
  });
435
- Object.defineProperty(exports, "latest", {
436
- enumerable: true,
437
- get: function () { return signals.latest; }
438
- });
439
430
  Object.defineProperty(exports, "mapArray", {
440
431
  enumerable: true,
441
432
  get: function () { return signals.mapArray; }
@@ -452,6 +443,14 @@ Object.defineProperty(exports, "onCleanup", {
452
443
  enumerable: true,
453
444
  get: function () { return signals.onCleanup; }
454
445
  });
446
+ Object.defineProperty(exports, "onSettled", {
447
+ enumerable: true,
448
+ get: function () { return signals.onSettled; }
449
+ });
450
+ Object.defineProperty(exports, "pending", {
451
+ enumerable: true,
452
+ get: function () { return signals.pending; }
453
+ });
455
454
  Object.defineProperty(exports, "reconcile", {
456
455
  enumerable: true,
457
456
  get: function () { return signals.reconcile; }
@@ -472,27 +471,19 @@ Object.defineProperty(exports, "snapshot", {
472
471
  enumerable: true,
473
472
  get: function () { return signals.snapshot; }
474
473
  });
475
- Object.defineProperty(exports, "transition", {
476
- enumerable: true,
477
- get: function () { return signals.transition; }
478
- });
479
474
  Object.defineProperty(exports, "untrack", {
480
475
  enumerable: true,
481
476
  get: function () { return signals.untrack; }
482
477
  });
483
- Object.defineProperty(exports, "useTransition", {
484
- enumerable: true,
485
- get: function () { return signals.useTransition; }
486
- });
487
478
  exports.$DEVCOMP = $DEVCOMP;
488
479
  exports.Boundary = Boundary;
489
480
  exports.DEV = DEV;
490
- exports.ErrorBoundary = ErrorBoundary;
481
+ exports.Errored = Errored;
491
482
  exports.For = For;
483
+ exports.Loading = Loading;
492
484
  exports.Match = Match;
493
485
  exports.Repeat = Repeat;
494
486
  exports.Show = Show;
495
- exports.Suspense = Suspense;
496
487
  exports.Switch = Switch;
497
488
  exports.children = children;
498
489
  exports.createAsync = createAsync;
package/dist/dev.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createEffect, getContext, createMemo, flatten, createRoot, setContext, getOwner, untrack, NotReadyError, onCleanup, createSignal, createSuspense, flush, runWithOwner, createAsync as createAsync$1, mapArray, repeat, createErrorBoundary, createBoundary } from '@solidjs/signals';
2
- export { $PROXY, $TRACK, createEffect, createMemo, createOptimistic, createOptimisticStore, createProjection, createReaction, createRenderEffect, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getObserver, getOwner, isEqual, isPending, isWrappable, latest, mapArray, merge, omit, onCleanup, reconcile, repeat, resolve, runWithOwner, snapshot, transition, untrack, useTransition } from '@solidjs/signals';
1
+ import { createEffect, getContext, createMemo, flatten, createRoot, setContext, getOwner, untrack, NotReadyError, onCleanup, createSignal, getNextChildId, createLoadBoundary, flush, runWithOwner, createAsync as createAsync$1, mapArray, repeat, createErrorBoundary, createBoundary } from '@solidjs/signals';
2
+ export { $PROXY, $TRACK, createEffect, createMemo, createOptimistic, createOptimisticStore, createProjection, createReaction, createRenderEffect, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getObserver, getOwner, isEqual, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, pending, reconcile, repeat, resolve, runWithOwner, snapshot, untrack } from '@solidjs/signals';
3
3
 
4
4
  const $DEVCOMP = Symbol("COMPONENT_DEV" );
5
5
  function onMount(fn) {
@@ -124,11 +124,11 @@ const sharedConfig = {
124
124
  getNextContextId() {
125
125
  const o = getOwner();
126
126
  if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`);
127
- return o.getNextChildId();
127
+ return getNextChildId(o);
128
128
  }
129
129
  };
130
- function Suspense(props) {
131
- if (!sharedConfig.hydrating) return createSuspense(() => props.children, () => props.fallback);
130
+ function Loading(props) {
131
+ if (!sharedConfig.hydrating) return createLoadBoundary(() => props.children, () => props.fallback);
132
132
  return createMemo(() => {
133
133
  const o = getOwner();
134
134
  const id = o.id;
@@ -157,7 +157,7 @@ function Suspense(props) {
157
157
  return props.fallback;
158
158
  }
159
159
  }
160
- return createSuspense(() => props.children, () => props.fallback);
160
+ return createLoadBoundary(() => props.children, () => props.fallback);
161
161
  });
162
162
  }
163
163
  function createAsync(compute, value, options) {
@@ -250,18 +250,14 @@ function For(props) {
250
250
  } : {
251
251
  keyed: props.keyed
252
252
  };
253
- return createMemo(mapArray(() => props.each, props.children, options), undefined, {
254
- name: "value"
255
- }) ;
253
+ return mapArray(() => props.each, props.children, options);
256
254
  }
257
255
  function Repeat(props) {
258
256
  const options = "fallback" in props ? {
259
257
  fallback: () => props.fallback
260
258
  } : {};
261
259
  options.from = () => props.from;
262
- return createMemo(repeat(() => props.count, index => typeof props.children === "function" ? props.children(index) : props.children, options), undefined, {
263
- name: "value"
264
- }) ;
260
+ return repeat(() => props.count, index => typeof props.children === "function" ? props.children(index) : props.children, options);
265
261
  }
266
262
  function Show(props) {
267
263
  const keyed = props.keyed;
@@ -290,8 +286,7 @@ function Show(props) {
290
286
  function Switch(props) {
291
287
  const chs = children(() => props.children);
292
288
  const switchFunc = createMemo(() => {
293
- const ch = chs();
294
- const mps = Array.isArray(ch) ? ch : [ch];
289
+ const mps = chs.toArray();
295
290
  let func = () => undefined;
296
291
  for (let i = 0; i < mps.length; i++) {
297
292
  const index = i;
@@ -325,7 +320,7 @@ function Switch(props) {
325
320
  function Match(props) {
326
321
  return props;
327
322
  }
328
- function ErrorBoundary(props) {
323
+ function Errored(props) {
329
324
  return createErrorBoundary(() => props.children, (err, reset) => {
330
325
  const f = props.fallback;
331
326
  if ((typeof f !== "function" || f.length == 0)) console.error(err);
@@ -347,4 +342,4 @@ if (globalThis) {
347
342
  if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
348
343
  }
349
344
 
350
- export { $DEVCOMP, Boundary, DEV, ErrorBoundary, For, Match, Repeat, Show, Suspense, Switch, children, createAsync, createComponent, createContext, createUniqueId, enableHydration, from, lazy, observable, onMount, reducer, sharedConfig, ssrHandleError, ssrRunInScope, tryCatch, useContext };
345
+ export { $DEVCOMP, Boundary, DEV, Errored, For, Loading, Match, Repeat, Show, Switch, children, createAsync, createComponent, createContext, createUniqueId, enableHydration, from, lazy, observable, onMount, reducer, sharedConfig, ssrHandleError, ssrRunInScope, tryCatch, useContext };