+20
-0
@@ -63,2 +63,6 @@ 'use strict'; | ||
| const NoHydrateContext = { | ||
| id: Symbol("NoHydrateContext"), | ||
| defaultValue: false | ||
| }; | ||
| const sharedConfig = { | ||
@@ -71,2 +75,3 @@ hydrating: false, | ||
| if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`); | ||
| if (signals.getContext(NoHydrateContext)) return undefined; | ||
| return signals.getNextChildId(o); | ||
@@ -591,2 +596,13 @@ } | ||
| } | ||
| function NoHydration(props) { | ||
| const o = signals.createOwner(); | ||
| return signals.runWithOwner(o, () => { | ||
| signals.setContext(NoHydrateContext, true); | ||
| if (sharedConfig.hydrating) return undefined; | ||
| return props.children; | ||
| }); | ||
| } | ||
| function Hydration(props) { | ||
| return props.children; | ||
| } | ||
@@ -623,2 +639,3 @@ function createComponent(Comp, props) { | ||
| wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p); | ||
| wrap.moduleUrl = moduleUrl; | ||
| return wrap; | ||
@@ -876,4 +893,7 @@ } | ||
| exports.For = For; | ||
| exports.Hydration = Hydration; | ||
| exports.Loading = Loading; | ||
| exports.Match = Match; | ||
| exports.NoHydrateContext = NoHydrateContext; | ||
| exports.NoHydration = NoHydration; | ||
| exports.Repeat = Repeat; | ||
@@ -880,0 +900,0 @@ exports.Show = Show; |
+19
-2
@@ -1,2 +0,2 @@ | ||
| import { getContext, createMemo as createMemo$1, flatten, getOwner, createRoot, setContext, untrack, setStrictRead, createLoadBoundary, onCleanup, isDisposed, runWithOwner, 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'; | ||
| import { getContext, createMemo as createMemo$1, flatten, getOwner, createRoot, setContext, untrack, setStrictRead, createLoadBoundary, 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, $TRACK, NotReadyError, action, createOwner, createReaction, createRoot, createTrackedEffect, deep, 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'; | ||
@@ -62,2 +62,6 @@ | ||
| const NoHydrateContext = { | ||
| id: Symbol("NoHydrateContext"), | ||
| defaultValue: false | ||
| }; | ||
| const sharedConfig = { | ||
@@ -70,2 +74,3 @@ hydrating: false, | ||
| if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`); | ||
| if (getContext(NoHydrateContext)) return undefined; | ||
| return getNextChildId(o); | ||
@@ -590,2 +595,13 @@ } | ||
| } | ||
| function NoHydration(props) { | ||
| const o = createOwner(); | ||
| return runWithOwner(o, () => { | ||
| setContext(NoHydrateContext, true); | ||
| if (sharedConfig.hydrating) return undefined; | ||
| return props.children; | ||
| }); | ||
| } | ||
| function Hydration(props) { | ||
| return props.children; | ||
| } | ||
@@ -622,2 +638,3 @@ function createComponent(Comp, props) { | ||
| wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p); | ||
| wrap.moduleUrl = moduleUrl; | ||
| return wrap; | ||
@@ -743,2 +760,2 @@ } | ||
| export { $DEVCOMP, DEV, Errored, For, Loading, Match, 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, createMemo, createOptimistic, createOptimisticStore, createProjection, createRenderEffect, createSignal, createStore, createUniqueId, enableHydration, lazy, sharedConfig, ssrHandleError, ssrRunInScope, useContext }; |
+59
-23
@@ -5,2 +5,6 @@ 'use strict'; | ||
| const NoHydrateContext = { | ||
| id: Symbol("NoHydrateContext"), | ||
| defaultValue: false | ||
| }; | ||
| const sharedConfig = { | ||
@@ -10,2 +14,3 @@ getNextContextId() { | ||
| if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`); | ||
| if (signals.getContext(NoHydrateContext)) return undefined; | ||
| return signals.getNextChildId(o); | ||
@@ -163,2 +168,3 @@ } | ||
| const uninitialized = comp.value === undefined; | ||
| const noHydrate = signals.getContext(NoHydrateContext, owner); | ||
| if (result instanceof Promise) { | ||
@@ -172,3 +178,3 @@ result.then(v => { | ||
| }, () => {}); | ||
| if (ctx?.async && ctx.serialize && id) ctx.serialize(id, result, deferStream); | ||
| if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, result, deferStream); | ||
| if (uninitialized) { | ||
@@ -190,3 +196,3 @@ comp.error = new signals.NotReadyError(result); | ||
| }, () => {}); | ||
| if (ctx?.async && ctx.serialize && id) ctx.serialize(id, promise, deferStream); | ||
| if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, promise, deferStream); | ||
| if (uninitialized) { | ||
@@ -219,3 +225,3 @@ comp.error = new signals.NotReadyError(promise); | ||
| }; | ||
| if (ctx?.async && ctx.serialize && id) ctx.serialize(id, tapped, deferStream); | ||
| if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, tapped, deferStream); | ||
| if (uninitialized) { | ||
@@ -340,3 +346,3 @@ comp.error = new signals.NotReadyError(firstReady); | ||
| }, () => {}); | ||
| if (ctx?.async && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| if (ctx?.async && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| const [pending, markReady] = createPendingProxy(state, promise); | ||
@@ -398,3 +404,3 @@ return pending; | ||
| }; | ||
| if (ctx?.async && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, tapped, options?.deferStream); | ||
| if (ctx?.async && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, tapped, options?.deferStream); | ||
| const [pending, markReady] = createPendingProxy(state, firstReady); | ||
@@ -417,3 +423,3 @@ return pending; | ||
| }, () => {}); | ||
| if (ctx?.async && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| if (ctx?.async && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| const [pending, markReady] = createPendingProxy(state, promise); | ||
@@ -446,4 +452,3 @@ return pending; | ||
| function mapArray(list, mapFn, options = {}) { | ||
| const root = signals.getOwner(); | ||
| const id = signals.getNextChildId(root); | ||
| const parent = signals.createOwner(); | ||
| return () => { | ||
@@ -453,9 +458,14 @@ const items = list(); | ||
| if (items && items.length) { | ||
| for (let i = 0, len = items.length; i < len; i++) { | ||
| const o = signals.createOwner({ | ||
| id: id + i | ||
| }); | ||
| s.push(signals.runWithOwner(o, () => mapFn(() => items[i], () => i))); | ||
| } | ||
| } else if (options.fallback) s = [options.fallback()]; | ||
| signals.runWithOwner(parent, () => { | ||
| for (let i = 0, len = items.length; i < len; i++) { | ||
| const o = signals.createOwner(); | ||
| s.push(signals.runWithOwner(o, () => mapFn(() => items[i], () => i))); | ||
| } | ||
| }); | ||
| } else if (options.fallback) { | ||
| s = [signals.runWithOwner(parent, () => { | ||
| const fo = signals.createOwner(); | ||
| return signals.runWithOwner(fo, () => options.fallback()); | ||
| })]; | ||
| } | ||
| return s; | ||
@@ -497,3 +507,3 @@ }; | ||
| signals.setContext(ErrorContext, err => { | ||
| if (ctx && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, err); | ||
| if (ctx && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err); | ||
| result = fallback(err, () => {}); | ||
@@ -504,3 +514,3 @@ }); | ||
| } catch (err) { | ||
| if (ctx && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, err); | ||
| if (ctx && !signals.getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err); | ||
| result = fallback(err, () => {}); | ||
@@ -606,6 +616,7 @@ } | ||
| const wrap = props => { | ||
| if (!moduleUrl) { | ||
| const noHydrate = signals.getContext(NoHydrateContext); | ||
| if (!noHydrate && !moduleUrl) { | ||
| 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."); | ||
| } | ||
| if (!sharedConfig.context?.resolveAssets) { | ||
| if (!noHydrate && !sharedConfig.context?.resolveAssets) { | ||
| throw new Error(`lazy() called with moduleUrl "${moduleUrl}" but no asset manifest is set. ` + "Pass a manifest option to renderToStream/renderToString."); | ||
@@ -615,8 +626,10 @@ } | ||
| const ctx = sharedConfig.context; | ||
| if (!ctx?.registerAsset || !ctx.resolveAssets) return; | ||
| if (!ctx?.registerAsset || !ctx.resolveAssets || !moduleUrl) return; | ||
| const assets = ctx.resolveAssets(moduleUrl); | ||
| if (assets) { | ||
| for (let i = 0; i < assets.css.length; i++) ctx.registerAsset("style", assets.css[i]); | ||
| for (let i = 0; i < assets.js.length; i++) ctx.registerAsset("module", assets.js[i]); | ||
| ctx.registerModule?.(moduleUrl, assets.js[0]); | ||
| if (!noHydrate) { | ||
| for (let i = 0; i < assets.js.length; i++) ctx.registerAsset("module", assets.js[i]); | ||
| ctx.registerModule?.(moduleUrl, assets.js[0]); | ||
| } | ||
| } | ||
@@ -634,6 +647,9 @@ if (ctx?.async) { | ||
| wrap.preload = load; | ||
| wrap.moduleUrl = moduleUrl; | ||
| return wrap; | ||
| } | ||
| function createUniqueId() { | ||
| return sharedConfig.getNextContextId(); | ||
| const o = signals.getOwner(); | ||
| if (!o) throw new Error(`createUniqueId cannot be used outside of a reactive context`); | ||
| return signals.getNextChildId(o); | ||
| } | ||
@@ -785,2 +801,19 @@ | ||
| } | ||
| 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; | ||
| }); | ||
| } | ||
@@ -857,4 +890,7 @@ const DEV = undefined; | ||
| exports.For = For; | ||
| exports.Hydration = Hydration; | ||
| exports.Loading = Loading; | ||
| exports.Match = Match; | ||
| exports.NoHydrateContext = NoHydrateContext; | ||
| exports.NoHydration = NoHydration; | ||
| exports.Repeat = Repeat; | ||
@@ -861,0 +897,0 @@ exports.Show = Show; |
+58
-25
@@ -1,4 +0,8 @@ | ||
| import { getOwner, getNextChildId, createOwner, runWithOwner, onCleanup, NotReadyError, isWrappable, setContext, getContext, flatten, createRoot } from '@solidjs/signals'; | ||
| import { getOwner, getContext, getNextChildId, createOwner, runWithOwner, onCleanup, NotReadyError, isWrappable, setContext, flatten, createRoot } from '@solidjs/signals'; | ||
| export { $PROXY, $TRACK, NotReadyError, createOwner, createRoot, flatten, getNextChildId, getOwner, isEqual, isWrappable, merge, omit, onCleanup, runWithOwner, snapshot, storePath } from '@solidjs/signals'; | ||
| const NoHydrateContext = { | ||
| id: Symbol("NoHydrateContext"), | ||
| defaultValue: false | ||
| }; | ||
| const sharedConfig = { | ||
@@ -8,2 +12,3 @@ getNextContextId() { | ||
| if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`); | ||
| if (getContext(NoHydrateContext)) return undefined; | ||
| return getNextChildId(o); | ||
@@ -161,2 +166,3 @@ } | ||
| const uninitialized = comp.value === undefined; | ||
| const noHydrate = getContext(NoHydrateContext, owner); | ||
| if (result instanceof Promise) { | ||
@@ -170,3 +176,3 @@ result.then(v => { | ||
| }, () => {}); | ||
| if (ctx?.async && ctx.serialize && id) ctx.serialize(id, result, deferStream); | ||
| if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, result, deferStream); | ||
| if (uninitialized) { | ||
@@ -188,3 +194,3 @@ comp.error = new NotReadyError(result); | ||
| }, () => {}); | ||
| if (ctx?.async && ctx.serialize && id) ctx.serialize(id, promise, deferStream); | ||
| if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, promise, deferStream); | ||
| if (uninitialized) { | ||
@@ -217,3 +223,3 @@ comp.error = new NotReadyError(promise); | ||
| }; | ||
| if (ctx?.async && ctx.serialize && id) ctx.serialize(id, tapped, deferStream); | ||
| if (ctx?.async && ctx.serialize && id && !noHydrate) ctx.serialize(id, tapped, deferStream); | ||
| if (uninitialized) { | ||
@@ -338,3 +344,3 @@ comp.error = new NotReadyError(firstReady); | ||
| }, () => {}); | ||
| if (ctx?.async && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| if (ctx?.async && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| const [pending, markReady] = createPendingProxy(state, promise); | ||
@@ -396,3 +402,3 @@ return pending; | ||
| }; | ||
| if (ctx?.async && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, tapped, options?.deferStream); | ||
| if (ctx?.async && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, tapped, options?.deferStream); | ||
| const [pending, markReady] = createPendingProxy(state, firstReady); | ||
@@ -415,3 +421,3 @@ return pending; | ||
| }, () => {}); | ||
| if (ctx?.async && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| if (ctx?.async && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, promise, options?.deferStream); | ||
| const [pending, markReady] = createPendingProxy(state, promise); | ||
@@ -444,4 +450,3 @@ return pending; | ||
| function mapArray(list, mapFn, options = {}) { | ||
| const root = getOwner(); | ||
| const id = getNextChildId(root); | ||
| const parent = createOwner(); | ||
| return () => { | ||
@@ -451,9 +456,14 @@ const items = list(); | ||
| if (items && items.length) { | ||
| for (let i = 0, len = items.length; i < len; i++) { | ||
| const o = createOwner({ | ||
| id: id + i | ||
| }); | ||
| s.push(runWithOwner(o, () => mapFn(() => items[i], () => i))); | ||
| } | ||
| } else if (options.fallback) s = [options.fallback()]; | ||
| runWithOwner(parent, () => { | ||
| for (let i = 0, len = items.length; i < len; i++) { | ||
| const o = createOwner(); | ||
| s.push(runWithOwner(o, () => mapFn(() => items[i], () => i))); | ||
| } | ||
| }); | ||
| } else if (options.fallback) { | ||
| s = [runWithOwner(parent, () => { | ||
| const fo = createOwner(); | ||
| return runWithOwner(fo, () => options.fallback()); | ||
| })]; | ||
| } | ||
| return s; | ||
@@ -495,3 +505,3 @@ }; | ||
| setContext(ErrorContext, err => { | ||
| if (ctx && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, err); | ||
| if (ctx && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err); | ||
| result = fallback(err, () => {}); | ||
@@ -502,3 +512,3 @@ }); | ||
| } catch (err) { | ||
| if (ctx && !ctx.noHydrate && owner.id) ctx.serialize(owner.id, err); | ||
| if (ctx && !getContext(NoHydrateContext) && owner.id) ctx.serialize(owner.id, err); | ||
| result = fallback(err, () => {}); | ||
@@ -604,6 +614,7 @@ } | ||
| const wrap = props => { | ||
| if (!moduleUrl) { | ||
| const noHydrate = getContext(NoHydrateContext); | ||
| if (!noHydrate && !moduleUrl) { | ||
| 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."); | ||
| } | ||
| if (!sharedConfig.context?.resolveAssets) { | ||
| if (!noHydrate && !sharedConfig.context?.resolveAssets) { | ||
| throw new Error(`lazy() called with moduleUrl "${moduleUrl}" but no asset manifest is set. ` + "Pass a manifest option to renderToStream/renderToString."); | ||
@@ -613,8 +624,10 @@ } | ||
| const ctx = sharedConfig.context; | ||
| if (!ctx?.registerAsset || !ctx.resolveAssets) return; | ||
| if (!ctx?.registerAsset || !ctx.resolveAssets || !moduleUrl) return; | ||
| const assets = ctx.resolveAssets(moduleUrl); | ||
| if (assets) { | ||
| for (let i = 0; i < assets.css.length; i++) ctx.registerAsset("style", assets.css[i]); | ||
| for (let i = 0; i < assets.js.length; i++) ctx.registerAsset("module", assets.js[i]); | ||
| ctx.registerModule?.(moduleUrl, assets.js[0]); | ||
| if (!noHydrate) { | ||
| for (let i = 0; i < assets.js.length; i++) ctx.registerAsset("module", assets.js[i]); | ||
| ctx.registerModule?.(moduleUrl, assets.js[0]); | ||
| } | ||
| } | ||
@@ -632,6 +645,9 @@ if (ctx?.async) { | ||
| wrap.preload = load; | ||
| wrap.moduleUrl = moduleUrl; | ||
| return wrap; | ||
| } | ||
| function createUniqueId() { | ||
| return sharedConfig.getNextContextId(); | ||
| const o = getOwner(); | ||
| if (!o) throw new Error(`createUniqueId cannot be used outside of a reactive context`); | ||
| return getNextChildId(o); | ||
| } | ||
@@ -783,5 +799,22 @@ | ||
| } | ||
| 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; | ||
| }); | ||
| } | ||
| const DEV = undefined; | ||
| export { $DEVCOMP, DEV, Errored, For, Loading, Match, Repeat, Show, Switch, action, children, createComponent, createContext, createDeepProxy, createEffect, createMemo, createOptimistic, createOptimisticStore, createProjection, createReaction, createRenderEffect, 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, Show, Switch, action, children, createComponent, createContext, createDeepProxy, createEffect, createMemo, createOptimistic, createOptimisticStore, createProjection, createReaction, createRenderEffect, createSignal, createStore, createTrackedEffect, createUniqueId, deep, enableHydration, flush, getObserver, isPending, isRefreshing, latest, lazy, mapArray, onSettled, reconcile, refresh, repeat, resolve, sharedConfig, ssrHandleError, ssrRunInScope, untrack, useContext }; |
+20
-0
@@ -35,2 +35,6 @@ 'use strict'; | ||
| const NoHydrateContext = { | ||
| id: Symbol("NoHydrateContext"), | ||
| defaultValue: false | ||
| }; | ||
| const sharedConfig = { | ||
@@ -43,2 +47,3 @@ hydrating: false, | ||
| if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`); | ||
| if (signals.getContext(NoHydrateContext)) return undefined; | ||
| return signals.getNextChildId(o); | ||
@@ -562,2 +567,13 @@ } | ||
| } | ||
| function NoHydration(props) { | ||
| const o = signals.createOwner(); | ||
| return signals.runWithOwner(o, () => { | ||
| signals.setContext(NoHydrateContext, true); | ||
| if (sharedConfig.hydrating) return undefined; | ||
| return props.children; | ||
| }); | ||
| } | ||
| function Hydration(props) { | ||
| return props.children; | ||
| } | ||
@@ -591,2 +607,3 @@ function createComponent(Comp, props) { | ||
| wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p); | ||
| wrap.moduleUrl = moduleUrl; | ||
| return wrap; | ||
@@ -820,4 +837,7 @@ } | ||
| exports.For = For; | ||
| exports.Hydration = Hydration; | ||
| exports.Loading = Loading; | ||
| exports.Match = Match; | ||
| exports.NoHydrateContext = NoHydrateContext; | ||
| exports.NoHydration = NoHydration; | ||
| exports.Repeat = Repeat; | ||
@@ -824,0 +844,0 @@ exports.Show = Show; |
+19
-2
@@ -1,2 +0,2 @@ | ||
| import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, createLoadBoundary, getOwner, onCleanup, isDisposed, runWithOwner, 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'; | ||
| import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, createLoadBoundary, 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, $TRACK, NotReadyError, action, createOwner, createReaction, createRoot, createTrackedEffect, deep, 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'; | ||
@@ -34,2 +34,6 @@ | ||
| const NoHydrateContext = { | ||
| id: Symbol("NoHydrateContext"), | ||
| defaultValue: false | ||
| }; | ||
| const sharedConfig = { | ||
@@ -42,2 +46,3 @@ hydrating: false, | ||
| if (!o) throw new Error(`getNextContextId cannot be used under non-hydrating context`); | ||
| if (getContext(NoHydrateContext)) return undefined; | ||
| return getNextChildId(o); | ||
@@ -561,2 +566,13 @@ } | ||
| } | ||
| function NoHydration(props) { | ||
| const o = createOwner(); | ||
| return runWithOwner(o, () => { | ||
| setContext(NoHydrateContext, true); | ||
| if (sharedConfig.hydrating) return undefined; | ||
| return props.children; | ||
| }); | ||
| } | ||
| function Hydration(props) { | ||
| return props.children; | ||
| } | ||
@@ -590,2 +606,3 @@ function createComponent(Comp, props) { | ||
| wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p); | ||
| wrap.moduleUrl = moduleUrl; | ||
| return wrap; | ||
@@ -687,2 +704,2 @@ } | ||
| export { $DEVCOMP, DEV, Errored, For, Loading, Match, 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, createMemo, createOptimistic, createOptimisticStore, createProjection, createRenderEffect, createSignal, createStore, createUniqueId, enableHydration, lazy, sharedConfig, ssrHandleError, ssrRunInScope, useContext }; |
+2
-2
| { | ||
| "name": "solid-js", | ||
| "description": "A declarative JavaScript library for building user interfaces.", | ||
| "version": "2.0.0-beta.0", | ||
| "version": "2.0.0-beta.1", | ||
| "author": "Ryan Carniato", | ||
@@ -82,3 +82,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@solidjs/signals": "^0.11.1", | ||
| "@solidjs/signals": "^0.11.3", | ||
| "csstype": "^3.1.0", | ||
@@ -85,0 +85,0 @@ "seroval": "~1.5.0", |
@@ -73,3 +73,4 @@ import type { JSX } from "../jsx.js"; | ||
| }>; | ||
| moduleUrl?: string; | ||
| }; | ||
| export declare function createUniqueId(): string; |
@@ -1,2 +0,2 @@ | ||
| import { createErrorBoundary as coreErrorBoundary, createMemo as coreMemo, createSignal as coreSignal, createOptimistic as coreOptimistic, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type ProjectionOptions, type Store, type StoreSetter } from "@solidjs/signals"; | ||
| import { createErrorBoundary as coreErrorBoundary, createMemo as coreMemo, createSignal as coreSignal, createOptimistic as coreOptimistic, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type ProjectionOptions, type Store, type StoreSetter, type Context } from "@solidjs/signals"; | ||
| import { JSX } from "../jsx.js"; | ||
@@ -21,2 +21,3 @@ declare module "@solidjs/signals" { | ||
| export type HydrationContext = {}; | ||
| export declare const NoHydrateContext: Context<boolean>; | ||
| type SharedConfig = { | ||
@@ -77,2 +78,17 @@ hydrating: boolean; | ||
| }): JSX.Element; | ||
| /** | ||
| * Disables hydration for its children on the client. | ||
| * During hydration, skips the subtree entirely (returns undefined so DOM is left untouched). | ||
| * After hydration, renders children fresh. | ||
| */ | ||
| export declare function NoHydration(props: { | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| /** | ||
| * Re-enables hydration within a NoHydration zone (passthrough on client). | ||
| */ | ||
| export declare function Hydration(props: { | ||
| id?: string; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| export {}; |
+1
-1
@@ -7,3 +7,3 @@ export { $PROXY, $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, snapshot, storePath, untrack } from "@solidjs/signals"; | ||
| export * from "./client/flow.js"; | ||
| export { sharedConfig, Loading, enableHydration, createMemo, createSignal, createStore, createProjection, createOptimistic, createOptimisticStore, createRenderEffect, createEffect } from "./client/hydration.js"; | ||
| export { sharedConfig, Loading, enableHydration, 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; |
@@ -65,3 +65,4 @@ import type { JSX } from "../jsx.js"; | ||
| }>; | ||
| moduleUrl?: string; | ||
| }; | ||
| export declare function createUniqueId(): string; |
| import type { JSX } from "../jsx.js"; | ||
| export { sharedConfig } from "./shared.js"; | ||
| export type { HydrationContext } from "./shared.js"; | ||
| export { sharedConfig, NoHydrateContext } from "./shared.js"; | ||
| export type { HydrationContext, SSRTemplateObject } from "./shared.js"; | ||
| /** | ||
@@ -22,1 +22,18 @@ * Handles errors during SSR rendering. | ||
| }): JSX.Element; | ||
| /** | ||
| * Disables hydration for its children during SSR. | ||
| * Elements inside will not receive hydration keys (`_hk`) and signals will not be serialized. | ||
| * Use `Hydration` to re-enable hydration within a `NoHydration` zone. | ||
| */ | ||
| export declare function NoHydration(props: { | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| /** | ||
| * Re-enables hydration within a `NoHydration` zone, establishing a new ID namespace. | ||
| * Pass an `id` prop matching the client's `hydrate({ renderId })` to align hydration keys. | ||
| * Has no effect when not inside a `NoHydration` zone (passthrough). | ||
| */ | ||
| export declare function Hydration(props: { | ||
| id?: string; | ||
| children: JSX.Element; | ||
| }): JSX.Element; |
@@ -7,3 +7,3 @@ export { $PROXY, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, 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, untrack } from "./signals.js"; | ||
| export * from "./flow.js"; | ||
| export { sharedConfig, Loading, ssrHandleError } from "./hydration.js"; | ||
| export { sharedConfig, Loading, ssrHandleError, NoHydration, Hydration, NoHydrateContext } from "./hydration.js"; | ||
| export type { HydrationContext } from "./hydration.js"; | ||
@@ -10,0 +10,0 @@ import type { JSX } from "../jsx.js"; |
@@ -1,2 +0,3 @@ | ||
| type SSRTemplateObject = { | ||
| import type { Context } from "@solidjs/signals"; | ||
| export type SSRTemplateObject = { | ||
| t: string[]; | ||
@@ -38,9 +39,9 @@ h: Function[]; | ||
| async?: boolean; | ||
| noHydrate: boolean; | ||
| }; | ||
| export declare const NoHydrateContext: Context<boolean>; | ||
| type SharedConfig = { | ||
| context?: HydrationContext; | ||
| getNextContextId(): string; | ||
| getNextContextId(): string | undefined; | ||
| }; | ||
| export declare const sharedConfig: SharedConfig; | ||
| export {}; |
@@ -6,2 +6,3 @@ export { createRoot, createOwner, runWithOwner, getOwner, onCleanup, getNextChildId, createContext, setContext, getContext, NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY } 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"; | ||
| interface ServerComputation<T = any> { | ||
@@ -50,2 +51,3 @@ owner: Owner; | ||
| export { ErrorContext }; | ||
| export { NoHydrateContext }; | ||
| export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: unknown, reset: () => void) => U): () => unknown; | ||
@@ -52,0 +54,0 @@ export declare function createLoadBoundary(fn: () => any, fallback: () => any): () => unknown; |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
372491
1.71%9623
1.93%13
-7.14%Updated