Skip to content

Commit 5ffa134

Browse files
Merge pull request #29 from zeixcom/next
Add unown() escape hatch
2 parents 2dc2acf + 5afdd12 commit 5ffa134

File tree

15 files changed

+368
-1045
lines changed

15 files changed

+368
-1045
lines changed

.ai-context.md

Lines changed: 0 additions & 281 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.18.5
4+
5+
### Added
6+
7+
- **`unown(fn)` — escape hatch for DOM-owned component lifecycles**: Runs a callback with `activeOwner` set to `null`, preventing any `createScope` or `createEffect` calls inside from being registered as children of the current active owner. Use this in `connectedCallback` (or any external lifecycle hook) when a component manages its own cleanup independently via `disconnectedCallback` rather than through the reactive ownership tree.
8+
9+
### Fixed
10+
11+
- **Scope disposal bug when `connectedCallback` fires inside a re-runnable effect**: Previously, calling `createScope` inside a reactive effect (e.g. a list sync effect) registered the scope's `dispose` on that effect's cleanup list. When the effect re-ran — for example, because a `MutationObserver` fired — it called `runCleanup`, 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 the `connectedCallback` body in `unown(() => createScope(...))` detaches the scope from the effect's ownership, so effect re-runs no longer dispose it.
12+
313
## 0.18.4
414

515
### Fixed

0 commit comments

Comments
 (0)