-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use strict equality for key block comparisons in runes mode (#14285
) fixes #14283
- Loading branch information
1 parent
2a1b615
commit 863ba15
Showing
5 changed files
with
42 additions
and
2 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 strict equality for key block comparisons in runes 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
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
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/runtime-runes/samples/key-unchanged-value/_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,13 @@ | ||
import { flushSync } from 'svelte'; | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
test({ assert, target, logs }) { | ||
assert.deepEqual(logs, ['rendering']); | ||
|
||
const btn = target.querySelector('button'); | ||
flushSync(() => btn?.click()); | ||
|
||
assert.deepEqual(logs, ['rendering']); | ||
} | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/svelte/tests/runtime-runes/samples/key-unchanged-value/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,10 @@ | ||
<script> | ||
let inner = Symbol(); | ||
let outer = $state({ inner }); | ||
</script> | ||
|
||
<button onclick={() => outer = { inner }}>update</button> | ||
|
||
{#key outer.inner} | ||
{console.log('rendering')} | ||
{/key} |