diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5e80b0d095..f9b3bb8b9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,14 @@
# Svelte changelog
-## Unreleased
+## 3.21.0
* Support dimension bindings in cross-origin environments ([#2147](https://github.com/sveltejs/svelte/issues/2147))
+* Fix several related outro bugs ([#3202](https://github.com/sveltejs/svelte/issues/3202), [#3410](https://github.com/sveltejs/svelte/issues/3410), [#3685](https://github.com/sveltejs/svelte/issues/3685), [#4620](https://github.com/sveltejs/svelte/issues/4620), [#4630](https://github.com/sveltejs/svelte/issues/4630))
* Try using `globalThis` rather than `globals` for the benefit of non-Node servers and web workers ([#3561](https://github.com/sveltejs/svelte/issues/3561), [#4545](https://github.com/sveltejs/svelte/issues/4545))
* Support `{#await ... catch ...}` syntax shorthand ([#3623](https://github.com/sveltejs/svelte/issues/3623))
* Fix attaching of JS debugging comments to HTML comments ([#4565](https://github.com/sveltejs/svelte/issues/4565))
+* Fix `` within `` ([#4597](https://github.com/sveltejs/svelte/issues/4597))
+* Fix bug with updating simple `{#if}` blocks ([#4629](https://github.com/sveltejs/svelte/issues/4629))
* Fix issues with `` updates ([#4631](https://github.com/sveltejs/svelte/issues/4631), [#4687](https://github.com/sveltejs/svelte/issues/4687))
* Prevent illegal attribute names ([#4648](https://github.com/sveltejs/svelte/issues/4648))
* Fix `{#if}` block directly within `` ([#4703](https://github.com/sveltejs/svelte/issues/4703))
diff --git a/package-lock.json b/package-lock.json
index 7c521bd93d..d5adaa34ca 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.20.1",
+ "version": "3.21.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -296,9 +296,9 @@
},
"dependencies": {
"acorn": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz",
- "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==",
+ "version": "6.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
+ "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
"dev": true
}
}
@@ -492,6 +492,12 @@
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
+ "buffer-crc32": {
+ "version": "0.2.13",
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
+ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
+ "dev": true
+ },
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
@@ -1352,15 +1358,15 @@
}
},
"extract-zip": {
- "version": "1.6.7",
- "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz",
- "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
+ "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
"dev": true,
"requires": {
- "concat-stream": "1.6.2",
- "debug": "2.6.9",
- "mkdirp": "0.5.1",
- "yauzl": "2.4.1"
+ "concat-stream": "^1.6.2",
+ "debug": "^2.6.9",
+ "mkdirp": "^0.5.4",
+ "yauzl": "^2.10.0"
},
"dependencies": {
"debug": {
@@ -1405,9 +1411,9 @@
"dev": true
},
"fd-slicer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
- "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
+ "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
"dev": true,
"requires": {
"pend": "~1.2.0"
@@ -1598,26 +1604,6 @@
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
- "handlebars": {
- "version": "4.5.3",
- "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
- "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
- "dev": true,
- "requires": {
- "neo-async": "^2.6.0",
- "optimist": "^0.6.1",
- "source-map": "^0.6.1",
- "uglify-js": "^3.1.4"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
@@ -1676,6 +1662,12 @@
"whatwg-encoding": "^1.0.1"
}
},
+ "html-escaper": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
+ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
+ "dev": true
+ },
"http-proxy-agent": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
@@ -1984,12 +1976,12 @@
}
},
"istanbul-reports": {
- "version": "2.2.6",
- "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz",
- "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==",
+ "version": "2.2.7",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.7.tgz",
+ "integrity": "sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg==",
"dev": true,
"requires": {
- "handlebars": "^4.1.2"
+ "html-escaper": "^2.0.0"
}
},
"js-tokens": {
@@ -2049,9 +2041,9 @@
},
"dependencies": {
"acorn": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz",
- "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==",
+ "version": "6.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
+ "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
"dev": true
},
"ws": {
@@ -2301,26 +2293,18 @@
}
},
"minimist": {
- "version": "0.0.10",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
- "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"mkdirp": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
- "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+ "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"requires": {
- "minimist": "0.0.8"
- },
- "dependencies": {
- "minimist": {
- "version": "0.0.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
- "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
- "dev": true
- }
+ "minimist": "^1.2.5"
}
},
"mocha": {
@@ -2397,6 +2381,21 @@
"path-is-absolute": "^1.0.0"
}
},
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.8"
+ }
+ },
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
@@ -2534,12 +2533,6 @@
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
"dev": true
},
- "neo-async": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
- "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
- "dev": true
- },
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@@ -2687,16 +2680,6 @@
}
}
},
- "optimist": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
- "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
- "dev": true,
- "requires": {
- "minimist": "~0.0.1",
- "wordwrap": "~0.0.2"
- }
- },
"optionator": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
@@ -3047,9 +3030,9 @@
}
},
"readable-stream": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
- "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
@@ -3672,26 +3655,6 @@
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==",
"dev": true
},
- "uglify-js": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
- "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
- "dev": true,
- "optional": true,
- "requires": {
- "commander": "~2.20.0",
- "source-map": "~0.6.1"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true,
- "optional": true
- }
- }
- },
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
@@ -3860,12 +3823,6 @@
}
}
},
- "wordwrap": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
- "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
- "dev": true
- },
"wrap-ansi": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
@@ -4112,12 +4069,13 @@
}
},
"yauzl": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz",
- "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=",
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
+ "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
"dev": true,
"requires": {
- "fd-slicer": "~1.0.1"
+ "buffer-crc32": "~0.2.3",
+ "fd-slicer": "~1.1.0"
}
}
}
diff --git a/package.json b/package.json
index 2053ebb76f..215a6099e9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.20.1",
+ "version": "3.21.0",
"description": "Cybernetically enhanced web apps",
"module": "index.mjs",
"main": "index",
diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md
index 2f99c0db82..3ee5b1dad1 100644
--- a/site/content/docs/02-template-syntax.md
+++ b/site/content/docs/02-template-syntax.md
@@ -816,7 +816,7 @@ transition = (node: HTMLElement, params: any) => {
A transition is triggered by an element entering or leaving the DOM as a result of a state change.
-When a block is transitioning out, elements inside the block are kept in the DOM until all current transitions have completed.
+When a block is transitioning out, all elements inside the block, including those that do not have their own transitions, are kept in the DOM until every transition in the block has completed.
The `transition:` directive indicates a *bidirectional* transition, which means it can be smoothly reversed while the transition is in progress.
diff --git a/src/compiler/compile/render_dom/wrappers/IfBlock.ts b/src/compiler/compile/render_dom/wrappers/IfBlock.ts
index 207e1e349e..78b821170f 100644
--- a/src/compiler/compile/render_dom/wrappers/IfBlock.ts
+++ b/src/compiler/compile/render_dom/wrappers/IfBlock.ts
@@ -334,7 +334,11 @@ export default class IfBlockWrapper extends Wrapper {
`);
}
} else if (dynamic) {
- block.chunks.update.push(b`${name}.p(#ctx, #dirty);`);
+ if (if_exists_condition) {
+ block.chunks.update.push(b`if (${if_exists_condition}) ${name}.p(#ctx, #dirty);`);
+ } else {
+ block.chunks.update.push(b`${name}.p(#ctx, #dirty);`);
+ }
}
if (if_exists_condition) {
@@ -357,7 +361,7 @@ export default class IfBlockWrapper extends Wrapper {
parent_node: Identifier,
_parent_nodes: Identifier,
dynamic,
- { name, anchor, has_else, has_transitions },
+ { name, anchor, has_else, has_transitions, if_exists_condition },
detaching
) {
const select_block_type = this.renderer.component.get_unique_name(`select_block_type`);
@@ -486,7 +490,11 @@ export default class IfBlockWrapper extends Wrapper {
`);
}
} else if (dynamic) {
- block.chunks.update.push(b`${name}.p(#ctx, #dirty);`);
+ if (if_exists_condition) {
+ block.chunks.update.push(b`if (${if_exists_condition}) ${name}.p(#ctx, #dirty);`);
+ } else {
+ block.chunks.update.push(b`${name}.p(#ctx, #dirty);`);
+ }
}
block.chunks.destroy.push(
@@ -520,28 +528,22 @@ export default class IfBlockWrapper extends Wrapper {
if (branch.dependencies.length > 0) {
const update_mount_node = this.get_update_mount_node(anchor);
- const enter = dynamic
- ? b`
- if (${name}) {
- ${name}.p(#ctx, #dirty);
- ${has_transitions && b`@transition_in(${name}, 1);`}
- } else {
- ${name} = ${branch.block.name}(#ctx);
- ${name}.c();
- ${has_transitions && b`@transition_in(${name}, 1);`}
- ${name}.m(${update_mount_node}, ${anchor});
- }
- `
- : b`
- if (!${name}) {
- ${name} = ${branch.block.name}(#ctx);
- ${name}.c();
- ${has_transitions && b`@transition_in(${name}, 1);`}
- ${name}.m(${update_mount_node}, ${anchor});
- } else {
- ${has_transitions && b`@transition_in(${name}, 1);`}
+ const enter = b`
+ if (${name}) {
+ ${dynamic && b`${name}.p(#ctx, #dirty);`}
+ ${
+ has_transitions &&
+ b`if (${block.renderer.dirty(branch.dependencies)}) {
+ @transition_in(${name}, 1);
+ }`
}
- `;
+ } else {
+ ${name} = ${branch.block.name}(#ctx);
+ ${name}.c();
+ ${has_transitions && b`@transition_in(${name}, 1);`}
+ ${name}.m(${update_mount_node}, ${anchor});
+ }
+ `;
if (branch.snippet) {
block.chunks.update.push(b`if (${block.renderer.dirty(branch.dependencies)}) ${branch.condition} = ${branch.snippet}`);
diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js
index b9fad863e2..eb6c8e8949 100644
--- a/test/js/samples/if-block-simple/expected.js
+++ b/test/js/samples/if-block-simple/expected.js
@@ -42,12 +42,12 @@ function create_fragment(ctx) {
},
p(ctx, [dirty]) {
if (/*foo*/ ctx[0]) {
- if (!if_block) {
+ if (if_block) {
+
+ } else {
if_block = create_if_block(ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
- } else {
-
}
} else if (if_block) {
if_block.d(1);
diff --git a/test/js/samples/transition-local/expected.js b/test/js/samples/transition-local/expected.js
index a5d3b6318f..25a03f026f 100644
--- a/test/js/samples/transition-local/expected.js
+++ b/test/js/samples/transition-local/expected.js
@@ -28,13 +28,15 @@ function create_if_block(ctx) {
},
p(ctx, dirty) {
if (/*y*/ ctx[1]) {
- if (!if_block) {
+ if (if_block) {
+ if (dirty & /*y*/ 2) {
+ transition_in(if_block, 1);
+ }
+ } else {
if_block = create_if_block_1(ctx);
if_block.c();
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
- } else {
- transition_in(if_block, 1);
}
} else if (if_block) {
if_block.d(1);
diff --git a/test/js/samples/transition-repeated-outro/expected.js b/test/js/samples/transition-repeated-outro/expected.js
index 6f071328a4..1f76a93666 100644
--- a/test/js/samples/transition-repeated-outro/expected.js
+++ b/test/js/samples/transition-repeated-outro/expected.js
@@ -63,13 +63,15 @@ function create_fragment(ctx) {
},
p(ctx, [dirty]) {
if (/*num*/ ctx[0] < 5) {
- if (!if_block) {
+ if (if_block) {
+ if (dirty & /*num*/ 1) {
+ transition_in(if_block, 1);
+ }
+ } else {
if_block = create_if_block(ctx);
if_block.c();
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
- } else {
- transition_in(if_block, 1);
}
} else if (if_block) {
group_outros();
diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js
index 52635e9b78..5be8808edb 100644
--- a/test/js/samples/use-elements-as-anchors/expected.js
+++ b/test/js/samples/use-elements-as-anchors/expected.js
@@ -157,12 +157,12 @@ function create_fragment(ctx) {
},
p(ctx, [dirty]) {
if (/*a*/ ctx[0]) {
- if (!if_block0) {
+ if (if_block0) {
+
+ } else {
if_block0 = create_if_block_4(ctx);
if_block0.c();
if_block0.m(div, t0);
- } else {
-
}
} else if (if_block0) {
if_block0.d(1);
@@ -170,12 +170,12 @@ function create_fragment(ctx) {
}
if (/*b*/ ctx[1]) {
- if (!if_block1) {
+ if (if_block1) {
+
+ } else {
if_block1 = create_if_block_3(ctx);
if_block1.c();
if_block1.m(div, t3);
- } else {
-
}
} else if (if_block1) {
if_block1.d(1);
@@ -183,12 +183,12 @@ function create_fragment(ctx) {
}
if (/*c*/ ctx[2]) {
- if (!if_block2) {
+ if (if_block2) {
+
+ } else {
if_block2 = create_if_block_2(ctx);
if_block2.c();
if_block2.m(div, t4);
- } else {
-
}
} else if (if_block2) {
if_block2.d(1);
@@ -196,12 +196,12 @@ function create_fragment(ctx) {
}
if (/*d*/ ctx[3]) {
- if (!if_block3) {
+ if (if_block3) {
+
+ } else {
if_block3 = create_if_block_1(ctx);
if_block3.c();
if_block3.m(div, null);
- } else {
-
}
} else if (if_block3) {
if_block3.d(1);
@@ -209,12 +209,12 @@ function create_fragment(ctx) {
}
if (/*e*/ ctx[4]) {
- if (!if_block4) {
+ if (if_block4) {
+
+ } else {
if_block4 = create_if_block(ctx);
if_block4.c();
if_block4.m(if_block4_anchor.parentNode, if_block4_anchor);
- } else {
-
}
} else if (if_block4) {
if_block4.d(1);
diff --git a/test/runtime/samples/component-slot-fallback-5/IconA.svelte b/test/runtime/samples/component-slot-fallback-5/IconA.svelte
new file mode 100644
index 0000000000..8921b6c531
--- /dev/null
+++ b/test/runtime/samples/component-slot-fallback-5/IconA.svelte
@@ -0,0 +1 @@
+Icon A
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-fallback-5/IconB.svelte b/test/runtime/samples/component-slot-fallback-5/IconB.svelte
new file mode 100644
index 0000000000..8a1a95ead3
--- /dev/null
+++ b/test/runtime/samples/component-slot-fallback-5/IconB.svelte
@@ -0,0 +1 @@
+Icon B
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-fallback-5/Inner.svelte b/test/runtime/samples/component-slot-fallback-5/Inner.svelte
new file mode 100644
index 0000000000..bc4b224c23
--- /dev/null
+++ b/test/runtime/samples/component-slot-fallback-5/Inner.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
diff --git a/test/runtime/samples/component-slot-fallback-5/_config.js b/test/runtime/samples/component-slot-fallback-5/_config.js
new file mode 100644
index 0000000000..fa374f3519
--- /dev/null
+++ b/test/runtime/samples/component-slot-fallback-5/_config.js
@@ -0,0 +1,31 @@
+export default {
+ html: `
+
+ Icon B
+ `,
+
+ async test({ assert, target, window }) {
+ const btn = target.querySelector("button");
+ const clickEvent = new window.MouseEvent("click");
+
+ await btn.dispatchEvent(clickEvent);
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ Icon A
+ `
+ );
+
+ await btn.dispatchEvent(clickEvent);
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ Icon B
+ `
+ );
+ }
+};
diff --git a/test/runtime/samples/component-slot-fallback-5/main.svelte b/test/runtime/samples/component-slot-fallback-5/main.svelte
new file mode 100644
index 0000000000..206ce21def
--- /dev/null
+++ b/test/runtime/samples/component-slot-fallback-5/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/transition-js-if-outro-unrelated-component-binding-update/Component.svelte b/test/runtime/samples/transition-js-if-outro-unrelated-component-binding-update/Component.svelte
new file mode 100644
index 0000000000..adb9aaea0e
--- /dev/null
+++ b/test/runtime/samples/transition-js-if-outro-unrelated-component-binding-update/Component.svelte
@@ -0,0 +1,18 @@
+
+
+