Summary
Replace per-annotated-element interaction listeners with delegated observation at the configured root, while preserving target strategy, priority, touch, scope, and per-element event semantics.
Evidence
packages/core/src/observer.ts currently scans all [data-askable] elements and attaches each active DOM event to each element. With default click/hover/focus behavior, 10,000 annotated elements create approximately 30,000 listeners plus a subtree MutationObserver.
Existing benchmarks pass, but they measure elapsed initialization and event latency—not listener count, heap retention, teardown pressure, or repeated dynamic churn.
Proposed direction
- Delegate bubbling
click and focusin at the root.
- Replace
mouseenter with delegated mouseover/pointerover, filtering relatedTarget to preserve enter semantics.
- Resolve candidates through the composed event path for Shadow DOM support.
- Keep element discovery only where viewport tracking needs IntersectionObserver registration.
- Preserve the current public API.
Acceptance criteria
Summary
Replace per-annotated-element interaction listeners with delegated observation at the configured root, while preserving target strategy, priority, touch, scope, and per-element event semantics.
Evidence
packages/core/src/observer.tscurrently scans all[data-askable]elements and attaches each active DOM event to each element. With default click/hover/focus behavior, 10,000 annotated elements create approximately 30,000 listeners plus a subtree MutationObserver.Existing benchmarks pass, but they measure elapsed initialization and event latency—not listener count, heap retention, teardown pressure, or repeated dynamic churn.
Proposed direction
clickandfocusinat the root.mouseenterwith delegatedmouseover/pointerover, filteringrelatedTargetto preserve enter semantics.Acceptance criteria
data-askable-eventsremain compatible