From 44bb2da29b10a120ff183aae58e232ac330549cf Mon Sep 17 00:00:00 2001 From: Rich Harris <richard.a.harris@gmail.com> Date: Sat, 12 May 2018 12:11:46 -0400 Subject: [PATCH] add skipIntroByDefault compiler option (#547) --- src/compile/dom/index.ts | 4 ++-- src/compile/nodes/Component.ts | 8 ++++---- src/interfaces.ts | 3 +++ src/shared/index.js | 4 ++-- test/cli/samples/basic/expected/Main.js | 8 ++++---- test/cli/samples/custom-element/expected/Main.js | 8 ++++---- test/cli/samples/dev/expected/Main.js | 8 ++++---- test/cli/samples/dir-sourcemap/expected/Main.js | 10 +++++----- .../cli/samples/dir-sourcemap/expected/Widget.js | 8 ++++---- test/cli/samples/dir-subdir/expected/Main.js | 10 +++++----- .../samples/dir-subdir/expected/widget/Widget.js | 8 ++++---- test/cli/samples/dir/expected/Main.js | 10 +++++----- test/cli/samples/dir/expected/Widget.js | 8 ++++---- test/cli/samples/globals/expected/Main.js | 8 ++++---- .../samples/sourcemap-inline/expected/Main.js | 8 ++++---- test/cli/samples/sourcemap/expected/Main.js | 8 ++++---- test/cli/samples/store/expected/Main.js | 8 ++++---- test/js/samples/action/expected-bundle.js | 6 +++--- test/js/samples/action/expected.js | 2 +- .../samples/bind-width-height/expected-bundle.js | 6 +++--- test/js/samples/bind-width-height/expected.js | 2 +- .../expected-bundle.js | 6 +++--- .../collapses-text-around-comments/expected.js | 2 +- .../component-static-array/expected-bundle.js | 8 ++++---- .../samples/component-static-array/expected.js | 4 ++-- .../expected-bundle.js | 8 ++++---- .../component-static-immutable/expected.js | 4 ++-- .../expected-bundle.js | 8 ++++---- .../component-static-immutable2/expected.js | 4 ++-- .../samples/component-static/expected-bundle.js | 8 ++++---- test/js/samples/component-static/expected.js | 4 ++-- .../computed-collapsed-if/expected-bundle.js | 6 +++--- .../js/samples/computed-collapsed-if/expected.js | 2 +- .../samples/css-media-query/expected-bundle.js | 6 +++--- test/js/samples/css-media-query/expected.js | 2 +- .../css-shadow-dom-keyframes/expected-bundle.js | 6 +++--- .../samples/css-shadow-dom-keyframes/expected.js | 2 +- .../deconflict-builtins/expected-bundle.js | 6 +++--- test/js/samples/deconflict-builtins/expected.js | 2 +- .../deconflict-globals/expected-bundle.js | 6 +++--- test/js/samples/deconflict-globals/expected.js | 2 +- .../expected-bundle.js | 6 +++--- .../expected.js | 2 +- .../js/samples/do-use-dataset/expected-bundle.js | 6 +++--- test/js/samples/do-use-dataset/expected.js | 2 +- .../expected-bundle.js | 6 +++--- .../dont-use-dataset-in-legacy/expected.js | 2 +- .../dont-use-dataset-in-svg/expected-bundle.js | 6 +++--- .../samples/dont-use-dataset-in-svg/expected.js | 2 +- .../each-block-changed-check/expected-bundle.js | 6 +++--- .../samples/each-block-changed-check/expected.js | 2 +- .../event-handlers-custom/expected-bundle.js | 6 +++--- .../js/samples/event-handlers-custom/expected.js | 2 +- .../head-no-whitespace/expected-bundle.js | 6 +++--- test/js/samples/head-no-whitespace/expected.js | 2 +- .../if-block-no-update/expected-bundle.js | 6 +++--- test/js/samples/if-block-no-update/expected.js | 2 +- .../samples/if-block-simple/expected-bundle.js | 6 +++--- test/js/samples/if-block-simple/expected.js | 2 +- .../expected-bundle.js | 6 +++--- .../inline-style-optimized-multiple/expected.js | 2 +- .../expected-bundle.js | 6 +++--- .../inline-style-optimized-url/expected.js | 2 +- .../inline-style-optimized/expected-bundle.js | 6 +++--- .../samples/inline-style-optimized/expected.js | 2 +- .../inline-style-unoptimized/expected-bundle.js | 6 +++--- .../samples/inline-style-unoptimized/expected.js | 2 +- test/js/samples/input-range/expected-bundle.js | 6 +++--- test/js/samples/input-range/expected.js | 2 +- .../expected-bundle.js | 6 +++--- .../input-without-blowback-guard/expected.js | 2 +- .../samples/legacy-input-type/expected-bundle.js | 6 +++--- test/js/samples/legacy-input-type/expected.js | 2 +- .../js/samples/media-bindings/expected-bundle.js | 6 +++--- test/js/samples/media-bindings/expected.js | 2 +- .../non-imported-component/expected-bundle.js | 10 +++++----- .../samples/non-imported-component/expected.js | 6 +++--- test/js/samples/setup-method/expected-bundle.js | 6 +++--- test/js/samples/setup-method/expected.js | 2 +- test/js/samples/svg-title/expected-bundle.js | 6 +++--- test/js/samples/svg-title/expected.js | 2 +- test/js/samples/title/expected-bundle.js | 6 +++--- test/js/samples/title/expected.js | 2 +- .../use-elements-as-anchors/expected-bundle.js | 6 +++--- .../samples/use-elements-as-anchors/expected.js | 2 +- .../window-binding-scroll/expected-bundle.js | 6 +++--- .../js/samples/window-binding-scroll/expected.js | 2 +- test/runtime/index.js | 4 +++- .../samples/transition-js-initial/_config.js | 12 +++++------- .../samples/transition-js-initial/main.html | 2 +- .../_config.js | 12 ++++++++++++ .../main.html | 16 ++++++++++++++++ .../_config.js | 11 +++++++++++ .../main.html | 16 ++++++++++++++++ 94 files changed, 282 insertions(+), 224 deletions(-) create mode 100644 test/runtime/samples/transition-js-intro-enabled-by-option/_config.js create mode 100644 test/runtime/samples/transition-js-intro-enabled-by-option/main.html create mode 100644 test/runtime/samples/transition-js-intro-skipped-by-default/_config.js create mode 100644 test/runtime/samples/transition-js-intro-skipped-by-default/main.html diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts index e9e27980bb..35a6ca1711 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 e25703dd2e..9b14a29452 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 773a93b37f..1a5c356404 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 cf82282ad8..e1d7fda5e9 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 dce010fb4c..b4b737bb76 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 d1b96c9899..6fcf0aa394 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 a2da6346b6..9c8394917c 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 b4a005c0ac..ccedf5a18a 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 28223fdd1c..702f6ee812 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 1a595e80dd..c43c922220 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 7ab7e73f96..df8b286b29 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 43ff753eca..501d7d8e9f 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 9c62194627..ad7f1ce7ed 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 968eb228fe..72daf778fb 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 3da16e1a57..b357420353 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 b44a4b2f27..14c1518dd0 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 320a159497..45ea6ea814 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 49e0372582..8828faba13 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 f92f3723fe..dab9d0d9db 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 371f3d2843..11a932ee3f 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 8d9b432ef0..12eb1e8c37 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 302c1c3aaf..a8a0b6f76b 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 75d00262c0..78e957933f 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 871a50c7cc..24e739c61a 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 f07b2d8ed3..667fa7f486 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 93a558f4ac..f272d7e11a 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 c18720c54a..877cbd5eda 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 93a558f4ac..f272d7e11a 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 c18720c54a..877cbd5eda 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 bf7121708a..04bd0982b5 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 2062324182..631d2e7814 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 1a44c576c5..c405221365 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 8ca8d597ee..05f6ae2bff 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 446ff23202..0c864a18ec 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 b307708cb3..9b8c88b3ef 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 86bef96e53..8277f96654 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 e86d8a3cb3..085cccb8d7 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 effd1571f6..4767d5ccec 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 8ae4b5dc3e..50a8aa2b43 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 06e30f87bc..9983368542 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 afac48dfbd..f19fe3af9c 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 bb93b05841..0d93b49f8f 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 5efb1f0a5e..7ef01fe796 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 e30355de25..056964765d 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 a57edb8483..4d3773a37a 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 3cbc5ca530..dd7e111725 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 1475687e2d..266cc25e96 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 80e1f60366..810683ae14 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 42bc11876e..359de3a16c 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 2c2c8838da..fb82c1ef93 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 609556bae0..82c588c939 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 10715bd84c..661c52fcf4 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 86741c470c..3e8b5b528b 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 539ea3e5a4..a39755bdd5 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 58b3f0e311..3be9e79389 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 d54a62c227..54712a5395 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 6bed171850..f6a3f03c03 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 9a067201fb..1d1d2088ed 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 98458d918f..d35299a94d 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 13da6e5fc0..cad82c33ca 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 742da2b3d9..0be17478ef 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 f27fd1f154..250878e4d7 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 2eb51e0818..d31dec9c81 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 1df7465c86..ec403776a7 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 9c55bc6e84..a4f7da5545 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 ed8e4fd01c..cba4485979 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 41ffd501e0..b0a1f77b66 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 048c9e088f..3df312e184 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 0899036bac..4468c4c92d 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 67915bc81b..265fc37de5 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 635987f16b..9b74212e68 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 9f806ed42a..69238bd3a0 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 2e1c279b20..bbdf477d49 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 fbb235a80d..0d6da357e1 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 f2400877e2..0496627968 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 bfab868082..04347d853a 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 c070fa76d4..cb22b97040 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 30d69d6180..d2801647e5 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 855e7635b0..0dc82648fb 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 faf86f14cb..28f5220935 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 96a1ea09d1..b5f7caf198 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 1c4fd5e84f..bd918afa0d 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 f5aa312569..6b9d49466d 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 3a3879b91e..66a472d56d 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 9e33cb6e03..20cf05be0c 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 a26fb90ce5..5b7e8ad96c 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 ce8a8213b6..eb0904d9c7 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 199a9a0c9b..1ae37afd61 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 f6501ed920..752780d6f0 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 13ffdc40a8..16ced20bc3 100644 --- a/test/runtime/samples/transition-js-initial/main.html +++ b/test/runtime/samples/transition-js-initial/main.html @@ -3,7 +3,7 @@ <script> export default { transitions: { - foo: function ( node, params ) { + foo(node, params) { return { duration: 100, tick: t => { diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js new file mode 100644 index 0000000000..f3124450dc --- /dev/null +++ b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js @@ -0,0 +1,12 @@ +export default { + skipIntroByDefault: true, + intro: true, + + 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); + }, +}; diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/main.html b/test/runtime/samples/transition-js-intro-enabled-by-option/main.html new file mode 100644 index 0000000000..16ced20bc3 --- /dev/null +++ b/test/runtime/samples/transition-js-intro-enabled-by-option/main.html @@ -0,0 +1,16 @@ +<div transition:foo></div> + +<script> + export default { + transitions: { + foo(node, params) { + return { + duration: 100, + tick: t => { + node.foo = t; + } + }; + } + } + }; +</script> \ 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 0000000000..9e63e6c8f7 --- /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 0000000000..16ced20bc3 --- /dev/null +++ b/test/runtime/samples/transition-js-intro-skipped-by-default/main.html @@ -0,0 +1,16 @@ +<div transition:foo></div> + +<script> + export default { + transitions: { + foo(node, params) { + return { + duration: 100, + tick: t => { + node.foo = t; + } + }; + } + } + }; +</script> \ No newline at end of file