Version 1.5.1
·
12 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
What's Changed
Fixed
deriveStore(seed, { watched })never started itswatchedlifecycle under property-only reads, leaving the store frozen at its seed (src/nodes/store.ts): Previously, only whole-store reads (get(),keys(), iteration) activated the external-push lifecycle; a consumer reading exclusively throughstore.prop.get(),byKey(), or'prop' in storeactivated nothing, sowatchednever ran — and an external-push Store has no value source other thanwatched'semit, so it stayed at its seed forever. Now the facade links a dedicated lifecycle anchor from every observation form: aSourceNodethat carries watcher edges but never holds or propagates a value. Activation still creates no structural edge, so per-property granularity is unchanged (ADR-0015 clarification). Backported fromv2/shape-explorationc48171b.Listseeds andsplice()validated duplicate keys and nullish items inconsistently, and a failingsplice()could half-apply (src/nodes/list.ts,src/nodes/collection.ts): Previously,createList(value)and the external-push seed ofderiveListdid not check for duplicate generated keys — the later item silently replaced the earlier one's signal whilekeysstill listed the key twice, desynchronizinglengthandget()from the item signals.splice()validated nullish items only whereapplyChanges()happened to touch them: a content-basedkeyConfigthrew a bareTypeErrorreading a property ofnull/undefined, duplicate keys within one inserted batch went undetected (the batch is applied after the loop, sosignals.has()never saw the batch's own earlier keys), and an error surfacing mid-mutation left earlier insertions applied. Now the whole batch is staged and validated before anything mutates: nullish items failvalidateSignalValuebeforegenerateKey, keys are checked against existing signals and the staged batch, an invalidsplice()throws with the list unchanged, and seeds throwDuplicateKeyError. Backported fromv2/shape-explorationc48171b.
Added
createCell(value, options?): Alias ofcreateState— the single-value mutable signal, value taken verbatim, no shape conversion. The terminal v2.0 name for the single-value shape under the ADR-0018 Revision (Cellnames the single-value shape;Signalstays the umbrella); carried into 2.0 unchanged. Backported fromv2/shape-exploratione4408f6.deriveCell(input, options?)/DeriveCellOptions<T>: Single-value derive factory withcreateComputed's dispatch — sync function →Memo, async function →Task— plus the external-push form (seed value +options.watched→Sensor); returnsSignal<T>, so origin is not part of the return type.DeriveCellOptionsuses theinitialvocabulary;initialstays optional and an early read before the first async resolution throwsUnsetSignalValueError, exactly ascreateTaskbehaves. Terminal bridge forcreateComputed. Backported fromv2/shape-exploratione4408f6.
Deprecated
deriveSignal(input, options?)/DeriveSignalOptions<T>: Shipped in 1.5.0, deprecated after one release in favor ofderiveCell/DeriveCellOptions— a pure rename, same dispatch and options. The ADR-0018 Revision settled thatSignalis the umbrella and the single-value shape isCell, so the 1.5.0 names carry a superseded meaning; both are removed in 2.0. This supersedes the 1.5.0 replacement pointers:createComputedmigrates toderiveCell(notderiveSignal), andcreateMutableSignalmigrates tocreateCell/createList/createStoreby argument shape (notcreateSignal, which 2.0 removes). SeeMIGRATION-2.0.md"Second flip". Backported fromv2/shape-exploratione4408f6.
Changed
tools/codemod-v2.tsretargeted at the Cell bridge names:createComputed→deriveCellwith a literaloptions.valuerewritten tooptions.initial;deriveSignal→deriveCellandDeriveSignalOptions→DeriveCellOptionsas exact-identifier renames;createMutableSignal(v)rewritten by literal argument shape tocreateCell/createList/createStore— a blanket rename would silently change array and record call sites now thatcreateCellis the narrow single-value factory.createSignal(...)call sites are always flagged, never rewritten (its shape dispatch is removed in 2.0 with no single replacement), and an asynccreateComputedcallback is flagged for theTaskmethods.isPending()/.abort()becoming the free functionsisPending(signal)/abort(signal).
Full Changelog: v1.5.0...v1.5.1