-
-
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: revert buggy reactive vars optimization (#8382)
- Loading branch information
1 parent
a1e8421
commit 68e492e
Showing
9 changed files
with
40 additions
and
101 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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
test/runtime/samples/reactive-statement-indirect/_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,14 @@ | ||
export default { | ||
html: ` | ||
<h1>2</h1> | ||
<button>Increment</button> | ||
`, | ||
async test({ assert, target }) { | ||
await target.querySelector('button').dispatchEvent(new window.MouseEvent('click')); | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<h1>4</h1> | ||
<button>Increment</button> | ||
`); | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/runtime/samples/reactive-statement-indirect/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> | ||
let count = 1; | ||
// Could be a let or simplified, but this tests that it still works like this | ||
$: indirect_double = 2; | ||
$: if (count > 0) { | ||
indirect_double = count * 2; | ||
} | ||
</script> | ||
|
||
<h1>{indirect_double}</h1> | ||
<button on:click={() => count++}>Increment</button> |