diff --git a/src/compile/dom/Block.ts b/src/compile/dom/Block.ts index ca3984b5d7..0ac3fc1bdc 100644 --- a/src/compile/dom/Block.ts +++ b/src/compile/dom/Block.ts @@ -241,7 +241,7 @@ export default class Block { properties.addBlock(`m: @noop,`); } else { properties.addBlock(deindent` - ${dev ? 'm: function mount' : 'm'}(#target, anchor) { + ${dev ? 'm: function mount' : 'm'}(#target, anchor${this.compiler.options.containedTransitions ? ', skipIntro' : ''}) { ${this.builders.mount} }, `); diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts index 79645f4081..140476aece 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${compiler.options.containedTransitions && ', !options.intro'}); ` : deindent` if (options.target) { ${compiler.options.hydratable @@ -239,7 +239,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${compiler.options.containedTransitions && ', !options.intro'}); ${(compiler.hasComponents || target.hasComplexBindings || hasInitHooks || target.hasIntroTransitions) && `@flush(this);`} diff --git a/src/compile/nodes/AwaitBlock.ts b/src/compile/nodes/AwaitBlock.ts index 4897adcd59..d679376485 100644 --- a/src/compile/nodes/AwaitBlock.ts +++ b/src/compile/nodes/AwaitBlock.ts @@ -172,15 +172,19 @@ export default class AwaitBlock extends Node { } if (this.pending.block.hasOutroMethod && this.compiler.options.nestedTransitions) { - const countdown = block.getUniqueName('countdown'); - block.builders.outro.addBlock(deindent` - const ${countdown} = @callAfter(#outrocallback, 3); - for (let #i = 0; #i < 3; #i += 1) { - const block = ${info}.blocks[#i]; - if (block) block.o(${countdown}); - else ${countdown}(); - } - `); + if (this.compiler.options.containedTransitions) { + block.builders.outro.addLine('#outrocallback();'); + } else { + const countdown = block.getUniqueName('countdown'); + block.builders.outro.addBlock(deindent` + const ${countdown} = @callAfter(#outrocallback, 3); + for (let #i = 0; #i < 3; #i += 1) { + const block = ${info}.blocks[#i]; + if (block) block.o(${countdown}); + else ${countdown}(); + } + `); + } } block.builders.destroy.addBlock(deindent` diff --git a/src/compile/nodes/Component.ts b/src/compile/nodes/Component.ts index 526af029c8..36e04fa65d 100644 --- a/src/compile/nodes/Component.ts +++ b/src/compile/nodes/Component.ts @@ -386,7 +386,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.containedTransitions ? ', skipIntro' : ''}); ${this.ref && `#component.refs.${this.ref} = ${name};`} } `); @@ -486,7 +486,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.containedTransitions ? ', skipIntro' : ''});` ); if (updates.length) { diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts index cae0aa7352..d4be9f614c 100644 --- a/src/compile/nodes/EachBlock.ts +++ b/src/compile/nodes/EachBlock.ts @@ -201,9 +201,13 @@ export default class EachBlock extends Node { } `); + const mountCall = compiler.options.containedTransitions + ? `m(${parentNode || '#target'}, null, true)` + : `${mountOrIntro}(${parentNode || '#target'}, null)` + block.builders.mount.addBlock(deindent` if (${each_block_else}) { - ${each_block_else}.${mountOrIntro}(${parentNode || '#target'}, null); + ${each_block_else}.${mountCall}; } `); @@ -309,8 +313,12 @@ export default class EachBlock extends Node { `); } + const mountCall = this.compiler.options.containedTransitions + ? `m(${initialMountNode}, ${anchorNode}, true)` + : `${mountOrIntro}(${initialMountNode}, ${anchorNode})`; + block.builders.mount.addBlock(deindent` - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].${mountOrIntro}(${initialMountNode}, ${anchorNode}); + for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].${mountCall}; `); const dynamic = this.block.hasUpdateMethod; @@ -332,11 +340,15 @@ export default class EachBlock extends Node { `); if (this.compiler.options.nestedTransitions) { - const countdown = block.getUniqueName('countdown'); - block.builders.outro.addBlock(deindent` - const ${countdown} = @callAfter(#outrocallback, ${blocks}.length); - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].o(${countdown}); - `); + if (this.compiler.options.containedTransitions) { + block.builders.outro.addLine('#outrocallback();'); + } else { + const countdown = block.getUniqueName('countdown'); + block.builders.outro.addBlock(deindent` + const ${countdown} = @callAfter(#outrocallback, ${blocks}.length); + for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].o(${countdown}); + `); + } } block.builders.destroy.addBlock(deindent` @@ -383,9 +395,13 @@ export default class EachBlock extends Node { `); } + const mountCall = this.compiler.options.containedTransitions + ? `m(${initialMountNode}, ${anchorNode}, true)` + : `${mountOrIntro}(${initialMountNode}, ${anchorNode})`; + block.builders.mount.addBlock(deindent` for (var #i = 0; #i < ${iterations}.length; #i += 1) { - ${iterations}[#i].${mountOrIntro}(${initialMountNode}, ${anchorNode}); + ${iterations}[#i].${mountCall}; } `); @@ -478,11 +494,15 @@ export default class EachBlock extends Node { } if (outroBlock && this.compiler.options.nestedTransitions) { - const countdown = block.getUniqueName('countdown'); - block.builders.outro.addBlock(deindent` - const ${countdown} = @callAfter(#outrocallback, ${iterations}.length); - for (let #i = 0; #i < ${iterations}.length; #i += 1) ${outroBlock}(#i, 0, ${countdown});` - ); + if (this.compiler.options.containedTransitions) { + block.builders.outro.addLine('#outrocallback();'); + } else { + const countdown = block.getUniqueName('countdown'); + block.builders.outro.addBlock(deindent` + const ${countdown} = @callAfter(#outrocallback, ${iterations}.length); + for (let #i = 0; #i < ${iterations}.length; #i += 1) ${outroBlock}(#i, 0, ${countdown});` + ); + } } block.builders.destroy.addBlock(`@destroyEach(${iterations}, detach);`); diff --git a/src/compile/nodes/IfBlock.ts b/src/compile/nodes/IfBlock.ts index eef654b90b..e91398322d 100644 --- a/src/compile/nodes/IfBlock.ts +++ b/src/compile/nodes/IfBlock.ts @@ -139,10 +139,14 @@ export default class IfBlock extends Node { this.buildCompoundWithOutros(block, parentNode, parentNodes, branches, dynamic, vars); if (this.compiler.options.nestedTransitions) { - block.builders.outro.addBlock(deindent` - if (${name}) ${name}.o(#outrocallback); - else #outrocallback(); - `); + if (this.compiler.options.containedTransitions) { + block.builders.outro.addLine('#outrocallback();'); + } else { + block.builders.outro.addBlock(deindent` + if (${name}) ${name}.o(#outrocallback); + else #outrocallback(); + `); + } } } else { this.buildCompound(block, parentNode, parentNodes, branches, dynamic, vars); @@ -151,10 +155,14 @@ export default class IfBlock extends Node { this.buildSimple(block, parentNode, parentNodes, branches[0], dynamic, vars); if (hasOutros && this.compiler.options.nestedTransitions) { - block.builders.outro.addBlock(deindent` - if (${name}) ${name}.o(#outrocallback); - else #outrocallback(); - `); + if (this.compiler.options.containedTransitions) { + block.builders.outro.addLine('#outrocallback();'); + } else { + block.builders.outro.addBlock(deindent` + if (${name}) ${name}.o(#outrocallback); + else #outrocallback(); + `); + } } } @@ -205,8 +213,11 @@ export default class IfBlock extends Node { const initialMountNode = parentNode || '#target'; const anchorNode = parentNode ? 'null' : 'anchor'; + const mountCall = this.compiler.options.containedTransitions + ? `m(${initialMountNode}, ${anchorNode}, true)` + : `${mountOrIntro}(${initialMountNode}, ${anchorNode})`; block.builders.mount.addLine( - `${if_name}${name}.${mountOrIntro}(${initialMountNode}, ${anchorNode});` + `${if_name}${name}.${mountCall};` ); const updateMountNode = this.getUpdateMountNode(anchor); @@ -290,9 +301,12 @@ export default class IfBlock extends Node { const mountOrIntro = branches[0].hasIntroMethod ? 'i' : 'm'; const initialMountNode = parentNode || '#target'; const anchorNode = parentNode ? 'null' : 'anchor'; + const mountCall = this.compiler.options.containedTransitions + ? `m(${initialMountNode}, ${anchorNode}, true)` + : `${mountOrIntro}(${initialMountNode}, ${anchorNode})`; block.builders.mount.addLine( - `${if_current_block_type_index}${if_blocks}[${current_block_type_index}].${mountOrIntro}(${initialMountNode}, ${anchorNode});` + `${if_current_block_type_index}${if_blocks}[${current_block_type_index}].${mountCall};` ); const updateMountNode = this.getUpdateMountNode(anchor); @@ -372,9 +386,12 @@ export default class IfBlock extends Node { const mountOrIntro = branch.hasIntroMethod ? 'i' : 'm'; const initialMountNode = parentNode || '#target'; const anchorNode = parentNode ? 'null' : 'anchor'; + const mountCall = this.compiler.options.containedTransitions + ? `m(${initialMountNode}, ${anchorNode}, true)` + : `${mountOrIntro}(${initialMountNode}, ${anchorNode})`; block.builders.mount.addLine( - `if (${name}) ${name}.${mountOrIntro}(${initialMountNode}, ${anchorNode});` + `if (${name}) ${name}.${mountCall};` ); const updateMountNode = this.getUpdateMountNode(anchor); diff --git a/src/interfaces.ts b/src/interfaces.ts index a30a67a91f..5cd7dd46bb 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -65,6 +65,8 @@ export interface CompileOptions { onerror?: (error: Error) => void; onwarn?: (warning: Warning) => void; + containedTransitions?: boolean; + // to remove in v3 skipIntroByDefault?: boolean; nestedTransitions: boolean; diff --git a/src/shared/index.js b/src/shared/index.js index 898e816beb..874eab1355 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -139,8 +139,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } export var PENDING = {}; diff --git a/test/cli/samples/amd/expected/Main.js b/test/cli/samples/amd/expected/Main.js index 35f4b57186..16c884e32f 100644 --- a/test/cli/samples/amd/expected/Main.js +++ b/test/cli/samples/amd/expected/Main.js @@ -156,8 +156,8 @@ define("test", function() { "use strict"; } } - function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); + function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/basic/expected/Main.js b/test/cli/samples/basic/expected/Main.js index 7d24fd3862..65618e7541 100644 --- a/test/cli/samples/basic/expected/Main.js +++ b/test/cli/samples/basic/expected/Main.js @@ -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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } 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 1d34cc12a6..2cfebf1382 100644 --- a/test/cli/samples/custom-element/expected/Main.js +++ b/test/cli/samples/custom-element/expected/Main.js @@ -177,8 +177,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/dev/expected/Main.js b/test/cli/samples/dev/expected/Main.js index e32ea9a61e..51d6c0e8c3 100644 --- a/test/cli/samples/dev/expected/Main.js +++ b/test/cli/samples/dev/expected/Main.js @@ -182,8 +182,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } 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 884f11d1d3..5a1c3815f7 100644 --- a/test/cli/samples/dir-sourcemap/expected/Main.js +++ b/test/cli/samples/dir-sourcemap/expected/Main.js @@ -158,8 +158,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } 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 99c6e08a0e..abaaee50ca 100644 --- a/test/cli/samples/dir-sourcemap/expected/Widget.js +++ b/test/cli/samples/dir-sourcemap/expected/Widget.js @@ -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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } 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 4b1803f5fc..3ef90ebe96 100644 --- a/test/cli/samples/dir-subdir/expected/Main.js +++ b/test/cli/samples/dir-subdir/expected/Main.js @@ -158,8 +158,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } 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 5c6241e320..647e3f0b97 100644 --- a/test/cli/samples/dir-subdir/expected/widget/Widget.js +++ b/test/cli/samples/dir-subdir/expected/widget/Widget.js @@ -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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/dir/expected/Main.js b/test/cli/samples/dir/expected/Main.js index dc82848d2e..d265f72093 100644 --- a/test/cli/samples/dir/expected/Main.js +++ b/test/cli/samples/dir/expected/Main.js @@ -158,8 +158,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/dir/expected/Widget.js b/test/cli/samples/dir/expected/Widget.js index 2896558acc..ca0379d41e 100644 --- a/test/cli/samples/dir/expected/Widget.js +++ b/test/cli/samples/dir/expected/Widget.js @@ -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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/globals/expected/Main.js b/test/cli/samples/globals/expected/Main.js index 62d5a02694..5b92ba3b98 100644 --- a/test/cli/samples/globals/expected/Main.js +++ b/test/cli/samples/globals/expected/Main.js @@ -181,8 +181,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } 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 f4cbc7d8df..a5501d3c20 100644 --- a/test/cli/samples/sourcemap-inline/expected/Main.js +++ b/test/cli/samples/sourcemap-inline/expected/Main.js @@ -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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/sourcemap/expected/Main.js b/test/cli/samples/sourcemap/expected/Main.js index 43ee0b6b7f..9a8365426a 100644 --- a/test/cli/samples/sourcemap/expected/Main.js +++ b/test/cli/samples/sourcemap/expected/Main.js @@ -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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/cli/samples/store/expected/Main.js b/test/cli/samples/store/expected/Main.js index e3beb9d80f..e54ad218bb 100644 --- a/test/cli/samples/store/expected/Main.js +++ b/test/cli/samples/store/expected/Main.js @@ -180,8 +180,8 @@ function _set(newState) { } } -function _mount(target, anchor) { - this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); +function _mount(target, anchor, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } function _differs(a, b) { diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index 7d62bef134..8b79acc8d0 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -125,8 +125,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { @@ -144,7 +144,7 @@ var proto = { /* generated by Svelte vX.Y.Z */ function link(node) { - + function onClick(event) { event.preventDefault(); history.pushState(null, null, event.target.href); diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index fab6e6a2b6..2c173d0133 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -2,7 +2,7 @@ import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; function link(node) { - + function onClick(event) { event.preventDefault(); history.pushState(null, null, event.target.href); diff --git a/test/js/samples/bind-width-height/expected-bundle.js b/test/js/samples/bind-width-height/expected-bundle.js index f0232218ac..a5c07c03ee 100644 --- a/test/js/samples/bind-width-height/expected-bundle.js +++ b/test/js/samples/bind-width-height/expected-bundle.js @@ -157,8 +157,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 58f2fbb09c..4db7513792 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/component-static-array/expected-bundle.js b/test/js/samples/component-static-array/expected-bundle.js index 3bbb1ede27..cea7dbc356 100644 --- a/test/js/samples/component-static-array/expected-bundle.js +++ b/test/js/samples/component-static-array/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index 98f6b26fec..1c343f931a 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index 98f6b26fec..1c343f931a 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index 4c394bba1d..9c5788665f 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 94cb7c3ef3..3419fc3180 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 703ef5f6c0..da790bc326 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 0bb956d285..64c6d4ebd5 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -125,8 +125,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/debug-empty/expected-bundle.js b/test/js/samples/debug-empty/expected-bundle.js index 0faf822be3..85b85c6a20 100644 --- a/test/js/samples/debug-empty/expected-bundle.js +++ b/test/js/samples/debug-empty/expected-bundle.js @@ -161,8 +161,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var protoDev = { diff --git a/test/js/samples/debug-foo-bar-baz-things/expected-bundle.js b/test/js/samples/debug-foo-bar-baz-things/expected-bundle.js index 521d57af5b..9cc64d8c52 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected-bundle.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected-bundle.js @@ -167,8 +167,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var protoDev = { diff --git a/test/js/samples/debug-foo/expected-bundle.js b/test/js/samples/debug-foo/expected-bundle.js index 5cc1c7a469..4dd1edb7a9 100644 --- a/test/js/samples/debug-foo/expected-bundle.js +++ b/test/js/samples/debug-foo/expected-bundle.js @@ -167,8 +167,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var protoDev = { diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index eae32e976c..c5ab9d9841 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -147,8 +147,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 28b8d1f46b..b36a3d4c37 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -118,8 +118,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 73fdae3223..25d05775cd 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 @@ -161,8 +161,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var protoDev = { diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index d981b929a7..3c0f9e2785 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 3be0e2a270..15ae22ff5c 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 @@ -133,8 +133,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 5b73e51762..0fdc6184c7 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 @@ -133,8 +133,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 ce97c56af5..00a194ac40 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -149,8 +149,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/each-block-keyed-animated/expected-bundle.js b/test/js/samples/each-block-keyed-animated/expected-bundle.js index 1cfdf681f0..c5293b6af2 100644 --- a/test/js/samples/each-block-keyed-animated/expected-bundle.js +++ b/test/js/samples/each-block-keyed-animated/expected-bundle.js @@ -452,8 +452,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/each-block-keyed/expected-bundle.js b/test/js/samples/each-block-keyed/expected-bundle.js index 1cc34f4455..984f6322df 100644 --- a/test/js/samples/each-block-keyed/expected-bundle.js +++ b/test/js/samples/each-block-keyed/expected-bundle.js @@ -232,8 +232,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 23327a276a..afb66668aa 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -125,8 +125,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index 91eaa6cd5b..faf6b5b41a 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -125,8 +125,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 83c3f60db0..f03713dde3 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 24b9e526cd..13802674b1 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 78e6cc7e40..01b4f8e1d2 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 9fd8e681a6..32fa122bcc 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index d8f9b7d7d2..a31301ad89 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index b46055315e..2d481b8b74 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/input-files/expected-bundle.js b/test/js/samples/input-files/expected-bundle.js index b3218c7fd4..ad7cb603ec 100644 --- a/test/js/samples/input-files/expected-bundle.js +++ b/test/js/samples/input-files/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/input-range/expected-bundle.js b/test/js/samples/input-range/expected-bundle.js index 2f53e740ea..cf74308a82 100644 --- a/test/js/samples/input-range/expected-bundle.js +++ b/test/js/samples/input-range/expected-bundle.js @@ -141,8 +141,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 b5f7a90f8c..387b5994b6 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index cd841f8a2d..053cc85280 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index d9f961f564..94f7de5635 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -141,8 +141,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index b890d8bed5..97a0fb5d6f 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/select-dynamic-value/expected-bundle.js b/test/js/samples/select-dynamic-value/expected-bundle.js index 1230856164..235d455c87 100644 --- a/test/js/samples/select-dynamic-value/expected-bundle.js +++ b/test/js/samples/select-dynamic-value/expected-bundle.js @@ -133,8 +133,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index fa63c78502..3d27a6cffa 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 269f6ca1f3..9e2f0750fe 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -133,8 +133,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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index f0afba9d24..0dd18e7258 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { 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 4065ba55ad..565bee1a3f 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index 7823390a2c..824e0e3132 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/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, skipIntro) { + this._fragment[!skipIntro && this._fragment.i ? 'i' : 'm'](target, anchor || null, skipIntro); } var proto = { diff --git a/test/runtime/index.js b/test/runtime/index.js index c59aa72d54..5403fb9d65 100644 --- a/test/runtime/index.js +++ b/test/runtime/index.js @@ -74,6 +74,7 @@ describe("runtime", () => { compileOptions.immutable = config.immutable; compileOptions.skipIntroByDefault = config.skipIntroByDefault; compileOptions.nestedTransitions = config.nestedTransitions; + compileOptions.containedTransitions = config.containedTransitions; Object.keys(require.cache) .filter(x => x.endsWith(".html")) diff --git a/test/runtime/samples/contained-transition-js-nested-await/_config.js b/test/runtime/samples/contained-transition-js-nested-await/_config.js new file mode 100644 index 0000000000..3fdd0d482c --- /dev/null +++ b/test/runtime/samples/contained-transition-js-nested-await/_config.js @@ -0,0 +1,34 @@ +let fulfil; + +const promise = new Promise(f => { + fulfil = f; +}); + +export default { + containedTransitions: true, + nestedTransitions: true, + + data: { + x: false, + promise + }, + + test(assert, component, target, window, raf) { + component.set({ x: true }); + fulfil(); + + return promise.then(() => { + const div = target.querySelector('div'); + assert.equal(div.foo, 0); + + raf.tick(100); + assert.equal(div.foo, 1); + + component.set({ x: false }); + assert.htmlEqual(target.innerHTML, ''); + + raf.tick(150); + assert.equal(div.foo, 1); + }); + } +}; diff --git a/test/runtime/samples/contained-transition-js-nested-await/main.html b/test/runtime/samples/contained-transition-js-nested-await/main.html new file mode 100644 index 0000000000..039051a8bd --- /dev/null +++ b/test/runtime/samples/contained-transition-js-nested-await/main.html @@ -0,0 +1,20 @@ +{#if x} + {#await promise then value} +
+ {/await} +{/if} + + \ No newline at end of file diff --git a/test/runtime/samples/contained-transition-js-nested-component/Widget.html b/test/runtime/samples/contained-transition-js-nested-component/Widget.html new file mode 100644 index 0000000000..16ced20bc3 --- /dev/null +++ b/test/runtime/samples/contained-transition-js-nested-component/Widget.html @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/contained-transition-js-nested-component/_config.js b/test/runtime/samples/contained-transition-js-nested-component/_config.js new file mode 100644 index 0000000000..763fda57f4 --- /dev/null +++ b/test/runtime/samples/contained-transition-js-nested-component/_config.js @@ -0,0 +1,27 @@ +export default { + containedTransitions: true, + nestedTransitions: true, + + data: { + x: false + }, + + test(assert, component, target, window, raf) { + component.set({ x: true }); + + const div = target.querySelector('div'); + assert.equal(div.foo, 0); + + raf.tick(100); + assert.equal(div.foo, 1); + + component.set({ x: false }); + assert.htmlEqual(target.innerHTML, ''); + + raf.tick(150); + assert.equal(div.foo, 0.5); + + raf.tick(200); + assert.htmlEqual(target.innerHTML, ''); + } +}; diff --git a/test/runtime/samples/contained-transition-js-nested-component/main.html b/test/runtime/samples/contained-transition-js-nested-component/main.html new file mode 100644 index 0000000000..2930f4dc16 --- /dev/null +++ b/test/runtime/samples/contained-transition-js-nested-component/main.html @@ -0,0 +1,13 @@ +{#if x} +