Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

solid-js

Package Overview
Dependencies
Maintainers
1
Versions
506
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.10
to
2.0.0-beta.11
+15
-8
dist/dev.cjs

@@ -27,3 +27,4 @@ 'use strict';

name: "children",
lazy: true
lazy: true,
sync: true
} );

@@ -765,3 +766,5 @@ memo.toArray = () => {

return Comp(props);
}) : "");
}) : "", {
sync: true
});
};

@@ -803,3 +806,4 @@ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);

equals: (a, b) => !a === !b,
name: "condition"
name: "condition",
sync: true
} );

@@ -818,3 +822,4 @@ return signals.createMemo(() => {

}, {
name: "value"
name: "value",
sync: true
} );

@@ -836,3 +841,4 @@ }

equals: (a, b) => !a === !b,
name: "condition"
name: "condition",
sync: true
} );

@@ -842,2 +848,4 @@ func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);

return func;
}, {
sync: true
});

@@ -855,3 +863,4 @@ return signals.createMemo(() => {

}, {
name: "eval conditions"
name: "eval conditions",
sync: true
} );

@@ -883,3 +892,2 @@ }

function ssrHandleError() {}
function ssrRunInScope() {}
const DEV = signals.DEV ;

@@ -1069,3 +1077,2 @@ if (globalThis) {

exports.ssrHandleError = ssrHandleError;
exports.ssrRunInScope = ssrRunInScope;
exports.useContext = useContext;

@@ -26,3 +26,4 @@ import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, getOwner, untrack, createOwner, runWithOwner, createEffect as createEffect$1, createErrorBoundary as createErrorBoundary$1, createLoadingBoundary as createLoadingBoundary$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, onCleanup, isDisposed, peekNextChildId, clearSnapshots, flush, markSnapshotScope, mapArray, repeat, createRevealOrder, DEV as DEV$1 } from '@solidjs/signals';

name: "children",
lazy: true
lazy: true,
sync: true
} );

@@ -764,3 +765,5 @@ memo.toArray = () => {

return Comp(props);
}) : "");
}) : "", {
sync: true
});
};

@@ -802,3 +805,4 @@ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);

equals: (a, b) => !a === !b,
name: "condition"
name: "condition",
sync: true
} );

@@ -817,3 +821,4 @@ return createMemo$1(() => {

}, {
name: "value"
name: "value",
sync: true
} );

@@ -835,3 +840,4 @@ }

equals: (a, b) => !a === !b,
name: "condition"
name: "condition",
sync: true
} );

@@ -841,2 +847,4 @@ func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);

return func;
}, {
sync: true
});

@@ -854,3 +862,4 @@ return createMemo$1(() => {

}, {
name: "eval conditions"
name: "eval conditions",
sync: true
} );

@@ -882,3 +891,2 @@ }

function ssrHandleError() {}
function ssrRunInScope() {}
const DEV = DEV$1 ;

@@ -889,2 +897,2 @@ if (globalThis) {

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 };
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, useContext };

@@ -11,9 +11,145 @@ 'use strict';

getNextContextId() {
const o = signals.getOwner();
const o = getOwner();
if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`);
if (signals.getContext(NoHydrateContext)) return undefined;
return signals.getNextChildId(o);
if (getContext(NoHydrateContext)) return undefined;
return getNextChildId(o);
}
};
const defaultSSRContext = {};
let currentOwner = null;
const OWNER_POOL_MAX = 4096;
const ownerPool = [];
function formatChildId(prefix, id) {
const num = id.toString(36);
const len = num.length - 1;
return prefix + (len ? String.fromCharCode(64 + len) : "") + num;
}
function nextChildIdFor(owner, consume) {
let counter = owner;
while (counter._transparent && counter._parent) counter = counter._parent;
if (counter.id != null) {
return formatChildId(counter.id, counter._childCount++ );
}
throw new Error("Cannot get child id from owner without an id");
}
function getNextChildId(owner) {
return nextChildIdFor(owner);
}
function createOwner(options) {
const parent = currentOwner;
const transparent = options?.transparent ?? false;
const id = options?.id ?? (transparent ? parent?.id : parent?.id != null ? nextChildIdFor(parent) : undefined);
const ctx = parent?._context ?? defaultSSRContext;
let owner;
if (ownerPool.length) {
owner = ownerPool.pop();
owner.id = id;
owner._transparent = transparent;
owner._disposal = null;
owner._parent = parent;
owner._context = ctx;
owner._childCount = 0;
owner._firstChild = null;
owner._nextSibling = null;
owner._disposed = false;
} else {
owner = {
id,
_transparent: transparent,
_disposal: null,
_parent: parent,
_context: ctx,
_childCount: 0,
_firstChild: null,
_nextSibling: null,
_disposed: false
};
}
if (parent) {
const lastChild = parent._firstChild;
if (lastChild) owner._nextSibling = lastChild;
parent._firstChild = owner;
}
return owner;
}
function runWithOwner(owner, fn) {
const prev = currentOwner;
currentOwner = owner;
try {
return fn();
} finally {
currentOwner = prev;
}
}
function getOwner() {
return currentOwner;
}
function isDisposed(owner) {
return owner._disposed;
}
function onCleanup(fn) {
const o = currentOwner;
if (!o) return fn;
if (!o._disposal) o._disposal = fn;else if (Array.isArray(o._disposal)) o._disposal.push(fn);else o._disposal = [o._disposal, fn];
return fn;
}
function getContext(context, owner = currentOwner) {
if (!owner) throw new signals.NoOwnerError();
const map = owner._context;
const stored = map[context.id];
const value = stored !== undefined ? stored : context.defaultValue;
if (value === undefined) throw new signals.ContextNotFoundError();
return value;
}
function setContext(context, value, owner = currentOwner) {
if (!owner) throw new signals.NoOwnerError();
const o = owner;
o._context = {
...o._context,
[context.id]: value === undefined ? context.defaultValue : value
};
}
function disposeOwner(owner, self = true) {
const node = owner;
if (node._disposed) return;
if (!node._firstChild && !node._disposal) {
if (self) {
node._disposed = true;
if (ownerPool.length < OWNER_POOL_MAX) {
node._parent = null;
node._nextSibling = null;
ownerPool.push(node);
}
}
return;
}
if (self) node._disposed = true;
let child = node._firstChild;
while (child) {
const next = child._nextSibling;
disposeOwner(child, true);
child = next;
}
node._firstChild = null;
node._childCount = 0;
const d = node._disposal;
if (d) {
if (Array.isArray(d)) {
for (let i = 0, len = d.length; i < len; i++) d[i]();
} else {
d();
}
node._disposal = null;
}
if (self && ownerPool.length < OWNER_POOL_MAX) {
node._parent = null;
node._nextSibling = null;
ownerPool.push(node);
}
}
function createRoot(init, options) {
const owner = createOwner(options);
return runWithOwner(owner, () => init(() => disposeOwner(owner)));
}
let Observer = null;

@@ -103,4 +239,7 @@ function runWithObserver(comp, fn) {

function createMemo(compute, options) {
if (options?.sync) {
return createSyncMemo(compute, options);
}
const ctx = sharedConfig.context;
const owner = signals.createOwner();
const owner = createOwner();
const comp = {

@@ -114,3 +253,3 @@ owner,

};
signals.runWithOwner(owner, () => signals.onCleanup(() => {
runWithOwner(owner, () => onCleanup(() => {
comp.disposed = true;

@@ -120,3 +259,3 @@ }));

if (comp.disposed) return;
const run = () => signals.runWithOwner(owner, () => runWithObserver(comp, () => comp.compute(comp.value)));
const run = () => runWithOwner(owner, () => runWithObserver(comp, () => comp.compute(comp.value)));
try {

@@ -141,3 +280,3 @@ comp.error = undefined;

}
return () => {
const read = () => {
if (!comp.computed) {

@@ -151,3 +290,41 @@ update();

};
read[signals.$REFRESH] = comp;
return read;
}
function createSyncMemo(compute, options) {
const owner = createOwner();
let value;
let error;
let cached = false;
function pull() {
const prev = currentOwner;
currentOwner = owner;
try {
value = compute(value);
error = undefined;
cached = true;
return value;
} catch (err) {
if (err instanceof signals.NotReadyError) throw err;
error = err;
cached = true;
throw err;
} finally {
currentOwner = prev;
}
}
if (!options?.lazy) {
try {
pull();
} catch {
}
}
return () => {
if (cached) {
if (error !== undefined) throw error;
return value;
}
return pull();
};
}
function createDeepProxy(target, patches, basePath = []) {

@@ -216,3 +393,3 @@ const childProxies = new Map();

const id = owner.id;
const noHydrate = signals.getContext(NoHydrateContext, owner);
const noHydrate = getContext(NoHydrateContext, owner);
if (result instanceof Promise) {

@@ -336,7 +513,7 @@ if (result.s === 1) {

if (ssrSource === "client") {
signals.createOwner();
createOwner();
return;
}
const ctx = sharedConfig.context;
const owner = signals.createOwner();
const owner = createOwner();
const comp = {

@@ -351,3 +528,3 @@ owner,

if (ssrSource) {
signals.runWithOwner(owner, () => signals.onCleanup(() => {
runWithOwner(owner, () => onCleanup(() => {
comp.disposed = true;

@@ -357,3 +534,3 @@ }));

try {
const result = signals.runWithOwner(owner, () => runWithObserver(comp, () => compute(undefined)));
const result = runWithOwner(owner, () => runWithObserver(comp, () => compute(undefined)));
if (ssrSource) {

@@ -373,4 +550,4 @@ processResult(comp, result, owner, ctx, options?.deferStream, ssrSource);

function createTrackedEffect(compute, options) {
const o = signals.getOwner();
if (o?.id != null) signals.getNextChildId(o);
const o = getOwner();
if (o?.id != null) getNextChildId(o);
}

@@ -418,3 +595,3 @@ function createReaction(effectFn, options) {

const ctx = sharedConfig.context;
const owner = signals.createOwner();
const owner = createOwner();
const [state] = createStore(initialValue);

@@ -425,3 +602,3 @@ if (options?.ssrSource === "client") {

let disposed = false;
signals.runWithOwner(owner, () => signals.onCleanup(() => {
runWithOwner(owner, () => onCleanup(() => {
disposed = true;

@@ -433,3 +610,3 @@ }));

const draft = useProxy ? createDeepProxy(state, patches) : state;
const runProjection = () => signals.runWithOwner(owner, () => fn(draft));
const runProjection = () => runWithOwner(owner, () => fn(draft));
const result = runProjection();

@@ -465,3 +642,3 @@ const iteratorFn = result?.[Symbol.asyncIterator];

}, () => disposed);
if (ctx?.async && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, deferred.promise, options?.deferStream);
if (ctx?.async && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, deferred.promise, options?.deferStream);
return pending;

@@ -498,3 +675,3 @@ } else {

}, () => disposed);
if (ctx?.async && !signals.getContext(NoHydrateContext) && owner.id) {
if (ctx?.async && !getContext(NoHydrateContext) && owner.id) {
let tappedFirst = true;

@@ -560,3 +737,3 @@ const tapped = {

}, () => disposed);
if (ctx?.async && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, deferred.promise, options?.deferStream);
if (ctx?.async && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, deferred.promise, options?.deferStream);
return pending;

@@ -588,24 +765,31 @@ }

function mapArray(list, mapFn, options = {}) {
const parent = signals.createOwner();
return createMemo(() => {
const items = list();
let s = [];
const s = [];
if (items && items.length) {
signals.runWithOwner(parent, () => {
const parent = currentOwner;
const origId = parent.id;
const origChildCount = parent._childCount;
try {
for (let i = 0, len = items.length; i < len; i++) {
const o = signals.createOwner();
s.push(signals.runWithOwner(o, () => mapFn(() => items[i], () => i)));
if (origId !== undefined) {
parent.id = formatChildId(origId, origChildCount + i);
}
parent._childCount = 0;
s.push(mapFn(() => items[i], () => i));
}
});
} finally {
parent.id = origId;
parent._childCount = origChildCount + items.length;
}
} else if (options.fallback) {
s = [signals.runWithOwner(parent, () => {
const fo = signals.createOwner();
return signals.runWithOwner(fo, () => options.fallback());
})];
const fo = createOwner();
s.push(runWithOwner(fo, () => options.fallback()));
}
return s;
}, {
sync: true
});
}
function repeat(count, mapFn, options = {}) {
const owner = signals.createOwner();
return createMemo(() => {

@@ -616,13 +800,24 @@ const len = count();

if (!options.fallback) return [];
return [signals.runWithOwner(owner, () => {
const fallbackOwner = signals.createOwner();
return signals.runWithOwner(fallbackOwner, () => options.fallback());
})];
const fo = createOwner();
return [runWithOwner(fo, () => options.fallback())];
}
return signals.runWithOwner(owner, () => Array.from({
length: len
}, (_, i) => {
const itemOwner = signals.createOwner();
return signals.runWithOwner(itemOwner, () => mapFn(i + offset));
}));
const out = new Array(len);
const parent = currentOwner;
const origId = parent.id;
const origChildCount = parent._childCount;
try {
for (let i = 0; i < len; i++) {
if (origId !== undefined) {
parent.id = formatChildId(origId, origChildCount + i);
}
parent._childCount = 0;
out[i] = mapFn(i + offset);
}
} finally {
parent.id = origId;
parent._childCount = origChildCount + len;
}
return out;
}, {
sync: true
});

@@ -642,5 +837,5 @@ }

try {
return signals.runWithOwner(owner, () => {
const parentHandler = signals.getContext(ErrorContext);
signals.setContext(ErrorContext, err => onError(err, parentHandler));
return runWithOwner(owner, () => {
const parentHandler = getContext(ErrorContext);
setContext(ErrorContext, err => onError(err, parentHandler));
return render();

@@ -657,15 +852,15 @@ });

const ctx = sharedConfig.context;
const parent = signals.getOwner();
const owner = signals.createOwner();
const parent = getOwner();
const owner = createOwner();
const resolve = () => {
const resolved = ctx.resolve(signals.runWithOwner(signals.createOwner(), fn));
const resolved = ctx.resolve(runWithOwner(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, () => {}));
const renderFallback = err => ctx ? runWithOwner(parent, () => {
const fallbackOwner = createOwner();
return runWithOwner(fallbackOwner, () => fallback(err, () => {}));
}) : fallback(err, () => {});
const serializeError = err => {
if (ctx && owner.id && !signals.runWithOwner(owner, () => signals.getContext(NoHydrateContext))) {
if (ctx && owner.id && !runWithOwner(owner, () => getContext(NoHydrateContext))) {
ctx.serialize(owner.id, err);

@@ -681,3 +876,3 @@ }

let handled = false;
if (ctx) owner.dispose(false);
if (ctx) disposeOwner(owner, false);
try {

@@ -689,3 +884,3 @@ result = ctx ? runWithBoundaryErrorContext(owner, resolve, err => {

throw err;
}) : signals.runWithOwner(owner, fn);
}) : runWithOwner(owner, fn);
} catch (err) {

@@ -710,4 +905,4 @@ if (err instanceof signals.NotReadyError) throw err;

function createRevealOrder(fn, _options) {
const o = signals.createOwner();
return signals.runWithOwner(o, fn);
const o = createOwner();
return runWithOwner(o, fn);
}

@@ -738,4 +933,4 @@ function untrack(fn) {

}
function refresh(fn) {
return fn();
function refresh(_target) {
return undefined;
}

@@ -746,4 +941,4 @@ function action(fn) {

function onSettled(callback) {
const o = signals.getOwner();
if (o?.id != null) signals.getNextChildId(o);
const o = getOwner();
if (o?.id != null) getNextChildId(o);
}

@@ -755,4 +950,4 @@

function provider(props) {
return signals.createRoot(() => {
signals.setContext(provider, props.value);
return createRoot(() => {
setContext(provider, props.value);
return children(() => props.children);

@@ -766,3 +961,3 @@ });

function useContext(context) {
return signals.getContext(context);
return getContext(context);
}

@@ -774,3 +969,4 @@ function children(fn) {

const memo = createMemo(() => signals.flatten(c()), {
lazy: true
lazy: true,
sync: true
});

@@ -783,7 +979,2 @@ memo.toArray = () => {

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

@@ -806,3 +997,3 @@ function enableHydration() {}

const wrap = props => {
const noHydrate = signals.getContext(NoHydrateContext);
const noHydrate = getContext(NoHydrateContext);
if (!noHydrate && !moduleUrl) {

@@ -833,2 +1024,4 @@ throw new Error("lazy() used in SSR without a moduleUrl. " + "All lazy() components require a moduleUrl for correct hydration. " + "This is typically injected by the bundler plugin.");

return p.v(props);
}, {
sync: true
});

@@ -841,5 +1034,5 @@ };

function createUniqueId() {
const o = signals.getOwner();
const o = getOwner();
if (!o) throw new Error(`createUniqueId cannot be used outside of a reactive context`);
return signals.getNextChildId(o);
return getNextChildId(o);
}

@@ -855,3 +1048,3 @@

}
const handler = signals.getContext(ErrorContext);
const handler = getContext(ErrorContext);
if (handler) {

@@ -869,6 +1062,6 @@ handler(err);

const ctx = currentCtx;
const parent = signals.getOwner();
const parentHandler = parent && signals.runWithOwner(parent, () => signals.getContext(ErrorContext));
const revealGroup = parent && signals.runWithOwner(parent, () => signals.getContext(RevealGroupContext));
const o = signals.createOwner();
const parent = getOwner();
const parentHandler = parent && runWithOwner(parent, () => getContext(ErrorContext));
const revealGroup = parent && runWithOwner(parent, () => getContext(RevealGroupContext));
const o = createOwner();
const id = o.id;

@@ -914,3 +1107,3 @@ o.id = id + "00";

try {
signals.runWithOwner(parent, () => parentHandler(err));
runWithOwner(parent, () => parentHandler(err));
} catch (caught) {

@@ -921,3 +1114,3 @@ if (caught !== err) throw caught;

function runDiscovery() {
o.dispose(false);
disposeOwner(o, false);
serializeBuffer = [];

@@ -949,6 +1142,6 @@ retryPromise = undefined;

}
const fallbackOwner = signals.createOwner({
const fallbackOwner = createOwner({
id
});
const fallbackResult = signals.runWithOwner(fallbackOwner, () => {
const fallbackResult = runWithOwner(fallbackOwner, () => {
if (!ctx.async) return fallback();

@@ -970,8 +1163,9 @@ const tpl = collapseFallback ? [`<template id="pl-${id}">`, `</template><!--pl-${id}-->`] : [`<template id="pl-${id}"></template>`, `<!--pl-${id}-->`];

commitBoundaryState();
while (ret.p.length) {
await Promise.all(ret.p).catch(() => {});
ret = runLoadingPhase(() => ctx.ssr(ret.t, ...ret.h));
while (ret && ret.p && ret.p.length) {
const pending = ret;
await Promise.all(pending.p).catch(() => {});
ret = runLoadingPhase(() => ctx.ssr(pending.t, ...pending.h));
}
flushSerializeBuffer();
done(ret.t[0]);
done(ret && Array.isArray(ret.t) ? ret.t[0] : ret && ret.t);
if (revealGroup) revealGroup.onResolved(id);

@@ -989,5 +1183,5 @@ } catch (err) {

function NoHydration(props) {
const o = signals.createOwner();
return signals.runWithOwner(o, () => {
signals.setContext(NoHydrateContext, true);
const o = createOwner();
return runWithOwner(o, () => {
setContext(NoHydrateContext, true);
return props.children;

@@ -997,8 +1191,8 @@ });

function Hydration(props) {
if (!signals.getContext(NoHydrateContext)) return props.children;
const o = signals.createOwner({
if (!getContext(NoHydrateContext)) return props.children;
const o = createOwner({
id: props.id ?? ""
});
return signals.runWithOwner(o, () => {
signals.setContext(NoHydrateContext, false);
return runWithOwner(o, () => {
setContext(NoHydrateContext, false);
return props.children;

@@ -1025,6 +1219,6 @@ });

function Show(props) {
const o = signals.getOwner();
const o = getOwner();
if (o?.id != null) {
signals.getNextChildId(o);
if (!props.keyed) signals.getNextChildId(o);
getNextChildId(o);
if (!props.keyed) getNextChildId(o);
}

@@ -1041,2 +1235,4 @@ return createMemo(() => {

return props.fallback;
}, {
sync: true
});

@@ -1046,4 +1242,4 @@ }

const chs = children(() => props.children);
const o = signals.getOwner();
if (o?.id != null) signals.getNextChildId(o);
const o = getOwner();
if (o?.id != null) getNextChildId(o);
return createMemo(() => {

@@ -1060,2 +1256,4 @@ let conds = chs();

return props.fallback;
}, {
sync: true
});

@@ -1076,3 +1274,3 @@ }

function Reveal(props) {
const o = signals.createOwner();
const o = createOwner();
const id = o.id;

@@ -1082,4 +1280,4 @@ const order = props.order ?? "sequential";

if (!sharedConfig.context?.async) {
const parent = signals.getOwner();
const parentGroup = parent ? signals.runWithOwner(parent, () => signals.getContext(RevealGroupContext)) : null;
const parent = getOwner();
const parentGroup = parent ? runWithOwner(parent, () => getContext(RevealGroupContext)) : null;
let collapsedByParent = false;

@@ -1092,4 +1290,4 @@ if (parentGroup) {

let count = 0;
return signals.runWithOwner(o, () => {
signals.setContext(RevealGroupContext, {
return runWithOwner(o, () => {
setContext(RevealGroupContext, {
id,

@@ -1122,4 +1320,4 @@ register(_key) {

let notifiedParentDone = false;
const parent = signals.getOwner();
const parentGroup = parent ? signals.runWithOwner(parent, () => signals.getContext(RevealGroupContext)) : null;
const parent = getOwner();
const parentGroup = parent ? runWithOwner(parent, () => getContext(RevealGroupContext)) : null;
if (parentGroup) {

@@ -1192,4 +1390,4 @@ const reg = parentGroup.register(id, {

}
return signals.runWithOwner(o, () => {
signals.setContext(RevealGroupContext, {
return runWithOwner(o, () => {
setContext(RevealGroupContext, {
id,

@@ -1271,10 +1469,2 @@ register(key, options) {

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

@@ -1292,14 +1482,2 @@ enumerable: true,

});
Object.defineProperty(exports, "getNextChildId", {
enumerable: true,
get: function () { return signals.getNextChildId; }
});
Object.defineProperty(exports, "getOwner", {
enumerable: true,
get: function () { return signals.getOwner; }
});
Object.defineProperty(exports, "isDisposed", {
enumerable: true,
get: function () { return signals.isDisposed; }
});
Object.defineProperty(exports, "isEqual", {

@@ -1321,10 +1499,2 @@ enumerable: true,

});
Object.defineProperty(exports, "onCleanup", {
enumerable: true,
get: function () { return signals.onCleanup; }
});
Object.defineProperty(exports, "runWithOwner", {
enumerable: true,
get: function () { return signals.runWithOwner; }
});
Object.defineProperty(exports, "snapshot", {

@@ -1362,2 +1532,3 @@ enumerable: true,

exports.createOptimisticStore = createOptimisticStore;
exports.createOwner = createOwner;
exports.createProjection = createProjection;

@@ -1367,2 +1538,3 @@ exports.createReaction = createReaction;

exports.createRevealOrder = createRevealOrder;
exports.createRoot = createRoot;
exports.createSignal = createSignal;

@@ -1375,3 +1547,6 @@ exports.createStore = createStore;

exports.flush = flush;
exports.getNextChildId = getNextChildId;
exports.getObserver = getObserver;
exports.getOwner = getOwner;
exports.isDisposed = isDisposed;
exports.isPending = isPending;

@@ -1382,2 +1557,3 @@ exports.isRefreshing = isRefreshing;

exports.mapArray = mapArray;
exports.onCleanup = onCleanup;
exports.onSettled = onSettled;

@@ -1388,6 +1564,6 @@ exports.reconcile = reconcile;

exports.resolve = resolve;
exports.runWithOwner = runWithOwner;
exports.sharedConfig = sharedConfig;
exports.ssrHandleError = ssrHandleError;
exports.ssrRunInScope = ssrRunInScope;
exports.untrack = untrack;
exports.useContext = useContext;

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

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, isDisposed, isEqual, isWrappable, merge, omit, onCleanup, runWithOwner, snapshot, storePath } from '@solidjs/signals';
import { NotReadyError, $REFRESH, isWrappable, NoOwnerError, ContextNotFoundError, flatten } from '@solidjs/signals';
export { $PROXY, $REFRESH, $TRACK, NotReadyError, enableExternalSource, enforceLoadingBoundary, flatten, isEqual, isWrappable, merge, omit, snapshot, storePath } from '@solidjs/signals';

@@ -17,2 +17,138 @@ const NoHydrateContext = {

const defaultSSRContext = {};
let currentOwner = null;
const OWNER_POOL_MAX = 4096;
const ownerPool = [];
function formatChildId(prefix, id) {
const num = id.toString(36);
const len = num.length - 1;
return prefix + (len ? String.fromCharCode(64 + len) : "") + num;
}
function nextChildIdFor(owner, consume) {
let counter = owner;
while (counter._transparent && counter._parent) counter = counter._parent;
if (counter.id != null) {
return formatChildId(counter.id, counter._childCount++ );
}
throw new Error("Cannot get child id from owner without an id");
}
function getNextChildId(owner) {
return nextChildIdFor(owner);
}
function createOwner(options) {
const parent = currentOwner;
const transparent = options?.transparent ?? false;
const id = options?.id ?? (transparent ? parent?.id : parent?.id != null ? nextChildIdFor(parent) : undefined);
const ctx = parent?._context ?? defaultSSRContext;
let owner;
if (ownerPool.length) {
owner = ownerPool.pop();
owner.id = id;
owner._transparent = transparent;
owner._disposal = null;
owner._parent = parent;
owner._context = ctx;
owner._childCount = 0;
owner._firstChild = null;
owner._nextSibling = null;
owner._disposed = false;
} else {
owner = {
id,
_transparent: transparent,
_disposal: null,
_parent: parent,
_context: ctx,
_childCount: 0,
_firstChild: null,
_nextSibling: null,
_disposed: false
};
}
if (parent) {
const lastChild = parent._firstChild;
if (lastChild) owner._nextSibling = lastChild;
parent._firstChild = owner;
}
return owner;
}
function runWithOwner(owner, fn) {
const prev = currentOwner;
currentOwner = owner;
try {
return fn();
} finally {
currentOwner = prev;
}
}
function getOwner() {
return currentOwner;
}
function isDisposed(owner) {
return owner._disposed;
}
function onCleanup(fn) {
const o = currentOwner;
if (!o) return fn;
if (!o._disposal) o._disposal = fn;else if (Array.isArray(o._disposal)) o._disposal.push(fn);else o._disposal = [o._disposal, fn];
return fn;
}
function getContext(context, owner = currentOwner) {
if (!owner) throw new NoOwnerError();
const map = owner._context;
const stored = map[context.id];
const value = stored !== undefined ? stored : context.defaultValue;
if (value === undefined) throw new ContextNotFoundError();
return value;
}
function setContext(context, value, owner = currentOwner) {
if (!owner) throw new NoOwnerError();
const o = owner;
o._context = {
...o._context,
[context.id]: value === undefined ? context.defaultValue : value
};
}
function disposeOwner(owner, self = true) {
const node = owner;
if (node._disposed) return;
if (!node._firstChild && !node._disposal) {
if (self) {
node._disposed = true;
if (ownerPool.length < OWNER_POOL_MAX) {
node._parent = null;
node._nextSibling = null;
ownerPool.push(node);
}
}
return;
}
if (self) node._disposed = true;
let child = node._firstChild;
while (child) {
const next = child._nextSibling;
disposeOwner(child, true);
child = next;
}
node._firstChild = null;
node._childCount = 0;
const d = node._disposal;
if (d) {
if (Array.isArray(d)) {
for (let i = 0, len = d.length; i < len; i++) d[i]();
} else {
d();
}
node._disposal = null;
}
if (self && ownerPool.length < OWNER_POOL_MAX) {
node._parent = null;
node._nextSibling = null;
ownerPool.push(node);
}
}
function createRoot(init, options) {
const owner = createOwner(options);
return runWithOwner(owner, () => init(() => disposeOwner(owner)));
}
let Observer = null;

@@ -102,2 +238,5 @@ function runWithObserver(comp, fn) {

function createMemo(compute, options) {
if (options?.sync) {
return createSyncMemo(compute, options);
}
const ctx = sharedConfig.context;

@@ -138,3 +277,3 @@ const owner = createOwner();

}
return () => {
const read = () => {
if (!comp.computed) {

@@ -148,3 +287,41 @@ update();

};
read[$REFRESH] = comp;
return read;
}
function createSyncMemo(compute, options) {
const owner = createOwner();
let value;
let error;
let cached = false;
function pull() {
const prev = currentOwner;
currentOwner = owner;
try {
value = compute(value);
error = undefined;
cached = true;
return value;
} catch (err) {
if (err instanceof NotReadyError) throw err;
error = err;
cached = true;
throw err;
} finally {
currentOwner = prev;
}
}
if (!options?.lazy) {
try {
pull();
} catch {
}
}
return () => {
if (cached) {
if (error !== undefined) throw error;
return value;
}
return pull();
};
}
function createDeepProxy(target, patches, basePath = []) {

@@ -574,24 +751,31 @@ const childProxies = new Map();

function mapArray(list, mapFn, options = {}) {
const parent = createOwner();
return createMemo(() => {
const items = list();
let s = [];
const s = [];
if (items && items.length) {
runWithOwner(parent, () => {
const parent = currentOwner;
const origId = parent.id;
const origChildCount = parent._childCount;
try {
for (let i = 0, len = items.length; i < len; i++) {
const o = createOwner();
s.push(runWithOwner(o, () => mapFn(() => items[i], () => i)));
if (origId !== undefined) {
parent.id = formatChildId(origId, origChildCount + i);
}
parent._childCount = 0;
s.push(mapFn(() => items[i], () => i));
}
});
} finally {
parent.id = origId;
parent._childCount = origChildCount + items.length;
}
} else if (options.fallback) {
s = [runWithOwner(parent, () => {
const fo = createOwner();
return runWithOwner(fo, () => options.fallback());
})];
const fo = createOwner();
s.push(runWithOwner(fo, () => options.fallback()));
}
return s;
}, {
sync: true
});
}
function repeat(count, mapFn, options = {}) {
const owner = createOwner();
return createMemo(() => {

@@ -602,13 +786,24 @@ const len = count();

if (!options.fallback) return [];
return [runWithOwner(owner, () => {
const fallbackOwner = createOwner();
return runWithOwner(fallbackOwner, () => options.fallback());
})];
const fo = createOwner();
return [runWithOwner(fo, () => options.fallback())];
}
return runWithOwner(owner, () => Array.from({
length: len
}, (_, i) => {
const itemOwner = createOwner();
return runWithOwner(itemOwner, () => mapFn(i + offset));
}));
const out = new Array(len);
const parent = currentOwner;
const origId = parent.id;
const origChildCount = parent._childCount;
try {
for (let i = 0; i < len; i++) {
if (origId !== undefined) {
parent.id = formatChildId(origId, origChildCount + i);
}
parent._childCount = 0;
out[i] = mapFn(i + offset);
}
} finally {
parent.id = origId;
parent._childCount = origChildCount + len;
}
return out;
}, {
sync: true
});

@@ -665,3 +860,3 @@ }

let handled = false;
if (ctx) owner.dispose(false);
if (ctx) disposeOwner(owner, false);
try {

@@ -720,4 +915,4 @@ result = ctx ? runWithBoundaryErrorContext(owner, resolve, err => {

}
function refresh(fn) {
return fn();
function refresh(_target) {
return undefined;
}

@@ -753,3 +948,4 @@ function action(fn) {

const memo = createMemo(() => flatten(c()), {
lazy: true
lazy: true,
sync: true
});

@@ -762,7 +958,2 @@ memo.toArray = () => {

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

@@ -811,2 +1002,4 @@ function enableHydration() {}

return p.v(props);
}, {
sync: true
});

@@ -895,3 +1088,3 @@ };

function runDiscovery() {
o.dispose(false);
disposeOwner(o, false);
serializeBuffer = [];

@@ -943,8 +1136,9 @@ retryPromise = undefined;

commitBoundaryState();
while (ret.p.length) {
await Promise.all(ret.p).catch(() => {});
ret = runLoadingPhase(() => ctx.ssr(ret.t, ...ret.h));
while (ret && ret.p && ret.p.length) {
const pending = ret;
await Promise.all(pending.p).catch(() => {});
ret = runLoadingPhase(() => ctx.ssr(pending.t, ...pending.h));
}
flushSerializeBuffer();
done(ret.t[0]);
done(ret && Array.isArray(ret.t) ? ret.t[0] : ret && ret.t);
if (revealGroup) revealGroup.onResolved(id);

@@ -1011,2 +1205,4 @@ } catch (err) {

return props.fallback;
}, {
sync: true
});

@@ -1029,2 +1225,4 @@ }

return props.fallback;
}, {
sync: true
});

@@ -1219,2 +1417,2 @@ }

export { $DEVCOMP, DEV, Errored, For, Hydration, Loading, Match, NoHydrateContext, NoHydration, Repeat, Reveal, Show, Switch, action, children, createComponent, createContext, createDeepProxy, createEffect, createErrorBoundary, createLoadingBoundary, createMemo, createOptimistic, createOptimisticStore, createProjection, createReaction, createRenderEffect, createRevealOrder, createSignal, createStore, createTrackedEffect, createUniqueId, deep, enableHydration, flush, getObserver, isPending, isRefreshing, latest, lazy, mapArray, onSettled, reconcile, refresh, repeat, resolve, sharedConfig, ssrHandleError, ssrRunInScope, untrack, useContext };
export { $DEVCOMP, DEV, Errored, For, Hydration, Loading, Match, NoHydrateContext, NoHydration, Repeat, Reveal, Show, Switch, action, children, createComponent, createContext, createDeepProxy, createEffect, createErrorBoundary, createLoadingBoundary, createMemo, createOptimistic, createOptimisticStore, createOwner, createProjection, createReaction, createRenderEffect, createRevealOrder, createRoot, createSignal, createStore, createTrackedEffect, createUniqueId, deep, enableHydration, flush, getNextChildId, getObserver, getOwner, isDisposed, isPending, isRefreshing, latest, lazy, mapArray, onCleanup, onSettled, reconcile, refresh, repeat, resolve, runWithOwner, sharedConfig, ssrHandleError, untrack, useContext };

@@ -27,3 +27,4 @@ 'use strict';

const memo = signals.createMemo(() => signals.flatten(c()), {
lazy: true
lazy: true,
sync: true
});

@@ -745,3 +746,5 @@ memo.toArray = () => {

return Comp(props);
}) : "");
}) : "", {
sync: true
});
};

@@ -778,3 +781,4 @@ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);

const condition = keyed ? conditionValue : signals.createMemo(conditionValue, {
equals: (a, b) => !a === !b
equals: (a, b) => !a === !b,
sync: true
});

@@ -792,3 +796,5 @@ return signals.createMemo(() => {

return props.fallback;
}, undefined);
}, {
sync: true
});
}

@@ -806,3 +812,4 @@ function Switch(props) {

const condition = mp.keyed ? conditionValue : signals.createMemo(conditionValue, {
equals: (a, b) => !a === !b
equals: (a, b) => !a === !b,
sync: true
});

@@ -812,2 +819,4 @@ func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);

return func;
}, {
sync: true
});

@@ -824,3 +833,5 @@ return signals.createMemo(() => {

}), IS_DEV) : child;
}, undefined);
}, {
sync: true
});
}

@@ -850,3 +861,2 @@ function Match(props) {

function ssrHandleError() {}
function ssrRunInScope() {}
const DEV = undefined;

@@ -1033,3 +1043,2 @@

exports.ssrHandleError = ssrHandleError;
exports.ssrRunInScope = ssrRunInScope;
exports.useContext = useContext;

@@ -26,3 +26,4 @@ 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';

const memo = createMemo$1(() => flatten(c()), {
lazy: true
lazy: true,
sync: true
});

@@ -744,3 +745,5 @@ memo.toArray = () => {

return Comp(props);
}) : "");
}) : "", {
sync: true
});
};

@@ -777,3 +780,4 @@ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);

const condition = keyed ? conditionValue : createMemo$1(conditionValue, {
equals: (a, b) => !a === !b
equals: (a, b) => !a === !b,
sync: true
});

@@ -791,3 +795,5 @@ return createMemo$1(() => {

return props.fallback;
}, undefined);
}, {
sync: true
});
}

@@ -805,3 +811,4 @@ function Switch(props) {

const condition = mp.keyed ? conditionValue : createMemo$1(conditionValue, {
equals: (a, b) => !a === !b
equals: (a, b) => !a === !b,
sync: true
});

@@ -811,2 +818,4 @@ func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);

return func;
}, {
sync: true
});

@@ -823,3 +832,5 @@ return createMemo$1(() => {

}), IS_DEV) : child;
}, undefined);
}, {
sync: true
});
}

@@ -849,5 +860,4 @@ function Match(props) {

function ssrHandleError() {}
function ssrRunInScope() {}
const DEV = undefined;
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 };
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, useContext };
{
"name": "solid-js",
"description": "Reactive JavaScript library for building user interfaces. Compiles JSX to real DOM with fine-grained signal-based updates — no virtual DOM.",
"version": "2.0.0-beta.10",
"version": "2.0.0-beta.11",
"author": "Ryan Carniato",

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

"dependencies": {
"@solidjs/signals": "^2.0.0-beta.10",
"@solidjs/signals": "^2.0.0-beta.11",
"csstype": "^3.1.0",

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

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

import { createErrorBoundary as coreErrorBoundary, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type Accessor, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type Store, type StoreSetter, type Context } from "@solidjs/signals";
import { createErrorBoundary as coreErrorBoundary, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type SourceAccessor, type Store, type StoreSetter, type Context } from "@solidjs/signals";
import type { Element as SolidElement } from "../types.cjs";

@@ -37,7 +37,8 @@ type HydrationSsrFields = {

}
interface ProjectionOptions extends HydrationSsrFields {
}
}
/**
* Options for `createProjection`, `createStore(fn, ...)`, and
* `createOptimisticStore(fn, ...)` — `ProjectionOptions` plus a
* hydration-aware `ssrSource` field.
* `createOptimisticStore(fn, ...)`.
*

@@ -56,5 +57,2 @@ * `ssrSource` controls what initial value the client uses and whether

*/
export type HydrationProjectionOptions = ProjectionOptions & {
ssrSource?: "server" | "hybrid" | "client";
};
type HydrationClientMemoOptions<T> = Omit<MemoOptions<T>, "ssrSource"> & {

@@ -162,4 +160,4 @@ ssrSource: "client";

export declare const createMemo: {
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: HydrationClientMemoOptions<T>): Accessor<T | undefined>;
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: HydrationMemoOptions<T>): Accessor<T>;
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: HydrationClientMemoOptions<T>): SourceAccessor<T | undefined>;
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: HydrationMemoOptions<T>): SourceAccessor<T>;
};

@@ -308,7 +306,7 @@ /**

*
* **Hydration:** {@link HydrationProjectionOptions} adds `ssrSource`
* **Hydration:** `ProjectionOptions` accepts an `ssrSource` field
* (`"server"` | `"hybrid"` | `"client"`) for the same client-vs-server
* tradeoffs as the other primitives. See {@link HydrationSsrFields}.
*/
export declare const createProjection: <T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, initialValue: T, options?: HydrationProjectionOptions) => Refreshable<Store<T>>;
export declare const createProjection: <T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, initialValue: T, options?: ProjectionOptions) => Refreshable<Store<T>>;
type NoFn<T> = T extends Function ? never : T;

@@ -369,4 +367,4 @@ /**

*
* **Hydration:** the derived form accepts
* {@link HydrationProjectionOptions}, which adds an `ssrSource` field
* **Hydration:** the derived form accepts `ProjectionOptions`, including
* an `ssrSource` field
* (`"server"` | `"hybrid"` | `"client"`). See {@link HydrationSsrFields}.

@@ -378,3 +376,3 @@ *

<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): [get: Store<T>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: HydrationProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
};

@@ -421,4 +419,4 @@ /**

*
* **Hydration:** the derived form accepts
* {@link HydrationProjectionOptions}, which adds an `ssrSource` field
* **Hydration:** the derived form accepts `ProjectionOptions`, including
* an `ssrSource` field
* (`"server"` | `"hybrid"` | `"client"`). See {@link HydrationSsrFields}.

@@ -430,3 +428,3 @@ *

<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): [get: Store<T>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: HydrationProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
};

@@ -433,0 +431,0 @@ /**

export { $PROXY, $REFRESH, $TRACK, action, createOwner, createReaction, createRevealOrder, createRoot, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, 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, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
export type { Accessor, ComputeFunction, EffectBundle, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, MemoOptions, NoInfer, NotWrappable, Omit, Owner, ProjectionOptions, Refreshable, Signal, SignalOptions, SourceAccessor, Setter, Store, StoreOptions, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
export { $DEVCOMP, children, createContext, useContext } from "./client/core.cjs";

@@ -11,4 +11,2 @@ export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./client/core.cjs";

export declare function ssrHandleError(): void;
/** @internal */
export declare function ssrRunInScope(): void;
import { type Dev } from "@solidjs/signals";

@@ -15,0 +13,0 @@ export declare const DEV: Dev | undefined;

@@ -43,8 +43,1 @@ import type { Accessor, EffectOptions } from "./signals.cjs";

export declare function children(fn: Accessor<SolidElement>): ChildrenReturn;
/**
* Pass-through for SSR dynamic expressions.
* On the client, insert() render effects are transparent (0 owner slots),
* so the server doesn't need to create owners for these either.
*/
export declare function ssrRunInScope(fn: () => any): () => any;
export declare function ssrRunInScope(array: (() => any)[]): (() => any)[];
export { $PROXY, $REFRESH, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, createErrorBoundary, createOwner, createProjection, createReaction, createRenderEffect, createRevealOrder, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, snapshot, storePath, createDeepProxy, enableExternalSource, enforceLoadingBoundary, untrack } from "./signals.cjs";
export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter, PatchOp } from "./signals.cjs";
export { $DEVCOMP, children, createContext, useContext, ssrRunInScope } from "./core.cjs";
export { $DEVCOMP, children, createContext, useContext } from "./core.cjs";
export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./core.cjs";

@@ -5,0 +5,0 @@ export * from "./component.cjs";

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

import type { Context } from "@solidjs/signals";
import type { Context } from "./signals.cjs";
export type SSRTemplateObject = {

@@ -6,2 +6,6 @@ t: string[];

p: Promise<any>[];
} | {
t: string;
h?: undefined;
p?: undefined;
};

@@ -8,0 +12,0 @@ export type HydrationContext = {

@@ -1,7 +0,43 @@

export { createRoot, createOwner, runWithOwner, getOwner, isDisposed, onCleanup, getNextChildId, createContext, setContext, getContext, NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY, enableExternalSource, enforceLoadingBoundary } from "@solidjs/signals";
import { $REFRESH } from "@solidjs/signals";
export { $REFRESH };
export { NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY, enableExternalSource, enforceLoadingBoundary } from "@solidjs/signals";
export { flatten } from "@solidjs/signals";
export { snapshot, merge, omit, storePath, $PROXY, $REFRESH, $TRACK } from "@solidjs/signals";
export { snapshot, merge, omit, storePath, $PROXY, $TRACK } from "@solidjs/signals";
import type { Accessor as SignalAccessor, Refreshable } from "@solidjs/signals";
export type SourceAccessor<T> = Refreshable<SignalAccessor<T>>;
export type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, MemoOptions, NoInfer, SignalOptions, Setter, Signal, Owner, Refreshable, Maybe, Store, StoreSetter, StoreNode, NotWrappable, SolidStore, Merge, Omit, Context, ContextRecord, IQueue, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
import type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, MemoOptions, SignalOptions, Signal, Owner, Store, StoreSetter, Context } from "@solidjs/signals";
import { sharedConfig, NoHydrateContext } from "./shared.cjs";
type Disposable = () => void;
export declare function getNextChildId(owner: Owner): string;
export declare function createOwner(options?: {
id?: string;
transparent?: boolean;
}): Owner;
export declare function runWithOwner<T>(owner: Owner | null, fn: () => T): T;
export declare function getOwner(): Owner | null;
export declare function isDisposed(owner: Owner): boolean;
export declare function onCleanup(fn: Disposable): Disposable;
export declare function createContext<T>(defaultValue?: T, description?: string): Context<T>;
export declare function getContext<T>(context: Context<T>, owner?: Owner | null): T;
export declare function setContext<T>(context: Context<T>, value?: T, owner?: Owner | null): void;
/**
* Tears down `owner` (optionally) and all of its descendants. Walks the
* forward-only `_firstChild` -> `_nextSibling` chain, recursively disposing
* each child with `self=true`, then runs the owner's own `_disposal` queue
* and resets `_firstChild` / `_childCount`.
*
* `self=false` keeps `owner` itself alive (its `_disposed` flag stays clear,
* future `runWithOwner(owner, ...)` keeps working) but tears down its
* subtree. This is what `createErrorBoundary` and `createLoadingBoundary`
* use on retry — wipe the children, keep the boundary owner around for the
* re-run.
*
* @internal
*/
export declare function disposeOwner(owner: Owner, self?: boolean): void;
export declare function createRoot<T>(init: ((dispose: () => void) => T) | (() => T), options?: {
id?: string;
transparent?: boolean;
}): T;
interface ServerComputation<T = any> {

@@ -37,4 +73,4 @@ owner: Owner;

export declare function createSignal<T>(fn: ComputeFunction<undefined | NoInfer<T>, T>, options?: ServerSignalOptions<T>): Signal<T>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: ServerClientMemoOptions<T>): Accessor<T | undefined>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: ServerMemoOptions<T>): Accessor<T>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: ServerClientMemoOptions<T>): SourceAccessor<T | undefined>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: ServerMemoOptions<T>): SourceAccessor<T>;
export type PatchOp = [path: PropertyKey[]] | [path: PropertyKey[], value: any] | [path: PropertyKey[], value: any, insert: 1];

@@ -85,5 +121,5 @@ export declare function createDeepProxy<T extends object>(target: T, patches: PatchOp[], basePath?: PropertyKey[]): T;

export declare function isRefreshing(): boolean;
export declare function refresh<T>(fn: () => T): T;
export declare function refresh<T>(_target: Refreshable<T>): void;
export declare function action<T extends (...args: any[]) => any>(fn: T): T;
export declare function onSettled(callback: () => void | (() => void)): void;
type NoInfer<T extends any> = [T][T extends any ? 0 : never];

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

import { createErrorBoundary as coreErrorBoundary, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type Accessor, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type Store, type StoreSetter, type Context } from "@solidjs/signals";
import { createErrorBoundary as coreErrorBoundary, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type SourceAccessor, type Store, type StoreSetter, type Context } from "@solidjs/signals";
import type { Element as SolidElement } from "../types.js";

@@ -37,7 +37,8 @@ type HydrationSsrFields = {

}
interface ProjectionOptions extends HydrationSsrFields {
}
}
/**
* Options for `createProjection`, `createStore(fn, ...)`, and
* `createOptimisticStore(fn, ...)` — `ProjectionOptions` plus a
* hydration-aware `ssrSource` field.
* `createOptimisticStore(fn, ...)`.
*

@@ -56,5 +57,2 @@ * `ssrSource` controls what initial value the client uses and whether

*/
export type HydrationProjectionOptions = ProjectionOptions & {
ssrSource?: "server" | "hybrid" | "client";
};
type HydrationClientMemoOptions<T> = Omit<MemoOptions<T>, "ssrSource"> & {

@@ -162,4 +160,4 @@ ssrSource: "client";

export declare const createMemo: {
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: HydrationClientMemoOptions<T>): Accessor<T | undefined>;
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: HydrationMemoOptions<T>): Accessor<T>;
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: HydrationClientMemoOptions<T>): SourceAccessor<T | undefined>;
<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: HydrationMemoOptions<T>): SourceAccessor<T>;
};

@@ -308,7 +306,7 @@ /**

*
* **Hydration:** {@link HydrationProjectionOptions} adds `ssrSource`
* **Hydration:** `ProjectionOptions` accepts an `ssrSource` field
* (`"server"` | `"hybrid"` | `"client"`) for the same client-vs-server
* tradeoffs as the other primitives. See {@link HydrationSsrFields}.
*/
export declare const createProjection: <T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, initialValue: T, options?: HydrationProjectionOptions) => Refreshable<Store<T>>;
export declare const createProjection: <T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, initialValue: T, options?: ProjectionOptions) => Refreshable<Store<T>>;
type NoFn<T> = T extends Function ? never : T;

@@ -369,4 +367,4 @@ /**

*
* **Hydration:** the derived form accepts
* {@link HydrationProjectionOptions}, which adds an `ssrSource` field
* **Hydration:** the derived form accepts `ProjectionOptions`, including
* an `ssrSource` field
* (`"server"` | `"hybrid"` | `"client"`). See {@link HydrationSsrFields}.

@@ -378,3 +376,3 @@ *

<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): [get: Store<T>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: HydrationProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
};

@@ -421,4 +419,4 @@ /**

*
* **Hydration:** the derived form accepts
* {@link HydrationProjectionOptions}, which adds an `ssrSource` field
* **Hydration:** the derived form accepts `ProjectionOptions`, including
* an `ssrSource` field
* (`"server"` | `"hybrid"` | `"client"`). See {@link HydrationSsrFields}.

@@ -430,3 +428,3 @@ *

<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): [get: Store<T>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: HydrationProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
};

@@ -433,0 +431,0 @@ /**

export { $PROXY, $REFRESH, $TRACK, action, createOwner, createReaction, createRevealOrder, createRoot, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, 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, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
export type { Accessor, ComputeFunction, EffectBundle, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, MemoOptions, NoInfer, NotWrappable, Omit, Owner, ProjectionOptions, Refreshable, Signal, SignalOptions, SourceAccessor, Setter, Store, StoreOptions, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
export { $DEVCOMP, children, createContext, useContext } from "./client/core.js";

@@ -11,4 +11,2 @@ export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./client/core.js";

export declare function ssrHandleError(): void;
/** @internal */
export declare function ssrRunInScope(): void;
import { type Dev } from "@solidjs/signals";

@@ -15,0 +13,0 @@ export declare const DEV: Dev | undefined;

@@ -43,8 +43,1 @@ import type { Accessor, EffectOptions } from "./signals.js";

export declare function children(fn: Accessor<SolidElement>): ChildrenReturn;
/**
* Pass-through for SSR dynamic expressions.
* On the client, insert() render effects are transparent (0 owner slots),
* so the server doesn't need to create owners for these either.
*/
export declare function ssrRunInScope(fn: () => any): () => any;
export declare function ssrRunInScope(array: (() => any)[]): (() => any)[];
export { $PROXY, $REFRESH, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, createErrorBoundary, createOwner, createProjection, createReaction, createRenderEffect, createRevealOrder, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, 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, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter, PatchOp } from "./signals.js";
export { $DEVCOMP, children, createContext, useContext, ssrRunInScope } from "./core.js";
export { $DEVCOMP, children, createContext, useContext } from "./core.js";
export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./core.js";

@@ -5,0 +5,0 @@ export * from "./component.js";

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

import type { Context } from "@solidjs/signals";
import type { Context } from "./signals.js";
export type SSRTemplateObject = {

@@ -6,2 +6,6 @@ t: string[];

p: Promise<any>[];
} | {
t: string;
h?: undefined;
p?: undefined;
};

@@ -8,0 +12,0 @@ export type HydrationContext = {

@@ -1,7 +0,43 @@

export { createRoot, createOwner, runWithOwner, getOwner, isDisposed, onCleanup, getNextChildId, createContext, setContext, getContext, NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY, enableExternalSource, enforceLoadingBoundary } from "@solidjs/signals";
import { $REFRESH } from "@solidjs/signals";
export { $REFRESH };
export { NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY, enableExternalSource, enforceLoadingBoundary } from "@solidjs/signals";
export { flatten } from "@solidjs/signals";
export { snapshot, merge, omit, storePath, $PROXY, $REFRESH, $TRACK } from "@solidjs/signals";
export { snapshot, merge, omit, storePath, $PROXY, $TRACK } from "@solidjs/signals";
import type { Accessor as SignalAccessor, Refreshable } from "@solidjs/signals";
export type SourceAccessor<T> = Refreshable<SignalAccessor<T>>;
export type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, MemoOptions, NoInfer, SignalOptions, Setter, Signal, Owner, Refreshable, Maybe, Store, StoreSetter, StoreNode, NotWrappable, SolidStore, Merge, Omit, Context, ContextRecord, IQueue, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
import type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, MemoOptions, SignalOptions, Signal, Owner, Store, StoreSetter, Context } from "@solidjs/signals";
import { sharedConfig, NoHydrateContext } from "./shared.js";
type Disposable = () => void;
export declare function getNextChildId(owner: Owner): string;
export declare function createOwner(options?: {
id?: string;
transparent?: boolean;
}): Owner;
export declare function runWithOwner<T>(owner: Owner | null, fn: () => T): T;
export declare function getOwner(): Owner | null;
export declare function isDisposed(owner: Owner): boolean;
export declare function onCleanup(fn: Disposable): Disposable;
export declare function createContext<T>(defaultValue?: T, description?: string): Context<T>;
export declare function getContext<T>(context: Context<T>, owner?: Owner | null): T;
export declare function setContext<T>(context: Context<T>, value?: T, owner?: Owner | null): void;
/**
* Tears down `owner` (optionally) and all of its descendants. Walks the
* forward-only `_firstChild` -> `_nextSibling` chain, recursively disposing
* each child with `self=true`, then runs the owner's own `_disposal` queue
* and resets `_firstChild` / `_childCount`.
*
* `self=false` keeps `owner` itself alive (its `_disposed` flag stays clear,
* future `runWithOwner(owner, ...)` keeps working) but tears down its
* subtree. This is what `createErrorBoundary` and `createLoadingBoundary`
* use on retry — wipe the children, keep the boundary owner around for the
* re-run.
*
* @internal
*/
export declare function disposeOwner(owner: Owner, self?: boolean): void;
export declare function createRoot<T>(init: ((dispose: () => void) => T) | (() => T), options?: {
id?: string;
transparent?: boolean;
}): T;
interface ServerComputation<T = any> {

@@ -37,4 +73,4 @@ owner: Owner;

export declare function createSignal<T>(fn: ComputeFunction<undefined | NoInfer<T>, T>, options?: ServerSignalOptions<T>): Signal<T>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: ServerClientMemoOptions<T>): Accessor<T | undefined>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: ServerMemoOptions<T>): Accessor<T>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options: ServerClientMemoOptions<T>): SourceAccessor<T | undefined>;
export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, options?: ServerMemoOptions<T>): SourceAccessor<T>;
export type PatchOp = [path: PropertyKey[]] | [path: PropertyKey[], value: any] | [path: PropertyKey[], value: any, insert: 1];

@@ -85,5 +121,5 @@ export declare function createDeepProxy<T extends object>(target: T, patches: PatchOp[], basePath?: PropertyKey[]): T;

export declare function isRefreshing(): boolean;
export declare function refresh<T>(fn: () => T): T;
export declare function refresh<T>(_target: Refreshable<T>): void;
export declare function action<T extends (...args: any[]) => any>(fn: T): T;
export declare function onSettled(callback: () => void | (() => void)): void;
type NoInfer<T extends any> = [T][T extends any ? 0 : never];