Skip to content

Version Packages - #860

Merged
JoviDeCroock merged 1 commit into
mainfrom
changeset-release/main
Feb 4, 2026
Merged

Version Packages#860
JoviDeCroock merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@preact/signals-core@1.13.0

Minor Changes

  • #812 19ac39b Thanks @andrewiggins! - 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:

    • Factory functions can accept arguments for initialization
    • All methods are automatically wrapped as actions (batched & untracked)
    • Effects created during model construction are captured and disposed when the model is disposed via Symbol.dispose
    • TypeScript validates that models only contain signals, actions, or nested objects with signals/actions

    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

@preact/signals-debug@1.4.0

Minor Changes

@preact/signals-devtools-adapter@0.4.0

Minor Changes

@preact/signals-devtools-ui@0.4.0

Minor Changes

Patch Changes

  • Updated dependencies [00ba858]:
    • @preact/signals-devtools-adapter@0.4.0

@preact/signals@2.7.0

Minor Changes

  • #861 5794b04 Thanks @andrewiggins! - Add useModel hook for using Models in components

    The new useModel hook provides a convenient way to use Models (created with createModel) 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

@preact/signals-react@3.8.0

Minor Changes

  • #861 5794b04 Thanks @andrewiggins! - Add useModel hook for using Models in components

    The new useModel hook provides a convenient way to use Models (created with createModel) 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

  • Updated dependencies [19ac39b]:
    • @preact/signals-core@1.13.0

@preact/signals-react-transform@0.8.1

Patch Changes

  • #814 a5d0a6e Thanks @andrewiggins! - Fix JSX detection leaking to non-component functions in the same scope

    Previously, when a component containing JSX was defined inside another function, the JSX detection could incorrectly "leak" to sibling functions or the parent function, causing non-components to be transformed. This was especially problematic in test files where components are defined inside it() or describe() blocks.

    describe("suite", () => {
      it("test", () => {
        // This arrow function was incorrectly transformed because
        // Counter's JSX detection leaked to sibling functions
        const CountModel = () => signal.value;
        function Counter() {
          return <div>Hello</div>;
        }
      });
    });

    The transform now correctly scopes JSX and signal usage detection to only the containing component or custom hook function.

  • Updated dependencies [5794b04]:

    • @preact/signals-react@3.8.0

preact-signals-devtools@1.1.6

Patch Changes

  • Updated dependencies [5794b04, 4872968, 00ba858, 19ac39b]:
    • @preact/signals@2.7.0
    • @preact/signals-devtools-adapter@0.4.0
    • @preact/signals-devtools-ui@0.4.0
    • @preact/signals-core@1.13.0

@netlify

netlify Bot commented Jan 31, 2026

Copy link
Copy Markdown

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit 651ec84
🔍 Latest deploy log https://app.netlify.com/projects/preact-signals-demo/deploys/6982f0b6fe4c340008a55768
😎 Deploy Preview https://deploy-preview-860--preact-signals-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
github-actions Bot force-pushed the changeset-release/main branch 4 times, most recently from ffa4501 to 2269d17 Compare February 1, 2026 17:35
@JoviDeCroock

Copy link
Copy Markdown
Member

Ah, the signals debug package needs to move signals core to peerDeps and we need to remove major bumps for dep bumps in changesets

@github-actions
github-actions Bot force-pushed the changeset-release/main branch 4 times, most recently from e9c61cb to dca9765 Compare February 3, 2026 19:46
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from dca9765 to 651ec84 Compare February 4, 2026 07:09
@JoviDeCroock
JoviDeCroock merged commit 28b5900 into main Feb 4, 2026
4 checks passed
@JoviDeCroock
JoviDeCroock deleted the changeset-release/main branch February 4, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant