[]previous and next page

Forgiving reactivity

The exact rules by which the compiler keeps plain constants, destructured props and conditional returns live inside components, each rule proven, and the limits where it stops.

For agentsUpdated

ShadowJS is strict where it must be (signals are explicit functions) and forgiving where mistakes are common. Code that is not best practice still works: a constant computed from a signal, a destructured prop, a returned ternary. The compiler rewrites these cases; nothing is added at runtime beyond one small helper, derived.

This page lists every rule, proves each one, and states exactly where the compiler leaves your code alone. The rules are normative: they come from docs/contracts/forgiving-reactivity.md and are implemented in packages/compiler/src/internal/derive.ts.