Releases: preactjs/signals
Release list
@preact/signals-react-transform@0.8.1
Patch Changes
-
#814
a5d0a6eThanks @andrewiggins! - Fix JSX detection leaking to non-component functions in the same scopePreviously, 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()ordescribe()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-ui@0.4.0
Minor Changes
- #866
00ba858Thanks @JoviDeCroock! - Add special case in devtools-ui for component updates
Patch Changes
- Updated dependencies [
00ba858]:- @preact/signals-devtools-adapter@0.4.0
@preact/signals-devtools-adapter@0.4.0
Minor Changes
- #866
00ba858Thanks @JoviDeCroock! - Add special case in devtools-ui for component updates
@preact/signals-debug@1.4.0
Minor Changes
-
#866
00ba858Thanks @JoviDeCroock! - Add special case in devtools-ui for component updates -
#851
a7f500bThanks @JoviDeCroock! - Add special copy for component renders
@preact/signals-core@1.13.0
Minor Changes
-
#812
19ac39bThanks @andrewiggins! - AddcreateModelandactionto signals core packagecreateModelprovides 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
actionis 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@2.6.2
Patch Changes
- #858
e4bbb66Thanks @JoviDeCroock! - Fix issue where unmounted vnodes could update with signals
@preact/signals@1.3.3
Patch Changes
- #856
57aa567Thanks @JoviDeCroock! - Fix issue where unmounted vnodes could update with signals
@preact/signals-devtools-ui@0.3.0
Minor Changes
- #837
0e0625dThanks @JoviDeCroock! - Ensure all component/effect dependencies are always visualized in the Graph
Patch Changes
-
#849
3a490feThanks @JoviDeCroock! - Improve sorting of nodes/links in the graph -
Updated dependencies [
0e0625d]:- @preact/signals-devtools-adapter@0.3.0
@preact/signals-devtools-ui@0.2.0
Minor Changes
- #828
030e428Thanks @JoviDeCroock! - Allow for disabling console.log debugging from devtools
Patch Changes
- Updated dependencies [
030e428]:- @preact/signals-devtools-adapter@0.2.0
@preact/signals-debug@1.2.1
Patch Changes
54094d5Thanks @JoviDeCroock! - Format react/preact components in the debug logging #844