Repository navigation
Version 0.18.5
Pre-release
Pre-release
What's Changed
Added
unown(fn)— escape hatch for DOM-owned component lifecycles: Runs a callback withactiveOwnerset tonull, preventing anycreateScopeorcreateEffectcalls inside from being registered as children of the current active owner. Use this inconnectedCallback(or any external lifecycle hook) when a component manages its own cleanup independently viadisconnectedCallbackrather than through the reactive ownership tree.
Fixed
- Scope disposal bug when
connectedCallbackfires inside a re-runnable effect: Previously, callingcreateScopeinside a reactive effect (e.g. a list sync effect) registered the scope'sdisposeon that effect's cleanup list. When the effect re-ran — for example, because aMutationObserverfired — it calledrunCleanup, disposing all child scopes including those belonging to already-connected custom elements. This silently removed event listeners and reactive subscriptions from components that were still live in the DOM. Wrapping theconnectedCallbackbody inunown(() => createScope(...))detaches the scope from the effect's ownership, so effect re-runs no longer dispose it.
Full Changelog: v0.18.4...v0.18.5