Skip to content

feat(dom): per-root awaitCommit / commitGeneration filtering (app-scoped superset today) #175

Description

@stefvw93

Summary

Follow-up to the Loom render scheduler (PR #170 / v0.31.0). RootHandle.awaitCommit and RootHandle.commitGeneration are app-scoped: one Loom serves all roots of a WeftApp, so with multiple roots awaitCommit may wait on sibling roots' in-flight work. This is documented as a deliberate superset (may over-wait), not a bug (LM11, loom.specs.md:129).

Proposal

Add per-root filtering so RootHandle.awaitCommit resolves once everything dirty for that root at call time has committed or been discarded, independent of sibling roots:

  • Tag each registered cell with its owning root (cells already carry a scope; a root id can be threaded through LoomRegisterOptions or derived from the render context).
  • awaitCommit barriers filter on the root tag; commitGeneration optionally exposes a per-root generation alongside the app-scoped one.

Constraints

  • Single-root apps (the common case) behave identically.
  • The app-scoped commitGeneration stays available (some callers want global quiescence).
  • No change to the flush loop's single-fiber, ascending-seq commit ordering.

References

  • LM11 (RootHandle surface, app-scoped superset) — packages/dom/src/client/loom.specs.md:129
  • awaitCommit quiescence scope note — loom.specs.md:304
  • Listed as out-of-scope follow-up in loom.specs.md (line 32).

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions