forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure if_block dependency is dirty to cancel outro (sveltejs#4634)
- Loading branch information
1 parent
135222b
commit 1d153b2
Showing
11 changed files
with
113 additions
and
45 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
18 changes: 18 additions & 0 deletions
18
...untime/samples/transition-js-if-outro-unrelated-component-binding-update/Component.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,18 @@ | ||
<script> | ||
export let condition; | ||
function foo(node, params) { | ||
return { | ||
duration: 100, | ||
tick: t => { | ||
node.foo = t; | ||
} | ||
}; | ||
} | ||
let bool = true; | ||
</script> | ||
|
||
<button on:click={() => (condition = false)} /> | ||
<button on:click={() => (bool = !bool)} /> | ||
{#if bool} | ||
<div out:foo /> | ||
{/if} |
9 changes: 9 additions & 0 deletions
9
test/runtime/samples/transition-js-if-outro-unrelated-component-binding-update/_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,9 @@ | ||
export default { | ||
async test({ assert, target, window, raf }) { | ||
const button = target.querySelector("button"); | ||
const event = new window.MouseEvent("click"); | ||
await button.dispatchEvent(event); | ||
raf.tick(500); | ||
assert.htmlEqual(target.innerHTML, ""); | ||
}, | ||
}; |
8 changes: 8 additions & 0 deletions
8
test/runtime/samples/transition-js-if-outro-unrelated-component-binding-update/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,8 @@ | ||
<script> | ||
import Component from "./Component.svelte"; | ||
let condition = true; | ||
</script> | ||
|
||
{#if condition} | ||
<Component bind:condition /> | ||
{/if} |
18 changes: 18 additions & 0 deletions
18
.../runtime/samples/transition-js-if-outro-unrelated-component-store-update/Component.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,18 @@ | ||
<script> | ||
export let condition; | ||
function foo(node, params) { | ||
return { | ||
duration: 100, | ||
tick: t => { | ||
node.foo = t; | ||
} | ||
}; | ||
} | ||
$condition; | ||
let bool = true; | ||
</script> | ||
|
||
<button on:click={() => (bool = !bool)} /> | ||
{#if bool} | ||
<div out:foo /> | ||
{/if} |
7 changes: 7 additions & 0 deletions
7
test/runtime/samples/transition-js-if-outro-unrelated-component-store-update/_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,7 @@ | ||
export default { | ||
async test({ assert, target, component, raf }) { | ||
await component.condition.set(false); | ||
raf.tick(500); | ||
assert.htmlEqual(target.innerHTML, ""); | ||
}, | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/runtime/samples/transition-js-if-outro-unrelated-component-store-update/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> | ||
import { writable } from "svelte/store"; | ||
import Component from "./Component.svelte"; | ||
export let condition = writable(true); | ||
</script> | ||
|
||
{#if $condition} | ||
<button on:click={() => ($condition = false)} id="1" /> | ||
<Component {condition} /> | ||
{/if} |