🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

solid-js

Package Overview
Dependencies
Maintainers
1
Versions
503
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-js - npm Package Compare versions

Comparing version
2.0.0-beta.4
to
2.0.0-beta.5
+89
-88
dist/dev.cjs

@@ -96,2 +96,3 @@ 'use strict';

if (globalThis._$HY) globalThis._$HY.done = true;
sharedConfig.registry?.clear();
});

@@ -114,20 +115,7 @@ }

class MockPromise {
static all() {
return new MockPromise();
static {
for (const k of ["all", "allSettled", "any", "race", "reject", "resolve"]) {
MockPromise[k] = () => new MockPromise();
}
}
static allSettled() {
return new MockPromise();
}
static any() {
return new MockPromise();
}
static race() {
return new MockPromise();
}
static reject() {
return new MockPromise();
}
static resolve() {
return new MockPromise();
}
catch() {

@@ -166,2 +154,24 @@ return new MockPromise();

}
const NO_HYDRATED_VALUE = Symbol("NO_HYDRATED_VALUE");
function readHydratedValue(initP, refresh) {
if (initP == null) return NO_HYDRATED_VALUE;
refresh();
if (typeof initP === "object" && initP.s === 2) throw initP.v;
return initP?.v ?? initP;
}
function readSerializedOrCompute(compute, prev) {
if (!sharedConfig.hydrating) return compute(prev);
const o = signals.getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = readHydratedValue(initP, () => subFetch(compute, prev));
return init !== NO_HYDRATED_VALUE ? init : compute(prev);
}
function forwardIteratorReturn(it, value) {
const returned = it.return?.(value);
return returned && typeof returned.then === "function" ? returned : syncThenable(returned ?? {
done: true,
value
});
}
function normalizeIterator(it) {

@@ -193,2 +203,6 @@ let first = true;

return Promise.resolve(latest);
},
return(value) {
buffered = null;
return forwardIteratorReturn(it, value);
}

@@ -271,2 +285,5 @@ };

return p;
},
return(value) {
return forwardIteratorReturn(srcIt, value);
}

@@ -354,2 +371,6 @@ };

return Promise.resolve(result);
},
return(value) {
buffered = null;
return forwardIteratorReturn(srcIt, value);
}

@@ -387,10 +408,3 @@ };

if (aiResult !== null) return aiResult;
return signals.createMemo(prev => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, value, options);
return signals.createMemo(prev => readSerializedOrCompute(compute, prev), value, options);
}

@@ -421,10 +435,3 @@ function hydratedCreateSignal(fn, second, third) {

if (aiResult !== null) return aiResult;
return signals.createSignal(prev => {
if (!sharedConfig.hydrating) return fn(prev);
const o = signals.getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return signals.createSignal(prev => readSerializedOrCompute(fn, prev), second, third);
}

@@ -475,20 +482,6 @@ function hydratedCreateErrorBoundary(fn, fallback) {

if (aiResult !== null) return aiResult;
return signals.createOptimistic(prev => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return fn(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return signals.createOptimistic(prev => readSerializedOrCompute(fn, prev), second, third);
}
function wrapStoreFn(fn) {
return draft => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return fn(draft);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, draft), init) : fn(draft);
};
return draft => readSerializedOrCompute(() => fn(draft), draft);
}

@@ -516,7 +509,4 @@ function hydrateStoreLikeFn(coreFn, fn, initialValue, options, ssrSource) {

const initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
if (init != null) {
subFetch(fn, draft);
return init;
}
const init = readHydratedValue(initP, () => subFetch(fn, draft));
if (init !== NO_HYDRATED_VALUE) return init;
}

@@ -588,10 +578,3 @@ return fn(draft);

markTopLevelSnapshotScope();
coreFn(prev => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, effectFn, value, options);
coreFn(prev => readSerializedOrCompute(compute, prev), effectFn, value, options);
}

@@ -694,3 +677,3 @@ function hydratedCreateRenderEffect(compute, effectFn, value, options) {

}
sharedConfig.gather(id);
sharedConfig.gather?.(id);
_hydratingValue = true;

@@ -707,7 +690,5 @@ signals.markSnapshotScope(o);

}
function Loading(props) {
const onOpt = props.on ? {
on: () => props.on()
} : undefined;
if (!sharedConfig.hydrating) return signals.createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
function createLoadingBoundary(fn, fallback, options) {
if (!sharedConfig.hydrating) return signals.createLoadingBoundary(fn, fallback, options);
let settledSerializationResumeQueued = false;
return signals.createMemo(() => {

@@ -722,7 +703,23 @@ const o = signals.getOwner();

if (sharedConfig.hydrating && sharedConfig.has(id)) {
let ref = sharedConfig.load(id);
const ref = sharedConfig.load(id);
let p;
if (ref) {
if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(id);
if (typeof ref !== "object" || ref.s == null) p = ref;else if (ref.s === 1 || ref.s === 2) sharedConfig.gather?.(id);else p = ref;
}
if (ref && typeof ref === "object" && ref.s === 1 && p == null && !settledSerializationResumeQueued) {
settledSerializationResumeQueued = true;
_pendingBoundaries++;
signals.onCleanup(() => {
if (!signals.isDisposed(o)) return;
sharedConfig.cleanupFragment?.(id);
});
const set = createBoundaryTrigger();
const scheduleResume = () => queueMicrotask(() => resumeBoundaryHydration(o, id, set));
if (assetPromise) {
assetPromise.then(scheduleResume);
return undefined;
}
scheduleResume();
return fallback();
}
if (p) {

@@ -737,8 +734,13 @@ _pendingBoundaries++;

const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
waitFor.then(() => resumeBoundaryHydration(o, id, set), err => {
_pendingBoundaries--;
checkHydrationComplete();
signals.runWithOwner(o, () => {
throw err;
});
waitFor.then(() => {
if (p && typeof p === "object") {
p.s = 1;
}
resumeBoundaryHydration(o, id, set);
}, err => {
if (p && typeof p === "object") {
p.s = 2;
p.v = err;
}
resumeBoundaryHydration(o, id, set);
});

@@ -753,6 +755,6 @@ } else {

}
return props.fallback;
return fallback();
}
}
if (assetPromise) {
if (assetPromise && !sharedConfig.has(id)) {
_pendingBoundaries++;

@@ -763,4 +765,3 @@ const set = createBoundaryTrigger();

}
const boundary = signals.createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
return boundary;
return signals.createLoadingBoundary(fn, fallback, options);
});

@@ -905,2 +906,8 @@ }

}
function Loading(props) {
const onOpt = "on" in props ? {
on: () => props.on
} : undefined;
return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
}

@@ -938,10 +945,2 @@ function ssrHandleError() {}

});
Object.defineProperty(exports, "createErrorBoundary", {
enumerable: true,
get: function () { return signals.createErrorBoundary; }
});
Object.defineProperty(exports, "createLoadingBoundary", {
enumerable: true,
get: function () { return signals.createLoadingBoundary; }
});
Object.defineProperty(exports, "createOwner", {

@@ -1083,2 +1082,4 @@ enumerable: true,

exports.createEffect = createEffect;
exports.createErrorBoundary = createErrorBoundary;
exports.createLoadingBoundary = createLoadingBoundary;
exports.createMemo = createMemo;

@@ -1085,0 +1086,0 @@ exports.createOptimistic = createOptimistic;

@@ -1,3 +0,3 @@

import { getContext, createMemo as createMemo$1, flatten, getOwner, createRoot, setContext, untrack, createLoadingBoundary, onCleanup, isDisposed, runWithOwner, createOwner, createEffect as createEffect$1, 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, createErrorBoundary as createErrorBoundary$1, markSnapshotScope, flush, clearSnapshots, peekNextChildId, mapArray, repeat } from '@solidjs/signals';
export { $PROXY, $REFRESH, $TRACK, NotReadyError, action, createErrorBoundary, createLoadingBoundary, 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';
import { getContext, createMemo as createMemo$1, flatten, getOwner, createRoot, setContext, untrack, createOwner, runWithOwner, createEffect as createEffect$1, createErrorBoundary as createErrorBoundary$1, createLoadingBoundary as createLoadingBoundary$1, 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, mapArray, repeat } from '@solidjs/signals';
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';

@@ -95,2 +95,3 @@ const $DEVCOMP = Symbol("COMPONENT_DEV" );

if (globalThis._$HY) globalThis._$HY.done = true;
sharedConfig.registry?.clear();
});

@@ -113,20 +114,7 @@ }

class MockPromise {
static all() {
return new MockPromise();
static {
for (const k of ["all", "allSettled", "any", "race", "reject", "resolve"]) {
MockPromise[k] = () => new MockPromise();
}
}
static allSettled() {
return new MockPromise();
}
static any() {
return new MockPromise();
}
static race() {
return new MockPromise();
}
static reject() {
return new MockPromise();
}
static resolve() {
return new MockPromise();
}
catch() {

@@ -165,2 +153,24 @@ return new MockPromise();

}
const NO_HYDRATED_VALUE = Symbol("NO_HYDRATED_VALUE");
function readHydratedValue(initP, refresh) {
if (initP == null) return NO_HYDRATED_VALUE;
refresh();
if (typeof initP === "object" && initP.s === 2) throw initP.v;
return initP?.v ?? initP;
}
function readSerializedOrCompute(compute, prev) {
if (!sharedConfig.hydrating) return compute(prev);
const o = getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = readHydratedValue(initP, () => subFetch(compute, prev));
return init !== NO_HYDRATED_VALUE ? init : compute(prev);
}
function forwardIteratorReturn(it, value) {
const returned = it.return?.(value);
return returned && typeof returned.then === "function" ? returned : syncThenable(returned ?? {
done: true,
value
});
}
function normalizeIterator(it) {

@@ -192,2 +202,6 @@ let first = true;

return Promise.resolve(latest);
},
return(value) {
buffered = null;
return forwardIteratorReturn(it, value);
}

@@ -270,2 +284,5 @@ };

return p;
},
return(value) {
return forwardIteratorReturn(srcIt, value);
}

@@ -353,2 +370,6 @@ };

return Promise.resolve(result);
},
return(value) {
buffered = null;
return forwardIteratorReturn(srcIt, value);
}

@@ -386,10 +407,3 @@ };

if (aiResult !== null) return aiResult;
return createMemo$1(prev => {
const o = getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, value, options);
return createMemo$1(prev => readSerializedOrCompute(compute, prev), value, options);
}

@@ -420,10 +434,3 @@ function hydratedCreateSignal(fn, second, third) {

if (aiResult !== null) return aiResult;
return createSignal$1(prev => {
if (!sharedConfig.hydrating) return fn(prev);
const o = getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return createSignal$1(prev => readSerializedOrCompute(fn, prev), second, third);
}

@@ -474,20 +481,6 @@ function hydratedCreateErrorBoundary(fn, fallback) {

if (aiResult !== null) return aiResult;
return createOptimistic$1(prev => {
const o = getOwner();
if (!sharedConfig.hydrating) return fn(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return createOptimistic$1(prev => readSerializedOrCompute(fn, prev), second, third);
}
function wrapStoreFn(fn) {
return draft => {
const o = getOwner();
if (!sharedConfig.hydrating) return fn(draft);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, draft), init) : fn(draft);
};
return draft => readSerializedOrCompute(() => fn(draft), draft);
}

@@ -515,7 +508,4 @@ function hydrateStoreLikeFn(coreFn, fn, initialValue, options, ssrSource) {

const initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
if (init != null) {
subFetch(fn, draft);
return init;
}
const init = readHydratedValue(initP, () => subFetch(fn, draft));
if (init !== NO_HYDRATED_VALUE) return init;
}

@@ -587,10 +577,3 @@ return fn(draft);

markTopLevelSnapshotScope();
coreFn(prev => {
const o = getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, effectFn, value, options);
coreFn(prev => readSerializedOrCompute(compute, prev), effectFn, value, options);
}

@@ -693,3 +676,3 @@ function hydratedCreateRenderEffect(compute, effectFn, value, options) {

}
sharedConfig.gather(id);
sharedConfig.gather?.(id);
_hydratingValue = true;

@@ -706,7 +689,5 @@ markSnapshotScope(o);

}
function Loading(props) {
const onOpt = props.on ? {
on: () => props.on()
} : undefined;
if (!sharedConfig.hydrating) return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
function createLoadingBoundary(fn, fallback, options) {
if (!sharedConfig.hydrating) return createLoadingBoundary$1(fn, fallback, options);
let settledSerializationResumeQueued = false;
return createMemo$1(() => {

@@ -721,7 +702,23 @@ const o = getOwner();

if (sharedConfig.hydrating && sharedConfig.has(id)) {
let ref = sharedConfig.load(id);
const ref = sharedConfig.load(id);
let p;
if (ref) {
if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(id);
if (typeof ref !== "object" || ref.s == null) p = ref;else if (ref.s === 1 || ref.s === 2) sharedConfig.gather?.(id);else p = ref;
}
if (ref && typeof ref === "object" && ref.s === 1 && p == null && !settledSerializationResumeQueued) {
settledSerializationResumeQueued = true;
_pendingBoundaries++;
onCleanup(() => {
if (!isDisposed(o)) return;
sharedConfig.cleanupFragment?.(id);
});
const set = createBoundaryTrigger();
const scheduleResume = () => queueMicrotask(() => resumeBoundaryHydration(o, id, set));
if (assetPromise) {
assetPromise.then(scheduleResume);
return undefined;
}
scheduleResume();
return fallback();
}
if (p) {

@@ -736,8 +733,13 @@ _pendingBoundaries++;

const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
waitFor.then(() => resumeBoundaryHydration(o, id, set), err => {
_pendingBoundaries--;
checkHydrationComplete();
runWithOwner(o, () => {
throw err;
});
waitFor.then(() => {
if (p && typeof p === "object") {
p.s = 1;
}
resumeBoundaryHydration(o, id, set);
}, err => {
if (p && typeof p === "object") {
p.s = 2;
p.v = err;
}
resumeBoundaryHydration(o, id, set);
});

@@ -752,6 +754,6 @@ } else {

}
return props.fallback;
return fallback();
}
}
if (assetPromise) {
if (assetPromise && !sharedConfig.has(id)) {
_pendingBoundaries++;

@@ -762,4 +764,3 @@ const set = createBoundaryTrigger();

}
const boundary = createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
return boundary;
return createLoadingBoundary$1(fn, fallback, options);
});

@@ -904,2 +905,8 @@ }

}
function Loading(props) {
const onOpt = "on" in props ? {
on: () => props.on
} : undefined;
return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
}

@@ -917,2 +924,2 @@ function ssrHandleError() {}

export { $DEVCOMP, DEV, Errored, For, Hydration, Loading, Match, NoHydrateContext, NoHydration, Repeat, Show, Switch, children, createComponent, createContext, createEffect, createMemo, createOptimistic, createOptimisticStore, createProjection, createRenderEffect, createSignal, createStore, createUniqueId, enableHydration, lazy, sharedConfig, ssrHandleError, ssrRunInScope, useContext };
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 };

@@ -67,3 +67,3 @@ 'use strict';

if (err instanceof signals.NotReadyError) {
err.source?.then(() => update());
err.source?.then(() => update(), () => update());
}

@@ -153,5 +153,13 @@ comp.error = err;

const id = owner.id;
const uninitialized = comp.value === undefined;
const noHydrate = signals.getContext(NoHydrateContext, owner);
if (result instanceof Promise) {
if (result.s === 1) {
comp.value = result.v;
comp.error = undefined;
return;
}
if (result.s === 2) {
comp.error = result.v;
return;
}
result.then(v => {

@@ -163,7 +171,10 @@ result.s = 1;

comp.error = undefined;
}, () => {});
}, err => {
result.s = 2;
result.v = err;
if (comp.disposed) return;
comp.error = err;
});
if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, result, deferStream);
if (uninitialized) {
comp.error = new signals.NotReadyError(result);
}
comp.error = new signals.NotReadyError(result);
return;

@@ -178,2 +189,3 @@ }

promise.v = v.value;
if (!v.done) closeAsyncIterator(iter);
if (comp.disposed) return v.value;

@@ -206,2 +218,5 @@ comp.value = v.value;

return iter.next().then(r => r);
},
return(value) {
return iter.return?.(value);
}

@@ -218,2 +233,8 @@ })

}
function closeAsyncIterator(iter, value) {
const returned = iter.return?.(value);
if (returned && typeof returned.then === "function") {
returned.then(undefined, () => {});
}
}
function serverEffect(compute, effectFn, value, options) {

@@ -320,2 +341,3 @@ const ssrSource = options?.ssrSource;

promise.s = 1;
if (!r.done) closeAsyncIterator(iter);
if (disposed) {

@@ -388,2 +410,5 @@ promise.v = state;

});
},
return(value) {
return iter.return?.(value);
}

@@ -440,3 +465,3 @@ })

const parent = signals.createOwner();
return () => {
return createMemo(() => {
const items = list();

@@ -458,23 +483,23 @@ let s = [];

return s;
};
});
}
function repeat(count, mapFn, options = {}) {
const owner = signals.createOwner();
const len = count();
const offset = options.from?.() || 0;
let s = [];
if (len) {
signals.runWithOwner(owner, () => {
for (let i = 0; i < len; i++) {
const itemOwner = signals.createOwner();
s.push(signals.runWithOwner(itemOwner, () => mapFn(i + offset)));
}
});
} else if (options.fallback) {
s = [signals.runWithOwner(owner, () => {
const fo = signals.createOwner();
return signals.runWithOwner(fo, () => options.fallback());
})];
}
return () => s;
return createMemo(() => {
const len = count();
const offset = options.from?.() || 0;
if (!len) {
if (!options.fallback) return [];
return [signals.runWithOwner(owner, () => {
const fallbackOwner = signals.createOwner();
return signals.runWithOwner(fallbackOwner, () => options.fallback());
})];
}
return signals.runWithOwner(owner, () => Array.from({
length: len
}, (_, i) => {
const itemOwner = signals.createOwner();
return signals.runWithOwner(itemOwner, () => mapFn(i + offset));
}));
});
}

@@ -485,24 +510,63 @@ const ErrorContext = {

};
function runWithBoundaryErrorContext(owner, render, onError, context, boundaryId) {
const prevCtx = sharedConfig.context;
const prevBoundary = context?._currentBoundaryId;
if (context) {
sharedConfig.context = context;
if (boundaryId !== undefined) context._currentBoundaryId = boundaryId;
}
try {
return signals.runWithOwner(owner, () => {
const parentHandler = signals.getContext(ErrorContext);
signals.setContext(ErrorContext, err => onError(err, parentHandler));
return render();
});
} finally {
if (context) {
if (boundaryId !== undefined) context._currentBoundaryId = prevBoundary;
sharedConfig.context = prevCtx;
}
}
}
function createErrorBoundary(fn, fallback) {
const ctx = sharedConfig.context;
const parent = signals.getOwner();
const owner = signals.createOwner();
const parent = signals.getOwner();
if (parent?.id != null) signals.getNextChildId(parent);
owner.id = owner.id + "0";
return signals.runWithOwner(owner, () => {
const resolve = () => {
const resolved = ctx.resolve(signals.runWithOwner(signals.createOwner(), fn));
if (resolved?.p?.length) throw new signals.NotReadyError(Promise.all(resolved.p));
return resolved;
};
const renderFallback = err => ctx ? signals.runWithOwner(parent, () => {
const fallbackOwner = signals.createOwner();
return signals.runWithOwner(fallbackOwner, () => fallback(err, () => {}));
}) : fallback(err, () => {});
const serializeError = err => {
if (ctx && owner.id && !signals.runWithOwner(owner, () => signals.getContext(NoHydrateContext))) {
ctx.serialize(owner.id, err);
}
};
const handleError = err => {
serializeError(err);
return renderFallback(err);
};
return () => {
let result;
signals.setContext(ErrorContext, err => {
if (ctx && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err);
result = fallback(err, () => {});
});
let handled = false;
if (ctx) owner.dispose(false);
try {
result = fn();
result = ctx ? runWithBoundaryErrorContext(owner, resolve, err => {
if (err instanceof signals.NotReadyError) throw err;
handled = true;
result = handleError(err);
throw err;
}) : signals.runWithOwner(owner, fn);
} catch (err) {
if (ctx && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err);
result = fallback(err, () => {});
if (err instanceof signals.NotReadyError) throw err;
result = handled ? result : handleError(err);
}
return () => result;
});
return result;
};
}
function createLoadingBoundary(fn, fallback, options) {
function createLoadingBoundary$1(fn, fallback, options) {
try {

@@ -583,3 +647,5 @@ const result = fn();

function ssrRunInScope(fn) {
return fn;
const owner = signals.getOwner();
if (!owner) return fn;
return Array.isArray(fn) ? fn.map(hole => () => signals.runWithOwner(owner, hole)) : () => signals.runWithOwner(owner, fn);
}

@@ -641,2 +707,132 @@

function ssrHandleError(err) {
if (err instanceof signals.NotReadyError) {
return err.source;
}
const handler = signals.getContext(ErrorContext);
if (handler) {
handler(err);
return;
}
throw err;
}
class InvalidTopLevelAsyncReadError extends Error {
constructor() {
super("Async values must be read within a tracking scope (JSX, a memo, or an effect's compute function).");
this.name = "InvalidTopLevelAsyncReadError";
}
}
function createLoadingBoundary(fn, fallback, options) {
const currentCtx = sharedConfig.context;
if (!currentCtx) {
return createLoadingBoundary$1(fn, fallback);
}
const ctx = currentCtx;
const parent = signals.getOwner();
const parentHandler = parent && signals.runWithOwner(parent, () => signals.getContext(ErrorContext));
const o = signals.createOwner();
const id = o.id;
o.id = id + "00";
let done;
let handledRenderError;
let serializeBuffer = [];
const bufferedCtx = Object.create(ctx);
bufferedCtx.serialize = (id, value, deferStream) => {
serializeBuffer.push([id, value, deferStream]);
};
bufferedCtx._currentBoundaryId = id;
function flushSerializeBuffer() {
for (const args of serializeBuffer) ctx.serialize(args[0], args[1], args[2]);
serializeBuffer = [];
}
function commitBoundaryState() {
flushSerializeBuffer();
const modules = ctx.getBoundaryModules?.(id);
if (modules) ctx.serialize(id + "_assets", modules);
}
function runLoadingPhase(render) {
handledRenderError = undefined;
return runWithBoundaryErrorContext(o, render, (err, parentHandler) => {
handledRenderError = err;
if (done?.(undefined, err)) throw err;
if (parentHandler) {
parentHandler(err);
return;
}
throw err;
}, bufferedCtx, id);
}
function finalizeError(err) {
if (handledRenderError === err) {
handledRenderError = undefined;
return;
}
if (done?.(undefined, err)) return;
if (!parentHandler) throw err;
try {
signals.runWithOwner(parent, () => parentHandler(err));
} catch (caught) {
if (caught !== err) throw caught;
}
}
function runDiscovery() {
o.dispose(false);
serializeBuffer = [];
return runLoadingPhase(() => {
try {
return ctx.resolve(fn());
} catch (err) {
if (err instanceof signals.NotReadyError) throw new InvalidTopLevelAsyncReadError();
throw err;
}
});
}
let ret = runDiscovery();
if (!ret?.p?.length) {
commitBoundaryState();
return () => ret;
}
const fallbackOwner = signals.createOwner({
id
});
const fallbackResult = signals.runWithOwner(fallbackOwner, () => ctx.async ? ctx.ssr([`<template id="pl-${id}"></template>`, `<!--pl-${id}-->`], ctx.escape(fallback())) : fallback());
if (ctx.async) {
done = ctx.registerFragment(id);
(async () => {
try {
commitBoundaryState();
while (ret.p.length) {
await Promise.all(ret.p).catch(() => {});
ret = runLoadingPhase(() => ctx.ssr(ret.t, ...ret.h));
}
flushSerializeBuffer();
done(ret.t[0]);
} catch (err) {
finalizeError(err);
}
})();
return () => fallbackResult;
}
commitBoundaryState();
ctx.serialize(id, "$$f");
return () => fallbackResult;
}
function NoHydration(props) {
const o = signals.createOwner();
return signals.runWithOwner(o, () => {
signals.setContext(NoHydrateContext, true);
return props.children;
});
}
function Hydration(props) {
if (!signals.getContext(NoHydrateContext)) return props.children;
const o = signals.createOwner({
id: props.id ?? ""
});
return signals.runWithOwner(o, () => {
signals.setContext(NoHydrateContext, false);
return props.children;
});
}
function For(props) {

@@ -649,3 +845,3 @@ const options = "fallback" in props ? {

};
return createMemo(mapArray(() => props.each, props.children, options));
return mapArray(() => props.each, props.children, options);
}

@@ -703,103 +899,5 @@ function Repeat(props) {

}
function ssrHandleError(err) {
if (err instanceof signals.NotReadyError) {
return err.source;
}
const handler = signals.getContext(ErrorContext);
if (handler) {
handler(err);
return;
}
throw err;
}
function Loading(props) {
const ctx = sharedConfig.context;
if (!ctx) {
return createLoadingBoundary(() => props.children, () => props.fallback);
}
const o = signals.createOwner();
const id = o.id;
o.id = id + "00";
let runPromise;
let serializeBuffer = [];
const origSerialize = ctx.serialize;
function runInitially() {
o.dispose(false);
serializeBuffer = [];
ctx.serialize = (id, p, deferStream) => {
serializeBuffer.push([id, p, deferStream]);
};
const prevBoundary = ctx._currentBoundaryId;
ctx._currentBoundaryId = id;
const result = signals.runWithOwner(o, () => {
try {
return ctx.resolve(props.children);
} catch (err) {
runPromise = ssrHandleError(err);
}
});
ctx._currentBoundaryId = prevBoundary;
ctx.serialize = origSerialize;
return result;
}
let ret = runInitially();
if (!(runPromise || ret?.p?.length)) {
for (const args of serializeBuffer) origSerialize(args[0], args[1], args[2]);
serializeBuffer = [];
const modules = ctx.getBoundaryModules?.(id);
if (modules) ctx.serialize(id + "_assets", modules);
return ret;
}
const fallbackOwner = signals.createOwner({
id
});
signals.getNextChildId(fallbackOwner);
if (ctx.async) {
const done = ctx.registerFragment(id);
(async () => {
try {
while (runPromise) {
o.dispose(false);
await runPromise;
runPromise = undefined;
ret = runInitially();
}
for (const args of serializeBuffer) origSerialize(args[0], args[1], args[2]);
serializeBuffer = [];
while (ret.p.length) {
await Promise.all(ret.p);
ret = signals.runWithOwner(o, () => ctx.ssr(ret.t, ...ret.h));
}
done(ret.t[0]);
} catch (err) {
done(undefined, err);
}
})();
return signals.runWithOwner(fallbackOwner, () => ctx.ssr([`<template id="pl-${id}"></template>`, `<!--pl-${id}-->`], ctx.escape(props.fallback)));
}
for (const args of serializeBuffer) origSerialize(args[0], args[1], args[2]);
serializeBuffer = [];
const modules = ctx.getBoundaryModules?.(id);
if (modules) ctx.serialize(id + "_assets", modules);
ctx.serialize(id, "$$f");
return signals.runWithOwner(fallbackOwner, () => props.fallback);
return createLoadingBoundary(() => props.children, () => props.fallback);
}
function NoHydration(props) {
const o = signals.createOwner();
return signals.runWithOwner(o, () => {
signals.setContext(NoHydrateContext, true);
return props.children;
});
}
function Hydration(props) {
if (!signals.getContext(NoHydrateContext)) return props.children;
const o = signals.createOwner({
id: props.id ?? ""
});
return signals.runWithOwner(o, () => {
signals.setContext(NoHydrateContext, false);
return props.children;
});
}

@@ -806,0 +904,0 @@ const DEV = undefined;

@@ -1,2 +0,2 @@

import { getOwner, getContext, getNextChildId, createOwner, runWithOwner, setContext, NotReadyError, onCleanup, isWrappable, flatten, createRoot } from '@solidjs/signals';
import { getOwner, getContext, getNextChildId, createOwner, NotReadyError, runWithOwner, onCleanup, isWrappable, setContext, flatten, createRoot } from '@solidjs/signals';
export { $PROXY, $REFRESH, $TRACK, NotReadyError, createOwner, createRoot, enableExternalSource, enforceLoadingBoundary, flatten, getNextChildId, getOwner, isEqual, isWrappable, merge, omit, onCleanup, runWithOwner, snapshot, storePath } from '@solidjs/signals';

@@ -66,3 +66,3 @@

if (err instanceof NotReadyError) {
err.source?.then(() => update());
err.source?.then(() => update(), () => update());
}

@@ -152,5 +152,13 @@ comp.error = err;

const id = owner.id;
const uninitialized = comp.value === undefined;
const noHydrate = getContext(NoHydrateContext, owner);
if (result instanceof Promise) {
if (result.s === 1) {
comp.value = result.v;
comp.error = undefined;
return;
}
if (result.s === 2) {
comp.error = result.v;
return;
}
result.then(v => {

@@ -162,7 +170,10 @@ result.s = 1;

comp.error = undefined;
}, () => {});
}, err => {
result.s = 2;
result.v = err;
if (comp.disposed) return;
comp.error = err;
});
if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, result, deferStream);
if (uninitialized) {
comp.error = new NotReadyError(result);
}
comp.error = new NotReadyError(result);
return;

@@ -177,2 +188,3 @@ }

promise.v = v.value;
if (!v.done) closeAsyncIterator(iter);
if (comp.disposed) return v.value;

@@ -205,2 +217,5 @@ comp.value = v.value;

return iter.next().then(r => r);
},
return(value) {
return iter.return?.(value);
}

@@ -217,2 +232,8 @@ })

}
function closeAsyncIterator(iter, value) {
const returned = iter.return?.(value);
if (returned && typeof returned.then === "function") {
returned.then(undefined, () => {});
}
}
function serverEffect(compute, effectFn, value, options) {

@@ -319,2 +340,3 @@ const ssrSource = options?.ssrSource;

promise.s = 1;
if (!r.done) closeAsyncIterator(iter);
if (disposed) {

@@ -387,2 +409,5 @@ promise.v = state;

});
},
return(value) {
return iter.return?.(value);
}

@@ -439,3 +464,3 @@ })

const parent = createOwner();
return () => {
return createMemo(() => {
const items = list();

@@ -457,23 +482,23 @@ let s = [];

return s;
};
});
}
function repeat(count, mapFn, options = {}) {
const owner = createOwner();
const len = count();
const offset = options.from?.() || 0;
let s = [];
if (len) {
runWithOwner(owner, () => {
for (let i = 0; i < len; i++) {
const itemOwner = createOwner();
s.push(runWithOwner(itemOwner, () => mapFn(i + offset)));
}
});
} else if (options.fallback) {
s = [runWithOwner(owner, () => {
const fo = createOwner();
return runWithOwner(fo, () => options.fallback());
})];
}
return () => s;
return createMemo(() => {
const len = count();
const offset = options.from?.() || 0;
if (!len) {
if (!options.fallback) return [];
return [runWithOwner(owner, () => {
const fallbackOwner = createOwner();
return runWithOwner(fallbackOwner, () => options.fallback());
})];
}
return runWithOwner(owner, () => Array.from({
length: len
}, (_, i) => {
const itemOwner = createOwner();
return runWithOwner(itemOwner, () => mapFn(i + offset));
}));
});
}

@@ -484,24 +509,63 @@ const ErrorContext = {

};
function runWithBoundaryErrorContext(owner, render, onError, context, boundaryId) {
const prevCtx = sharedConfig.context;
const prevBoundary = context?._currentBoundaryId;
if (context) {
sharedConfig.context = context;
if (boundaryId !== undefined) context._currentBoundaryId = boundaryId;
}
try {
return runWithOwner(owner, () => {
const parentHandler = getContext(ErrorContext);
setContext(ErrorContext, err => onError(err, parentHandler));
return render();
});
} finally {
if (context) {
if (boundaryId !== undefined) context._currentBoundaryId = prevBoundary;
sharedConfig.context = prevCtx;
}
}
}
function createErrorBoundary(fn, fallback) {
const ctx = sharedConfig.context;
const parent = getOwner();
const owner = createOwner();
const parent = getOwner();
if (parent?.id != null) getNextChildId(parent);
owner.id = owner.id + "0";
return runWithOwner(owner, () => {
const resolve = () => {
const resolved = ctx.resolve(runWithOwner(createOwner(), fn));
if (resolved?.p?.length) throw new NotReadyError(Promise.all(resolved.p));
return resolved;
};
const renderFallback = err => ctx ? runWithOwner(parent, () => {
const fallbackOwner = createOwner();
return runWithOwner(fallbackOwner, () => fallback(err, () => {}));
}) : fallback(err, () => {});
const serializeError = err => {
if (ctx && owner.id && !runWithOwner(owner, () => getContext(NoHydrateContext))) {
ctx.serialize(owner.id, err);
}
};
const handleError = err => {
serializeError(err);
return renderFallback(err);
};
return () => {
let result;
setContext(ErrorContext, err => {
if (ctx && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err);
result = fallback(err, () => {});
});
let handled = false;
if (ctx) owner.dispose(false);
try {
result = fn();
result = ctx ? runWithBoundaryErrorContext(owner, resolve, err => {
if (err instanceof NotReadyError) throw err;
handled = true;
result = handleError(err);
throw err;
}) : runWithOwner(owner, fn);
} catch (err) {
if (ctx && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err);
result = fallback(err, () => {});
if (err instanceof NotReadyError) throw err;
result = handled ? result : handleError(err);
}
return () => result;
});
return result;
};
}
function createLoadingBoundary(fn, fallback, options) {
function createLoadingBoundary$1(fn, fallback, options) {
try {

@@ -582,3 +646,5 @@ const result = fn();

function ssrRunInScope(fn) {
return fn;
const owner = getOwner();
if (!owner) return fn;
return Array.isArray(fn) ? fn.map(hole => () => runWithOwner(owner, hole)) : () => runWithOwner(owner, fn);
}

@@ -640,2 +706,132 @@

function ssrHandleError(err) {
if (err instanceof NotReadyError) {
return err.source;
}
const handler = getContext(ErrorContext);
if (handler) {
handler(err);
return;
}
throw err;
}
class InvalidTopLevelAsyncReadError extends Error {
constructor() {
super("Async values must be read within a tracking scope (JSX, a memo, or an effect's compute function).");
this.name = "InvalidTopLevelAsyncReadError";
}
}
function createLoadingBoundary(fn, fallback, options) {
const currentCtx = sharedConfig.context;
if (!currentCtx) {
return createLoadingBoundary$1(fn, fallback);
}
const ctx = currentCtx;
const parent = getOwner();
const parentHandler = parent && runWithOwner(parent, () => getContext(ErrorContext));
const o = createOwner();
const id = o.id;
o.id = id + "00";
let done;
let handledRenderError;
let serializeBuffer = [];
const bufferedCtx = Object.create(ctx);
bufferedCtx.serialize = (id, value, deferStream) => {
serializeBuffer.push([id, value, deferStream]);
};
bufferedCtx._currentBoundaryId = id;
function flushSerializeBuffer() {
for (const args of serializeBuffer) ctx.serialize(args[0], args[1], args[2]);
serializeBuffer = [];
}
function commitBoundaryState() {
flushSerializeBuffer();
const modules = ctx.getBoundaryModules?.(id);
if (modules) ctx.serialize(id + "_assets", modules);
}
function runLoadingPhase(render) {
handledRenderError = undefined;
return runWithBoundaryErrorContext(o, render, (err, parentHandler) => {
handledRenderError = err;
if (done?.(undefined, err)) throw err;
if (parentHandler) {
parentHandler(err);
return;
}
throw err;
}, bufferedCtx, id);
}
function finalizeError(err) {
if (handledRenderError === err) {
handledRenderError = undefined;
return;
}
if (done?.(undefined, err)) return;
if (!parentHandler) throw err;
try {
runWithOwner(parent, () => parentHandler(err));
} catch (caught) {
if (caught !== err) throw caught;
}
}
function runDiscovery() {
o.dispose(false);
serializeBuffer = [];
return runLoadingPhase(() => {
try {
return ctx.resolve(fn());
} catch (err) {
if (err instanceof NotReadyError) throw new InvalidTopLevelAsyncReadError();
throw err;
}
});
}
let ret = runDiscovery();
if (!ret?.p?.length) {
commitBoundaryState();
return () => ret;
}
const fallbackOwner = createOwner({
id
});
const fallbackResult = runWithOwner(fallbackOwner, () => ctx.async ? ctx.ssr([`<template id="pl-${id}"></template>`, `<!--pl-${id}-->`], ctx.escape(fallback())) : fallback());
if (ctx.async) {
done = ctx.registerFragment(id);
(async () => {
try {
commitBoundaryState();
while (ret.p.length) {
await Promise.all(ret.p).catch(() => {});
ret = runLoadingPhase(() => ctx.ssr(ret.t, ...ret.h));
}
flushSerializeBuffer();
done(ret.t[0]);
} catch (err) {
finalizeError(err);
}
})();
return () => fallbackResult;
}
commitBoundaryState();
ctx.serialize(id, "$$f");
return () => fallbackResult;
}
function NoHydration(props) {
const o = createOwner();
return runWithOwner(o, () => {
setContext(NoHydrateContext, true);
return props.children;
});
}
function Hydration(props) {
if (!getContext(NoHydrateContext)) return props.children;
const o = createOwner({
id: props.id ?? ""
});
return runWithOwner(o, () => {
setContext(NoHydrateContext, false);
return props.children;
});
}
function For(props) {

@@ -648,3 +844,3 @@ const options = "fallback" in props ? {

};
return createMemo(mapArray(() => props.each, props.children, options));
return mapArray(() => props.each, props.children, options);
}

@@ -702,103 +898,5 @@ function Repeat(props) {

}
function ssrHandleError(err) {
if (err instanceof NotReadyError) {
return err.source;
}
const handler = getContext(ErrorContext);
if (handler) {
handler(err);
return;
}
throw err;
}
function Loading(props) {
const ctx = sharedConfig.context;
if (!ctx) {
return createLoadingBoundary(() => props.children, () => props.fallback);
}
const o = createOwner();
const id = o.id;
o.id = id + "00";
let runPromise;
let serializeBuffer = [];
const origSerialize = ctx.serialize;
function runInitially() {
o.dispose(false);
serializeBuffer = [];
ctx.serialize = (id, p, deferStream) => {
serializeBuffer.push([id, p, deferStream]);
};
const prevBoundary = ctx._currentBoundaryId;
ctx._currentBoundaryId = id;
const result = runWithOwner(o, () => {
try {
return ctx.resolve(props.children);
} catch (err) {
runPromise = ssrHandleError(err);
}
});
ctx._currentBoundaryId = prevBoundary;
ctx.serialize = origSerialize;
return result;
}
let ret = runInitially();
if (!(runPromise || ret?.p?.length)) {
for (const args of serializeBuffer) origSerialize(args[0], args[1], args[2]);
serializeBuffer = [];
const modules = ctx.getBoundaryModules?.(id);
if (modules) ctx.serialize(id + "_assets", modules);
return ret;
}
const fallbackOwner = createOwner({
id
});
getNextChildId(fallbackOwner);
if (ctx.async) {
const done = ctx.registerFragment(id);
(async () => {
try {
while (runPromise) {
o.dispose(false);
await runPromise;
runPromise = undefined;
ret = runInitially();
}
for (const args of serializeBuffer) origSerialize(args[0], args[1], args[2]);
serializeBuffer = [];
while (ret.p.length) {
await Promise.all(ret.p);
ret = runWithOwner(o, () => ctx.ssr(ret.t, ...ret.h));
}
done(ret.t[0]);
} catch (err) {
done(undefined, err);
}
})();
return runWithOwner(fallbackOwner, () => ctx.ssr([`<template id="pl-${id}"></template>`, `<!--pl-${id}-->`], ctx.escape(props.fallback)));
}
for (const args of serializeBuffer) origSerialize(args[0], args[1], args[2]);
serializeBuffer = [];
const modules = ctx.getBoundaryModules?.(id);
if (modules) ctx.serialize(id + "_assets", modules);
ctx.serialize(id, "$$f");
return runWithOwner(fallbackOwner, () => props.fallback);
return createLoadingBoundary(() => props.children, () => props.fallback);
}
function NoHydration(props) {
const o = createOwner();
return runWithOwner(o, () => {
setContext(NoHydrateContext, true);
return props.children;
});
}
function Hydration(props) {
if (!getContext(NoHydrateContext)) return props.children;
const o = createOwner({
id: props.id ?? ""
});
return runWithOwner(o, () => {
setContext(NoHydrateContext, false);
return props.children;
});
}

@@ -805,0 +903,0 @@ const DEV = undefined;

@@ -75,2 +75,3 @@ 'use strict';

if (globalThis._$HY) globalThis._$HY.done = true;
sharedConfig.registry?.clear();
});

@@ -93,20 +94,7 @@ }

class MockPromise {
static all() {
return new MockPromise();
static {
for (const k of ["all", "allSettled", "any", "race", "reject", "resolve"]) {
MockPromise[k] = () => new MockPromise();
}
}
static allSettled() {
return new MockPromise();
}
static any() {
return new MockPromise();
}
static race() {
return new MockPromise();
}
static reject() {
return new MockPromise();
}
static resolve() {
return new MockPromise();
}
catch() {

@@ -145,2 +133,24 @@ return new MockPromise();

}
const NO_HYDRATED_VALUE = Symbol("NO_HYDRATED_VALUE");
function readHydratedValue(initP, refresh) {
if (initP == null) return NO_HYDRATED_VALUE;
refresh();
if (typeof initP === "object" && initP.s === 2) throw initP.v;
return initP?.v ?? initP;
}
function readSerializedOrCompute(compute, prev) {
if (!sharedConfig.hydrating) return compute(prev);
const o = signals.getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = readHydratedValue(initP, () => subFetch(compute, prev));
return init !== NO_HYDRATED_VALUE ? init : compute(prev);
}
function forwardIteratorReturn(it, value) {
const returned = it.return?.(value);
return returned && typeof returned.then === "function" ? returned : syncThenable(returned ?? {
done: true,
value
});
}
function normalizeIterator(it) {

@@ -172,2 +182,6 @@ let first = true;

return Promise.resolve(latest);
},
return(value) {
buffered = null;
return forwardIteratorReturn(it, value);
}

@@ -250,2 +264,5 @@ };

return p;
},
return(value) {
return forwardIteratorReturn(srcIt, value);
}

@@ -333,2 +350,6 @@ };

return Promise.resolve(result);
},
return(value) {
buffered = null;
return forwardIteratorReturn(srcIt, value);
}

@@ -366,10 +387,3 @@ };

if (aiResult !== null) return aiResult;
return signals.createMemo(prev => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, value, options);
return signals.createMemo(prev => readSerializedOrCompute(compute, prev), value, options);
}

@@ -400,10 +414,3 @@ function hydratedCreateSignal(fn, second, third) {

if (aiResult !== null) return aiResult;
return signals.createSignal(prev => {
if (!sharedConfig.hydrating) return fn(prev);
const o = signals.getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return signals.createSignal(prev => readSerializedOrCompute(fn, prev), second, third);
}

@@ -454,20 +461,6 @@ function hydratedCreateErrorBoundary(fn, fallback) {

if (aiResult !== null) return aiResult;
return signals.createOptimistic(prev => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return fn(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return signals.createOptimistic(prev => readSerializedOrCompute(fn, prev), second, third);
}
function wrapStoreFn(fn) {
return draft => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return fn(draft);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, draft), init) : fn(draft);
};
return draft => readSerializedOrCompute(() => fn(draft), draft);
}

@@ -495,7 +488,4 @@ function hydrateStoreLikeFn(coreFn, fn, initialValue, options, ssrSource) {

const initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
if (init != null) {
subFetch(fn, draft);
return init;
}
const init = readHydratedValue(initP, () => subFetch(fn, draft));
if (init !== NO_HYDRATED_VALUE) return init;
}

@@ -567,10 +557,3 @@ return fn(draft);

markTopLevelSnapshotScope();
coreFn(prev => {
const o = signals.getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, effectFn, value, options);
coreFn(prev => readSerializedOrCompute(compute, prev), effectFn, value, options);
}

@@ -673,3 +656,3 @@ function hydratedCreateRenderEffect(compute, effectFn, value, options) {

}
sharedConfig.gather(id);
sharedConfig.gather?.(id);
_hydratingValue = true;

@@ -686,7 +669,5 @@ signals.markSnapshotScope(o);

}
function Loading(props) {
const onOpt = props.on ? {
on: () => props.on()
} : undefined;
if (!sharedConfig.hydrating) return signals.createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
function createLoadingBoundary(fn, fallback, options) {
if (!sharedConfig.hydrating) return signals.createLoadingBoundary(fn, fallback, options);
let settledSerializationResumeQueued = false;
return signals.createMemo(() => {

@@ -701,7 +682,23 @@ const o = signals.getOwner();

if (sharedConfig.hydrating && sharedConfig.has(id)) {
let ref = sharedConfig.load(id);
const ref = sharedConfig.load(id);
let p;
if (ref) {
if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(id);
if (typeof ref !== "object" || ref.s == null) p = ref;else if (ref.s === 1 || ref.s === 2) sharedConfig.gather?.(id);else p = ref;
}
if (ref && typeof ref === "object" && ref.s === 1 && p == null && !settledSerializationResumeQueued) {
settledSerializationResumeQueued = true;
_pendingBoundaries++;
signals.onCleanup(() => {
if (!signals.isDisposed(o)) return;
sharedConfig.cleanupFragment?.(id);
});
const set = createBoundaryTrigger();
const scheduleResume = () => queueMicrotask(() => resumeBoundaryHydration(o, id, set));
if (assetPromise) {
assetPromise.then(scheduleResume);
return undefined;
}
scheduleResume();
return fallback();
}
if (p) {

@@ -716,8 +713,13 @@ _pendingBoundaries++;

const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
waitFor.then(() => resumeBoundaryHydration(o, id, set), err => {
_pendingBoundaries--;
checkHydrationComplete();
signals.runWithOwner(o, () => {
throw err;
});
waitFor.then(() => {
if (p && typeof p === "object") {
p.s = 1;
}
resumeBoundaryHydration(o, id, set);
}, err => {
if (p && typeof p === "object") {
p.s = 2;
p.v = err;
}
resumeBoundaryHydration(o, id, set);
});

@@ -732,6 +734,6 @@ } else {

}
return props.fallback;
return fallback();
}
}
if (assetPromise) {
if (assetPromise && !sharedConfig.has(id)) {
_pendingBoundaries++;

@@ -742,4 +744,3 @@ const set = createBoundaryTrigger();

}
const boundary = signals.createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
return boundary;
return signals.createLoadingBoundary(fn, fallback, options);
});

@@ -868,2 +869,8 @@ }

}
function Loading(props) {
const onOpt = "on" in props ? {
on: () => props.on
} : undefined;
return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
}

@@ -894,10 +901,2 @@ function ssrHandleError() {}

});
Object.defineProperty(exports, "createErrorBoundary", {
enumerable: true,
get: function () { return signals.createErrorBoundary; }
});
Object.defineProperty(exports, "createLoadingBoundary", {
enumerable: true,
get: function () { return signals.createLoadingBoundary; }
});
Object.defineProperty(exports, "createOwner", {

@@ -1039,2 +1038,4 @@ enumerable: true,

exports.createEffect = createEffect;
exports.createErrorBoundary = createErrorBoundary;
exports.createLoadingBoundary = createLoadingBoundary;
exports.createMemo = createMemo;

@@ -1041,0 +1042,0 @@ exports.createOptimistic = createOptimistic;

@@ -1,3 +0,3 @@

import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, createLoadingBoundary, getOwner, onCleanup, isDisposed, runWithOwner, createOwner, createEffect as createEffect$1, 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, createErrorBoundary as createErrorBoundary$1, markSnapshotScope, flush, clearSnapshots, peekNextChildId, untrack, mapArray, repeat } from '@solidjs/signals';
export { $PROXY, $REFRESH, $TRACK, NotReadyError, action, createErrorBoundary, createLoadingBoundary, 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';
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';
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';

@@ -74,2 +74,3 @@ const IS_DEV = false;

if (globalThis._$HY) globalThis._$HY.done = true;
sharedConfig.registry?.clear();
});

@@ -92,20 +93,7 @@ }

class MockPromise {
static all() {
return new MockPromise();
static {
for (const k of ["all", "allSettled", "any", "race", "reject", "resolve"]) {
MockPromise[k] = () => new MockPromise();
}
}
static allSettled() {
return new MockPromise();
}
static any() {
return new MockPromise();
}
static race() {
return new MockPromise();
}
static reject() {
return new MockPromise();
}
static resolve() {
return new MockPromise();
}
catch() {

@@ -144,2 +132,24 @@ return new MockPromise();

}
const NO_HYDRATED_VALUE = Symbol("NO_HYDRATED_VALUE");
function readHydratedValue(initP, refresh) {
if (initP == null) return NO_HYDRATED_VALUE;
refresh();
if (typeof initP === "object" && initP.s === 2) throw initP.v;
return initP?.v ?? initP;
}
function readSerializedOrCompute(compute, prev) {
if (!sharedConfig.hydrating) return compute(prev);
const o = getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = readHydratedValue(initP, () => subFetch(compute, prev));
return init !== NO_HYDRATED_VALUE ? init : compute(prev);
}
function forwardIteratorReturn(it, value) {
const returned = it.return?.(value);
return returned && typeof returned.then === "function" ? returned : syncThenable(returned ?? {
done: true,
value
});
}
function normalizeIterator(it) {

@@ -171,2 +181,6 @@ let first = true;

return Promise.resolve(latest);
},
return(value) {
buffered = null;
return forwardIteratorReturn(it, value);
}

@@ -249,2 +263,5 @@ };

return p;
},
return(value) {
return forwardIteratorReturn(srcIt, value);
}

@@ -332,2 +349,6 @@ };

return Promise.resolve(result);
},
return(value) {
buffered = null;
return forwardIteratorReturn(srcIt, value);
}

@@ -365,10 +386,3 @@ };

if (aiResult !== null) return aiResult;
return createMemo$1(prev => {
const o = getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, value, options);
return createMemo$1(prev => readSerializedOrCompute(compute, prev), value, options);
}

@@ -399,10 +413,3 @@ function hydratedCreateSignal(fn, second, third) {

if (aiResult !== null) return aiResult;
return createSignal$1(prev => {
if (!sharedConfig.hydrating) return fn(prev);
const o = getOwner();
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return createSignal$1(prev => readSerializedOrCompute(fn, prev), second, third);
}

@@ -453,20 +460,6 @@ function hydratedCreateErrorBoundary(fn, fallback) {

if (aiResult !== null) return aiResult;
return createOptimistic$1(prev => {
const o = getOwner();
if (!sharedConfig.hydrating) return fn(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, prev), init) : fn(prev);
}, second, third);
return createOptimistic$1(prev => readSerializedOrCompute(fn, prev), second, third);
}
function wrapStoreFn(fn) {
return draft => {
const o = getOwner();
if (!sharedConfig.hydrating) return fn(draft);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(fn, draft), init) : fn(draft);
};
return draft => readSerializedOrCompute(() => fn(draft), draft);
}

@@ -494,7 +487,4 @@ function hydrateStoreLikeFn(coreFn, fn, initialValue, options, ssrSource) {

const initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
if (init != null) {
subFetch(fn, draft);
return init;
}
const init = readHydratedValue(initP, () => subFetch(fn, draft));
if (init !== NO_HYDRATED_VALUE) return init;
}

@@ -566,10 +556,3 @@ return fn(draft);

markTopLevelSnapshotScope();
coreFn(prev => {
const o = getOwner();
if (!sharedConfig.hydrating) return compute(prev);
let initP;
if (sharedConfig.has(o.id)) initP = sharedConfig.load(o.id);
const init = initP?.v ?? initP;
return init != null ? (subFetch(compute, prev), init) : compute(prev);
}, effectFn, value, options);
coreFn(prev => readSerializedOrCompute(compute, prev), effectFn, value, options);
}

@@ -672,3 +655,3 @@ function hydratedCreateRenderEffect(compute, effectFn, value, options) {

}
sharedConfig.gather(id);
sharedConfig.gather?.(id);
_hydratingValue = true;

@@ -685,7 +668,5 @@ markSnapshotScope(o);

}
function Loading(props) {
const onOpt = props.on ? {
on: () => props.on()
} : undefined;
if (!sharedConfig.hydrating) return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
function createLoadingBoundary(fn, fallback, options) {
if (!sharedConfig.hydrating) return createLoadingBoundary$1(fn, fallback, options);
let settledSerializationResumeQueued = false;
return createMemo$1(() => {

@@ -700,7 +681,23 @@ const o = getOwner();

if (sharedConfig.hydrating && sharedConfig.has(id)) {
let ref = sharedConfig.load(id);
const ref = sharedConfig.load(id);
let p;
if (ref) {
if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(id);
if (typeof ref !== "object" || ref.s == null) p = ref;else if (ref.s === 1 || ref.s === 2) sharedConfig.gather?.(id);else p = ref;
}
if (ref && typeof ref === "object" && ref.s === 1 && p == null && !settledSerializationResumeQueued) {
settledSerializationResumeQueued = true;
_pendingBoundaries++;
onCleanup(() => {
if (!isDisposed(o)) return;
sharedConfig.cleanupFragment?.(id);
});
const set = createBoundaryTrigger();
const scheduleResume = () => queueMicrotask(() => resumeBoundaryHydration(o, id, set));
if (assetPromise) {
assetPromise.then(scheduleResume);
return undefined;
}
scheduleResume();
return fallback();
}
if (p) {

@@ -715,8 +712,13 @@ _pendingBoundaries++;

const waitFor = assetPromise ? Promise.all([p, assetPromise]) : p;
waitFor.then(() => resumeBoundaryHydration(o, id, set), err => {
_pendingBoundaries--;
checkHydrationComplete();
runWithOwner(o, () => {
throw err;
});
waitFor.then(() => {
if (p && typeof p === "object") {
p.s = 1;
}
resumeBoundaryHydration(o, id, set);
}, err => {
if (p && typeof p === "object") {
p.s = 2;
p.v = err;
}
resumeBoundaryHydration(o, id, set);
});

@@ -731,6 +733,6 @@ } else {

}
return props.fallback;
return fallback();
}
}
if (assetPromise) {
if (assetPromise && !sharedConfig.has(id)) {
_pendingBoundaries++;

@@ -741,4 +743,3 @@ const set = createBoundaryTrigger();

}
const boundary = createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
return boundary;
return createLoadingBoundary$1(fn, fallback, options);
});

@@ -867,2 +868,8 @@ }

}
function Loading(props) {
const onOpt = "on" in props ? {
on: () => props.on
} : undefined;
return createLoadingBoundary(() => props.children, () => props.fallback, onOpt);
}

@@ -873,2 +880,2 @@ function ssrHandleError() {}

export { $DEVCOMP, DEV, Errored, For, Hydration, Loading, Match, NoHydrateContext, NoHydration, Repeat, Show, Switch, children, createComponent, createContext, createEffect, createMemo, createOptimistic, createOptimisticStore, createProjection, createRenderEffect, createSignal, createStore, createUniqueId, enableHydration, lazy, sharedConfig, ssrHandleError, ssrRunInScope, useContext };
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 };
{
"name": "solid-js",
"description": "A declarative JavaScript library for building user interfaces.",
"version": "2.0.0-beta.4",
"version": "2.0.0-beta.5",
"author": "Ryan Carniato",

@@ -82,3 +82,3 @@ "license": "MIT",

"dependencies": {
"@solidjs/signals": "^0.13.6",
"@solidjs/signals": "^0.13.9",
"csstype": "^3.1.0",

@@ -85,0 +85,0 @@ "seroval": "~1.5.0",

import type { Accessor } from "@solidjs/signals";
import type { JSX } from "../jsx.js";
type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T;
type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => JSX.Element;
type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = JSX.Element | NonZeroParams<F>;
/**

@@ -43,7 +46,7 @@ * Creates a list of elements from a list

*/
export declare function Show<T>(props: {
export declare function Show<T, F extends ConditionalRenderCallback<T>>(props: {
when: T | undefined | null | false;
keyed?: boolean;
fallback?: JSX.Element;
children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
children: ConditionalRenderChildren<T, F>;
}): JSX.Element;

@@ -68,6 +71,6 @@ /**

}): JSX.Element;
export type MatchProps<T> = {
export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = {
when: T | undefined | null | false;
keyed?: boolean;
children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
children: ConditionalRenderChildren<T, F>;
};

@@ -83,3 +86,3 @@ /**

*/
export declare function Match<T>(props: MatchProps<T>): JSX.Element;
export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): JSX.Element;
/**

@@ -104,1 +107,18 @@ * Catches uncaught errors inside components and renders a fallback content

}): JSX.Element;
/**
* Tracks all resources inside a component and renders a fallback until they are all resolved
* ```typescript
* const AsyncComponent = lazy(() => import('./component'));
*
* <Loading fallback={<LoadingIndicator />}>
* <AsyncComponent />
* </Loading>
* ```
* @description https://docs.solidjs.com/reference/components/suspense
*/
export declare function Loading(props: {
fallback?: JSX.Element;
on?: any;
children: JSX.Element;
}): JSX.Element;
export {};
import { createErrorBoundary as coreErrorBoundary, createMemo as coreMemo, createSignal as coreSignal, createOptimistic as coreOptimistic, createRenderEffect as coreRenderEffect, createEffect as coreEffect, $REFRESH, type ProjectionOptions, type Store, type StoreSetter, type Context } from "@solidjs/signals";
import { JSX } from "../jsx.js";
type HydrationSsrFields = {
deferStream?: boolean;
ssrSource?: "server" | "hybrid" | "initial" | "client";
};
declare module "@solidjs/signals" {
interface MemoOptions<T> {
deferStream?: boolean;
ssrSource?: "server" | "hybrid" | "initial" | "client";
interface MemoOptions<T> extends HydrationSsrFields {
}
interface SignalOptions<T> {
deferStream?: boolean;
ssrSource?: "server" | "hybrid" | "initial" | "client";
interface SignalOptions<T> extends HydrationSsrFields {
}
interface EffectOptions {
deferStream?: boolean;
ssrSource?: "server" | "hybrid" | "initial" | "client";
interface EffectOptions extends HydrationSsrFields {
}

@@ -79,7 +77,5 @@ }

*/
export declare function Loading(props: {
fallback?: JSX.Element;
export declare function createLoadingBoundary(fn: () => any, fallback: () => any, options?: {
on?: () => any;
children: JSX.Element;
}): JSX.Element;
}): () => unknown;
/**

@@ -86,0 +82,0 @@ * Disables hydration for its children on the client.

@@ -1,2 +0,2 @@

export { $PROXY, $REFRESH, $TRACK, action, createErrorBoundary, createLoadingBoundary, createOwner, createReaction, createRoot, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, enableExternalSource, enforceLoadingBoundary, snapshot, storePath, untrack } from "@solidjs/signals";
export { $PROXY, $REFRESH, $TRACK, action, createOwner, createReaction, createRoot, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, enableExternalSource, enforceLoadingBoundary, snapshot, storePath, untrack } from "@solidjs/signals";
export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";

@@ -7,3 +7,3 @@ export { $DEVCOMP, children, createContext, useContext } from "./client/core.js";

export * from "./client/flow.js";
export { sharedConfig, Loading, enableHydration, createMemo, createSignal, createStore, createProjection, createOptimistic, createOptimisticStore, createRenderEffect, createEffect, NoHydration, Hydration, NoHydrateContext } from "./client/hydration.js";
export { sharedConfig, enableHydration, createErrorBoundary, createLoadingBoundary, createMemo, createSignal, createStore, createProjection, createOptimistic, createOptimisticStore, createRenderEffect, createEffect, NoHydration, Hydration, NoHydrateContext } from "./client/hydration.js";
export declare function ssrHandleError(): void;

@@ -10,0 +10,0 @@ export declare function ssrRunInScope(): void;

import type { Accessor } from "./signals.js";
import type { JSX } from "../jsx.js";
type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T;
type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => JSX.Element;
type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = JSX.Element | NonZeroParams<F>;
/**

@@ -29,7 +32,7 @@ * Creates a list of elements from a list

*/
export declare function Show<T>(props: {
export declare function Show<T, F extends ConditionalRenderCallback<T>>(props: {
when: T | undefined | null | false;
keyed?: boolean;
fallback?: JSX.Element;
children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
children: ConditionalRenderChildren<T, F>;
}): JSX.Element;

@@ -44,6 +47,6 @@ /**

}): JSX.Element;
export type MatchProps<T> = {
export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = {
when: T | undefined | null | false;
keyed?: boolean;
children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
children: ConditionalRenderChildren<T, F>;
};

@@ -54,3 +57,3 @@ /**

*/
export declare function Match<T>(props: MatchProps<T>): JSX.Element;
export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): JSX.Element;
/**

@@ -64,1 +67,11 @@ * Catches uncaught errors inside components and renders a fallback content

}): JSX.Element;
/**
* Tracks all resources inside a component and renders a fallback until they are all resolved
* @description https://docs.solidjs.com/reference/components/suspense
*/
export declare function Loading(props: {
fallback?: JSX.Element;
on?: any;
children: JSX.Element;
}): JSX.Element;
export {};

@@ -18,7 +18,5 @@ import type { JSX } from "../jsx.js";

*/
export declare function Loading(props: {
fallback?: JSX.Element;
export declare function createLoadingBoundary(fn: () => any, fallback: () => any, options?: {
on?: () => any;
children: JSX.Element;
}): JSX.Element;
}): () => unknown;
/**

@@ -25,0 +23,0 @@ * Disables hydration for its children during SSR.

@@ -1,2 +0,2 @@

export { $PROXY, $REFRESH, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, createErrorBoundary, createLoadingBoundary, createOwner, createProjection, createReaction, createRenderEffect, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, snapshot, storePath, createDeepProxy, enableExternalSource, enforceLoadingBoundary, untrack } from "./signals.js";
export { $PROXY, $REFRESH, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, createErrorBoundary, createOwner, createProjection, createReaction, createRenderEffect, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, snapshot, storePath, createDeepProxy, enableExternalSource, enforceLoadingBoundary, untrack } from "./signals.js";
export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter, PatchOp } from "./signals.js";

@@ -7,3 +7,3 @@ export { $DEVCOMP, children, createContext, useContext, ssrRunInScope } from "./core.js";

export * from "./flow.js";
export { sharedConfig, Loading, ssrHandleError, NoHydration, Hydration, NoHydrateContext } from "./hydration.js";
export { sharedConfig, createLoadingBoundary, ssrHandleError, NoHydration, Hydration, NoHydrateContext } from "./hydration.js";
export type { HydrationContext } from "./hydration.js";

@@ -10,0 +10,0 @@ import type { JSX } from "../jsx.js";

@@ -6,3 +6,3 @@ export { createRoot, createOwner, runWithOwner, getOwner, onCleanup, getNextChildId, createContext, setContext, getContext, NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY, enableExternalSource, enforceLoadingBoundary } from "@solidjs/signals";

import type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, MemoOptions, SignalOptions, Signal, Owner, Store, StoreSetter, Context } from "@solidjs/signals";
import { NoHydrateContext } from "./shared.js";
import { sharedConfig, NoHydrateContext } from "./shared.js";
interface ServerComputation<T = any> {

@@ -51,2 +51,3 @@ owner: Owner;

export { ErrorContext };
export declare function runWithBoundaryErrorContext<T>(owner: Owner, render: () => T, onError: (err: any, parentHandler: ((err: any) => void) | null) => void, context?: NonNullable<typeof sharedConfig.context>, boundaryId?: string): T;
export { NoHydrateContext };

@@ -53,0 +54,0 @@ export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: unknown, reset: () => void) => U): () => unknown;

Sorry, the diff of this file is too big to display