Reactive values created in a component's body — computeds, effects, event handlers — are never disposed when the component goes away. Currently nothing removes components, so nothing leaks, but any future dynamic component tree needs this.
Agreed design direction (see notes/ui-architecture.md):
- Ownership is a framework concern, invisible to application code. The
React capability implementation is the natural place to register everything created for disposal, since all creation already goes through it.
- Ownership forms a tree of per-component context objects, not a single owner like the
Runtime.
- Disposal responsibility lies with subscribers: a
WritableSignal needs no disposal, a Computed or Effect must unsubscribe from its sources.
- The single app-facing lifecycle verb is
onCleanup, for external resources.
Reactive values created in a component's body — computeds, effects, event handlers — are never disposed when the component goes away. Currently nothing removes components, so nothing leaks, but any future dynamic component tree needs this.
Agreed design direction (see
notes/ui-architecture.md):Reactcapability implementation is the natural place to register everything created for disposal, since all creation already goes through it.Runtime.WritableSignalneeds no disposal, aComputedorEffectmust unsubscribe from its sources.onCleanup, for external resources.