From 042ec54f7f513bdbd574e5235c11fd5748d48cb9 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 12 May 2018 16:48:05 -0400 Subject: [PATCH] nested component transitions --- src/compile/dom/Block.ts | 4 +-- src/compile/dom/index.ts | 3 +++ src/compile/nodes/AwaitBlock.ts | 4 +-- src/compile/nodes/Component.ts | 18 ++++++++++--- src/compile/nodes/EachBlock.ts | 12 +++++---- src/compile/nodes/Element.ts | 2 -- test/cli/samples/basic/expected/Main.js | 1 + .../samples/custom-element/expected/Main.js | 1 + test/cli/samples/dev/expected/Main.js | 1 + .../samples/dir-sourcemap/expected/Main.js | 1 + .../dir-sourcemap/expected/Main.js.map | 2 +- .../samples/dir-sourcemap/expected/Widget.js | 1 + .../dir-sourcemap/expected/Widget.js.map | 2 +- test/cli/samples/dir-subdir/expected/Main.js | 1 + .../dir-subdir/expected/widget/Widget.js | 1 + test/cli/samples/dir/expected/Main.js | 1 + test/cli/samples/dir/expected/Widget.js | 1 + test/cli/samples/globals/expected/Main.js | 1 + .../samples/sourcemap-inline/expected/Main.js | 3 ++- test/cli/samples/sourcemap/expected/Main.js | 1 + .../samples/sourcemap/expected/Main.js.map | 2 +- test/cli/samples/store/expected/Main.js | 1 + test/js/samples/action/expected-bundle.js | 1 + test/js/samples/action/expected.js | 1 + .../bind-width-height/expected-bundle.js | 1 + test/js/samples/bind-width-height/expected.js | 1 + .../expected-bundle.js | 1 + .../expected.js | 1 + .../component-static-array/expected-bundle.js | 1 + .../component-static-array/expected.js | 1 + .../expected-bundle.js | 1 + .../component-static-immutable/expected.js | 1 + .../expected-bundle.js | 1 + .../component-static-immutable2/expected.js | 1 + .../component-static/expected-bundle.js | 1 + test/js/samples/component-static/expected.js | 1 + .../computed-collapsed-if/expected-bundle.js | 1 + .../samples/computed-collapsed-if/expected.js | 1 + .../css-media-query/expected-bundle.js | 1 + test/js/samples/css-media-query/expected.js | 1 + .../expected-bundle.js | 1 + .../css-shadow-dom-keyframes/expected.js | 1 + .../deconflict-builtins/expected-bundle.js | 1 + .../samples/deconflict-builtins/expected.js | 1 + .../deconflict-globals/expected-bundle.js | 1 + .../js/samples/deconflict-globals/expected.js | 1 + .../expected-bundle.js | 1 + .../expected.js | 1 + .../samples/do-use-dataset/expected-bundle.js | 1 + test/js/samples/do-use-dataset/expected.js | 1 + .../expected-bundle.js | 1 + .../dont-use-dataset-in-legacy/expected.js | 1 + .../expected-bundle.js | 1 + .../dont-use-dataset-in-svg/expected.js | 1 + .../expected-bundle.js | 1 + .../each-block-changed-check/expected.js | 1 + .../event-handlers-custom/expected-bundle.js | 1 + .../samples/event-handlers-custom/expected.js | 1 + .../head-no-whitespace/expected-bundle.js | 1 + .../js/samples/head-no-whitespace/expected.js | 1 + .../if-block-no-update/expected-bundle.js | 1 + .../js/samples/if-block-no-update/expected.js | 1 + .../if-block-simple/expected-bundle.js | 1 + test/js/samples/if-block-simple/expected.js | 1 + .../expected-bundle.js | 1 + .../expected.js | 1 + .../expected-bundle.js | 1 + .../inline-style-optimized-url/expected.js | 1 + .../inline-style-optimized/expected-bundle.js | 1 + .../inline-style-optimized/expected.js | 1 + .../expected-bundle.js | 1 + .../inline-style-unoptimized/expected.js | 1 + .../js/samples/input-range/expected-bundle.js | 1 + test/js/samples/input-range/expected.js | 1 + .../expected-bundle.js | 1 + .../input-without-blowback-guard/expected.js | 1 + .../legacy-input-type/expected-bundle.js | 1 + test/js/samples/legacy-input-type/expected.js | 1 + .../samples/media-bindings/expected-bundle.js | 1 + test/js/samples/media-bindings/expected.js | 1 + .../non-imported-component/expected-bundle.js | 1 + .../non-imported-component/expected.js | 1 + .../samples/setup-method/expected-bundle.js | 1 + test/js/samples/setup-method/expected.js | 1 + test/js/samples/svg-title/expected-bundle.js | 1 + test/js/samples/svg-title/expected.js | 1 + test/js/samples/title/expected-bundle.js | 1 + test/js/samples/title/expected.js | 1 + .../expected-bundle.js | 1 + .../use-elements-as-anchors/expected.js | 1 + .../window-binding-scroll/expected-bundle.js | 1 + .../samples/window-binding-scroll/expected.js | 1 + test/runtime/index.js | 6 ++--- .../Widget.html | 16 +++++++++++ .../transition-js-nested-component/_config.js | 27 +++++++++++++++++++ .../transition-js-nested-component/main.html | 13 +++++++++ 96 files changed, 174 insertions(+), 22 deletions(-) create mode 100644 test/runtime/samples/transition-js-nested-component/Widget.html create mode 100644 test/runtime/samples/transition-js-nested-component/_config.js create mode 100644 test/runtime/samples/transition-js-nested-component/main.html diff --git a/src/compile/dom/Block.ts b/src/compile/dom/Block.ts index a0330c888c..6730d416b0 100644 --- a/src/compile/dom/Block.ts +++ b/src/compile/dom/Block.ts @@ -119,11 +119,11 @@ export default class Block { } addIntro() { - this.hasIntroMethod = true; + this.hasIntroMethod = this.compiler.target.hasIntroTransitions = true; } addOutro() { - this.hasOutroMethod = true; + this.hasOutroMethod = this.compiler.target.hasOutroTransitions = true; this.outros += 1; } 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 097aea3d0d..9a8aa51020 100644 --- a/src/compile/nodes/AwaitBlock.ts +++ b/src/compile/nodes/AwaitBlock.ts @@ -77,7 +77,7 @@ export default class AwaitBlock extends Node { this.then.block.hasOutroMethod = hasOutros; this.catch.block.hasOutroMethod = hasOutros; - if (hasOutros) block.addOutro(); + if (hasOutros && this.compiler.options.nestedTransitions) block.addOutro(); } build( @@ -171,7 +171,7 @@ export default class AwaitBlock extends Node { `); } - if (this.pending.block.hasOutroMethod) { + 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) { 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 7af6bfbec3..cee550d5fe 100644 --- a/src/compile/nodes/EachBlock.ts +++ b/src/compile/nodes/EachBlock.ts @@ -321,10 +321,12 @@ export default class EachBlock extends Node { ${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}); `); - block.builders.outro.addBlock(deindent` - #outrocallback = @callAfter(#outrocallback, ${blocks}.length); - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].o(#outrocallback); - `) + 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'}); @@ -462,7 +464,7 @@ export default class EachBlock extends Node { `); } - if (outro) { + 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);` diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index cdfe1926df..a2f12858c7 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -182,13 +182,11 @@ export default class Element extends Node { if (this.intro) { this.parent.cannotUseInnerHTML(); - this.compiler.target.hasIntroTransitions = true; block.addIntro(); } if (this.outro) { this.parent.cannotUseInnerHTML(); - this.compiler.target.hasOutroTransitions = true; block.addOutro(); } 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":["\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/test/cli/samples/dir-sourcemap/expected/Widget.js b/test/cli/samples/dir-sourcemap/expected/Widget.js index 702f6ee812..5c57d9dae6 100644 --- a/test/cli/samples/dir-sourcemap/expected/Widget.js +++ b/test/cli/samples/dir-sourcemap/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/dir-sourcemap/expected/Widget.js.map b/test/cli/samples/dir-sourcemap/expected/Widget.js.map index 8d57bc3c9a..1fb22cb1e4 100644 --- a/test/cli/samples/dir-sourcemap/expected/Widget.js.map +++ b/test/cli/samples/dir-sourcemap/expected/Widget.js.map @@ -1 +1 @@ -{"version":3,"file":"Widget.js","sources":["../src/Widget.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(" was created without expected data property 'foo'"); + this._intro = true; this._fragment = create_main_fragment(this, this._state); 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 7ef01fe796..877cbddebc 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -48,6 +48,7 @@ function SvelteComponent(options) { this._state = assign({ Math : Math }, options.data); this._recompute({ foo: 1 }, this._state); if (!('foo' in this._state)) console.warn(" was created without expected data property 'foo'"); + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index 056964765d..8b160e19ea 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -170,6 +170,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/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js index 4d3773a37a..72b2d63180 100644 --- a/test/js/samples/do-use-dataset/expected.js +++ b/test/js/samples/do-use-dataset/expected.js @@ -38,6 +38,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/dont-use-dataset-in-legacy/expected-bundle.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js index dd7e111725..0560f2095f 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 @@ -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/dont-use-dataset-in-legacy/expected.js b/test/js/samples/dont-use-dataset-in-legacy/expected.js index 266cc25e96..8dda681218 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js @@ -38,6 +38,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/dont-use-dataset-in-svg/expected-bundle.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js index 810683ae14..76cfc5d9fb 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 @@ -172,6 +172,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/dont-use-dataset-in-svg/expected.js b/test/js/samples/dont-use-dataset-in-svg/expected.js index 359de3a16c..a65ef20033 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected.js @@ -36,6 +36,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/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index fb82c1ef93..f1327b51ca 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -289,6 +289,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/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 82c588c939..b58e5bfc17 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -141,6 +141,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/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 661c52fcf4..985c7f8305 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -172,6 +172,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/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index 3e8b5b528b..5d0e2746a3 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -45,6 +45,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/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index a39755bdd5..4f513c2e10 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -159,6 +159,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/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index 3be9e79389..f01f233fe6 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/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; this._fragment = create_main_fragment(this, this._state); 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 54712a5395..747a0e3e31 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -220,6 +220,7 @@ function create_if_block_1(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/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index f6a3f03c03..78f9e45fd8 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -88,6 +88,7 @@ function create_if_block_1(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/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 1d1d2088ed..c59f7155d7 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -196,6 +196,7 @@ function create_if_block(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/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index d35299a94d..02b6720758 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -64,6 +64,7 @@ function create_if_block(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/inline-style-optimized-multiple/expected-bundle.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js index cad82c33ca..04632dde4b 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -168,6 +168,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/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 0be17478ef..dce0d97032 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -36,6 +36,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/inline-style-optimized-url/expected-bundle.js b/test/js/samples/inline-style-optimized-url/expected-bundle.js index 250878e4d7..b19fecc8a0 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -163,6 +163,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/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index d31dec9c81..3a1eaaa6fb 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/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; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index ec403776a7..5656d88734 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -163,6 +163,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/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index a4f7da5545..b6d4d82530 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/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; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index cba4485979..45a7ea3696 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/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/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index b0a1f77b66..fba1c75c2f 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -42,6 +42,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/input-range/expected-bundle.js b/test/js/samples/input-range/expected-bundle.js index 3df312e184..56b2574411 100644 --- a/test/js/samples/input-range/expected-bundle.js +++ b/test/js/samples/input-range/expected-bundle.js @@ -184,6 +184,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/input-range/expected.js b/test/js/samples/input-range/expected.js index 4468c4c92d..00e886aec6 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -40,6 +40,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/input-without-blowback-guard/expected-bundle.js b/test/js/samples/input-without-blowback-guard/expected-bundle.js index 265fc37de5..ee6c38a0ae 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -178,6 +178,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/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 9b74212e68..afdc22e5fb 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -38,6 +38,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/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 69238bd3a0..eea8f6cb2c 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -161,6 +161,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/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index bbdf477d49..238dafdcf4 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -27,6 +27,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/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 0d6da357e1..d85fbc083c 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -227,6 +227,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/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 0496627968..143d678457 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -83,6 +83,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/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 04347d853a..cd89e51cd7 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -173,6 +173,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/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index cb22b97040..c7c19efe2d 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -44,6 +44,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/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index d2801647e5..eef49483af 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -149,6 +149,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/setup-method/expected.js b/test/js/samples/setup-method/expected.js index 0dc82648fb..bcb05faf38 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -33,6 +33,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/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 28f5220935..b5a8a998cd 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/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; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js index b5f7caf198..2a3cb38e42 100644 --- a/test/js/samples/svg-title/expected.js +++ b/test/js/samples/svg-title/expected.js @@ -30,6 +30,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/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index bd918afa0d..9778eff646 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -140,6 +140,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/title/expected.js b/test/js/samples/title/expected.js index 6b9d49466d..961140ab9f 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -24,6 +24,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/use-elements-as-anchors/expected-bundle.js b/test/js/samples/use-elements-as-anchors/expected-bundle.js index 66a472d56d..fe52babbf3 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -384,6 +384,7 @@ function create_if_block_4(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/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 20cf05be0c..a9cd7cd6d2 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -244,6 +244,7 @@ function create_if_block_4(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/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index 5b7e8ad96c..9926710016 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -193,6 +193,7 @@ function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); this._state.y = window.pageYOffset; + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index eb0904d9c7..1216ede536 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -57,6 +57,7 @@ function SvelteComponent(options) { init(this, options); this._state = assign({}, options.data); this._state.y = window.pageYOffset; + this._intro = true; this._fragment = create_main_fragment(this, this._state); diff --git a/test/runtime/index.js b/test/runtime/index.js index ceed2bfb0f..c59aa72d54 100644 --- a/test/runtime/index.js +++ b/test/runtime/index.js @@ -115,7 +115,7 @@ describe("runtime", () => { try { SvelteComponent = require(`./samples/${dir}/main.html`); } catch (err) { - showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store }, compile); // eslint-disable-line no-console + showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, skipIntroByDefault: compileOptions.skipIntroByDefault, nestedTransitions: compileOptions.nestedTransitions }, compile); // eslint-disable-line no-console throw err; } @@ -174,12 +174,12 @@ describe("runtime", () => { config.error(assert, err); } else { failed.add(dir); - showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store }, compile); // eslint-disable-line no-console + showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, skipIntroByDefault: compileOptions.skipIntroByDefault, nestedTransitions: compileOptions.nestedTransitions }, compile); // eslint-disable-line no-console throw err; } }) .then(() => { - if (config.show) showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store }, compile); + if (config.show) showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, skipIntroByDefault: compileOptions.skipIntroByDefault, nestedTransitions: compileOptions.nestedTransitions }, compile); }); }); } diff --git a/test/runtime/samples/transition-js-nested-component/Widget.html b/test/runtime/samples/transition-js-nested-component/Widget.html new file mode 100644 index 0000000000..16ced20bc3 --- /dev/null +++ b/test/runtime/samples/transition-js-nested-component/Widget.html @@ -0,0 +1,16 @@ +
+ + \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-component/_config.js b/test/runtime/samples/transition-js-nested-component/_config.js new file mode 100644 index 0000000000..6f2c039a40 --- /dev/null +++ b/test/runtime/samples/transition-js-nested-component/_config.js @@ -0,0 +1,27 @@ +export default { + skipIntroByDefault: 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/transition-js-nested-component/main.html b/test/runtime/samples/transition-js-nested-component/main.html new file mode 100644 index 0000000000..2930f4dc16 --- /dev/null +++ b/test/runtime/samples/transition-js-nested-component/main.html @@ -0,0 +1,13 @@ +{#if x} + +{/if} + + \ No newline at end of file