From 6e57fa3ced1fef675b2ff7ad0321d7d7d8bb0b60 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 16 Sep 2017 14:24:55 -0400 Subject: [PATCH 1/2] add debugging comments --- src/generators/Generator.ts | 4 ++++ src/generators/dom/Block.ts | 5 ++++ src/generators/dom/index.ts | 2 ++ src/generators/dom/preprocess.ts | 23 +++++++++++++++++++ src/generators/server-side-rendering/index.ts | 2 +- src/index.ts | 3 --- test/js/index.js | 2 +- .../expected-bundle.js | 2 ++ .../expected.js | 2 ++ .../computed-collapsed-if/expected-bundle.js | 2 ++ .../samples/computed-collapsed-if/expected.js | 2 ++ .../css-media-query/expected-bundle.js | 2 ++ test/js/samples/css-media-query/expected.js | 2 ++ .../expected-bundle.js | 2 ++ .../css-shadow-dom-keyframes/expected.js | 2 ++ .../expected-bundle.js | 3 +++ .../each-block-changed-check/expected.js | 3 +++ .../event-handlers-custom/expected-bundle.js | 2 ++ .../samples/event-handlers-custom/expected.js | 2 ++ .../if-block-no-update/expected-bundle.js | 4 ++++ .../js/samples/if-block-no-update/expected.js | 4 ++++ .../if-block-simple/expected-bundle.js | 3 +++ test/js/samples/if-block-simple/expected.js | 3 +++ .../expected-bundle.js | 2 ++ .../expected.js | 2 ++ .../expected-bundle.js | 2 ++ .../inline-style-optimized-url/expected.js | 2 ++ .../inline-style-optimized/expected-bundle.js | 2 ++ .../inline-style-optimized/expected.js | 2 ++ .../expected-bundle.js | 2 ++ .../inline-style-unoptimized/expected.js | 2 ++ .../expected-bundle.js | 2 ++ .../input-without-blowback-guard/expected.js | 2 ++ .../legacy-input-type/expected-bundle.js | 2 ++ test/js/samples/legacy-input-type/expected.js | 2 ++ .../legacy-quote-class/expected-bundle.js | 2 ++ .../js/samples/legacy-quote-class/expected.js | 2 ++ .../samples/media-bindings/expected-bundle.js | 2 ++ test/js/samples/media-bindings/expected.js | 2 ++ .../non-imported-component/expected-bundle.js | 2 ++ .../non-imported-component/expected.js | 2 ++ .../expected-bundle.js | 2 ++ .../onrender-onteardown-rewritten/expected.js | 2 ++ .../samples/setup-method/expected-bundle.js | 2 ++ test/js/samples/setup-method/expected.js | 2 ++ .../expected-bundle.js | 7 ++++++ .../use-elements-as-anchors/expected.js | 7 ++++++ 47 files changed, 134 insertions(+), 5 deletions(-) diff --git a/src/generators/Generator.ts b/src/generators/Generator.ts index 48a93cc7f7..91b73b6162 100644 --- a/src/generators/Generator.ts +++ b/src/generators/Generator.ts @@ -56,6 +56,8 @@ export default class Generator { expectedProperties: Set; usesRefs: boolean; + locate: (c: number) => { line: number, column: number }; + stylesheet: Stylesheet; importedNames: Set; @@ -86,6 +88,8 @@ export default class Generator { this.bindingGroups = []; this.indirectDependencies = new Map(); + this.locate = getLocator(this.source); + // track which properties are needed, so we can provide useful info // in dev mode this.expectedProperties = new Set(); diff --git a/src/generators/dom/Block.ts b/src/generators/dom/Block.ts index 8acd99b2a8..c0fb7a2c4c 100644 --- a/src/generators/dom/Block.ts +++ b/src/generators/dom/Block.ts @@ -1,5 +1,6 @@ import CodeBuilder from '../../utils/CodeBuilder'; import deindent from '../../utils/deindent'; +import { escape } from '../../utils/stringify'; import { DomGenerator } from './index'; import { Node } from '../../interfaces'; import shared from './shared'; @@ -9,6 +10,7 @@ export interface BlockOptions { generator?: DomGenerator; expression?: Node; context?: string; + comment?: string; key?: string; contexts?: Map; indexes?: Map; @@ -27,6 +29,7 @@ export default class Block { name: string; expression: Node; context: string; + comment?: string; key: string; first: string; @@ -72,6 +75,7 @@ export default class Block { this.name = options.name; this.expression = options.expression; this.context = options.context; + this.comment = options.comment; // for keyed each blocks this.key = options.key; @@ -340,6 +344,7 @@ export default class Block { } return deindent` + ${this.comment && `// ${escape(this.comment)}`} function ${this.name}(${this.params.join(', ')}, #component${this.key ? `, ${localKey}` : ''}) { ${this.variables.size > 0 && `var ${Array.from(this.variables.keys()) diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index 8d82fef182..7bcee58366 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -12,6 +12,7 @@ import Generator from '../Generator'; import Stylesheet from '../../css/Stylesheet'; import preprocess from './preprocess'; import Block from './Block'; +import { version } from '../../../package.json'; import { Parsed, CompileOptions, Node } from '../../interfaces'; export class DomGenerator extends Generator { @@ -76,6 +77,7 @@ export default function dom( }); const builder = new CodeBuilder(); + builder.addBlock(`// ${options.filename ? `${options.filename} ` : ``}generated by Svelte v${version}`); const computationBuilder = new CodeBuilder(); if (computations.length) { diff --git a/src/generators/dom/preprocess.ts b/src/generators/dom/preprocess.ts index 1fdfababeb..b993dcb43f 100644 --- a/src/generators/dom/preprocess.ts +++ b/src/generators/dom/preprocess.ts @@ -22,6 +22,25 @@ function getChildState(parent: State, child = {}) { ); } +function createDebuggingComment(node: Node, generator: DomGenerator) { + const { locate, source } = generator; + + let c = node.start; + if (node.type === 'ElseBlock') { + while (source[c] !== '{') c -= 1; + c -= 1; + } + + let d = node.expression ? node.expression.end : c; + while (source[d] !== '}') d += 1; + d += 2; + + const start = locate(c); + const loc = `(${start.line + 1}:${start.column})`; + + return `${loc} ${source.slice(c, d)}`.replace(/\n/g, ' '); +} + // Whitespace inside one of these elements will not result in // a whitespace node being created in any circumstances. (This // list is almost certainly very incomplete) @@ -107,6 +126,7 @@ const preprocessors = { block.addDependencies(dependencies); node._block = block.child({ + comment: createDebuggingComment(node, generator), name: generator.getUniqueName(`create_if_block`), }); @@ -127,6 +147,7 @@ const preprocessors = { attachBlocks(node.else.children[0]); } else if (node.else) { node.else._block = block.child({ + comment: createDebuggingComment(node.else, generator), name: generator.getUniqueName(`create_if_block`), }); @@ -202,6 +223,7 @@ const preprocessors = { contextDependencies.set(node.context, dependencies); node._block = block.child({ + comment: createDebuggingComment(node, generator), name: generator.getUniqueName('create_each_block'), expression: node.expression, context: node.context, @@ -231,6 +253,7 @@ const preprocessors = { if (node.else) { node.else._block = block.child({ + comment: createDebuggingComment(node.else, generator), name: generator.getUniqueName(`${node._block.name}_else`), }); diff --git a/src/generators/server-side-rendering/index.ts b/src/generators/server-side-rendering/index.ts index 11918995e7..d624400b91 100644 --- a/src/generators/server-side-rendering/index.ts +++ b/src/generators/server-side-rendering/index.ts @@ -103,7 +103,7 @@ export default function ssr( var ${name} = {}; - ${name}.filename = ${stringify(options.filename)}; + ${options.filename && `${name}.filename = ${stringify(options.filename)}`}; ${name}.data = function() { return ${templateProperties.data ? `@template.data()` : `{}`}; diff --git a/src/index.ts b/src/index.ts index c9c4d23a1e..f2a2af1483 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,9 +12,6 @@ function normalizeOptions(options: CompileOptions): CompileOptions { { generate: 'dom', - // a filename is necessary for sourcemap generation - filename: 'SvelteComponent.html', - onwarn: (warning: Warning) => { if (warning.loc) { console.warn( diff --git a/test/js/index.js b/test/js/index.js index 581df93dd8..170c396a2e 100644 --- a/test/js/index.js +++ b/test/js/index.js @@ -71,7 +71,7 @@ describe("js", () => { expectedBundle.trim().replace(/^\s+$/gm, "") ); }).catch(err => { - console.error(err.loc); + if (err.loc) console.error(err.loc); throw err; }); }); 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 5e61b5cb39..c359d3ea3f 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -175,6 +175,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + var template = (function() { return { data: function () { diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index dd6689737e..af560c143e 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + var template = (function() { return { data: function () { diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 5e7b1d99c7..fa28281f01 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -151,6 +151,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + var template = (function() { return { computed: { diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index 87804092f2..d07ea6b452 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -1,5 +1,7 @@ import { assign, differs, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + var template = (function() { return { computed: { diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index bba05e07aa..fca610b373 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -171,6 +171,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function encapsulateStyles(node) { setAttribute(node, "svelte-2363328337", ""); } diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 8a70516367..d27aa6cf30 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createElement, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function encapsulateStyles(node) { setAttribute(node, "svelte-2363328337", ""); } 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 8e3fa4e47f..2bc6c1965f 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -171,6 +171,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div, text; diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 87cf2940bd..2580d2ed30 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div, text; 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 28bd3c608d..6bd30e8ac6 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -184,6 +184,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var text, p, text_1; @@ -257,6 +259,7 @@ function create_main_fragment(state, component) { }; } +// (1:0) {{#each comments as comment, i}} function create_each_block(state, each_block_value, comment, i, component) { var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before; diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 5fec542b69..8bc3d9af66 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var text, p, text_1; @@ -73,6 +75,7 @@ function create_main_fragment(state, component) { }; } +// (1:0) {{#each comments as comment, i}} function create_each_block(state, each_block_value, comment, i, component) { var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before; diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 9a683c9dab..db874825c6 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -171,6 +171,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + var template = (function() { return { methods: { diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index e123de9c98..b5342613ca 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + var template = (function() { return { methods: { 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 00418f43cc..9076a1c39b 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -175,6 +175,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var if_block_anchor; @@ -213,6 +215,7 @@ function create_main_fragment(state, component) { }; } +// (1:0) {{#if foo}} function create_if_block(state, component) { var p, text; @@ -235,6 +238,7 @@ function create_if_block(state, component) { }; } +// (3:0) {{else}} function create_if_block_1(state, component) { var p, text; diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index 619465c331..dc6eb0af02 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var if_block_anchor; @@ -38,6 +40,7 @@ function create_main_fragment(state, component) { }; } +// (1:0) {{#if foo}} function create_if_block(state, component) { var p, text; @@ -60,6 +63,7 @@ function create_if_block(state, component) { }; } +// (3:0) {{else}} function create_if_block_1(state, component) { var p, text; diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 6798ecce54..ed136d6d2c 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -175,6 +175,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var if_block_anchor; @@ -216,6 +218,7 @@ function create_main_fragment(state, component) { }; } +// (1:0) {{#if foo}} function create_if_block(state, component) { var p, text; diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index f003447f3b..3581be9e8f 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var if_block_anchor; @@ -41,6 +43,7 @@ function create_main_fragment(state, component) { }; } +// (1:0) {{#if foo}} function create_if_block(state, component) { var p, text; 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 019bf5e86b..2eb97d7393 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -167,6 +167,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 540cee99bc..8ee98dd788 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -1,5 +1,7 @@ import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; 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 05aa4df9d7..e82cd57b1e 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -167,6 +167,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index d5d415aafd..5cb1dea1d6 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -1,5 +1,7 @@ import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index 91db41380b..74b25b920e 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -167,6 +167,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index e4816ffbfb..edaff13d94 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -1,5 +1,7 @@ import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index cfe849e3f9..5e2225497f 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -167,6 +167,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div, text, div_1, div_1_style_value; diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index 209cc90df6..e9d67c220f 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -1,5 +1,7 @@ import { assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div, text, div_1, div_1_style_value; 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 c5cfd84bec..34657df7ff 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -171,6 +171,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index b459bdb7c8..921080a85d 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -1,5 +1,7 @@ import { addListener, assign, createElement, detachNode, insertNode, proto, removeListener } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index f34e19450e..74bf748994 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -169,6 +169,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index 9f585862e1..1c8b29cc93 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -1,5 +1,7 @@ import { assign, createElement, detachNode, insertNode, noop, proto, setInputType } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js index bf4bf86be9..b493642b59 100644 --- a/test/js/samples/legacy-quote-class/expected-bundle.js +++ b/test/js/samples/legacy-quote-class/expected-bundle.js @@ -186,6 +186,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/legacy-quote-class/expected.js b/test/js/samples/legacy-quote-class/expected.js index 7eec7950fd..eae392fd13 100644 --- a/test/js/samples/legacy-quote-class/expected.js +++ b/test/js/samples/legacy-quote-class/expected.js @@ -1,5 +1,7 @@ import { assign, children, claimElement, createElement, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 8dca649745..633556871b 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -179,6 +179,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var audio, audio_updating = false, audio_animationframe, audio_paused_value = true; diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 738de4f815..de779fcd11 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -1,5 +1,7 @@ import { addListener, assign, callAll, createElement, detachNode, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var audio, audio_updating = false, audio_animationframe, audio_paused_value = true; diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 6d5ea4bba3..08484ebe48 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -165,6 +165,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + var template = (function() { return { components: { diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index de96d252be..fd42c6f4d0 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -2,6 +2,8 @@ import Imported from 'Imported.html'; import { assign, callAll, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + var template = (function() { return { components: { diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index 272f822a9e..ae542fc797 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -151,6 +151,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + var template = (function() { return { // this test should be removed in v2 diff --git a/test/js/samples/onrender-onteardown-rewritten/expected.js b/test/js/samples/onrender-onteardown-rewritten/expected.js index 32a116b3a1..9490a3377b 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected.js @@ -1,5 +1,7 @@ import { assign, callAll, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + var template = (function() { return { // this test should be removed in v2 diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index 6967036e49..45dcf576b8 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -151,6 +151,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + var template = (function() { return { methods: { diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js index 50d2ec47c5..f1a00ca030 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -1,5 +1,7 @@ import { assign, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + var template = (function() { return { methods: { 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 dc41a1501f..ee4404dd6a 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -175,6 +175,8 @@ var proto = { _unmount: _unmount }; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor; @@ -312,6 +314,7 @@ function create_main_fragment(state, component) { }; } +// (2:1) {{#if a}} function create_if_block(state, component) { var p, text; @@ -334,6 +337,7 @@ function create_if_block(state, component) { }; } +// (8:1) {{#if b}} function create_if_block_1(state, component) { var p, text; @@ -356,6 +360,7 @@ function create_if_block_1(state, component) { }; } +// (12:1) {{#if c}} function create_if_block_2(state, component) { var p, text; @@ -378,6 +383,7 @@ function create_if_block_2(state, component) { }; } +// (18:1) {{#if d}} function create_if_block_3(state, component) { var p, text; @@ -400,6 +406,7 @@ function create_if_block_3(state, component) { }; } +// (25:0) {{#if e}} function create_if_block_4(state, component) { var p, text; diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index d520ee49e6..4ee6157183 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -1,5 +1,7 @@ import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +// generated by Svelte v1.39.2 + function create_main_fragment(state, component) { var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor; @@ -137,6 +139,7 @@ function create_main_fragment(state, component) { }; } +// (2:1) {{#if a}} function create_if_block(state, component) { var p, text; @@ -159,6 +162,7 @@ function create_if_block(state, component) { }; } +// (8:1) {{#if b}} function create_if_block_1(state, component) { var p, text; @@ -181,6 +185,7 @@ function create_if_block_1(state, component) { }; } +// (12:1) {{#if c}} function create_if_block_2(state, component) { var p, text; @@ -203,6 +208,7 @@ function create_if_block_2(state, component) { }; } +// (18:1) {{#if d}} function create_if_block_3(state, component) { var p, text; @@ -225,6 +231,7 @@ function create_if_block_3(state, component) { }; } +// (25:0) {{#if e}} function create_if_block_4(state, component) { var p, text; From 1d34bd886e82a5f89b56ffc149cfda526d1b4455 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 16 Sep 2017 14:27:59 -0400 Subject: [PATCH 2/2] put version comment above imports --- src/generators/dom/index.ts | 3 ++- .../samples/collapses-text-around-comments/expected-bundle.js | 2 +- test/js/samples/collapses-text-around-comments/expected.js | 4 ++-- test/js/samples/computed-collapsed-if/expected-bundle.js | 2 +- test/js/samples/computed-collapsed-if/expected.js | 4 ++-- test/js/samples/css-media-query/expected-bundle.js | 2 +- test/js/samples/css-media-query/expected.js | 4 ++-- test/js/samples/css-shadow-dom-keyframes/expected-bundle.js | 2 +- test/js/samples/css-shadow-dom-keyframes/expected.js | 4 ++-- test/js/samples/each-block-changed-check/expected-bundle.js | 2 +- test/js/samples/each-block-changed-check/expected.js | 4 ++-- test/js/samples/event-handlers-custom/expected-bundle.js | 2 +- test/js/samples/event-handlers-custom/expected.js | 4 ++-- test/js/samples/if-block-no-update/expected-bundle.js | 2 +- test/js/samples/if-block-no-update/expected.js | 4 ++-- test/js/samples/if-block-simple/expected-bundle.js | 2 +- test/js/samples/if-block-simple/expected.js | 4 ++-- .../inline-style-optimized-multiple/expected-bundle.js | 2 +- test/js/samples/inline-style-optimized-multiple/expected.js | 4 ++-- test/js/samples/inline-style-optimized-url/expected-bundle.js | 2 +- test/js/samples/inline-style-optimized-url/expected.js | 4 ++-- test/js/samples/inline-style-optimized/expected-bundle.js | 2 +- test/js/samples/inline-style-optimized/expected.js | 4 ++-- test/js/samples/inline-style-unoptimized/expected-bundle.js | 2 +- test/js/samples/inline-style-unoptimized/expected.js | 4 ++-- .../samples/input-without-blowback-guard/expected-bundle.js | 2 +- test/js/samples/input-without-blowback-guard/expected.js | 4 ++-- test/js/samples/legacy-input-type/expected-bundle.js | 2 +- test/js/samples/legacy-input-type/expected.js | 4 ++-- test/js/samples/legacy-quote-class/expected-bundle.js | 2 +- test/js/samples/legacy-quote-class/expected.js | 4 ++-- test/js/samples/media-bindings/expected-bundle.js | 2 +- test/js/samples/media-bindings/expected.js | 4 ++-- test/js/samples/non-imported-component/expected-bundle.js | 2 +- test/js/samples/non-imported-component/expected.js | 4 ++-- .../samples/onrender-onteardown-rewritten/expected-bundle.js | 2 +- test/js/samples/onrender-onteardown-rewritten/expected.js | 4 ++-- test/js/samples/setup-method/expected-bundle.js | 2 +- test/js/samples/setup-method/expected.js | 4 ++-- test/js/samples/use-elements-as-anchors/expected-bundle.js | 2 +- test/js/samples/use-elements-as-anchors/expected.js | 4 ++-- 41 files changed, 62 insertions(+), 61 deletions(-) diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index 7bcee58366..4dc638676d 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -77,7 +77,6 @@ export default function dom( }); const builder = new CodeBuilder(); - builder.addBlock(`// ${options.filename ? `${options.filename} ` : ``}generated by Svelte v${version}`); const computationBuilder = new CodeBuilder(); if (computations.length) { @@ -407,6 +406,8 @@ export default function dom( }); } + result = `/* ${options.filename ? `${options.filename} ` : ``}generated by Svelte v${version} */\n\n${result}`; + return generator.generate(result, options, { name, format, 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 c359d3ea3f..d9449d5c66 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -175,7 +175,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ var template = (function() { return { diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index af560c143e..7a027c389d 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; var template = (function() { return { diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index fa28281f01..8dad6f4adc 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -151,7 +151,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ var template = (function() { return { diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index d07ea6b452..60adf0376e 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -1,6 +1,6 @@ -import { assign, differs, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, differs, noop, proto } from "svelte/shared.js"; var template = (function() { return { diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index fca610b373..d12dbea66a 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -171,7 +171,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function encapsulateStyles(node) { setAttribute(node, "svelte-2363328337", ""); diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index d27aa6cf30..a51d9d0f7a 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createElement, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createElement, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; function encapsulateStyles(node) { setAttribute(node, "svelte-2363328337", ""); 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 2bc6c1965f..bfcc815643 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -171,7 +171,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div, text; diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 2580d2ed30..6e4ce0a044 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var div, text; 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 6bd30e8ac6..17dbba5d17 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -184,7 +184,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var text, p, text_1; diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 8bc3d9af66..50aea24e12 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var text, p, text_1; diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index db874825c6..00e24ed978 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -171,7 +171,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ var template = (function() { return { diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index b5342613ca..304ee13841 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; var template = (function() { return { 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 9076a1c39b..d67e038a00 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -175,7 +175,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var if_block_anchor; diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index dc6eb0af02..45e01ab96d 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var if_block_anchor; diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index ed136d6d2c..8bb4ac429d 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -175,7 +175,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var if_block_anchor; diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index 3581be9e8f..d128a6a4ec 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var if_block_anchor; 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 2eb97d7393..b5e54c7e6e 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -167,7 +167,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 8ee98dd788..f54ea5d785 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -1,6 +1,6 @@ -import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; function create_main_fragment(state, component) { var div; 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 e82cd57b1e..21561be133 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -167,7 +167,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index 5cb1dea1d6..cb17cedca8 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -1,6 +1,6 @@ -import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index 74b25b920e..4fcd4211a5 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -167,7 +167,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index edaff13d94..182250bf0c 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -1,6 +1,6 @@ -import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, createElement, detachNode, insertNode, noop, proto, setStyle } from "svelte/shared.js"; function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index 5e2225497f..7ca2e8323d 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -167,7 +167,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div, text, div_1, div_1_style_value; diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index e9d67c220f..7fbb2eab0c 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -1,6 +1,6 @@ -import { assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var div, text, div_1, div_1_style_value; 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 34657df7ff..c5d2693d15 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -171,7 +171,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 921080a85d..1052a5cffa 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -1,6 +1,6 @@ -import { addListener, assign, createElement, detachNode, insertNode, proto, removeListener } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { addListener, assign, createElement, detachNode, insertNode, proto, removeListener } from "svelte/shared.js"; function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 74bf748994..e96195727c 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -169,7 +169,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index 1c8b29cc93..bd2353a560 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -1,6 +1,6 @@ -import { assign, createElement, detachNode, insertNode, noop, proto, setInputType } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, createElement, detachNode, insertNode, noop, proto, setInputType } from "svelte/shared.js"; function create_main_fragment(state, component) { var input; diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js index b493642b59..1ae85825e7 100644 --- a/test/js/samples/legacy-quote-class/expected-bundle.js +++ b/test/js/samples/legacy-quote-class/expected-bundle.js @@ -186,7 +186,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/legacy-quote-class/expected.js b/test/js/samples/legacy-quote-class/expected.js index eae392fd13..f98967ca7e 100644 --- a/test/js/samples/legacy-quote-class/expected.js +++ b/test/js/samples/legacy-quote-class/expected.js @@ -1,6 +1,6 @@ -import { assign, children, claimElement, createElement, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, children, claimElement, createElement, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var div; diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 633556871b..36efc05ee0 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -179,7 +179,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var audio, audio_updating = false, audio_animationframe, audio_paused_value = true; diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index de779fcd11..02a16f72f8 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -1,6 +1,6 @@ -import { addListener, assign, callAll, createElement, detachNode, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { addListener, assign, callAll, createElement, detachNode, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js"; function create_main_fragment(state, component) { var audio, audio_updating = false, audio_animationframe, audio_paused_value = true; diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 08484ebe48..48f69ac7d9 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -165,7 +165,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ var template = (function() { return { diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index fd42c6f4d0..61034fa15d 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -1,8 +1,8 @@ import Imported from 'Imported.html'; -import { assign, callAll, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, callAll, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; var template = (function() { return { diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index ae542fc797..133875e583 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -151,7 +151,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ var template = (function() { return { diff --git a/test/js/samples/onrender-onteardown-rewritten/expected.js b/test/js/samples/onrender-onteardown-rewritten/expected.js index 9490a3377b..230f69cffa 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected.js @@ -1,6 +1,6 @@ -import { assign, callAll, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, callAll, noop, proto } from "svelte/shared.js"; var template = (function() { return { diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index 45dcf576b8..1ee808404a 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -151,7 +151,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ var template = (function() { return { diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js index f1a00ca030..5d4a7e3dac 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -1,6 +1,6 @@ -import { assign, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { assign, noop, proto } from "svelte/shared.js"; var template = (function() { return { 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 ee4404dd6a..1fb76590dc 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -175,7 +175,7 @@ var proto = { _unmount: _unmount }; -// generated by Svelte v1.39.2 +/* generated by Svelte v1.39.2 */ function create_main_fragment(state, component) { var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor; diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 4ee6157183..2cb72d2ce3 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -1,6 +1,6 @@ -import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; +/* generated by Svelte v1.39.2 */ -// generated by Svelte v1.39.2 +import { appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop, proto } from "svelte/shared.js"; function create_main_fragment(state, component) { var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor;