Skip to content

ui: component ownership and resource cleanup #42

Description

@noelwelsh

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions