@preact/signals-core
1.14.5 · 27 Oct 2026MIT17.2M / weekRepositoryHomepagenpmAtom feed
34 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.14.5
27 Oct 2026Dispose captured effects when a
createModelfactory throws.End the batch when a self-disposing effect's cleanup throws.
Fix
createModelto also wrap class prototype methods as actions. This includestoString/toJSON, and the actions are not auto-bound.
1.14.4
7 Jul 2026Fix computeds returning stale values after a batch reverts a signal to its original value.
Reconciling a reverted batch write used to roll the signal's version number back, breaking version monotonicity. A lazy computed that read the signal during the batch had already observed the intermediate version, so a later write could re-mint that same version number for a different value and the computed would treat it as unchanged forever. Subscriber nodes that saw the pre-batch version are now fast-forwarded instead, keeping the no-op skip optimization without ever reusing version numbers.
Prevent model effect capture while creating effects inside
untracked()andaction()callbacks.If you create an
effect()inside anuntracked()callback within acreateModel()factory, that effect is no longer disposed when the model is disposed. Use the disposer returned byeffect()to clean it up manually.
1.14.3
16 Jun 2026Optimize bundle size
1.14.2
11 May 2026Shave some bytes by using untracked to implement peek
1.14.1
31 Mar 2026Wrap nested object methods returned from createModel so composed models keep action batching semantics without manual action wrappers.
Avoid hard-requiring
ESNext.Disposablein consumer tsconfigs forModelandeffect()types.
1.14.0
8 Mar 2026Prevent batches where a signal goes from A --> B --> A from triggering dependent updates, a computed/effect should not re-run when the dependencies in a batched update amount to an equal value.
1.13.0
4 Feb 2026Add
createModelandactionto signals core packagecreateModelprovides a structured way to create reactive model classes that encapsulate signals, computed values, and actions:const CounterModel = createModel((initialCount = 0) => { const count = signal(initialCount); const doubled = computed(() => count.value * 2); effect(() => { console.log("Count changed:", count.value); }); return { count, doubled, increment() { count.value++; }, }; }); const counter = new CounterModel(5); counter.increment(); // Updates are automatically batched counter[Symbol.dispose](); // Cleans up all effectsKey features:
actionis a helper that wraps a function to run batched and untracked:const updateAll = action(items => { items.forEach(item => item.value++); }); // All updates batched into single notification
1.12.2
20 Jan 20261.12.1
23 Aug 2025Remove internal annotation as it confused TS
1.12.0
19 Aug 2025Initial release of
@preact/signals-debugAdd devtools capabilities and component tracking
Minor Changes
Initial release of
@preact/signals-debugAdd devtools capabilities and component tracking
1.11.0
29 Jun 2025Support disposing
effect()with resource managementThis allows
effect()'s to be disposed with the newusingkeyword from the explicit resource management proposal.Whenever an effect goes out of scope the
Symbol.disposefunction is called automatically.const count = signal(0); function doSomething() { // The `using` keyword calls dispose at the end of // this function scope using _ = effect(() => { console.log(count.value); return () => console.log("disposed"); }); console.log("hey"); } doSomething(); // Logs: // 0 // hey // disposed
1.10.0
11 Jun 2025Publicly expose
dispose()on an effect callback
1.9.0
29 May 2025Add an option to specify a watched/unwatched callback to a signal
Loosen up types for
watchedandunwatched
1.8.0
4 Aug 2024Adjust the
ReadOnlySignaltype to not inherit fromSignal
this way the type can't be widened without noticing, i.e. when
we'd haveconst sig: Signal = useComputed(() => x);
We would have widened the type to be mutable again, which for
a computed is not allowed. We want to provide the tools to our
users to avoid these footguns hence we are correcting this type
in a minor version.
1.7.0
6 Jul 2024Allow for passing no argument to the signal and the type to be automatically inferred as
T | undefined
1.6.1
12 Jun 2024Restore stricter effect callback & cleanup function types
1.6.0
19 Mar 2024Allow setting a signal value inside a computed
Publish packages with provenance statements
Document effect cleanups
Minor Changes
Allow setting a signal value inside a computed
Patch Changes
Publish packages with provenance statements
Document effect cleanups
Always reset the evaluation context upon entering an untracked block
Add JSDocs for exported core module members
1.5.1
7 Dec 2023- Removed
Removes backward-incompatible type export from signals core.
1.5.0
8 Sep 2023Add unique identifier to every
Signal, this will be present on thebrandproperty of a Signal coming from eithersignal()orcomputed()
1.4.0
2 Aug 2023Add
untrackedfunction, this allows more granular control withineffect/computedaround what should affect re-runs.
1.2.2
13 Oct 2022Simplify effect change checking (and make effect cycle detection more accurate as a side-effect)
Simplify Node book keeping code
1.2.1
1 Oct 2022Use the same tracking logic for both effects and computeds. This ensures that effects are only called whenever any of their dependencies changes. If they all stay the same, then the effect will not be invoked.
Fix effect disposal when cleanup throws
Optimize dependency value change checks by allowing earlier exists from the loop
1.2.0
21 Sep 2022Add ability to run custom cleanup logic when an effect is disposed.
effect(() => { console.log("This runs whenever a dependency changes"); return () => { console.log("This runs when the effect is disposed"); }); });Allow disposing a currently running effect
Fix
.subscribe()unexpectedly tracking signal access
This release improves performance of signals across all measurements. We want to especially highlight @jviide 's work in #161 here as it did outstanding strides on reducing memory usage, improving performance and ending up making signals one (if not the) fastest reactive library at the time of this writing 🎉
Minor Changes
Add ability to run custom cleanup logic when an effect is disposed.
effect(() => { console.log("This runs whenever a dependency changes"); return () => { console.log("This runs when the effect is disposed"); }); });Allow disposing a currently running effect
Patch Changes
Fix
.subscribe()unexpectedly tracking signal accessAdd support for
Signal.prototype.valueOfRemove all usages of
Set,Mapand other allocation heavy objects in signals-core. This substaintially increases performance across all measurements.
1.1.1
15 Sep 2022Simplify
batch()to use a single flag instead of a counterFix computed signal being re-calculated despite dependencies not having changed
Fix
.subscribe's TypeScript type
Patch Changes
Simplify
batch()to use a single flag instead of a counterFix computed signal being re-calculated despite dependencies not having changed
Fix
.subscribe's TypeScript typeMove
typesfield inpackage.jsonto the top of the entry list to ensure that TypeScript always finds it.Fix invalidated signals inside
batch()not being refreshed when read inside a batching operation. This fixes a regression.
1.1.0
13 Sep 2022experimental: Add
.subscribe()-method to signals to add support for natively using signals with Svelte - #134 @marvinhagemeisterDon't mangle
Signalclass name - #100 @marvinhagemeisterFix internal API functions being able to unmark non-invalidated signals - #112 @marvinhagemeister
Minor Changes
experimental: Add
.subscribe()-method to signals to add support for natively using signals with Svelte - #134 @marvinhagemeister
Patch Changes
Don't mangle
Signalclass name - #100 @marvinhagemeisterFix internal API functions being able to unmark non-invalidated signals - #112 @marvinhagemeister
Fix conditionally signals (lazy branches) not being re-computed upon activation - #127 @marvinhagemeister
Fix a memory leak when computed signals and effects are removed - #117 @developit
- 0.0.x
0.0.5
2 Sep 20220.0.4
24 Aug 2022Reading the note…
0.0.3
24 Aug 2022Reading the note…
0.0.2
24 Aug 2022Reading the note…
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.