diff --git a/src/compile/render-dom/wrappers/shared/Tag.ts b/src/compile/render-dom/wrappers/shared/Tag.ts index 5fe91b74cc..510c2cf756 100644 --- a/src/compile/render-dom/wrappers/shared/Tag.ts +++ b/src/compile/render-dom/wrappers/shared/Tag.ts @@ -27,7 +27,6 @@ export default class Tag extends Wrapper { if (this.node.shouldCache) block.addVariable(value, snippet); if (dependencies.size) { - // TODO can we check `#current` at the top of the `update` method, instead of in individual updates? const changedCheck = ( (block.hasOutros ? `!#current || ` : '') + [...dependencies].map((dependency: string) => `changed.${dependency}`).join(' || ') diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js index e4a1329c60..d076e11734 100644 --- a/test/js/samples/action-custom-event-handler/expected.js +++ b/test/js/samples/action-custom-event-handler/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var button, foo_action, current; + var button, foo_action, current, mounted; return { c() { @@ -13,17 +13,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, button, anchor); foo_action = foo.call(null, button, ctx.foo_function) || {}; - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index f2f66baa2b..3659cb4d4a 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, detachNode, identity, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, identity, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var a, link_action, current; + var a, link_action, current, mounted; return { c() { @@ -14,17 +14,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, a, anchor); link_action = link.call(null, a) || {}; - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index 4ca71de2cf..2481f44d15 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addResizeListener, add_render_callback, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addResizeListener, add_render_callback, createElement, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var div, div_resize_listener, current; + var div, div_resize_listener, current, mounted; return { c() { @@ -14,17 +14,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, div, anchor); div_resize_listener = addResizeListener(div, ctx.div_resize_handler.bind(div)); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index 26b8dac055..af3b94df81 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function add_css() { var style = createElement("style"); @@ -9,7 +9,7 @@ function add_css() { } function create_fragment($$, ctx) { - var p, text, current; + var p, text, current, mounted; return { c() { @@ -21,7 +21,7 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, p, anchor); append(p, text); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -31,11 +31,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js index f39cb4c328..f4a8716ec5 100644 --- a/test/js/samples/component-static-array/expected.js +++ b/test/js/samples/component-static-array/expected.js @@ -2,7 +2,7 @@ import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var current; + var current, mounted; var nested = new ctx.Nested({ props: { foo: [1, 2, 3] } }); @@ -13,20 +13,17 @@ function create_fragment($$, ctx) { m(target, anchor) { mount_component(nested, target, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o(outrocallback) { - if (!current) return; - - if (nested) nested.$$.fragment.o(outrocallback); + o() { + if (nested) nested.$$.fragment.o(); current = false; }, diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index a33a09a093..274526b518 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -2,7 +2,7 @@ import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var current; + var current, mounted; var nested = new ctx.Nested({ props: { foo: "bar" } }); @@ -13,20 +13,17 @@ function create_fragment($$, ctx) { m(target, anchor) { mount_component(nested, target, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o(outrocallback) { - if (!current) return; - - if (nested) nested.$$.fragment.o(outrocallback); + o() { + if (nested) nested.$$.fragment.o(); current = false; }, diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index a33a09a093..274526b518 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -2,7 +2,7 @@ import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var current; + var current, mounted; var nested = new ctx.Nested({ props: { foo: "bar" } }); @@ -13,20 +13,17 @@ function create_fragment($$, ctx) { m(target, anchor) { mount_component(nested, target, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o(outrocallback) { - if (!current) return; - - if (nested) nested.$$.fragment.o(outrocallback); + o() { + if (nested) nested.$$.fragment.o(); current = false; }, diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index df8a0d3274..3ecb5965f9 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -2,7 +2,7 @@ import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var current; + var current, mounted; var nested = new ctx.Nested({ props: { foo: "bar" } }); @@ -13,20 +13,17 @@ function create_fragment($$, ctx) { m(target, anchor) { mount_component(nested, target, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o(outrocallback) { - if (!current) return; - - if (nested) nested.$$.fragment.o(outrocallback); + o() { + if (nested) nested.$$.fragment.o(); current = false; }, diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index 39c7f85bc8..8dac94bdee 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -1,15 +1,15 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, flush, init, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var current; + var current, mounted; return { c: noop, m: noop, p: noop, i: noop, - o: run, + o: noop, d: noop }; } diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index f130945c4b..5890b84768 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, identity, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, identity, init, insert, noop, safe_not_equal } from "svelte/internal"; function add_css() { var style = createElement("style"); @@ -9,7 +9,7 @@ function add_css() { } function create_fragment($$, ctx) { - var div, current; + var div, current, mounted; return { c() { @@ -19,17 +19,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, div, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index bf56378e2d..1e531f35ab 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteElement, createElement, detachNode, identity, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteElement, createElement, detachNode, identity, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var div, current; + var div, current, mounted; return { c() { @@ -13,17 +13,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, div, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 16313a1a50..86dcceccee 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -1,10 +1,10 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; const file = undefined; function create_fragment($$, ctx) { - var h1, text0, text1, text2, text3, current; + var h1, text0, text1, text2, text3, current, mounted; return { c: function create() { @@ -27,7 +27,7 @@ function create_fragment($$, ctx) { append(h1, text1); append(h1, text2); insert(target, text3, anchor); - current = true; + current = mounted = true; }, p: function update(changed, ctx) { @@ -39,11 +39,10 @@ function create_fragment($$, ctx) { }, i: function intro(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d: function destroy(detach) { if (detach) { diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 7183e59e83..38a2675cc3 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; const file = undefined; @@ -55,7 +55,7 @@ function create_each_block($$, ctx) { } function create_fragment($$, ctx) { - var text0, p, text1, text2, current; + var text0, p, text1, text2, current, mounted; var each_value = ctx.things; @@ -91,7 +91,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text1); append(p, text2); - current = true; + current = mounted = true; }, p: function update(changed, ctx) { @@ -122,11 +122,10 @@ function create_fragment($$, ctx) { }, i: function intro(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d: function destroy(detach) { destroyEach(each_blocks, detach); diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 93fbdc2f21..96891ebecc 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; const file = undefined; @@ -55,7 +55,7 @@ function create_each_block($$, ctx) { } function create_fragment($$, ctx) { - var text0, p, text1, text2, current; + var text0, p, text1, text2, current, mounted; var each_value = ctx.things; @@ -91,7 +91,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text1); append(p, text2); - current = true; + current = mounted = true; }, p: function update(changed, ctx) { @@ -122,11 +122,10 @@ function create_fragment($$, ctx) { }, i: function intro(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d: function destroy(detach) { destroyEach(each_blocks, detach); diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index fe2a247d3d..0d4d881ba3 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createComment, createElement as createElement_1, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createComment, createElement as createElement_1, createText, destroyEach, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -37,7 +37,7 @@ function create_each_block($$, ctx) { } function create_fragment($$, ctx) { - var each_anchor, current; + var each_anchor, current, mounted; var each_value = ctx.createElement; @@ -62,7 +62,7 @@ function create_fragment($$, ctx) { } insert(target, each_anchor, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -89,11 +89,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { destroyEach(each_blocks, detach); diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index eae53e6ab6..a3069d9ae5 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -1,16 +1,16 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, flush, init, noop, safe_not_equal } from "svelte/internal"; import { onMount } from "svelte"; function create_fragment($$, ctx) { - var current; + var current, mounted; return { c: noop, m: noop, p: noop, i: noop, - o: run, + o: noop, d: noop }; } diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index 7f52c96119..288205bc30 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -1,10 +1,10 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; const file = undefined; function create_fragment($$, ctx) { - var p, text0_value = Math.max(0, ctx.foo), text0, text1, text2, current; + var p, text0_value = Math.max(0, ctx.foo), text0, text1, text2, current, mounted; return { c: function create() { @@ -24,7 +24,7 @@ function create_fragment($$, ctx) { append(p, text0); append(p, text1); append(p, text2); - current = true; + current = mounted = true; }, p: function update(changed, ctx) { @@ -38,11 +38,10 @@ function create_fragment($$, ctx) { }, i: function intro(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d: function destroy(detach) { if (detach) { diff --git a/test/js/samples/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js index 1cdc176977..10d3ca7d02 100644 --- a/test/js/samples/do-use-dataset/expected.js +++ b/test/js/samples/do-use-dataset/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var div0, text, div1, current; + var div0, text, div1, current, mounted; return { c() { @@ -17,7 +17,7 @@ function create_fragment($$, ctx) { insert(target, div0, anchor); insert(target, text, anchor); insert(target, div1, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -27,11 +27,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected.js b/test/js/samples/dont-use-dataset-in-legacy/expected.js index 26fd86b9b6..1a3cfcc02a 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal, setAttribute } from "svelte/internal"; function create_fragment($$, ctx) { - var div0, text, div1, current; + var div0, text, div1, current, mounted; return { c() { @@ -17,7 +17,7 @@ function create_fragment($$, ctx) { insert(target, div0, anchor); insert(target, text, anchor); insert(target, div1, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -27,11 +27,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/dont-use-dataset-in-svg/expected.js b/test/js/samples/dont-use-dataset-in-svg/expected.js index 2bb5a1d36b..aec7ce3f2a 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createSvgElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createSvgElement, detachNode, flush, init, insert, noop, safe_not_equal, setAttribute } from "svelte/internal"; function create_fragment($$, ctx) { - var svg, g0, g1, current; + var svg, g0, g1, current, mounted; return { c() { @@ -17,7 +17,7 @@ function create_fragment($$, ctx) { insert(target, svg, anchor); append(svg, g0); append(svg, g1); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -27,11 +27,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js index d0e36d4936..c14efc96cc 100644 --- a/test/js/samples/dynamic-import/expected.js +++ b/test/js/samples/dynamic-import/expected.js @@ -3,7 +3,7 @@ import { SvelteComponent as SvelteComponent_1, identity, init, mount_component, import LazyLoad from "./LazyLoad.html"; function create_fragment($$, ctx) { - var current; + var current, mounted; var lazyload = new LazyLoad({ props: { load: func } }); @@ -14,20 +14,17 @@ function create_fragment($$, ctx) { m(target, anchor) { mount_component(lazyload, target, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o(outrocallback) { - if (!current) return; - - if (lazyload) lazyload.$$.fragment.o(outrocallback); + o() { + if (lazyload) lazyload.$$.fragment.o(); current = false; }, diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index cc59d354d6..9ea537c212 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createElement, createText, destroyEach, detachAfter, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createElement, createText, destroyEach, detachAfter, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -68,7 +68,7 @@ function create_each_block($$, ctx) { } function create_fragment($$, ctx) { - var text0, p, text1, current; + var text0, p, text1, current, mounted; var each_value = ctx.comments; @@ -97,7 +97,7 @@ function create_fragment($$, ctx) { insert(target, text0, anchor); insert(target, p, anchor); append(p, text1); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -128,11 +128,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { destroyEach(each_blocks, detach); diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index 874c79c637..6ca1581376 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, animate, append, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fix_position, flush, init, insert, noop, run, safe_not_equal, setData, updateKeyedEach } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, animate, append, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fix_position, flush, init, insert, noop, safe_not_equal, setData, updateKeyedEach } from "svelte/internal"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -56,7 +56,7 @@ function create_each_block($$, key_1, ctx) { } function create_fragment($$, ctx) { - var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current; + var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current, mounted; var each_value = ctx.things; @@ -79,7 +79,7 @@ function create_fragment($$, ctx) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor); insert(target, each_anchor, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -90,11 +90,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach); diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index dc6f2c98e2..3d695e5167 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, blankObject, createComment, createElement, createText, destroyBlock, detachNode, flush, init, insert, run, safe_not_equal, setData, updateKeyedEach } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, blankObject, createComment, createElement, createText, destroyBlock, detachNode, flush, init, insert, noop, safe_not_equal, setData, updateKeyedEach } from "svelte/internal"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -42,7 +42,7 @@ function create_each_block($$, key_1, ctx) { } function create_fragment($$, ctx) { - var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current; + var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current, mounted; var each_value = ctx.things; @@ -65,7 +65,7 @@ function create_fragment($$, ctx) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor); insert(target, each_anchor, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -74,11 +74,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach); diff --git a/test/js/samples/event-handler-no-passive/expected.js b/test/js/samples/event-handler-no-passive/expected.js index fea5cf99e2..4f0219f096 100644 --- a/test/js/samples/event-handler-no-passive/expected.js +++ b/test/js/samples/event-handler-no-passive/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, identity, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, identity, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var a, current, dispose; + var a, current, mounted, dispose; return { c() { @@ -14,17 +14,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, a, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/event-modifiers/expected.js b/test/js/samples/event-modifiers/expected.js index 8d334ec04a..7fea6779ba 100644 --- a/test/js/samples/event-modifiers/expected.js +++ b/test/js/samples/event-modifiers/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, identity, init, insert, noop, preventDefault, run, run_all, safe_not_equal, stopPropagation } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, identity, init, insert, noop, preventDefault, run_all, safe_not_equal, stopPropagation } from "svelte/internal"; function create_fragment($$, ctx) { - var div, button0, text1, button1, text3, button2, current, dispose; + var div, button0, text1, button1, text3, button2, current, mounted, dispose; return { c() { @@ -30,17 +30,16 @@ function create_fragment($$, ctx) { append(div, button1); append(div, text3); append(div, button2); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index 58bfa6ee06..bfd258671e 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, identity, init, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, identity, init, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var meta0, meta1, current; + var meta0, meta1, current, mounted; return { c() { @@ -17,17 +17,16 @@ function create_fragment($$, ctx) { m(target, anchor) { append(document.head, meta0); append(document.head, meta1); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { detachNode(meta0); diff --git a/test/js/samples/hoisted-const/expected.js b/test/js/samples/hoisted-const/expected.js index aa81d991e8..f478f72648 100644 --- a/test/js/samples/hoisted-const/expected.js +++ b/test/js/samples/hoisted-const/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, identity, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, identity, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var b, text_value = get_answer(), text, current; + var b, text_value = get_answer(), text, current, mounted; return { c() { @@ -13,17 +13,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, b, anchor); append(b, text); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index cc01e9791a..6a9ca01c28 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; // (3:0) {:else} function create_else_block($$, ctx) { @@ -46,7 +46,7 @@ function create_if_block($$, ctx) { } function create_fragment($$, ctx) { - var if_block_anchor, current; + var if_block_anchor, current, mounted; function select_block_type(ctx) { if (ctx.foo) return create_if_block; @@ -65,7 +65,7 @@ function create_fragment($$, ctx) { m(target, anchor) { if_block.m(target, anchor); insert(target, if_block_anchor, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -78,11 +78,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if_block.d(detach); diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index 054ee7219b..50d5217456 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; // (1:0) {#if foo} function create_if_block($$, ctx) { @@ -24,7 +24,7 @@ function create_if_block($$, ctx) { } function create_fragment($$, ctx) { - var if_block_anchor, current; + var if_block_anchor, current, mounted; var if_block = (ctx.foo) && create_if_block($$, ctx); @@ -37,7 +37,7 @@ function create_fragment($$, ctx) { m(target, anchor) { if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -54,11 +54,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (if_block) if_block.d(detach); diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index f4ac24f484..b2994e861d 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, safe_not_equal, setStyle } from "svelte/internal"; function create_fragment($$, ctx) { - var div, current; + var div, current, mounted; return { c() { @@ -13,7 +13,7 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, div, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -27,11 +27,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index da4f91c1d2..8a2571bcd9 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, safe_not_equal, setStyle } from "svelte/internal"; function create_fragment($$, ctx) { - var div, current; + var div, current, mounted; return { c() { @@ -12,7 +12,7 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, div, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -22,11 +22,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index 84056cfd50..fb5952b419 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, safe_not_equal, setStyle } from "svelte/internal"; function create_fragment($$, ctx) { - var div, current; + var div, current, mounted; return { c() { @@ -12,7 +12,7 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, div, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -22,11 +22,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index 1f66ec8766..c19241c2fc 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var div0, text, div1, div1_style_value, current; + var div0, text, div1, div1_style_value, current, mounted; return { c() { @@ -17,7 +17,7 @@ function create_fragment($$, ctx) { insert(target, div0, anchor); insert(target, text, anchor); insert(target, div1, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -31,11 +31,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js index baab165695..2a35cfa708 100644 --- a/test/js/samples/input-files/expected.js +++ b/test/js/samples/input-files/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal, setAttribute } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, safe_not_equal, setAttribute } from "svelte/internal"; function create_fragment($$, ctx) { - var input, current, dispose; + var input, current, mounted, dispose; return { c() { @@ -14,17 +14,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, input, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js index 1d90cf146c..e092c7c54c 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, run_all, safe_not_equal, setAttribute, toNumber } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, run_all, safe_not_equal, setAttribute, toNumber } from "svelte/internal"; function create_fragment($$, ctx) { - var input, current, dispose; + var input, current, mounted, dispose; return { c() { @@ -20,7 +20,7 @@ function create_fragment($$, ctx) { input.value = ctx.value; - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -28,11 +28,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 3c5f57391b..05b85d82e8 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, safe_not_equal, setAttribute } from "svelte/internal"; function create_fragment($$, ctx) { - var input, current, dispose; + var input, current, mounted, dispose; return { c() { @@ -16,7 +16,7 @@ function create_fragment($$, ctx) { input.checked = ctx.foo; - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -24,11 +24,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/instrumentation-script-if-no-block/expected.js b/test/js/samples/instrumentation-script-if-no-block/expected.js index b8c0cb22e1..e461bac6c1 100644 --- a/test/js/samples/instrumentation-script-if-no-block/expected.js +++ b/test/js/samples/instrumentation-script-if-no-block/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function create_fragment($$, ctx) { - var button, text1, p, text2, text3, current, dispose; + var button, text1, p, text2, text3, current, mounted, dispose; return { c() { @@ -21,7 +21,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text2); append(p, text3); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -31,11 +31,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/instrumentation-script-x-equals-x/expected.js b/test/js/samples/instrumentation-script-x-equals-x/expected.js index 429bf51fae..37ef90b46e 100644 --- a/test/js/samples/instrumentation-script-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-script-x-equals-x/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function create_fragment($$, ctx) { - var button, text1, p, text2, text3_value = ctx.things.length, text3, current, dispose; + var button, text1, p, text2, text3_value = ctx.things.length, text3, current, mounted, dispose; return { c() { @@ -21,7 +21,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text2); append(p, text3); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -31,11 +31,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/instrumentation-template-if-no-block/expected.js b/test/js/samples/instrumentation-template-if-no-block/expected.js index 8aba31fc4d..12320d4d43 100644 --- a/test/js/samples/instrumentation-template-if-no-block/expected.js +++ b/test/js/samples/instrumentation-template-if-no-block/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function create_fragment($$, ctx) { - var button, text1, p, text2, text3, current, dispose; + var button, text1, p, text2, text3, current, mounted, dispose; return { c() { @@ -21,7 +21,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text2); append(p, text3); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -31,11 +31,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/instrumentation-template-x-equals-x/expected.js b/test/js/samples/instrumentation-template-x-equals-x/expected.js index 6136f16432..21d25baa47 100644 --- a/test/js/samples/instrumentation-template-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-template-x-equals-x/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function create_fragment($$, ctx) { - var button, text1, p, text2, text3_value = ctx.things.length, text3, current, dispose; + var button, text1, p, text2, text3_value = ctx.things.length, text3, current, mounted, dispose; return { c() { @@ -21,7 +21,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text2); append(p, text3); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -31,11 +31,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index de095d7c0a..79ac9cdb43 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, createElement, detachNode, identity, init, insert, noop, run, safe_not_equal, setInputType } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, identity, init, insert, noop, safe_not_equal, setInputType } from "svelte/internal"; function create_fragment($$, ctx) { - var input, current; + var input, current, mounted; return { c() { @@ -12,17 +12,16 @@ function create_fragment($$, ctx) { m(target, anchor) { insert(target, input, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 645a7d9b0f..7add6cf7d8 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, createElement, detachNode, flush, init, insert, run, run_all, safe_not_equal, timeRangesToArray } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, createElement, detachNode, flush, init, insert, noop, run_all, safe_not_equal, timeRangesToArray } from "svelte/internal"; function create_fragment($$, ctx) { - var audio, audio_updating = false, audio_animationframe, audio_is_paused = true, current, dispose; + var audio, audio_updating = false, audio_animationframe, audio_is_paused = true, current, mounted, dispose; function audio_timeupdate_handler() { cancelAnimationFrame(audio_animationframe); @@ -35,7 +35,7 @@ function create_fragment($$, ctx) { audio.volume = ctx.volume; - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -46,11 +46,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index 32a772b3b5..343bdb2453 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -1,9 +1,9 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, callAfter, createText, detachNode, identity, init, insert, mount_component, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, createText, detachNode, identity, init, insert, mount_component, noop, safe_not_equal } from "svelte/internal"; import Imported from "Imported.html"; function create_fragment($$, ctx) { - var text, current; + var text, current, mounted; var imported = new Imported({}); @@ -20,23 +20,18 @@ function create_fragment($$, ctx) { mount_component(imported, target, anchor); insert(target, text, anchor); mount_component(nonimported, target, anchor); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o(outrocallback) { - if (!current) return; - - outrocallback = callAfter(outrocallback, 2); - - if (imported) imported.$$.fragment.o(outrocallback); - if (nonimported) nonimported.$$.fragment.o(outrocallback); + o() { + if (imported) imported.$$.fragment.o(); + if (nonimported) nonimported.$$.fragment.o(); current = false; }, diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js index cce868ee40..281f3e98ae 100644 --- a/test/js/samples/select-dynamic-value/expected.js +++ b/test/js/samples/select-dynamic-value/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var select, option0, option1, select_value_value, current_1; + var select, option0, option1, select_value_value, current_1, mounted; return { c() { @@ -32,7 +32,7 @@ function create_fragment($$, ctx) { } } - current_1 = true; + current_1 = mounted = true; }, p(changed, ctx) { @@ -49,11 +49,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current_1) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js index 257de1d245..94a6068bb4 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -1,15 +1,15 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, identity, init, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, identity, init, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var current; + var current, mounted; return { c: noop, m: noop, p: noop, i: noop, - o: run, + o: noop, d: noop }; } diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js index ed67789799..8658434265 100644 --- a/test/js/samples/svg-title/expected.js +++ b/test/js/samples/svg-title/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createSvgElement, createText, detachNode, identity, init, insert, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createSvgElement, createText, detachNode, identity, init, insert, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var svg, title, text, current; + var svg, title, text, current, mounted; return { c() { @@ -15,17 +15,16 @@ function create_fragment($$, ctx) { insert(target, svg, anchor); append(svg, title); append(title, text); - current = true; + current = mounted = true; }, p: noop, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index cfac2c0ad1..ba0a6337b5 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, flush, init, noop, safe_not_equal } from "svelte/internal"; function create_fragment($$, ctx) { - var title_value, current; + var title_value, current, mounted; document.title = title_value = "a " + ctx.custom + " title"; @@ -17,7 +17,7 @@ function create_fragment($$, ctx) { }, i: noop, - o: run, + o: noop, d: noop }; } diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index e6610407e4..4e65d09fd3 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, append, createComment, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, append, createComment, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal } from "svelte/internal"; // (2:1) {#if a} function create_if_block_4($$, ctx) { @@ -112,7 +112,7 @@ function create_if_block($$, ctx) { } function create_fragment($$, ctx) { - var div, text0, p0, text2, text3, text4, p1, text6, text7, if_block4_anchor, current; + var div, text0, p0, text2, text3, text4, p1, text6, text7, if_block4_anchor, current, mounted; var if_block0 = (ctx.a) && create_if_block_4($$, ctx); @@ -161,7 +161,7 @@ function create_fragment($$, ctx) { insert(target, text7, anchor); if (if_block4) if_block4.m(target, anchor); insert(target, if_block4_anchor, anchor); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -222,11 +222,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index 0fded5c925..7c5737ba7f 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; +import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, append, createElement, createText, detachNode, flush, init, insert, noop, safe_not_equal, setData } from "svelte/internal"; function create_fragment($$, ctx) { - var scrolling = false, clear_scrolling = () => { scrolling = false }, scrolling_timeout, p, text0, text1, current, dispose; + var scrolling = false, clear_scrolling = () => { scrolling = false }, scrolling_timeout, p, text0, text1, current, mounted, dispose; add_render_callback(ctx.onwindowscroll); @@ -23,7 +23,7 @@ function create_fragment($$, ctx) { insert(target, p, anchor); append(p, text0); append(p, text1); - current = true; + current = mounted = true; }, p(changed, ctx) { @@ -40,11 +40,10 @@ function create_fragment($$, ctx) { }, i(target, anchor) { - if (current) return; - this.m(target, anchor); + if (!mounted) this.m(target, anchor); }, - o: run, + o: noop, d(detach) { if (detach) { diff --git a/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js b/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js index 6036be6055..aa0bd9e1aa 100644 --- a/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js +++ b/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js @@ -3,7 +3,7 @@ export default { name: 'world' }, - test({ assert, component, target, window, raf }) { + test({ assert, component, target, raf }) { global.count = 0; component.visible = true;