-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use coarse-grained updates for derived expressions in legacy mode (
- Loading branch information
1 parent
54083fb
commit c2f75dc
Showing
5 changed files
with
47 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte": patch | ||
--- | ||
|
||
fix: use coarse-grained updates for derived expressions passed to props in legacy mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/runtime-legacy/samples/component-prop-object/Child.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let x; | ||
</script> | ||
|
||
child: {x.y} |
10 changes: 10 additions & 0 deletions
10
packages/svelte/tests/runtime-legacy/samples/component-prop-object/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
html: `child: 0 parent: 0 <button>inc x</button>`, | ||
|
||
async test({ assert, target }) { | ||
await target.querySelector('button')?.click(); | ||
assert.htmlEqual(target.innerHTML, `child: 1 parent: 1 <button>inc x</button>`); | ||
} | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/svelte/tests/runtime-legacy/samples/component-prop-object/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script> | ||
import Child from "./Child.svelte"; | ||
let x; | ||
$: if (!x) x = {y:0}; | ||
</script> | ||
|
||
<Child x={x ?? {}} /> | ||
|
||
parent: {x.y} | ||
<button on:click={() => x.y++}>inc x</button> |