-
-
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.
dont trigger bindings for torn-down components (#277)
- Loading branch information
1 parent
9ff9a59
commit 593b870
Showing
12 changed files
with
141 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<p>y: {{y}}</p> | ||
|
||
<script> | ||
export default { | ||
data: () => ({ | ||
y: 'bar' | ||
}) | ||
}; | ||
</script> |
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 @@ | ||
<script> | ||
export default { | ||
data: () => ({ | ||
x: true | ||
}) | ||
}; | ||
</script> |
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 @@ | ||
<p>y: {{y}}</p> | ||
|
||
<script> | ||
export default { | ||
data: () => ({ | ||
y: 'foo' | ||
}) | ||
}; | ||
</script> |
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,24 @@ | ||
export default { | ||
'skip-ssr': true, // TODO delete this line, once binding works | ||
|
||
// This test fails, because the Bar y binding is activated before the | ||
// Baz x binding, meaning that by the time Foo is created, we already | ||
// have a value for y which Foo won't override. Easily worked around, | ||
// probably impossible to 'fix', so this test is left here for info | ||
// purposes but will probably remain skipped indefinitely. | ||
skip: true, | ||
|
||
html: ` | ||
<p>y: foo</p> | ||
<p>y: foo</p> | ||
`, | ||
|
||
test ( assert, component, target ) { | ||
component.set({ x: false }); | ||
|
||
assert.htmlEqual( target.innerHTML, ` | ||
<p>y: foo</p> | ||
<p>y: foo</p> | ||
` ); | ||
} | ||
}; |
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,23 @@ | ||
<p>y: {{y}}</p> | ||
|
||
<Baz bind:x/> | ||
|
||
{{#if x}} | ||
<Foo bind:y/> | ||
{{else}} | ||
<Bar bind:y/> | ||
{{/if}} | ||
|
||
<script> | ||
import Foo from './Foo.html'; | ||
import Bar from './Bar.html'; | ||
import Baz from './Baz.html'; | ||
|
||
export default { | ||
components: { | ||
Foo, | ||
Bar, | ||
Baz | ||
} | ||
}; | ||
</script> |
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 @@ | ||
<p>y: {{y}}</p> | ||
|
||
<script> | ||
export default { | ||
data: () => ({ | ||
y: 'bar' | ||
}) | ||
}; | ||
</script> |
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 @@ | ||
<script> | ||
export default { | ||
data: () => ({ | ||
x: true | ||
}) | ||
}; | ||
</script> |
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 @@ | ||
<p>y: {{y}}</p> | ||
|
||
<script> | ||
export default { | ||
data: () => ({ | ||
y: 'foo' | ||
}) | ||
}; | ||
</script> |
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,17 @@ | ||
export default { | ||
'skip-ssr': true, // TODO delete this line, once binding works | ||
|
||
html: ` | ||
<p>y: foo</p> | ||
<p>y: foo</p> | ||
`, | ||
|
||
test ( assert, component, target ) { | ||
component.set({ x: false }); | ||
|
||
assert.htmlEqual( target.innerHTML, ` | ||
<p>y: foo</p> | ||
<p>y: foo</p> | ||
` ); | ||
} | ||
}; |
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,23 @@ | ||
<p>y: {{y}}</p> | ||
|
||
{{#if x}} | ||
<Foo bind:y/> | ||
{{else}} | ||
<Bar bind:y/> | ||
{{/if}} | ||
|
||
<Baz bind:x/> | ||
|
||
<script> | ||
import Foo from './Foo.html'; | ||
import Bar from './Bar.html'; | ||
import Baz from './Baz.html'; | ||
|
||
export default { | ||
components: { | ||
Foo, | ||
Bar, | ||
Baz | ||
} | ||
}; | ||
</script> |