Skip to content

Commit edad4c8

Browse files
Merge pull request #16 from zeixcom/next
Fix scope disposal bug
2 parents 349e20e + 88ffd0a commit edad4c8

File tree

242 files changed

+2718
-1602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+2718
-1602
lines changed

CHANGELOG.md

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

3+
## 0.16.3
4+
5+
### Added
6+
7+
- **New re-exports from `@zeix/cause-effect`**: `createSignal`, `unown`, `untrack`, `isObjectOfType`, `SKIP_EQUALITY`, and error classes `ReadonlySignalError`, `RequiredOwnerError`, `UnsetSignalValueError` — previously omitted from Le Truc's public API surface.
8+
9+
### Changed
10+
11+
- **`@zeix/cause-effect` upgraded to `0.18.5`**: Adds `unown()` and fixes a scope disposal bug in components connected inside re-runnable effects (see Fixed below).
12+
- **`form-checkbox`, `form-radiogroup`, and `form-spinbutton` examples updated**: All three examples now support controlled component usage, accepting externally managed state in addition to their built-in uncontrolled behaviour.
13+
14+
### Fixed
15+
16+
- **Scope disposal bug when `connectedCallback` fires inside a re-runnable effect**: `createScope` inside a reactive effect (e.g. a list-sync effect) registered its dispose on that effect's cleanup list. When the effect re-ran — for example because a `MutationObserver` fired — it disposed all child scopes including those of already-connected components, silently removing their live event listeners and reactive subscriptions. Fixed by wrapping the `connectedCallback` body in `unown()`, detaching each component's scope from the surrounding effect's ownership tree so effect re-runs no longer dispose it.
17+
318
## 0.16.2
419

520
### Added

bun.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-src/api/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
- [InvalidUIKeyError](classes/InvalidUIKeyError.md)
1616
- [MissingElementError](classes/MissingElementError.md)
1717
- [NullishSignalValueError](classes/NullishSignalValueError.md)
18+
- [ReadonlySignalError](classes/ReadonlySignalError.md)
19+
- [RequiredOwnerError](classes/RequiredOwnerError.md)
20+
- [UnsetSignalValueError](classes/UnsetSignalValueError.md)
1821

1922
#### Type Aliases
2023

@@ -90,6 +93,7 @@
9093
#### Variables
9194

9295
- [CONTEXT\_REQUEST](variables/CONTEXT_REQUEST.md)
96+
- [SKIP\_EQUALITY](variables/SKIP_EQUALITY.md)
9397

9498
#### Functions
9599

@@ -112,6 +116,7 @@
112116
- [createMutableSignal](functions/createMutableSignal.md)
113117
- [createScope](functions/createScope.md)
114118
- [createSensor](functions/createSensor.md)
119+
- [createSignal](functions/createSignal.md)
115120
- [createSlot](functions/createSlot.md)
116121
- [createState](functions/createState.md)
117122
- [createStore](functions/createStore.md)
@@ -127,6 +132,7 @@
127132
- [isMemo](functions/isMemo.md)
128133
- [isMethodProducer](functions/isMethodProducer.md)
129134
- [isMutableSignal](functions/isMutableSignal.md)
135+
- [isObjectOfType](functions/isObjectOfType.md)
130136
- [isParser](functions/isParser.md)
131137
- [isRecord](functions/isRecord.md)
132138
- [isSensor](functions/isSensor.md)
@@ -149,5 +155,7 @@
149155
- [show](functions/show.md)
150156
- [toggleAttribute](functions/toggleAttribute.md)
151157
- [toggleClass](functions/toggleClass.md)
158+
- [unown](functions/unown.md)
159+
- [untrack](functions/untrack.md)
152160
- [updateElement](functions/updateElement.md)
153161
- [valueString](functions/valueString.md)

docs-src/api/classes/ContextRequestEvent.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: ContextRequestEvent\<T\>
22

3-
Defined in: [src/context.ts:78](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/context.ts#L78)
3+
Defined in: [src/context.ts:78](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/context.ts#L78)
44

55
Class for context-request events
66

@@ -31,7 +31,7 @@ function to the callback which requesters can invoke to indicate they no longer
3131

3232
> **new ContextRequestEvent**\<`T`\>(`context`, `callback`, `subscribe?`): `ContextRequestEvent`\<`T`\>
3333
34-
Defined in: [src/context.ts:83](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/context.ts#L83)
34+
Defined in: [src/context.ts:83](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/context.ts#L83)
3535

3636
###### Parameters
3737

@@ -101,7 +101,7 @@ Defined in: node\_modules/typescript/lib/lib.dom.d.ts:11463
101101

102102
> `readonly` **callback**: [`ContextCallback`](../type-aliases/ContextCallback.md)\<[`ContextType`](../type-aliases/ContextType.md)\<`T`\>\>
103103
104-
Defined in: [src/context.ts:80](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/context.ts#L80)
104+
Defined in: [src/context.ts:80](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/context.ts#L80)
105105

106106
callback function for value getter and unsubscribe function
107107

@@ -173,7 +173,7 @@ The read-only **`composed`** property of the or not the event will propagate acr
173173

174174
> `readonly` **context**: `T`
175175
176-
Defined in: [src/context.ts:79](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/context.ts#L79)
176+
Defined in: [src/context.ts:79](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/context.ts#L79)
177177

178178
context key
179179

@@ -295,7 +295,7 @@ The deprecated **`Event.srcElement`** is an alias for the Event.target property.
295295

296296
> `readonly` **subscribe**: `boolean`
297297
298-
Defined in: [src/context.ts:81](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/context.ts#L81)
298+
Defined in: [src/context.ts:81](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/context.ts#L81)
299299

300300
whether to subscribe to context changes
301301

docs-src/api/classes/DependencyTimeoutError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: DependencyTimeoutError
22

3-
Defined in: [src/errors.ts:102](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L102)
3+
Defined in: [src/errors.ts:102](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L102)
44

55
Error when a component's dependencies are not met within a specified timeout
66

@@ -18,7 +18,7 @@ Error when a component's dependencies are not met within a specified timeout
1818

1919
> **new DependencyTimeoutError**(`host`, `missing`): `DependencyTimeoutError`
2020
21-
Defined in: [src/errors.ts:107](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L107)
21+
Defined in: [src/errors.ts:107](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L107)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidComponentNameError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidComponentNameError
22

3-
Defined in: [src/errors.ts:11](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L11)
3+
Defined in: [src/errors.ts:11](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L11)
44

55
Error thrown when component name violates rules for custom element names
66

@@ -18,7 +18,7 @@ Error thrown when component name violates rules for custom element names
1818

1919
> **new InvalidComponentNameError**(`component`): `InvalidComponentNameError`
2020
21-
Defined in: [src/errors.ts:15](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L15)
21+
Defined in: [src/errors.ts:15](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L15)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidCustomElementError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidCustomElementError
22

3-
Defined in: [src/errors.ts:139](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L139)
3+
Defined in: [src/errors.ts:139](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L139)
44

55
Error thrown when target element is not a custom element as expected
66

@@ -18,7 +18,7 @@ Error thrown when target element is not a custom element as expected
1818

1919
> **new InvalidCustomElementError**(`target`, `where`): `InvalidCustomElementError`
2020
21-
Defined in: [src/errors.ts:144](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L144)
21+
Defined in: [src/errors.ts:144](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L144)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidEffectsError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidEffectsError
22

3-
Defined in: [src/errors.ts:47](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L47)
3+
Defined in: [src/errors.ts:47](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L47)
44

55
Error thrown when setup function does not return effects
66

@@ -18,7 +18,7 @@ Error thrown when setup function does not return effects
1818

1919
> **new InvalidEffectsError**(`host`, `cause?`): `InvalidEffectsError`
2020
21-
Defined in: [src/errors.ts:52](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L52)
21+
Defined in: [src/errors.ts:52](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L52)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidPropertyNameError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidPropertyNameError
22

3-
Defined in: [src/errors.ts:28](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L28)
3+
Defined in: [src/errors.ts:28](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L28)
44

55
Error thrown when trying to assign a property name that conflicts with reserved words or inherited HTMLElement properties
66

@@ -18,7 +18,7 @@ Error thrown when trying to assign a property name that conflicts with reserved
1818

1919
> **new InvalidPropertyNameError**(`component`, `prop`, `reason`): `InvalidPropertyNameError`
2020
21-
Defined in: [src/errors.ts:34](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L34)
21+
Defined in: [src/errors.ts:34](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L34)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidReactivesError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidReactivesError
22

3-
Defined in: [src/errors.ts:120](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L120)
3+
Defined in: [src/errors.ts:120](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L120)
44

55
Error thrown when reactives passed to a component are invalid
66

@@ -18,7 +18,7 @@ Error thrown when reactives passed to a component are invalid
1818

1919
> **new InvalidReactivesError**(`host`, `target`, `reactives`): `InvalidReactivesError`
2020
21-
Defined in: [src/errors.ts:126](https://github.com/zeixcom/le-truc/blob/d3151c8acd4577999007fad73e21cf0cc45337e4/src/errors.ts#L126)
21+
Defined in: [src/errors.ts:126](https://github.com/zeixcom/le-truc/blob/23167c4de345bf28cd627a58ae4ea4e29243c54c/src/errors.ts#L126)
2222

2323
###### Parameters
2424

0 commit comments

Comments
 (0)