solid-js 1.3.0-beta.4 → 1.3.0-beta.5

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
@@ -1512,7 +1512,10 @@ function Suspense(props) {
1512
1512
  if (!visibleFallback) return;
1513
1513
  return createRoot(disposer => {
1514
1514
  dispose = disposer;
1515
- if (sharedConfig.context) sharedConfig.context.count = 0;
1515
+ if (sharedConfig.context) setHydrateContext({
1516
+ id: sharedConfig.context.id + "f",
1517
+ count: 0
1518
+ });
1516
1519
  return props.fallback;
1517
1520
  }, owner);
1518
1521
  });
package/dist/dev.js CHANGED
@@ -1508,7 +1508,10 @@ function Suspense(props) {
1508
1508
  if (!visibleFallback) return;
1509
1509
  return createRoot(disposer => {
1510
1510
  dispose = disposer;
1511
- if (sharedConfig.context) sharedConfig.context.count = 0;
1511
+ if (sharedConfig.context) setHydrateContext({
1512
+ id: sharedConfig.context.id + "f",
1513
+ count: 0
1514
+ });
1512
1515
  return props.fallback;
1513
1516
  }, owner);
1514
1517
  });
package/dist/server.cjs CHANGED
@@ -351,7 +351,7 @@ function createResource(fn, fetcher, options = {}) {
351
351
  if (error) throw error;
352
352
  if (resourceContext && p) resourceContext.push(p);
353
353
  const resolved = sharedConfig.context.async && sharedConfig.context.resources[id].data;
354
- if (!resolved) {
354
+ if (!resolved && read.loading) {
355
355
  const ctx = useContext(SuspenseContext);
356
356
  if (ctx) {
357
357
  ctx.resources.set(id, read);
@@ -363,7 +363,7 @@ function createResource(fn, fetcher, options = {}) {
363
363
  read.loading = false;
364
364
  function load() {
365
365
  const ctx = sharedConfig.context;
366
- if (!ctx.async) return read.loading = true;
366
+ if (!ctx.async) return read.loading = !!(typeof fn === "function" ? fn() : fn);
367
367
  if (ctx.resources && id in ctx.resources && ctx.resources[id].data) {
368
368
  value = ctx.resources[id].data;
369
369
  return;
@@ -502,9 +502,10 @@ function Suspense(props) {
502
502
  };
503
503
  }
504
504
  setHydrateContext({ ...ctx,
505
- count: 0
505
+ count: 0,
506
+ id: ctx.id + "0.f"
506
507
  });
507
- return createComponent(() => props.fallback, {});
508
+ return props.fallback;
508
509
  }
509
510
 
510
511
  exports.$PROXY = $PROXY;
package/dist/server.js CHANGED
@@ -347,7 +347,7 @@ function createResource(fn, fetcher, options = {}) {
347
347
  if (error) throw error;
348
348
  if (resourceContext && p) resourceContext.push(p);
349
349
  const resolved = sharedConfig.context.async && sharedConfig.context.resources[id].data;
350
- if (!resolved) {
350
+ if (!resolved && read.loading) {
351
351
  const ctx = useContext(SuspenseContext);
352
352
  if (ctx) {
353
353
  ctx.resources.set(id, read);
@@ -359,7 +359,7 @@ function createResource(fn, fetcher, options = {}) {
359
359
  read.loading = false;
360
360
  function load() {
361
361
  const ctx = sharedConfig.context;
362
- if (!ctx.async) return read.loading = true;
362
+ if (!ctx.async) return read.loading = !!(typeof fn === "function" ? fn() : fn);
363
363
  if (ctx.resources && id in ctx.resources && ctx.resources[id].data) {
364
364
  value = ctx.resources[id].data;
365
365
  return;
@@ -498,9 +498,10 @@ function Suspense(props) {
498
498
  };
499
499
  }
500
500
  setHydrateContext({ ...ctx,
501
- count: 0
501
+ count: 0,
502
+ id: ctx.id + "0.f"
502
503
  });
503
- return createComponent(() => props.fallback, {});
504
+ return props.fallback;
504
505
  }
505
506
 
506
507
  export { $PROXY, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableScheduling, equalFn, from, getListener, getOwner, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
package/dist/solid.cjs CHANGED
@@ -1436,7 +1436,10 @@ function Suspense(props) {
1436
1436
  if (!visibleFallback) return;
1437
1437
  return createRoot(disposer => {
1438
1438
  dispose = disposer;
1439
- if (sharedConfig.context) sharedConfig.context.count = 0;
1439
+ if (sharedConfig.context) setHydrateContext({
1440
+ id: sharedConfig.context.id + "f",
1441
+ count: 0
1442
+ });
1440
1443
  return props.fallback;
1441
1444
  }, owner);
1442
1445
  });
package/dist/solid.js CHANGED
@@ -1432,7 +1432,10 @@ function Suspense(props) {
1432
1432
  if (!visibleFallback) return;
1433
1433
  return createRoot(disposer => {
1434
1434
  dispose = disposer;
1435
- if (sharedConfig.context) sharedConfig.context.count = 0;
1435
+ if (sharedConfig.context) setHydrateContext({
1436
+ id: sharedConfig.context.id + "f",
1437
+ count: 0
1438
+ });
1436
1439
  return props.fallback;
1437
1440
  }, owner);
1438
1441
  });
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": "1.3.0-beta.4",
4
+ "version": "1.3.0-beta.5",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -132,5 +132,5 @@
132
132
  "compiler",
133
133
  "performance"
134
134
  ],
135
- "gitHead": "c9307f020f33ff584f2d896c219e530d8ee97a9c"
135
+ "gitHead": "18bc089262ac37bf761140489c1e6ecbe1ea92d8"
136
136
  }