preact-signals

Preact Signals: Supercharge your React/Preact development! Unleash the power of reactive programming with hooks, components, a TanStack query adapter, and more. Code smarter, not harder

MIT License

Downloads
9.5K
Stars
65
Committers
4

Bot releases are visible (Hide)

preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 10 months ago

Minor Changes

  • 75d8a9f: # Breaking Changes

    This release changes opt-in and opt-out directives to be the same as in @preact/signals-react.

    @trackSignals -> @useSignals
    @noTrackSignals -> @noUseSignals

    To support new directives, you can just find and replace all instances of the old directives with the new ones.

preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 2938683: Exported public apis
  • 62fee87: Fix incorrect work of reactifyLite with regular props
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • Updated dependencies [2938683]
  • Updated dependencies [62fee87]
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • 6abe126: Improve deep signals types
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • 29c5dbf: Written more comprehensive README.md. Added integration comparsion
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • d26e23e: Fix call of rafReaction fn after disposal
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • a1628ba: Added manual tracking option with HOC withTrackSignals for unsupported environments.

    import { withTrackSignals } from "@preact-signals/safe-react/manual";
    
    const A = withTrackSignals(() => {
      const count = signal(0);
      count.value++;
      return <div>{count.value}</div>;
    });
    
  • d5fc3f0: Removed incorrect jsx exports importSource @preact-signals/safe-react -> @preact-signals/safe-react/jsx

Patch Changes

  • 4616c74: Add info about babel transform
  • 16ff353: Add troubleshooting section to README
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • d3bbcd3: Added WritableUncached which receives getter and setter functions.

    const a = signal({ a: 1 });
    const aField = $w({
      get() {
        return a().a;
      },
      set(value) {
        a({ a: value });
      },
    });
    
    console.log(aField.value); // 1
    aField.value = 2;
    console.log(aField.value); // 2
    console.log(a.value); // { a: 2 }
    
  • 8ad6ae2: Added rafReaction for easier integration with raw DOM.

    rafReaction

    Will execute reaction after deps changed on next animation frame. Return dispose function.

    const sig = signal(1);
    const el = document.createElement("div");
    
    rafReaction(
      // deps
      () => sig.value,
      // effect
      (value) => {
        el.style.transform = `translateX(${value}px)`;
      },
    );
    
    sig.value = 10;
    
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • Updated dependencies [d3bbcd3]
  • Updated dependencies [8ad6ae2]
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • eb2df1b: Moved deepReactivity api to main entry point

    @preact-signals/utils/store is now @preact-signals/utils
    @preact-signals/utils/store/hooks is now @preact-signals/utils/hooks

    For now the old paths are still available, but will be removed in the next minor version.

preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • 40ee2a3: Remove microtask spam for each useSignals - batching it to one queueMicrotask
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

preact-signals - React native support with @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • 58a8047: Remove irrelevant information from README
  • 3909f6c: react-native is supported from now. Added info to readme
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • 5a2abc9: Fix of jsxImportSource while @babel/plugin-transform-react-jsx is trying to use main entry of jsx runtime instead of jsx-runtime package.
    Changed jsxImportSource to satisfy this requirement.

    // vite.config.ts
    import { defineConfig } from "vite";
    import react from "@vitejs/plugin-react";
    import { createReactAlias } from "@preact-signals/safe-react/integrations/vite";
    
    // https://vitejs.dev/config/
    export default defineConfig({
      resolve: {
        // add react alias
        alias: [createReactAlias()],
      },
      plugins: [
        react({
          // using custom wrapper for jsx runtime and babel plugin for components
          // Previously: jsxImportSource: "@preact-signals/safe-react",
          jsxImportSource: "@preact-signals/safe-react/jsx",
          babel: {
            plugins: ["module:@preact-signals/safe-react/babel"],
          },
        }),
      ],
    });
    

    For now old style are also working but will be dropped in next minor

preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • c716069: Now can transform commonjs modules
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • d451d06: Added fallback for resolver that is not supporting package exports (react-native)

Patch Changes

  • 7684de9: Fixed typescript issue with "moduleResolution": "node"
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • 50214d3: Added vite integration info to README. Enusred stability of work with vite

Patch Changes

  • 7684de9: Fixed typescript issue with "moduleResolution": "node"
preact-signals - @preact-signals/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • Updated dependencies [d451d06]
  • Updated dependencies [7684de9]