diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts index e9e27980bb80..35a6ca17114c 100644 --- a/src/compile/dom/index.ts +++ b/src/compile/dom/index.ts @@ -227,7 +227,7 @@ export default function dom( this._fragment.c(); this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor); + if (options.target) this._mount(options.target, options.anchor, ${options.skipIntroByDefault ? `options.intro` : 'true'}); ` : deindent` if (options.target) { ${compiler.options.hydratable @@ -240,7 +240,7 @@ export default function dom( ${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`} this._fragment.c(); `} - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, ${options.skipIntroByDefault ? `options.intro` : 'true'}); ${(compiler.hasComponents || target.hasComplexBindings || hasInitHooks || target.hasIntroTransitions) && deindent` ${compiler.hasComponents && `this._lock = true;`} diff --git a/src/compile/nodes/Component.ts b/src/compile/nodes/Component.ts index e25703dd2e04..9b14a294524b 100644 --- a/src/compile/nodes/Component.ts +++ b/src/compile/nodes/Component.ts @@ -383,7 +383,7 @@ export default class Component extends Node { block.builders.mount.addBlock(deindent` if (${name}) { - ${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}); + ${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}, ${compiler.options.skipIntroByDefault ? 'false' : 'true'}); ${this.ref && `#component.refs.${this.ref} = ${name};`} } `); @@ -405,7 +405,7 @@ export default class Component extends Node { ${name}._fragment.c(); ${this.children.map(child => child.remount(name))} - ${name}._mount(${updateMountNode}, ${anchor}); + ${name}._mount(${updateMountNode}, ${anchor}, ${compiler.options.skipIntroByDefault ? 'false' : 'true'}); ${this.handlers.map(handler => deindent` ${name}.on("${handler.name}", ${handler.var}); @@ -464,7 +464,7 @@ export default class Component extends Node { } block.builders.mount.addLine( - `${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'});` + `${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}, ${compiler.options.skipIntroByDefault ? 'false' : 'true'});` ); if (updates.length) { @@ -483,7 +483,7 @@ export default class Component extends Node { } remount(name: string) { - return `${this.var}._mount(${name}._slotted.default, null);`; + return `${this.var}._mount(${name}._slotted.default, null, ${this.compiler.options.skipIntroByDefault ? 'false' : 'true'});`; } ssr() { diff --git a/src/interfaces.ts b/src/interfaces.ts index 773a93b37f75..1a5c356404c9 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -64,6 +64,9 @@ export interface CompileOptions { onerror?: (error: Error) => void; onwarn?: (warning: Warning) => void; + + // to remove in v3 + skipIntroByDefault?: boolean; } export interface GenerateOptions { diff --git a/src/shared/index.js b/src/shared/index.js index cf82282ad809..e1d7fda5e9f8 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -128,8 +128,8 @@ export function callAll(fns) { while (fns && fns.length) fns.shift()(); } -export function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +export function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } export var PENDING = {}; diff --git a/test/cli/samples/basic/expected/Main.js b/test/cli/samples/basic/expected/Main.js index dce010fb4c4c..b4b737bb766d 100644 --- a/test/cli/samples/basic/expected/Main.js +++ b/test/cli/samples/basic/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -31,7 +31,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -149,8 +149,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/custom-element/expected/Main.js b/test/cli/samples/custom-element/expected/Main.js index d1b96c98992b..6fcf0aa394db 100644 --- a/test/cli/samples/custom-element/expected/Main.js +++ b/test/cli/samples/custom-element/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -37,7 +37,7 @@ class Main extends HTMLElement { this._fragment.c(); this._fragment.m(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor); + if (options.target) this._mount(options.target, options.anchor, true); } static get observedAttributes() { @@ -170,8 +170,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dev/expected/Main.js b/test/cli/samples/dev/expected/Main.js index a2da6346b646..9c8394917ce6 100644 --- a/test/cli/samples/dev/expected/Main.js +++ b/test/cli/samples/dev/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -34,7 +34,7 @@ function Main(options) { if (options.target) { if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -153,8 +153,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dir-sourcemap/expected/Main.js b/test/cli/samples/dir-sourcemap/expected/Main.js index b4a005c0ac5f..ccedf5a18ade 100644 --- a/test/cli/samples/dir-sourcemap/expected/Main.js +++ b/test/cli/samples/dir-sourcemap/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ import Widget from './Widget.html'; @@ -15,7 +15,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - widget._mount(target, anchor); + widget._mount(target, anchor, true); }, p: noop, @@ -40,7 +40,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); @@ -156,8 +156,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dir-sourcemap/expected/Widget.js b/test/cli/samples/dir-sourcemap/expected/Widget.js index 28223fdd1c0e..702f6ee812a1 100644 --- a/test/cli/samples/dir-sourcemap/expected/Widget.js +++ b/test/cli/samples/dir-sourcemap/expected/Widget.js @@ -1,4 +1,4 @@ -/* src/Widget.html generated by Svelte v2.4.4 */ +/* src/Widget.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -31,7 +31,7 @@ function Widget(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -149,8 +149,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dir-subdir/expected/Main.js b/test/cli/samples/dir-subdir/expected/Main.js index 1a595e80dd4f..c43c92222022 100644 --- a/test/cli/samples/dir-subdir/expected/Main.js +++ b/test/cli/samples/dir-subdir/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ import Widget from './widget/Widget.html'; @@ -15,7 +15,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - widget._mount(target, anchor); + widget._mount(target, anchor, true); }, p: noop, @@ -40,7 +40,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); @@ -156,8 +156,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dir-subdir/expected/widget/Widget.js b/test/cli/samples/dir-subdir/expected/widget/Widget.js index 7ab7e73f96c1..df8b286b2926 100644 --- a/test/cli/samples/dir-subdir/expected/widget/Widget.js +++ b/test/cli/samples/dir-subdir/expected/widget/Widget.js @@ -1,4 +1,4 @@ -/* src/widget/Widget.html generated by Svelte v2.4.4 */ +/* src/widget/Widget.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -31,7 +31,7 @@ function Widget(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -149,8 +149,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dir/expected/Main.js b/test/cli/samples/dir/expected/Main.js index 43ff753ecad4..501d7d8e9f7a 100644 --- a/test/cli/samples/dir/expected/Main.js +++ b/test/cli/samples/dir/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ import Widget from './Widget.html'; @@ -15,7 +15,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - widget._mount(target, anchor); + widget._mount(target, anchor, true); }, p: noop, @@ -40,7 +40,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); @@ -156,8 +156,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/dir/expected/Widget.js b/test/cli/samples/dir/expected/Widget.js index 9c62194627df..ad7f1ce7edb2 100644 --- a/test/cli/samples/dir/expected/Widget.js +++ b/test/cli/samples/dir/expected/Widget.js @@ -1,4 +1,4 @@ -/* src/Widget.html generated by Svelte v2.4.4 */ +/* src/Widget.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -31,7 +31,7 @@ function Widget(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -149,8 +149,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/globals/expected/Main.js b/test/cli/samples/globals/expected/Main.js index 968eb228fec7..72daf778fbc6 100644 --- a/test/cli/samples/globals/expected/Main.js +++ b/test/cli/samples/globals/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ var Main = (function(answer) { "use strict"; answer = (answer && answer.__esModule) ? answer["default"] : answer; @@ -46,7 +46,7 @@ var Main = (function(answer) { "use strict"; if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -170,8 +170,8 @@ var Main = (function(answer) { "use strict"; } } - function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); + function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/sourcemap-inline/expected/Main.js b/test/cli/samples/sourcemap-inline/expected/Main.js index 3da16e1a57e4..b357420353de 100644 --- a/test/cli/samples/sourcemap-inline/expected/Main.js +++ b/test/cli/samples/sourcemap-inline/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -31,7 +31,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -149,8 +149,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/sourcemap/expected/Main.js b/test/cli/samples/sourcemap/expected/Main.js index b44a4b2f2714..14c1518dd09b 100644 --- a/test/cli/samples/sourcemap/expected/Main.js +++ b/test/cli/samples/sourcemap/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var p; @@ -31,7 +31,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -149,8 +149,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/cli/samples/store/expected/Main.js b/test/cli/samples/store/expected/Main.js index 320a159497ae..45ea6ea81451 100644 --- a/test/cli/samples/store/expected/Main.js +++ b/test/cli/samples/store/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte v2.4.4 */ +/* src/Main.html generated by Svelte v2.5.1 */ function create_main_fragment(component, ctx) { var h1, text, text_1; @@ -41,7 +41,7 @@ function Main(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } @@ -169,8 +169,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _differs(a, b) { diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index 49e0372582f3..8828faba1393 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -111,8 +111,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -179,7 +179,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index f92f3723fe76..dab9d0d9db57 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -52,7 +52,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/bind-width-height/expected-bundle.js b/test/js/samples/bind-width-height/expected-bundle.js index 371f3d2843c5..11a932ee3f6f 100644 --- a/test/js/samples/bind-width-height/expected-bundle.js +++ b/test/js/samples/bind-width-height/expected-bundle.js @@ -143,8 +143,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -205,7 +205,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); callAll(this._beforecreate); } diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index 8d9b432ef0ea..12eb1e8c37f0 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); callAll(this._beforecreate); } diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle.js b/test/js/samples/collapses-text-around-comments/expected-bundle.js index 302c1c3aaf4d..a8a0b6f76ba9 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -119,8 +119,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -186,7 +186,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index 75d00262c0d8..78e957933fb5 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -51,7 +51,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/component-static-array/expected-bundle.js b/test/js/samples/component-static-array/expected-bundle.js index 871a50c7cc5d..24e739c61af4 100644 --- a/test/js/samples/component-static-array/expected-bundle.js +++ b/test/js/samples/component-static-array/expected-bundle.js @@ -99,8 +99,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -133,7 +133,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -158,7 +158,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js index f07b2d8ed366..667fa7f4869f 100644 --- a/test/js/samples/component-static-array/expected.js +++ b/test/js/samples/component-static-array/expected.js @@ -17,7 +17,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -42,7 +42,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index 93a558f4acef..f272d7e11a65 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -103,8 +103,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -137,7 +137,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -162,7 +162,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index c18720c54ac8..877cbd5eda18 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -17,7 +17,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -42,7 +42,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index 93a558f4acef..f272d7e11a65 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -103,8 +103,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -137,7 +137,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -162,7 +162,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index c18720c54ac8..877cbd5eda18 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -17,7 +17,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -42,7 +42,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index bf7121708aba..04bd0982b57c 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -99,8 +99,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -133,7 +133,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -158,7 +158,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index 206232418244..631d2e781459 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -17,7 +17,7 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - nested._mount(target, anchor); + nested._mount(target, anchor, true); }, p: noop, @@ -42,7 +42,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 1a44c576c579..c40522136571 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -99,8 +99,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -147,7 +147,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index 8ca8d597ee54..05f6ae2bff60 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -31,7 +31,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 446ff232022a..0c864a18ec10 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -173,7 +173,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index b307708cb322..9b8c88b3ef6e 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -41,7 +41,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js index 86bef96e53a9..8277f96654ae 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -111,8 +111,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -167,7 +167,7 @@ class SvelteComponent extends HTMLElement { this._fragment.c(); this._fragment.m(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor); + if (options.target) this._mount(options.target, options.anchor, true); } static get observedAttributes() { diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index e86d8a3cb309..085cccb8d705 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -39,7 +39,7 @@ class SvelteComponent extends HTMLElement { this._fragment.c(); this._fragment.m(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor); + if (options.target) this._mount(options.target, options.anchor, true); } static get observedAttributes() { diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index effd1571f618..4767d5ccecb1 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -129,8 +129,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -253,7 +253,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index 8ae4b5dc3ea8..50a8aa2b43ca 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -107,7 +107,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 06e30f87bcaa..9983368542ff 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -104,8 +104,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -161,7 +161,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); callAll(this._oncreate); } diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index afac48dfbd42..f19fe3af9cb9 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -41,7 +41,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); callAll(this._oncreate); } diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js index bb93b058410a..0d93b49f8f36 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js @@ -137,8 +137,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var protoDev = { @@ -208,7 +208,7 @@ function SvelteComponent(options) { if (options.target) { if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } 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 5efb1f0a5ec4..7ef01fe7961f 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -54,7 +54,7 @@ function SvelteComponent(options) { if (options.target) { if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index e30355de2502..056964765dc3 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -175,7 +175,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js index a57edb8483b2..4d3773a37a25 100644 --- a/test/js/samples/do-use-dataset/expected.js +++ b/test/js/samples/do-use-dataset/expected.js @@ -43,7 +43,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js index 3cbc5ca530f4..dd7e1117257a 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js @@ -119,8 +119,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -179,7 +179,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } 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 1475687e2d47..266cc25e96b6 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js @@ -43,7 +43,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js index 80e1f6036685..810683ae14fe 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js @@ -119,8 +119,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -177,7 +177,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } 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 42bc11876efc..359de3a16cf1 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected.js @@ -41,7 +41,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index 2c2c8838da52..fb82c1ef93c4 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -131,8 +131,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -294,7 +294,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 609556bae0f2..82c588c9390f 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -146,7 +146,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 10715bd84c33..661c52fcf4f1 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -111,8 +111,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -177,7 +177,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index 86741c470c06..3e8b5b528b67 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -50,7 +50,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index 539ea3e5a4df..a39755bdd5da 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -111,8 +111,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -164,7 +164,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index 58b3f0e31185..3be9e7938971 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -36,7 +36,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/if-block-no-update/expected-bundle.js b/test/js/samples/if-block-no-update/expected-bundle.js index d54a62c22783..54712a53957d 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -225,7 +225,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index 6bed171850a8..f6a3f03c03b2 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -93,7 +93,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 9a067201fbf8..1d1d2088ed0d 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -201,7 +201,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index 98458d918fff..d35299a94dd5 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -69,7 +69,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js index 13da6e5fc0aa..cad82c33ca6b 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -173,7 +173,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 742da2b3d9ec..0be17478ef70 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -41,7 +41,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-optimized-url/expected-bundle.js b/test/js/samples/inline-style-optimized-url/expected-bundle.js index f27fd1f154f3..250878e4d781 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -168,7 +168,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index 2eb51e081805..d31dec9c815c 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -36,7 +36,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index 1df7465c86f8..ec403776a751 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -168,7 +168,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index 9c55bc6e8451..a4f7da55459d 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -36,7 +36,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index ed8e4fd01cf6..cba448597908 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -115,8 +115,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -179,7 +179,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index 41ffd501e014..b0a1f77b667c 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -47,7 +47,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/input-range/expected-bundle.js b/test/js/samples/input-range/expected-bundle.js index 048c9e088ff1..3df312e184f8 100644 --- a/test/js/samples/input-range/expected-bundle.js +++ b/test/js/samples/input-range/expected-bundle.js @@ -127,8 +127,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -189,7 +189,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js index 0899036bac8c..4468c4c92d58 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/input-without-blowback-guard/expected-bundle.js b/test/js/samples/input-without-blowback-guard/expected-bundle.js index 67915bc81b61..265fc37de50b 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -123,8 +123,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -183,7 +183,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 635987f16b4f..9b74212e6835 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -43,7 +43,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 9f806ed42a0c..69238bd3a00c 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -117,8 +117,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -166,7 +166,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index 2e1c279b2080..bbdf477d4963 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -32,7 +32,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index fbb235a80d16..0d6da357e1d0 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -127,8 +127,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -237,7 +237,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); callAll(this._beforecreate); } diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index f2400877e23b..049662796874 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -93,7 +93,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); callAll(this._beforecreate); } diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index bfab868082d2..04347d853a32 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -113,8 +113,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -152,9 +152,9 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - imported._mount(target, anchor); + imported._mount(target, anchor, true); insertNode(text, target, anchor); - nonimported._mount(target, anchor); + nonimported._mount(target, anchor, true); }, p: noop, @@ -184,7 +184,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index c070fa76d442..cb22b9704037 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -23,9 +23,9 @@ function create_main_fragment(component, ctx) { }, m(target, anchor) { - imported._mount(target, anchor); + imported._mount(target, anchor, true); insertNode(text, target, anchor); - nonimported._mount(target, anchor); + nonimported._mount(target, anchor, true); }, p: noop, @@ -55,7 +55,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index 30d69d6180ce..d2801647e5e9 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -99,8 +99,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -154,7 +154,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js index 855e7635b0a3..0dc82648fb11 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -38,7 +38,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index faf86f14cbfd..28f5220935c0 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -119,8 +119,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -171,7 +171,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js index 96a1ea09d1e1..b5f7caf1983a 100644 --- a/test/js/samples/svg-title/expected.js +++ b/test/js/samples/svg-title/expected.js @@ -35,7 +35,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index 1c4fd5e84fad..bd918afa0da1 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -99,8 +99,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -145,7 +145,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index f5aa312569f6..6b9d49466d1c 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -29,7 +29,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle.js b/test/js/samples/use-elements-as-anchors/expected-bundle.js index 3a3879b91e83..66a472d56d52 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -123,8 +123,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -389,7 +389,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 9e33cb6e03e9..20cf05be0c02 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -249,7 +249,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index a26fb90ce58c..5b7e8ad96c51 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -119,8 +119,8 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, intro) { + this._fragment[intro && this._fragment.i ? 'i' : 'm'](target, anchor || null); } var proto = { @@ -198,7 +198,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index ce8a8213b64a..eb0904d9c72a 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -62,7 +62,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._mount(options.target, options.anchor); + this._mount(options.target, options.anchor, true); } } diff --git a/test/runtime/index.js b/test/runtime/index.js index 199a9a0c9ba0..1ae37afd612b 100644 --- a/test/runtime/index.js +++ b/test/runtime/index.js @@ -72,6 +72,7 @@ describe("runtime", () => { compileOptions.dev = config.dev; compileOptions.store = !!config.store; compileOptions.immutable = config.immutable; + compileOptions.skipIntroByDefault = config.skipIntroByDefault; Object.keys(require.cache) .filter(x => x.endsWith(".html")) @@ -134,7 +135,8 @@ describe("runtime", () => { target, hydrate, data: config.data, - store: (config.store !== true && config.store) + store: (config.store !== true && config.store), + intro: config.intro }, config.options || {}); const component = new SvelteComponent(options); diff --git a/test/runtime/samples/transition-js-initial/_config.js b/test/runtime/samples/transition-js-initial/_config.js index f6501ed9202b..752780d6f0b4 100644 --- a/test/runtime/samples/transition-js-initial/_config.js +++ b/test/runtime/samples/transition-js-initial/_config.js @@ -1,11 +1,9 @@ export default { - test ( assert, component, target, window, raf ) { - const div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + test(assert, component, target, window, raf) { + const div = target.querySelector('div'); + assert.equal(div.foo, 0); raf.tick(50); - assert.equal( div.foo, 0.5 ); - - component.destroy(); + assert.equal(div.foo, 0.5); } -}; \ No newline at end of file +}; diff --git a/test/runtime/samples/transition-js-initial/main.html b/test/runtime/samples/transition-js-initial/main.html index 13ffdc40a8dc..16ced20bc3be 100644 --- a/test/runtime/samples/transition-js-initial/main.html +++ b/test/runtime/samples/transition-js-initial/main.html @@ -3,7 +3,7 @@ \ No newline at end of file diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js new file mode 100644 index 000000000000..9e63e6c8f731 --- /dev/null +++ b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js @@ -0,0 +1,11 @@ +export default { + skipIntroByDefault: true, + + test(assert, component, target, window, raf) { + const div = target.querySelector('div'); + assert.equal(div.foo, undefined); + + raf.tick(50); + assert.equal(div.foo, undefined); + }, +}; diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/main.html b/test/runtime/samples/transition-js-intro-skipped-by-default/main.html new file mode 100644 index 000000000000..16ced20bc3be --- /dev/null +++ b/test/runtime/samples/transition-js-intro-skipped-by-default/main.html @@ -0,0 +1,16 @@ +
+ + \ No newline at end of file