Releases: XantreDev/preact-signals
Releases · XantreDev/preact-signals
@preact-signals/utils@0.22.1
Patch Changes
- 661a86e: babel plugin: removed unexpected logging
@preact-signals/query@2.0.7
Patch Changes
- Updated dependencies [661a86e]
- @preact-signals/utils@0.22.1
@preact-signals/utils@0.22.0
Minor Changes
-
dcd7e2c: Implemented
experimental_stateMacrosOptimization
for automatic optimization of state macroses in JSXExample:
import { $state, $derived } from "@preact-signals/utils/macro"; let a = $state(10); let b = $state(20); const c = <>{a * b + 10}</>;
Will be optimized to:
import { deepSignal as _deepSignal, $ as _$ } from "@preact-signals/utils"; let a = _deepSignal(10); let b = _deepSignal(20); const c = <>{_$(() => a.value * b.value + 10)}</>;
In result your components will have less rerender when using state bindings
-
f706a6e: Removed
experimental_
prefix fromstateMacro
options of@preact-signals/utils/babel
Migration (Vite):
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ react({ babel: { plugins: [ "module:@preact-signals/safe-react/babel", [ "module:@preact-signals/utils/babel", { - experimental_stateMacros: true, + stateMacros: true, }, ], ], }, }), ], });
@preact-signals/query@2.0.6
@preact-signals/utils@0.21.0
@preact-signals/query@2.0.5
@preact-signals/utils@0.20.2
Patch Changes
- 1b339b4: Fixed incorrect babel transform of state macro identifier inside of
$
@preact-signals/query@2.0.4
Patch Changes
- Updated dependencies [1b339b4]
- @preact-signals/utils@0.20.2