Releases: XantreDev/preact-signals
Releases · XantreDev/preact-signals
@preact-signals/[email protected]
Patch Changes
- Updated dependencies [661a86e]
- @preact-signals/[email protected]
@preact-signals/[email protected]
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/[email protected]
Patch Changes
- Updated dependencies [dcd7e2c]
- Updated dependencies [f706a6e]
- @preact-signals/[email protected]
@preact-signals/[email protected]
@preact-signals/[email protected]
Patch Changes
- Updated dependencies [b29dbc5]
- Updated dependencies [b29dbc5]
- @preact-signals/[email protected]
@preact-signals/[email protected]
Patch Changes
- 1b339b4: Fixed incorrect babel transform of state macro identifier inside of
$
@preact-signals/[email protected]
Patch Changes
- Updated dependencies [1b339b4]
- @preact-signals/[email protected]
@preact-signals/[email protected]
@preact-signals/[email protected]
Patch Changes
- Updated dependencies [79d2ace]
- Updated dependencies [3801b85]
- @preact-signals/[email protected]