Skip to content

Commit 070ea13

Browse files
committed
fix(signals): order the #4540 gate term for size
`unstaged && wasUninitialized && !isEffect`, with wasUninitialized kept as the raw status bit, minifies 4 B smaller than the boolean-coerced form and keeps the brotli rows under their caps. The `!!` moves to the observe-only devChanged assignment, which needs a boolean. Same logic. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
1 parent 2671fe1 commit 070ea13

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/signals/src/core/core.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
520520
if (__DEV__) clearSignals(el);
521521
}
522522

523-
const wasUninitialized = !!(el._statusFlags & STATUS_UNINITIALIZED);
523+
const wasUninitialized = el._statusFlags & STATUS_UNINITIALIZED;
524524
// Capture both error and pending status before the compute clears them.
525525
// A conditional can drop its pending source and recover to an unchanged
526526
// value, leaving blocked dependents outside that source’s settle walk.
@@ -805,15 +805,15 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
805805
// equal to it changes nothing, though the node stays uninitialized until
806806
// the commit (#4540).
807807
const valueChanged =
808-
(!isEffect && wasUninitialized && unstaged) ||
808+
(unstaged && wasUninitialized && !isEffect) ||
809809
!!el._x?._shownError ||
810810
!!replaced ||
811811
!isSame(el, compareValue, value);
812812

813813
// A committed derived change becomes a cause for this node's subscribers,
814814
// chaining their attribution through this node to the root write.
815815
if (__OBSERVE__ && attrHooks !== null) {
816-
devChanged = valueChanged && !el._x?._error;
816+
devChanged = !!valueChanged && !el._x?._error;
817817
if (devChanged && !isEffect && !create) attrHooks.derivedChanged(el);
818818
}
819819

0 commit comments

Comments
 (0)