diff --git a/src/compile/dom/Block.ts b/src/compile/dom/Block.ts
index 4e88d27a18..6730d416b0 100644
--- a/src/compile/dom/Block.ts
+++ b/src/compile/dom/Block.ts
@@ -5,6 +5,7 @@ import Compiler from '../Compiler';
import { Node } from '../../interfaces';
export interface BlockOptions {
+ parent?: Block;
name: string;
compiler?: Compiler;
comment?: string;
@@ -14,6 +15,7 @@ export interface BlockOptions {
}
export default class Block {
+ parent?: Block;
compiler: Compiler;
name: string;
comment?: string;
@@ -50,6 +52,7 @@ export default class Block {
autofocus: string;
constructor(options: BlockOptions) {
+ this.parent = options.parent;
this.compiler = options.compiler;
this.name = options.name;
this.comment = options.comment;
@@ -115,6 +118,15 @@ export default class Block {
}
}
+ addIntro() {
+ this.hasIntroMethod = this.compiler.target.hasIntroTransitions = true;
+ }
+
+ addOutro() {
+ this.hasOutroMethod = this.compiler.target.hasOutroTransitions = true;
+ this.outros += 1;
+ }
+
addVariable(name: string, init?: string) {
if (this.variables.has(name) && this.variables.get(name) !== init) {
throw new Error(
@@ -246,11 +258,15 @@ export default class Block {
},
`);
} else {
- properties.addBlock(deindent`
- ${dev ? 'i: function intro' : 'i'}(#target, anchor) {
- this.m(#target, anchor);
- },
- `);
+ if (this.builders.mount.isEmpty()) {
+ properties.addBlock(`i: @noop,`);
+ } else {
+ properties.addBlock(deindent`
+ ${dev ? 'i: function intro' : 'i'}(#target, anchor) {
+ this.m(#target, anchor);
+ },
+ `);
+ }
}
if (hasOutros) {
@@ -260,7 +276,7 @@ export default class Block {
${outroing} = true;
${hasIntros && `${introing} = false;`}
- ${this.outros > 1 && `var #outros = ${this.outros};`}
+ ${this.outros > 1 && `#outrocallback = @callAfter(#outrocallback, ${this.outros});`}
${this.builders.outro}
},
diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts
index 35a6ca1711..4a70ed06ca 100644
--- a/src/compile/dom/index.ts
+++ b/src/compile/dom/index.ts
@@ -182,6 +182,7 @@ export default function dom(
})}
${compiler.bindingGroups.length &&
`this._bindingGroups = [${Array(compiler.bindingGroups.length).fill('[]').join(', ')}];`}
+ this._intro = ${compiler.options.skipIntroByDefault ? 'options.intro' : 'true'};
${templateProperties.onstate && `this._handlers.state = [%onstate];`}
${templateProperties.onupdate && `this._handlers.update = [%onupdate];`}
@@ -251,6 +252,8 @@ export default function dom(
`}
}
`}
+
+ ${compiler.options.skipIntroByDefault && `this._intro = true;`}
`;
if (compiler.customElement) {
diff --git a/src/compile/nodes/AwaitBlock.ts b/src/compile/nodes/AwaitBlock.ts
index 0d74dc608b..9a8aa51020 100644
--- a/src/compile/nodes/AwaitBlock.ts
+++ b/src/compile/nodes/AwaitBlock.ts
@@ -76,6 +76,8 @@ export default class AwaitBlock extends Node {
this.pending.block.hasOutroMethod = hasOutros;
this.then.block.hasOutroMethod = hasOutros;
this.catch.block.hasOutroMethod = hasOutros;
+
+ if (hasOutros && this.compiler.options.nestedTransitions) block.addOutro();
}
build(
@@ -169,6 +171,17 @@ export default class AwaitBlock extends Node {
`);
}
+ if (this.pending.block.hasOutroMethod && this.compiler.options.nestedTransitions) {
+ block.builders.outro.addBlock(deindent`
+ #outrocallback = @callAfter(#outrocallback, 3);
+ for (let #i = 0; #i < 3; #i += 1) {
+ const block = ${info}.blocks[#i];
+ if (block) block.o(#outrocallback);
+ else #outrocallback();
+ }
+ `);
+ }
+
block.builders.destroy.addBlock(deindent`
${info}.block.d(${parentNode ? '' : 'detach'});
${info} = null;
diff --git a/src/compile/nodes/Component.ts b/src/compile/nodes/Component.ts
index 9b14a29452..6020825f4a 100644
--- a/src/compile/nodes/Component.ts
+++ b/src/compile/nodes/Component.ts
@@ -108,6 +108,10 @@ export default class Component extends Node {
child.init(block, stripWhitespace, nextSibling);
});
}
+
+ if (this.compiler.options.nestedTransitions) {
+ block.addOutro();
+ }
}
build(
@@ -383,7 +387,7 @@ export default class Component extends Node {
block.builders.mount.addBlock(deindent`
if (${name}) {
- ${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}, ${compiler.options.skipIntroByDefault ? 'false' : 'true'});
+ ${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}, ${compiler.options.skipIntroByDefault ? '#component._intro' : 'true'});
${this.ref && `#component.refs.${this.ref} = ${name};`}
}
`);
@@ -405,7 +409,7 @@ export default class Component extends Node {
${name}._fragment.c();
${this.children.map(child => child.remount(name))}
- ${name}._mount(${updateMountNode}, ${anchor}, ${compiler.options.skipIntroByDefault ? 'false' : 'true'});
+ ${name}._mount(${updateMountNode}, ${anchor}, true);
${this.handlers.map(handler => deindent`
${name}.on("${handler.name}", ${handler.var});
@@ -464,7 +468,7 @@ export default class Component extends Node {
}
block.builders.mount.addLine(
- `${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}, ${compiler.options.skipIntroByDefault ? 'false' : 'true'});`
+ `${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}, ${compiler.options.skipIntroByDefault ? '#component._intro' : 'true'});`
);
if (updates.length) {
@@ -480,10 +484,16 @@ export default class Component extends Node {
${this.ref && `if (#component.refs.${this.ref} === ${name}) #component.refs.${this.ref} = null;`}
`);
}
+
+ if (this.compiler.options.nestedTransitions) {
+ block.builders.outro.addLine(
+ `${name}._fragment.o(#outrocallback);`
+ );
+ }
}
remount(name: string) {
- return `${this.var}._mount(${name}._slotted.default, null, ${this.compiler.options.skipIntroByDefault ? 'false' : 'true'});`;
+ return `${this.var}._mount(${name}._slotted.default, null, false);`;
}
ssr() {
diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts
index 78a9e4d48c..cee550d5fe 100644
--- a/src/compile/nodes/EachBlock.ts
+++ b/src/compile/nodes/EachBlock.ts
@@ -118,6 +118,10 @@ export default class EachBlock extends Node {
);
this.else.block.hasUpdateMethod = this.else.block.dependencies.size > 0;
}
+
+ if (this.block.hasOutroMethod || (this.else && this.else.block.hasOutroMethod)) {
+ block.addOutro();
+ }
}
build(
@@ -313,9 +317,17 @@ export default class EachBlock extends Node {
block.builders.update.addBlock(deindent`
var ${this.each_block_value} = ${snippet};
+ ${this.block.hasOutroMethod && `@transitionManager.groupOutros();`}
${blocks} = @updateKeyedEach(${blocks}, #component, changed, ${get_key}, ${dynamic ? '1' : '0'}, ctx, ${this.each_block_value}, ${lookup}, ${updateMountNode}, ${String(this.block.hasOutroMethod)}, ${create_each_block}, "${mountOrIntro}", ${anchor}, ${this.get_each_context});
`);
+ if (this.compiler.options.nestedTransitions) {
+ block.builders.outro.addBlock(deindent`
+ #outrocallback = @callAfter(#outrocallback, ${blocks}.length);
+ for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].o(#outrocallback);
+ `);
+ }
+
block.builders.destroy.addBlock(deindent`
for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].d(${parentNode ? '' : 'detach'});
`);
@@ -372,6 +384,21 @@ export default class EachBlock extends Node {
allDependencies.add(dependency);
});
+ const outro = this.block.hasOutroMethod && block.getUniqueName('outro')
+ if (outro) {
+ block.builders.init.addBlock(deindent`
+ function ${outro}(i, detach, fn) {
+ if (${iterations}[i]) {
+ ${iterations}[i].o(() => {
+ ${iterations}[i].d(detach);
+ if (detach) ${iterations}[i] = null;
+ if (fn) fn();
+ });
+ }
+ }
+ `);
+ }
+
// TODO do this for keyed blocks as well
const condition = Array.from(allDependencies)
.map(dependency => `changed.${dependency}`)
@@ -406,27 +433,21 @@ export default class EachBlock extends Node {
const start = this.block.hasUpdateMethod ? '0' : `${iterations}.length`;
- const outro = block.getUniqueName('outro');
- const destroy = this.block.hasOutroMethod
- ? deindent`
- function ${outro}(i) {
- if (${iterations}[i]) {
- ${iterations}[i].o(function() {
- ${iterations}[i].d(1);
- ${iterations}[i] = null;
- });
- }
- }
+ let destroy;
+ if (this.block.hasOutroMethod) {
+ destroy = deindent`
@transitionManager.groupOutros();
- for (; #i < ${iterations}.length; #i += 1) ${outro}(#i);
- `
- : deindent`
+ for (; #i < ${iterations}.length; #i += 1) ${outro}(#i, 1);
+ `;
+ } else {
+ destroy = deindent`
for (; #i < ${iterations}.length; #i += 1) {
${iterations}[#i].d(1);
}
${iterations}.length = ${this.each_block_value}.${length};
`;
+ }
block.builders.update.addBlock(deindent`
if (${condition}) {
@@ -443,6 +464,13 @@ export default class EachBlock extends Node {
`);
}
+ if (outro && this.compiler.options.nestedTransitions) {
+ block.builders.outro.addBlock(deindent`
+ #outrocallback = @callAfter(#outrocallback, #i);
+ for (let #i = 0; #i < ${iterations}.length; #i += 1) ${outro}(#i, 0, #outrocallback);`
+ );
+ }
+
block.builders.destroy.addBlock(`@destroyEach(${iterations}, detach);`);
}
diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts
index ec166a8130..a2f12858c7 100644
--- a/src/compile/nodes/Element.ts
+++ b/src/compile/nodes/Element.ts
@@ -182,13 +182,12 @@ export default class Element extends Node {
if (this.intro) {
this.parent.cannotUseInnerHTML();
- this.compiler.target.hasIntroTransitions = block.hasIntroMethod = true;
+ block.addIntro();
}
if (this.outro) {
this.parent.cannotUseInnerHTML();
- this.compiler.target.hasOutroTransitions = block.hasOutroMethod = true;
- block.outros += 1;
+ block.addOutro();
}
if (this.ref) {
@@ -711,7 +710,7 @@ export default class Element extends Node {
block.builders.outro.addBlock(deindent`
${name}.run(0, () => {
- ${block.outros > 1 ? `if (--#outros === 0) #outrocallback();` : `#outrocallback();`}
+ #outrocallback();
${name} = null;
});
`);
@@ -758,9 +757,7 @@ export default class Element extends Node {
// group) prior to their removal from the DOM
block.builders.outro.addBlock(deindent`
${outroName} = @wrapTransition(#component, ${this.var}, ${fn}, ${snippet}, false);
- ${outroName}.run(0, () => {
- ${block.outros > 1 ? `if (--#outros === 0) #outrocallback();` : `#outrocallback();`}
- });
+ ${outroName}.run(0, #outrocallback);
`);
}
}
diff --git a/src/compile/nodes/IfBlock.ts b/src/compile/nodes/IfBlock.ts
index dd6e98a82a..87727e5b9e 100644
--- a/src/compile/nodes/IfBlock.ts
+++ b/src/compile/nodes/IfBlock.ts
@@ -95,6 +95,11 @@ export default class IfBlock extends Node {
attachBlocks(this);
+ if (compiler.options.nestedTransitions) {
+ if (hasIntros) block.addIntro();
+ if (hasOutros) block.addOutro();
+ }
+
blocks.forEach(block => {
block.hasUpdateMethod = dynamic;
block.hasIntroMethod = hasIntros;
@@ -129,11 +134,23 @@ export default class IfBlock extends Node {
if (this.else) {
if (hasOutros) {
this.buildCompoundWithOutros(block, parentNode, parentNodes, branches, dynamic, vars);
+
+ if (this.compiler.options.nestedTransitions) {
+ block.builders.outro.addLine(
+ `${name}.o(#outrocallback);`
+ );
+ }
} else {
this.buildCompound(block, parentNode, parentNodes, branches, dynamic, vars);
}
} else {
this.buildSimple(block, parentNode, parentNodes, branches[0], dynamic, vars);
+
+ if (hasOutros && this.compiler.options.nestedTransitions) {
+ block.builders.outro.addLine(
+ `if (${name}) ${name}.o(#outrocallback);`
+ );
+ }
}
block.builders.create.addLine(`${if_name}${name}.c();`);
diff --git a/src/interfaces.ts b/src/interfaces.ts
index 1a5c356404..a30a67a91f 100644
--- a/src/interfaces.ts
+++ b/src/interfaces.ts
@@ -67,6 +67,7 @@ export interface CompileOptions {
// to remove in v3
skipIntroByDefault?: boolean;
+ nestedTransitions: boolean;
}
export interface GenerateOptions {
diff --git a/src/shared/keyed-each.js b/src/shared/keyed-each.js
index 60b0fe8bcd..dac16930ee 100644
--- a/src/shared/keyed-each.js
+++ b/src/shared/keyed-each.js
@@ -1,5 +1,3 @@
-import { transitionManager } from './transitions.js';
-
export function destroyBlock(block, lookup) {
block.d(1);
lookup[block.key] = null;
@@ -45,7 +43,6 @@ export function updateKeyedEach(old_blocks, component, changed, get_key, dynamic
var did_move = {};
var destroy = has_outro ? outroAndDestroyBlock : destroyBlock;
- if (has_outro) transitionManager.groupOutros();
function insert(block) {
block[intro_method](node, next);
diff --git a/src/shared/utils.js b/src/shared/utils.js
index f9fbf80e66..d1f2c7f5e5 100644
--- a/src/shared/utils.js
+++ b/src/shared/utils.js
@@ -12,4 +12,10 @@ export function assignTrue(tar, src) {
export function isPromise(value) {
return value && typeof value.then === 'function';
+}
+
+export function callAfter(fn, i) {
+ return () => {
+ if (!--i) fn();
+ };
}
\ No newline at end of file
diff --git a/test/cli/samples/basic/expected/Main.js b/test/cli/samples/basic/expected/Main.js
index b4b737bb76..f7aa8f698a 100644
--- a/test/cli/samples/basic/expected/Main.js
+++ b/test/cli/samples/basic/expected/Main.js
@@ -26,6 +26,7 @@ function create_main_fragment(component, ctx) {
function Main(options) {
init(this, options);
this._state = assign({}, options.data);
+ this._intro = true;
this._fragment = create_main_fragment(this, this._state);
diff --git a/test/cli/samples/custom-element/expected/Main.js b/test/cli/samples/custom-element/expected/Main.js
index 6fcf0aa394..bf393c995c 100644
--- a/test/cli/samples/custom-element/expected/Main.js
+++ b/test/cli/samples/custom-element/expected/Main.js
@@ -29,6 +29,7 @@ class Main extends HTMLElement {
super();
init(this, options);
this._state = assign({}, options.data);
+ this._intro = true;
this.attachShadow({ mode: 'open' });
diff --git a/test/cli/samples/dev/expected/Main.js b/test/cli/samples/dev/expected/Main.js
index 9c8394917c..477b3f1635 100644
--- a/test/cli/samples/dev/expected/Main.js
+++ b/test/cli/samples/dev/expected/Main.js
@@ -28,6 +28,7 @@ function Main(options) {
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
init(this, options);
this._state = assign({}, options.data);
+ this._intro = true;
this._fragment = create_main_fragment(this, this._state);
diff --git a/test/cli/samples/dir-sourcemap/expected/Main.js b/test/cli/samples/dir-sourcemap/expected/Main.js
index ccedf5a18a..9933db03f4 100644
--- a/test/cli/samples/dir-sourcemap/expected/Main.js
+++ b/test/cli/samples/dir-sourcemap/expected/Main.js
@@ -29,6 +29,7 @@ function create_main_fragment(component, ctx) {
function Main(options) {
init(this, options);
this._state = assign({}, options.data);
+ this._intro = true;
if (!options.root) {
this._oncreate = [];
diff --git a/test/cli/samples/dir-sourcemap/expected/Main.js.map b/test/cli/samples/dir-sourcemap/expected/Main.js.map
index 6e2eb7d0b0..e164b7b845 100644
--- a/test/cli/samples/dir-sourcemap/expected/Main.js.map
+++ b/test/cli/samples/dir-sourcemap/expected/Main.js.map
@@ -1 +1 @@
-{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["
widget
"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Widget.js","sources":["../src/Widget.html"],"sourcesContent":["widget
"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/test/cli/samples/dir-subdir/expected/Main.js b/test/cli/samples/dir-subdir/expected/Main.js index c43c922220..23591bd0a0 100644 --- a/test/cli/samples/dir-subdir/expected/Main.js +++ b/test/cli/samples/dir-subdir/expected/Main.js @@ -29,6 +29,7 @@ function create_main_fragment(component, ctx) { function Main(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/cli/samples/dir-subdir/expected/widget/Widget.js b/test/cli/samples/dir-subdir/expected/widget/Widget.js index df8b286b29..e33859eccd 100644 --- a/test/cli/samples/dir-subdir/expected/widget/Widget.js +++ b/test/cli/samples/dir-subdir/expected/widget/Widget.js @@ -26,6 +26,7 @@ function create_main_fragment(component, ctx) { function Widget(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/cli/samples/dir/expected/Main.js b/test/cli/samples/dir/expected/Main.js index 501d7d8e9f..6338328094 100644 --- a/test/cli/samples/dir/expected/Main.js +++ b/test/cli/samples/dir/expected/Main.js @@ -29,6 +29,7 @@ function create_main_fragment(component, ctx) { function Main(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/cli/samples/dir/expected/Widget.js b/test/cli/samples/dir/expected/Widget.js index ad7f1ce7ed..66eeb2a895 100644 --- a/test/cli/samples/dir/expected/Widget.js +++ b/test/cli/samples/dir/expected/Widget.js @@ -26,6 +26,7 @@ function create_main_fragment(component, ctx) { function Widget(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/cli/samples/globals/expected/Main.js b/test/cli/samples/globals/expected/Main.js index 72daf778fb..46f3fa2594 100644 --- a/test/cli/samples/globals/expected/Main.js +++ b/test/cli/samples/globals/expected/Main.js @@ -41,6 +41,7 @@ var Main = (function(answer) { "use strict"; function Main(options) { init(this, options); this._state = assign(data(), options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/cli/samples/sourcemap-inline/expected/Main.js b/test/cli/samples/sourcemap-inline/expected/Main.js index b357420353..0a7463533a 100644 --- a/test/cli/samples/sourcemap-inline/expected/Main.js +++ b/test/cli/samples/sourcemap-inline/expected/Main.js @@ -26,6 +26,7 @@ function create_main_fragment(component, ctx) { function Main(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); @@ -165,4 +166,4 @@ function callAll(fns) { while (fns && fns.length) fns.shift()(); } export default Main; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWFpbi5qcyIsInNvdXJjZXMiOlsiLi4vc3JjL01haW4uaHRtbCJdLCJzb3VyY2VzQ29udGVudCI6WyI8cD5IZWxsbyB3b3JsZCE8L3A+XG5cbjxzY3JpcHQ+XG5cdGV4cG9ydCBkZWZhdWx0IHtcblx0XHRvbnJlbmRlciAoKSB7XG5cdFx0XHRjb25zb2xlLmxvZyggJ2hlcmUnICk7XG5cdFx0fVxuXHR9O1xuPC9zY3JpcHQ+Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7In0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWFpbi5qcyIsInNvdXJjZXMiOlsiLi4vc3JjL01haW4uaHRtbCJdLCJzb3VyY2VzQ29udGVudCI6WyI8cD5IZWxsbyB3b3JsZCE8L3A+XG5cbjxzY3JpcHQ+XG5cdGV4cG9ydCBkZWZhdWx0IHtcblx0XHRvbnJlbmRlciAoKSB7XG5cdFx0XHRjb25zb2xlLmxvZyggJ2hlcmUnICk7XG5cdFx0fVxuXHR9O1xuPC9zY3JpcHQ+Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9 diff --git a/test/cli/samples/sourcemap/expected/Main.js b/test/cli/samples/sourcemap/expected/Main.js index 14c1518dd0..1c40d1fa58 100644 --- a/test/cli/samples/sourcemap/expected/Main.js +++ b/test/cli/samples/sourcemap/expected/Main.js @@ -26,6 +26,7 @@ function create_main_fragment(component, ctx) { function Main(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/cli/samples/sourcemap/expected/Main.js.map b/test/cli/samples/sourcemap/expected/Main.js.map index c8777bdd11..e5a7f2a162 100644 --- a/test/cli/samples/sourcemap/expected/Main.js.map +++ b/test/cli/samples/sourcemap/expected/Main.js.map @@ -1 +1 @@ -{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["Hello world!
\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["Hello world!
\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/test/cli/samples/store/expected/Main.js b/test/cli/samples/store/expected/Main.js index 45ea6ea814..a16131512f 100644 --- a/test/cli/samples/store/expected/Main.js +++ b/test/cli/samples/store/expected/Main.js @@ -34,6 +34,7 @@ function Main(options) { init(this, options); this._state = assign(this.store._init(["name"]), options.data); this.store._add(this, ["name"]); + this._intro = true; this._handlers.destroy = [removeFromStore]; diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index 8828faba13..d90836bd06 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -174,6 +174,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index dab9d0d9db..8ae971178c 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -47,6 +47,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/bind-width-height/expected-bundle.js b/test/js/samples/bind-width-height/expected-bundle.js index 11a932ee3f..037a3e351d 100644 --- a/test/js/samples/bind-width-height/expected-bundle.js +++ b/test/js/samples/bind-width-height/expected-bundle.js @@ -195,6 +195,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index 12eb1e8c37..45eea94620 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -35,6 +35,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; 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 a8a0b6f76b..2abdb35ad3 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -179,6 +179,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign(data(), options.data); + this._intro = true; if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index 78e957933f..77b9ecda68 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -44,6 +44,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign(data(), options.data); + this._intro = true; if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); diff --git a/test/js/samples/component-static-array/expected-bundle.js b/test/js/samples/component-static-array/expected-bundle.js index 24e739c61a..47534baf71 100644 --- a/test/js/samples/component-static-array/expected-bundle.js +++ b/test/js/samples/component-static-array/expected-bundle.js @@ -147,6 +147,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js index 667fa7f486..dd94dfbe1b 100644 --- a/test/js/samples/component-static-array/expected.js +++ b/test/js/samples/component-static-array/expected.js @@ -31,6 +31,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index f272d7e11a..55f31adaa3 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -151,6 +151,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index 877cbd5eda..01c61db843 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -31,6 +31,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index f272d7e11a..55f31adaa3 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -151,6 +151,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index 877cbd5eda..01c61db843 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -31,6 +31,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index 04bd0982b5..ed27d44137 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -147,6 +147,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index 631d2e7814..c4308b66e3 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -31,6 +31,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index c405221365..f389a4a991 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -142,6 +142,7 @@ function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); this._recompute({ x: 1 }, this._state); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index 05f6ae2bff..208b2503f2 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -26,6 +26,7 @@ function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); this._recompute({ x: 1 }, this._state); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 0c864a18ec..deaed19d8f 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -166,6 +166,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!document.getElementById("svelte-1slhpfn-style")) add_css(); diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 9b8c88b3ef..8addd3e494 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -34,6 +34,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; if (!document.getElementById("svelte-1slhpfn-style")) add_css(); 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 8277f96654..9c7e0c14b1 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -158,6 +158,7 @@ class SvelteComponent extends HTMLElement { super(); init(this, options); this._state = assign({}, options.data); + this._intro = true; this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ``; diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 085cccb8d7..1832bac488 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -30,6 +30,7 @@ class SvelteComponent extends HTMLElement { super(); init(this, options); this._state = assign({}, options.data); + this._intro = true; this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ``; diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index 4767d5ccec..6ea32ad693 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -248,6 +248,7 @@ function get_each_context(ctx, list, i) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index 50a8aa2b43..afc357605c 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -102,6 +102,7 @@ function get_each_context(ctx, list, i) { function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 9983368542..b68330a2f5 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -147,6 +147,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign(data_1(), options.data); + this._intro = true; if (!options.root) { this._oncreate = []; diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index f19fe3af9c..fd110588da 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -27,6 +27,7 @@ function create_main_fragment(component, ctx) { function SvelteComponent(options) { init(this, options); this._state = assign(data_1(), options.data); + this._intro = true; if (!options.root) { 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 0d93b49f8f..70a240dfab 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 @@ -202,6 +202,7 @@ function SvelteComponent(options) { this._state = assign({ Math : Math }, options.data); this._recompute({ foo: 1 }, this._state); if (!('foo' in this._state)) console.warn("