@preact/signals
2.11.4 · 27 Oct 2026MIT4.7M / weekRepositoryHomepagenpmAtom feed
60 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 2.x · latest line
2.11.4
27 Oct 2026Use the active Preact VNode marker.
Patch Changes
Use the active Preact VNode marker.
2.11.3
30 Sep 2026Don't re-run a
useSignalEffectfor a component that was unmounted by the same update. Preact 11 disposes it after paint, so the effect could otherwise run once more against an unmounted component.
2.11.2
4 Sep 2026Stop component tracking before Preact reconciles the returned VNode so Signals read by DOM property getters do not subscribe the parent component.
2.11.1
14 Aug 2026Avoid closing over VNodes in component updater callbacks.
2.11.0
4 Aug 2026Add support for passing functions as fallback to
<For>for lazy instantiation.<For each={list} fallback={() => <p>No items</p>}> {item => <p>{item}</p>} </For>This avoids eager evaluation of the fallback when the collection has items, which matters when you're dealing with signals.
2.10.1
31 Jul 2026Export the
ModelFactorytype from the Preact and React adapters.
2.10.0
23 Jul 2026Add support for passing functions as fallback to
<Show>for lazy instantiation.<Show when={toggle} fallback={() => <p>I'm lazy</p>}> <p>foo</p> </Show>This avoids eager evaluation of whatever is passed to fallback which matters when you're dealing with signals.
Name signals created internally by the Preact adapter and
useLiveSignalso debugging tools can identify them.
2.9.4
15 Jul 2026Stop treating
useContextas hook state in the auto-memoization heuristic. Context updates force-update their subscribers in Preact, bypassingshouldComponentUpdateentirely, so context consumers can safely keep the props-based render skipping.
2.9.3
7 Jul 2026Allow
<For>to accept readonly arrays and signals containing readonly arrays.Dispose signal prop updaters when an element re-renders without any signal props.
The disposal pass only ran when the new render still carried at least one signal-bound prop. When every signal prop was replaced by plain values, the old updater effect stayed subscribed and kept writing the previous signal's values straight into the DOM, overriding whatever Preact rendered.
Patch Changes
Allow
<For>to accept readonly arrays and signals containing readonly arrays.Dispose signal prop updaters when an element re-renders without any signal props.
The disposal pass only ran when the new render still carried at least one signal-bound prop. When every signal prop was replaced by plain values, the old updater effect stayed subscribed and kept writing the previous signal's values straight into the DOM, overriding whatever Preact rendered.
2.9.2
16 Jun 2026Fix stale
<For>render-prop indexes after removals/reorders by making each cached item's index reactive (a per-item signal) instead of a frozen prop. Cached children are reused and re-render with the new index rather than being recreated, so DOM/component identity is preserved.Fix Signal-bound DOM props getting stranded at a stale value when Preact reuses a DOM node. The prop-binding effect now writes the applied value back into the rendered props, keeping Preact's diff baseline in sync with the DOM instead of assuming Preact applied every update.
Patch Changes
Fix stale
<For>render-prop indexes after removals/reorders by making each cached item's index reactive (a per-item signal) instead of a frozen prop. Cached children are reused and re-render with the new index rather than being recreated, so DOM/component identity is preserved.Fix Signal-bound DOM props getting stranded at a stale value when Preact reuses a DOM node. The prop-binding effect now writes the applied value back into the rendered props, keeping Preact's diff baseline in sync with the DOM instead of assuming Preact applied every update.
2.9.1
25 May 2026Fix redundant DOM attribute writes when a parent rerenders with unchanged signal props. The DIFFED hook no longer writes Signal references back into
vnode.props, which was causing Preact's prop diff to see a mismatch (old: Signal, new: peeked value) and re-apply every signal-bound attribute on every parent rerender.
2.9.0
27 Mar 2026Add optional
getKeyprop to<For>component for stable list reconciliation. When provided,getKeygenerates stable keys for the internal<Item>wrapper, fixing incorrect DOM reuse when items are removed or reordered.
2.8.2
8 Mar 2026Fix infinite recursion when tools like Storybook traverse Signal props
Patch Changes
Fix infinite recursion when tools like Storybook traverse Signal props
2.8.1
16 Feb 2026Ensure that re-mounting components preserve the DOM updaters correctly
2.8.0
13 Feb 2026Support returning a plain array in the
whenof aForcomponent
2.7.1
9 Feb 2026Prevent scheduled effects from highjacking the execution-context
2.7.0
4 Feb 2026Add
useModelhook for using Models in componentsThe new
useModelhook provides a convenient way to use Models (created withcreateModel) within React and Preact components. It handles:import { createModel, signal } from "@preact/signals-core"; import { useModel } from "@preact/signals-react"; // or "@preact/signals" const CountModel = createModel(() => ({ count: signal(0), increment() { this.count.value++; }, })); function Counter() { const model = useModel(CountModel); return <button onClick={() => model.increment()}>{model.count}</button>; }For models that require constructor arguments, wrap in a factory function:
const CountModel = createModel((initialCount: number) => ({ count: signal(initialCount), })); function Counter() { const model = useModel(() => new CountModel(5)); return <div>{model.count}</div>; }Revert #728 - this might entail work in prefresh but currently the presence of
uesStatemakes every sCU bail
Minor Changes
Add
useModelhook for using Models in componentsThe new
useModelhook provides a convenient way to use Models (created withcreateModel) within React and Preact components. It handles:Creating the model instance lazily on first render
Maintaining the same instance across re-renders
Automatically disposing the model when the component unmounts
import { createModel, signal } from "@preact/signals-core"; import { useModel } from "@preact/signals-react"; // or "@preact/signals" const CountModel = createModel(() => ({ count: signal(0), increment() { this.count.value++; }, })); function Counter() { const model = useModel(CountModel); return <button onClick={() => model.increment()}>{model.count}</button>; }For models that require constructor arguments, wrap in a factory function:
const CountModel = createModel((initialCount: number) => ({ count: signal(initialCount), })); function Counter() { const model = useModel(() => new CountModel(5)); return <div>{model.count}</div>; }
Patch Changes
Revert #728 - this might entail work in prefresh but currently the presence of
uesStatemakes every sCU bail
2.6.2
30 Jan 2026Fix issue where unmounted vnodes could update with signals
2.6.1
21 Jan 2026Ensure that the
ForandShowcomponent have display-names
2.6.0
20 Jan 2026- Removed
Remove the need for enter/exit component and track the effects normally
Add mangle entry for _debugCallback
Minor Changes
- Removed
Remove the need for enter/exit component and track the effects normally
Patch Changes
Add mangle entry for _debugCallback
2.5.1
19 Nov 2025Widen utility component types to accept ComponentChildren/ReactNodes as children and fallbacks
Fix performance regression by checking if the
@preact/signals-debugpackage is enabled only once.Allow useLiveSignal to accept plain values
2.5.0
12 Nov 2025Allow the
whenproperty ofShowto be a function so not everything has to be transformed into a boolean computedEnsure the cached and non-cached shape is the same
Prevent
Forcache from expanding infinitely
2.4.0
6 Nov 2025Revert the changes to
useComputed, sincere apologies for the inconvenience we've discussed this at length and are going to side on the perf side.Ensure aria/data attributes stick around when going back to an empty string
Ensure
ForandShowaccount for nested reactivity
2.3.2
4 Oct 2025Update useComputed compute function on rerender
2.3.1
20 Aug 2025Correct semver range to support beta releases of Preact v11
2.3.0
19 Aug 2025Call into component tracking of the chrome extension
Allow for naming your singals/computeds/effects
Fix prefresh HMR not working with
useSignal.
Minor Changes
Call into component tracking of the chrome extension
Allow for naming your singals/computeds/effects
Patch Changes
Fix prefresh HMR not working with
useSignal.Expand semver range to support the upcoming v11 beta release
2.2.1
29 Jun 2025Narrow types for Show utility, the callback is truthy by design
Patch Changes
Narrow types for Show utility, the callback is truthy by design
2.2.0
29 May 2025Add an option to specify a watched/unwatched callback to a signal
Minor Changes
Add an option to specify a watched/unwatched callback to a signal
2.1.1
27 May 2025Ensure we build the thing
2.1.0
27 May 2025Provide
@preact/signals/utilspackage with some helpers to make working with signals easier in Preact
2.0.5
24 May 2025We reduce the raf timeout to be just above a timeout that is associated with a 30hz refresh rate. This ensures that for hidden frames the timeout drift can't be too large, the drift being too high could lead to unexpected situations.
Fix accessing signals from Preact Class Component constructor.
2.0.4
20 Apr 2025Correctly set peerDep of signals
2.0.3
4 Apr 2025Fix array signals when used as jsx
2.0.2
26 Mar 2025Avoid usage of
.baseand check the_domon the vnode insteadBail out of the animation frame with a setTimeout in case the origin page is hidden
2.0.1
13 Jan 2025Ensure that text effects get disposed
Change the way we deal with state settling hooks, when we know we are dealing with hooks that can settle their A -> B -> A state (and wind up at the same value). We should not verbatim rerender in our custom shouldComponentUpdate. Instead we should trust that hooks have handled their own state settling.
2.0.0
17 Dec 2024- Breaking
Defer all DOM updates by an animation frame, this should make it so
that any previously synchronous DOM update will be instead delayed by an
animation frame. This allows Preact to first perform its own render
cycle and then our direct DOM updates to occur. These will now
be performed in a batched way which is more performant as the browser
is prepared to handle these during the animation frame.This does impact how Preact based signals are tested, when
you perform a signal update, you'll need to wrap it inact. In a way
this was always the case, as a signal update that resulted in
a Preact state update would require it to be wrapped inact, but
now this is the norm. Align signal effects with animation-frames for better performance
Change timing to a double microtask so we are behind the Preact render queue but can't delay as much as a user-input coming in.
- 1.x
1.3.4
7 Feb 2026Prevent scheduled effects from highjacking the execution-context
1.3.3
29 Jan 2026Fix issue where unmounted vnodes could update with signals
1.3.2
13 Jan 2025Change the way we deal with state settling hooks, when we know we are dealing with hooks that can settle their A -> B -> A state (and wind up at the same value). We should not verbatim rerender in our custom shouldComponentUpdate. Instead we should trust that hooks have handled their own state settling.
1.3.1
27 Nov 2024Simplify text update patch to avoid using new internals
Ensure that the Effects versions are updated when using it as a JSX Signal
1.3.0
6 Jul 2024Allow for passing no argument to the signal and the type to be automatically inferred as
T | undefined
Minor Changes
Allow for passing no argument to the signal and the type to be automatically inferred as
T | undefined
1.2.3
19 Mar 2024Publish packages with provenance statements
Patch Changes
Publish packages with provenance statements
1.2.2
22 Nov 2023Fix error when using
useSignalwith UMD builds of@preact/signals.
1.2.1
11 Aug 2023Fixes UMD builds of
@preact/signalsand@preact/signals-react
1.2.0
2 Aug 2023- Removed
Removed difference in behaviour between adapters, signals that use a JSX value will correctly re-render the whole component rather than attempting the JSX-Text optimization.
1.1.5
7 Jul 2023Allow for context to propagate to components using context
1.1.4
29 Jun 2023- Removed
Removes package.json#exports.umd, which had invalid paths if they were ever to be consumed
Patch Changes
- Removed
Removes package.json#exports.umd, which had invalid paths if they were ever to be consumed
1.1.3
29 Dec 2022Fix rendering of Signals as text in
preact-render-to-stringcafbdaaThanks @developit! - Fix a bug that caused cleanup functions returned from auseSignalEffect()callback not to be called.
Patch Changes
Fix rendering of Signals as text in
preact-render-to-string
cafbdaaThanks @developit! - Fix a bug that caused cleanup functions returned from auseSignalEffect()callback not to be called.
1.1.2
13 Oct 2022Fix hook names being mangled
1.1.1
22 Sep 2022Fix server-sider-render error when unmounting a signal passed as text into JSX.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.