@adia-ai/web-components 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/core/element.js +12 -2
  2. package/package.json +1 -1
package/core/element.js CHANGED
@@ -17,7 +17,7 @@ export { signal, computed, effect, batch, untracked, isSignal } from './signals.
17
17
  export { html, css, repeat } from './template.js';
18
18
 
19
19
  // Internal imports for AdiaElement
20
- import { signal, computed, effect } from './signals.js';
20
+ import { signal, computed, effect, untracked } from './signals.js';
21
21
  import { stamp, disposeParts, KEY_MAP } from './template.js';
22
22
 
23
23
  // ═══════════════════════════════════════════════════════════════
@@ -105,7 +105,17 @@ export class AdiaElement extends HTMLElement {
105
105
  if (!ctor._tag) ctor._tag = this.localName;
106
106
  adoptStyles(ctor);
107
107
  prepareParts(ctor);
108
- this.connected();
108
+ // connected() commonly reads this element's reactive properties via
109
+ // template-literal interpolation (`${this.label}` etc.) to stamp its
110
+ // inner DOM. If the outer call path is inside another effect (e.g.
111
+ // a parent's render loop appendChild'ing this node), those reads
112
+ // would subscribe the outer effect to THIS element's signals —
113
+ // invisible cross-element coupling that looks like spooky re-runs
114
+ // on unrelated state changes. Wrap in untracked so element setup
115
+ // never leaks subscriptions upward. The element's OWN effect
116
+ // (below) re-reads the same signals in its own tracking context,
117
+ // so reactivity within the element is unaffected.
118
+ untracked(() => this.connected());
109
119
  this.#fx.push(effect(() => {
110
120
  for (const sig of this[SIG].values()) sig.value;
111
121
  this.#notify.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-utils.",
5
5
  "type": "module",
6
6
  "exports": {