Packages

@preact/signals-core

1.14.5 · 27 Oct 2026MIT17.2M / weekRepositoryHomepagenpmAtom feed

Your version

34 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 1.x · latest line
  2. 1.14.5

    27 Oct 2026
    • Dispose captured effects when a createModel factory throws.

    • End the batch when a self-disposing effect's cleanup throws.

    • Fix createModel to also wrap class prototype methods as actions. This includes toString/toJSON, and the actions are not auto-bound.

  3. 1.14.4

    7 Jul 2026
    • Fix 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() and action() callbacks.

      If you create an effect() inside an untracked() callback within a createModel() factory, that effect is no longer disposed when the model is disposed. Use the disposer returned by effect() to clean it up manually.

  4. 1.14.3

    16 Jun 2026
    • Optimize bundle size

  5. 1.14.2

    11 May 2026
    • Shave some bytes by using untracked to implement peek

  6. 1.14.1

    31 Mar 2026
    • Wrap nested object methods returned from createModel so composed models keep action batching semantics without manual action wrappers.

    • Avoid hard-requiring ESNext.Disposable in consumer tsconfigs for Model and effect() types.

  7. 1.14.0

    8 Mar 2026
    • Prevent 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.

  8. 1.13.0

    4 Feb 2026
    • Add createModel and action to signals core package

      createModel provides 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 effects

      Key features:

      action is 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
  9. 1.12.2

    20 Jan 2026
  10. 1.12.1

    23 Aug 2025
    • Remove internal annotation as it confused TS

  11. 1.12.0

    19 Aug 2025
  12. 1.11.0

    29 Jun 2025
    • Support disposing effect() with resource management

      This allows effect()'s to be disposed with the new using keyword from the explicit resource management proposal.

      Whenever an effect goes out of scope the Symbol.dispose function 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
  13. 1.10.0

    11 Jun 2025
    • Publicly expose dispose() on an effect callback

  14. 1.9.0

    29 May 2025
    • Add an option to specify a watched/unwatched callback to a signal

    • Loosen up types for watched and unwatched

  15. 1.8.0

    4 Aug 2024
    • Adjust the ReadOnlySignal type to not inherit from Signal
      this way the type can't be widened without noticing, i.e. when
      we'd have

      const 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.

  16. 1.7.0

    6 Jul 2024
    • Allow for passing no argument to the signal and the type to be automatically inferred as T | undefined

  17. 1.6.1

    12 Jun 2024
    • Restore stricter effect callback & cleanup function types

  18. 1.6.0

    19 Mar 2024
    • Allow setting a signal value inside a computed

    • Publish packages with provenance statements

    • Document effect cleanups

  19. 1.5.1

    7 Dec 2023
    • Removed

      Removes backward-incompatible type export from signals core.

  20. 1.5.0

    8 Sep 2023
    • Add unique identifier to every Signal, this will be present on the brand property of a Signal coming from either signal() or computed()

  21. 1.4.0

    2 Aug 2023
    • Add untracked function, this allows more granular control within effect/computed around what should affect re-runs.

  22. 1.2.3 – 1.3.13 releases without a noteShow each
  23. 1.2.2

    13 Oct 2022
    • Simplify effect change checking (and make effect cycle detection more accurate as a side-effect)

    • Simplify Node book keeping code

  24. 1.2.1

    1 Oct 2022
    • Use 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

  25. 1.2.0

    21 Sep 2022
    • 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

    • Fix .subscribe() unexpectedly tracking signal access

  26. 1.1.1

    15 Sep 2022
    • Simplify batch() to use a single flag instead of a counter

    • Fix computed signal being re-calculated despite dependencies not having changed

    • Fix .subscribe's TypeScript type

  27. 1.1.0

    13 Sep 2022
  28. 1.0.0 – 1.0.12 releases without a noteShow each
  29. 0.0.x
  30. 0.0.5

    2 Sep 2022
  31. 0.0.4

    24 Aug 2022

    Reading the note…

  32. 0.0.3

    24 Aug 2022

    Reading the note…

  33. 0.0.2

    24 Aug 2022

    Reading 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.