mirror of https://github.com/sveltejs/svelte
fix: loosen proxy signal creation heuristics (#11109)
* fix: loosen proxy signal creation heuristics * tighten up test * update comment * no need to create a source outside an effect here, because it can't result in a reference * preserve reference to props.$$events --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/11111/head
parent
27891cb2dd
commit
3bb231197e
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: loosen proxy signal creation heuristics
|
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
const { settings } = $props();
|
import { settings } from './main.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
Child: {settings.showInRgb}
|
Child: {settings.showInRgb}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<script context="module">
|
<script context="module">
|
||||||
export const context = $state({
|
const context = $state({
|
||||||
settings: {
|
settings: {
|
||||||
showInRgb: true
|
showInRgb: true
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
export const settings = context.settings;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Child from './Child.svelte';
|
import Child from './Child.svelte';
|
||||||
|
|
||||||
const { settings } = context
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button onclick={() => settings.showInRgb = !settings.showInRgb}>
|
<button onclick={() => settings.showInRgb = !settings.showInRgb}>
|
||||||
click {settings.showInRgb}
|
click {settings.showInRgb}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Child settings={settings} />
|
<Child />
|
||||||
|
Loading…
Reference in new issue