From 7d62528f7af75cf00b1c901a95eb97996cbc7d54 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Tue, 25 Jun 2024 17:01:15 +0100 Subject: [PATCH 01/10] fix: ensure correct each block element is moved during reconcilation --- .changeset/smooth-cameras-appear.md | 5 ++++ .../src/internal/client/dom/blocks/each.js | 17 +++++++++--- .../samples/each-updates-6/_config.js | 27 +++++++++++++++++++ .../samples/each-updates-6/main.svelte | 26 ++++++++++++++++++ 4 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 .changeset/smooth-cameras-appear.md create mode 100644 packages/svelte/tests/runtime-runes/samples/each-updates-6/_config.js create mode 100644 packages/svelte/tests/runtime-runes/samples/each-updates-6/main.svelte diff --git a/.changeset/smooth-cameras-appear.md b/.changeset/smooth-cameras-appear.md new file mode 100644 index 000000000000..77dfb049f2cc --- /dev/null +++ b/.changeset/smooth-cameras-appear.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: ensure correct each block element is moved during reconcilation diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js index e20d4ec41fa9..57e8d71180bf 100644 --- a/packages/svelte/src/internal/client/dom/blocks/each.js +++ b/packages/svelte/src/internal/client/dom/blocks/each.js @@ -482,10 +482,11 @@ function create_item(anchor, prev, next, value, key, index, render_fn, flags) { /** * @param {import('#client').TemplateNode} dom + * @param {import('#client').TemplateNode | null} sibling * @param {import("#client").Effect} effect * @returns {import('#client').TemplateNode} */ -function get_adjusted_first_node(dom, effect) { +function get_adjusted_first_node(dom, sibling, effect) { if ((dom.nodeType === 3 && /** @type {Text} */ (dom).data === '') || dom.nodeType === 8) { var adjusted = effect.first; var next; @@ -498,7 +499,11 @@ function get_adjusted_first_node(dom, effect) { } adjusted = next; } - return get_first_node(/** @type {import("#client").Effect} */ (adjusted)); + var adjusted_dom = get_first_node(/** @type {import("#client").Effect} */ (adjusted)); + // If we have a sibling that contains the adjusted_dom, then use that instead. + if (sibling?.contains(adjusted_dom)) { + return sibling; + } } return dom; } @@ -511,9 +516,13 @@ function get_adjusted_first_node(dom, effect) { function get_first_node(effect) { var dom = effect.dom; if (is_array(dom)) { - return get_adjusted_first_node(dom[0], effect); + return get_adjusted_first_node(dom[0], dom[1], effect); } - return get_adjusted_first_node(/** @type {import('#client').TemplateNode} **/ (dom), effect); + return get_adjusted_first_node( + /** @type {import('#client').TemplateNode} **/ (dom), + null, + effect + ); } /** diff --git a/packages/svelte/tests/runtime-runes/samples/each-updates-6/_config.js b/packages/svelte/tests/runtime-runes/samples/each-updates-6/_config.js new file mode 100644 index 000000000000..8bd2d17131df --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/each-updates-6/_config.js @@ -0,0 +1,27 @@ +import { flushSync } from 'svelte'; +import { test } from '../../test'; + +export default test({ + html: ``, + + async test({ assert, target }) { + const [btn1] = target.querySelectorAll('button'); + + flushSync(() => { + btn1.click(); + }); + + flushSync(() => { + btn1.click(); + }); + + flushSync(() => { + btn1.click(); + }); + + assert.htmlEqual( + target.innerHTML, + `` + ); + } +}); diff --git a/packages/svelte/tests/runtime-runes/samples/each-updates-6/main.svelte b/packages/svelte/tests/runtime-runes/samples/each-updates-6/main.svelte new file mode 100644 index 000000000000..a1b948ac0fb8 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/each-updates-6/main.svelte @@ -0,0 +1,26 @@ + + +{#snippet renderItem(item)} +
  • + {item.name} ({item.id}) + {#if item.color}{/if} +
  • +{/snippet} + + + From 4284067f28e5bd210aec6c8bd1f014014e0df25c Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Tue, 25 Jun 2024 17:37:33 +0100 Subject: [PATCH 02/10] tune --- .../src/internal/client/dom/blocks/each.js | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js index 57e8d71180bf..99c17d70b6c6 100644 --- a/packages/svelte/src/internal/client/dom/blocks/each.js +++ b/packages/svelte/src/internal/client/dom/blocks/each.js @@ -482,11 +482,10 @@ function create_item(anchor, prev, next, value, key, index, render_fn, flags) { /** * @param {import('#client').TemplateNode} dom - * @param {import('#client').TemplateNode | null} sibling * @param {import("#client").Effect} effect * @returns {import('#client').TemplateNode} */ -function get_adjusted_first_node(dom, sibling, effect) { +function get_adjusted_first_node(dom, effect) { if ((dom.nodeType === 3 && /** @type {Text} */ (dom).data === '') || dom.nodeType === 8) { var adjusted = effect.first; var next; @@ -499,11 +498,7 @@ function get_adjusted_first_node(dom, sibling, effect) { } adjusted = next; } - var adjusted_dom = get_first_node(/** @type {import("#client").Effect} */ (adjusted)); - // If we have a sibling that contains the adjusted_dom, then use that instead. - if (sibling?.contains(adjusted_dom)) { - return sibling; - } + return get_first_node(/** @type {import("#client").Effect} */ (adjusted)); } return dom; } @@ -516,13 +511,12 @@ function get_adjusted_first_node(dom, sibling, effect) { function get_first_node(effect) { var dom = effect.dom; if (is_array(dom)) { - return get_adjusted_first_node(dom[0], dom[1], effect); + var adjusted_dom = get_adjusted_first_node(dom[0], effect); + // If we have a sibling that contains the adjusted_dom, then use that instead. + var sibling = dom[1]; + return sibling?.contains(adjusted_dom) ? sibling : adjusted_dom; } - return get_adjusted_first_node( - /** @type {import('#client').TemplateNode} **/ (dom), - null, - effect - ); + return get_adjusted_first_node(/** @type {import('#client').TemplateNode} **/ (dom), effect); } /** From e071734d2b2caa4df17e037300112057f50f6c52 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Wed, 26 Jun 2024 11:20:41 +0100 Subject: [PATCH 03/10] fix root cause for issue --- .../3-transform/client/visitors/template.js | 10 +++-- .../src/internal/client/dom/blocks/each.js | 10 ++--- .../src/internal/client/dom/blocks/html.js | 4 +- .../client/dom/blocks/svelte-element.js | 2 +- .../internal/client/dom/blocks/svelte-head.js | 2 +- .../src/internal/client/dom/template.js | 42 +++++++++++++------ .../samples/each-updates-7/_config.js | 27 ++++++++++++ .../samples/each-updates-7/main.svelte | 26 ++++++++++++ playgrounds/demo/server.js | 2 +- 9 files changed, 99 insertions(+), 26 deletions(-) create mode 100644 packages/svelte/tests/runtime-runes/samples/each-updates-7/_config.js create mode 100644 packages/svelte/tests/runtime-runes/samples/each-updates-7/main.svelte diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js index 6a426db0d419..6892eb3b3c5c 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js @@ -1646,7 +1646,11 @@ export const template_visitors = { add_template(template_name, args); - body.push(b.var(id, b.call(template_name)), ...state.before_init, ...state.init); + body.push( + b.var(id, b.call(template_name, b.id('$$anchor'))), + ...state.before_init, + ...state.init + ); close = b.stmt(b.call('$.append', b.id('$$anchor'), id)); } else if (is_single_child_not_needing_template) { context.visit(trimmed[0], state); @@ -1684,7 +1688,7 @@ export const template_visitors = { if (use_comment_template) { // special case — we can use `$.comment` instead of creating a unique template - body.push(b.var(id, b.call('$.comment'))); + body.push(b.var(id, b.call('$.comment', b.id('$$anchor')))); } else { let flags = TEMPLATE_FRAGMENT; @@ -1697,7 +1701,7 @@ export const template_visitors = { b.literal(flags) ]); - body.push(b.var(id, b.call(template_name))); + body.push(b.var(id, b.call(template_name, b.id('$$anchor')))); } body.push(...state.before_init, ...state.init); diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js index 99c17d70b6c6..140fcd900835 100644 --- a/packages/svelte/src/internal/client/dom/blocks/each.js +++ b/packages/svelte/src/internal/client/dom/blocks/each.js @@ -486,7 +486,10 @@ function create_item(anchor, prev, next, value, key, index, render_fn, flags) { * @returns {import('#client').TemplateNode} */ function get_adjusted_first_node(dom, effect) { - if ((dom.nodeType === 3 && /** @type {Text} */ (dom).data === '') || dom.nodeType === 8) { + if ( + (dom.nodeType === 3 && /** @type {Text} */ (dom).data === '') || + (dom.nodeType === 8 && /** @type {Comment} */ (dom).data !== '[') + ) { var adjusted = effect.first; var next; while (adjusted !== null) { @@ -511,10 +514,7 @@ function get_adjusted_first_node(dom, effect) { function get_first_node(effect) { var dom = effect.dom; if (is_array(dom)) { - var adjusted_dom = get_adjusted_first_node(dom[0], effect); - // If we have a sibling that contains the adjusted_dom, then use that instead. - var sibling = dom[1]; - return sibling?.contains(adjusted_dom) ? sibling : adjusted_dom; + return get_adjusted_first_node(dom[0], effect); } return get_adjusted_first_node(/** @type {import('#client').TemplateNode} **/ (dom), effect); } diff --git a/packages/svelte/src/internal/client/dom/blocks/html.js b/packages/svelte/src/internal/client/dom/blocks/html.js index 6873adf70ce2..8ab6d58d6b7e 100644 --- a/packages/svelte/src/internal/client/dom/blocks/html.js +++ b/packages/svelte/src/internal/client/dom/blocks/html.js @@ -82,7 +82,7 @@ function html_to_dom(target, effect, value, svg, mathml) { var child = /** @type {Text | Element | Comment} */ (node.firstChild); target.before(child); if (effect !== null) { - push_template_node(child, effect); + push_template_node(child, null, effect); } return child; } @@ -98,7 +98,7 @@ function html_to_dom(target, effect, value, svg, mathml) { } if (effect !== null) { - push_template_node(nodes, effect); + push_template_node(nodes, null, effect); } return nodes; diff --git a/packages/svelte/src/internal/client/dom/blocks/svelte-element.js b/packages/svelte/src/internal/client/dom/blocks/svelte-element.js index 6e0740b937b3..611eb6395fa1 100644 --- a/packages/svelte/src/internal/client/dom/blocks/svelte-element.js +++ b/packages/svelte/src/internal/client/dom/blocks/svelte-element.js @@ -140,7 +140,7 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio swap_block_dom(element_effect, prev_element, element); prev_element.remove(); } else { - push_template_node(element, element_effect); + push_template_node(element, null, element_effect); } if (render_fn) { diff --git a/packages/svelte/src/internal/client/dom/blocks/svelte-head.js b/packages/svelte/src/internal/client/dom/blocks/svelte-head.js index b00a3a242b1e..c5fb0f277115 100644 --- a/packages/svelte/src/internal/client/dom/blocks/svelte-head.js +++ b/packages/svelte/src/internal/client/dom/blocks/svelte-head.js @@ -1,7 +1,7 @@ import { hydrate_anchor, hydrate_nodes, hydrating, set_hydrate_nodes } from '../hydration.js'; import { empty } from '../operations.js'; import { block } from '../../reactivity/effects.js'; -import { HYDRATION_END, HYDRATION_START } from '../../../../constants.js'; +import { HYDRATION_START } from '../../../../constants.js'; /** * @type {Node | undefined} diff --git a/packages/svelte/src/internal/client/dom/template.js b/packages/svelte/src/internal/client/dom/template.js index 7342b71edadd..14d5769f73bc 100644 --- a/packages/svelte/src/internal/client/dom/template.js +++ b/packages/svelte/src/internal/client/dom/template.js @@ -9,10 +9,12 @@ import { queue_micro_task } from './task.js'; /** * @template {import("#client").TemplateNode | import("#client").TemplateNode[]} T * @param {T} dom + * @param {import("#client").TemplateNode | null} anchor * @param {import("#client").Effect} effect */ export function push_template_node( dom, + anchor, effect = /** @type {import('#client').Effect} */ (current_effect) ) { var current_dom = effect.dom; @@ -22,11 +24,20 @@ export function push_template_node( if (!is_array(current_dom)) { current_dom = effect.dom = [current_dom]; } + const anchor_index = anchor !== null ? current_dom.indexOf(anchor) : null; if (is_array(dom)) { - current_dom.push(...dom); + if (anchor_index !== null) { + current_dom.splice(anchor_index, 0, ...dom); + } else { + current_dom.push(...dom); + } } else { - current_dom.push(dom); + if (anchor_index !== null) { + current_dom.splice(anchor_index, 0, dom); + } else { + current_dom.push(dom); + } } } return dom; @@ -45,9 +56,9 @@ export function template(content, flags) { /** @type {Node} */ var node; - return () => { + return (/** @type {Element | Comment | null} */ prev_anchor) => { if (hydrating) { - push_template_node(is_fragment ? hydrate_nodes : hydrate_start); + push_template_node(is_fragment ? hydrate_nodes : hydrate_start, prev_anchor); return hydrate_start; } @@ -61,7 +72,8 @@ export function template(content, flags) { push_template_node( is_fragment ? /** @type {import('#client').TemplateNode[]} */ ([...clone.childNodes]) - : /** @type {import('#client').TemplateNode} */ (clone) + : /** @type {import('#client').TemplateNode} */ (clone), + prev_anchor ); return clone; @@ -106,9 +118,9 @@ export function ns_template(content, flags, ns = 'svg') { /** @type {Element | DocumentFragment} */ var node; - return () => { + return (/** @type {Element | Comment | null} */ prev_anchor) => { if (hydrating) { - push_template_node(is_fragment ? hydrate_nodes : hydrate_start); + push_template_node(is_fragment ? hydrate_nodes : hydrate_start, prev_anchor); return hydrate_start; } @@ -130,7 +142,8 @@ export function ns_template(content, flags, ns = 'svg') { push_template_node( is_fragment ? /** @type {import('#client').TemplateNode[]} */ ([...clone.childNodes]) - : /** @type {import('#client').TemplateNode} */ (clone) + : /** @type {import('#client').TemplateNode} */ (clone), + prev_anchor ); return clone; @@ -208,7 +221,7 @@ function run_scripts(node) { */ /*#__NO_SIDE_EFFECTS__*/ export function text(anchor) { - if (!hydrating) return push_template_node(empty()); + if (!hydrating) return push_template_node(empty(), null); var node = hydrate_start; @@ -218,21 +231,24 @@ export function text(anchor) { anchor.before((node = empty())); } - push_template_node(node); + push_template_node(node, null); return node; } -export function comment() { +/** + * @param {Element | Comment | null} prev_anchor + */ +export function comment(prev_anchor) { // we're not delegating to `template` here for performance reasons if (hydrating) { - push_template_node(hydrate_nodes); + push_template_node(hydrate_nodes, prev_anchor); return hydrate_start; } var frag = document.createDocumentFragment(); var anchor = empty(); frag.append(anchor); - push_template_node([anchor]); + push_template_node([anchor], prev_anchor); return frag; } diff --git a/packages/svelte/tests/runtime-runes/samples/each-updates-7/_config.js b/packages/svelte/tests/runtime-runes/samples/each-updates-7/_config.js new file mode 100644 index 000000000000..7f1f5b65890d --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/each-updates-7/_config.js @@ -0,0 +1,27 @@ +import { flushSync } from 'svelte'; +import { test } from '../../test'; + +export default test({ + html: `
    • test (1)
    • test 2 (2)
    • test 3 (3)
    `, + + async test({ assert, target }) { + const [btn1] = target.querySelectorAll('button'); + + flushSync(() => { + btn1.click(); + }); + + flushSync(() => { + btn1.click(); + }); + + flushSync(() => { + btn1.click(); + }); + + assert.htmlEqual( + target.innerHTML, + `
    • test (1)
    • test 2 (2)
    • test 3 (3)
    ` + ); + } +}); diff --git a/packages/svelte/tests/runtime-runes/samples/each-updates-7/main.svelte b/packages/svelte/tests/runtime-runes/samples/each-updates-7/main.svelte new file mode 100644 index 000000000000..df8b054a4258 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/each-updates-7/main.svelte @@ -0,0 +1,26 @@ + + +{#snippet renderItem(item)} +
  • + {item.name} ({item.id}) +
  • + {#if item.color}{/if} +{/snippet} + +
      + {#each items as item (item.id)} + {@render renderItem(item)} + {/each} +
    + diff --git a/playgrounds/demo/server.js b/playgrounds/demo/server.js index 0a545e739758..cf2a6b2ab587 100644 --- a/playgrounds/demo/server.js +++ b/playgrounds/demo/server.js @@ -34,7 +34,7 @@ async function createServer() { .replace(``, appHtml) .replace(``, headHtml); - res.status(200).set({ 'Content-Type': 'text/html' }).end(html); + res.end(html); }); return { app, vite }; From 9af8ef32dd0d76025bf5261c88a9050968076293 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Wed, 26 Jun 2024 11:23:58 +0100 Subject: [PATCH 04/10] fix root cause for issue --- packages/svelte/src/internal/client/dom/template.js | 3 +++ .../tests/migrate/samples/svelte-element/output.svelte | 2 +- .../parser-legacy/samples/action-duplicate/output.json | 2 +- .../parser-legacy/samples/action-with-call/output.json | 2 +- .../samples/action-with-identifier/output.json | 2 +- .../parser-legacy/samples/action-with-literal/output.json | 2 +- .../svelte/tests/parser-legacy/samples/action/output.json | 2 +- .../tests/parser-legacy/samples/animation/output.json | 2 +- .../samples/attribute-class-directive/output.json | 2 +- .../samples/attribute-containing-solidus/output.json | 2 +- .../samples/attribute-curly-bracket/output.json | 2 +- .../samples/attribute-dynamic-boolean/output.json | 2 +- .../parser-legacy/samples/attribute-dynamic/output.json | 2 +- .../parser-legacy/samples/attribute-empty/output.json | 2 +- .../parser-legacy/samples/attribute-escaped/output.json | 2 +- .../parser-legacy/samples/attribute-multiple/output.json | 2 +- .../parser-legacy/samples/attribute-shorthand/output.json | 2 +- .../samples/attribute-static-boolean/output.json | 2 +- .../parser-legacy/samples/attribute-static/output.json | 2 +- .../attribute-style-directive-modifiers/output.json | 6 ++++-- .../attribute-style-directive-shorthand/output.json | 2 +- .../samples/attribute-style-directive-string/output.json | 2 +- .../samples/attribute-style-directive/output.json | 2 +- .../parser-legacy/samples/attribute-style/output.json | 2 +- .../parser-legacy/samples/attribute-unquoted/output.json | 2 +- .../samples/attribute-with-whitespace/output.json | 2 +- .../tests/parser-legacy/samples/await-catch/output.json | 2 +- .../parser-legacy/samples/await-then-catch/output.json | 2 +- .../parser-legacy/samples/binding-shorthand/output.json | 2 +- .../svelte/tests/parser-legacy/samples/binding/output.json | 2 +- .../parser-legacy/samples/comment-with-ignores/output.json | 7 +++++-- .../svelte/tests/parser-legacy/samples/comment/output.json | 2 +- .../parser-legacy/samples/component-dynamic/output.json | 2 +- .../samples/convert-entities-in-element/output.json | 2 +- .../parser-legacy/samples/convert-entities/output.json | 2 +- .../svelte/tests/parser-legacy/samples/css/output.json | 2 +- .../samples/dynamic-element-string/output.json | 2 +- .../samples/dynamic-element-variable/output.json | 2 +- .../tests/parser-legacy/samples/dynamic-import/output.json | 2 +- .../samples/each-block-destructured/output.json | 2 +- .../parser-legacy/samples/each-block-else/output.json | 2 +- .../parser-legacy/samples/each-block-indexed/output.json | 2 +- .../parser-legacy/samples/each-block-keyed/output.json | 2 +- .../tests/parser-legacy/samples/each-block/output.json | 2 +- .../element-with-attribute-empty-string/output.json | 2 +- .../samples/element-with-attribute/output.json | 2 +- .../samples/element-with-mustache/output.json | 2 +- .../parser-legacy/samples/element-with-text/output.json | 2 +- .../tests/parser-legacy/samples/elements/output.json | 2 +- .../tests/parser-legacy/samples/event-handler/output.json | 2 +- .../tests/parser-legacy/samples/if-block-else/output.json | 2 +- .../parser-legacy/samples/if-block-elseif/output.json | 2 +- .../tests/parser-legacy/samples/if-block/output.json | 2 +- .../parser-legacy/samples/implicitly-closed-li/output.json | 2 +- .../parser-legacy/samples/javascript-comments/output.json | 2 +- .../svelte/tests/parser-legacy/samples/nbsp/output.json | 2 +- .../samples/no-error-if-before-closing/output.json | 2 +- .../tests/parser-legacy/samples/raw-mustaches/output.json | 2 +- .../svelte/tests/parser-legacy/samples/refs/output.json | 2 +- .../samples/script-attribute-with-curly-braces/output.json | 2 +- .../parser-legacy/samples/script-comment-only/output.json | 2 +- .../samples/script-context-module-unquoted/output.json | 2 +- .../svelte/tests/parser-legacy/samples/script/output.json | 2 +- .../parser-legacy/samples/self-closing-element/output.json | 2 +- .../tests/parser-legacy/samples/self-reference/output.json | 2 +- .../parser-legacy/samples/slotted-element/output.json | 2 +- .../samples/space-between-mustaches/output.json | 2 +- .../svelte/tests/parser-legacy/samples/spread/output.json | 2 +- .../parser-legacy/samples/style-inside-head/output.json | 2 +- .../parser-legacy/samples/textarea-children/output.json | 2 +- .../parser-legacy/samples/textarea-end-tag/output.json | 2 +- .../samples/transition-intro-no-params/output.json | 2 +- .../parser-legacy/samples/transition-intro/output.json | 2 +- .../parser-legacy/samples/unusual-identifier/output.json | 2 +- .../samples/whitespace-after-script-tag/output.json | 2 +- .../samples/whitespace-after-style-tag/output.json | 2 +- .../samples/whitespace-leading-trailing/output.json | 2 +- .../parser-legacy/samples/whitespace-normal/output.json | 2 +- .../samples/comment-before-script/output.json | 2 +- .../tests/parser-modern/samples/css-nth-syntax/output.json | 2 +- .../parser-modern/samples/css-pseudo-classes/output.json | 2 +- .../samples/each-block-object-pattern/output.json | 2 +- .../svelte/tests/parser-modern/samples/options/output.json | 2 +- .../samples/semicolon-inside-quotes/output.json | 2 +- .../tests/parser-modern/samples/snippets/output.json | 6 +++--- .../parser-modern/samples/template-shadowroot/output.json | 2 +- .../samples/typescript-in-event-handler/output.json | 2 +- .../_expected/client/index.svelte.js | 4 ++-- .../samples/bind-this/_expected/client/index.svelte.js | 2 +- .../_expected/client/main.svelte.js | 2 +- .../each-string-template/_expected/client/index.svelte.js | 2 +- .../_expected/client/index.svelte.js | 2 +- .../samples/hello-world/_expected/client/index.svelte.js | 2 +- .../snapshot/samples/hmr/_expected/client/index.svelte.js | 2 +- .../state-proxy-literal/_expected/client/index.svelte.js | 4 ++-- .../svelte-element/_expected/client/index.svelte.js | 2 +- 96 files changed, 109 insertions(+), 101 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/template.js b/packages/svelte/src/internal/client/dom/template.js index 14d5769f73bc..5ee3611b5e3d 100644 --- a/packages/svelte/src/internal/client/dom/template.js +++ b/packages/svelte/src/internal/client/dom/template.js @@ -24,6 +24,9 @@ export function push_template_node( if (!is_array(current_dom)) { current_dom = effect.dom = [current_dom]; } + // If we have an existing anchor, then we should ensure that we insert the DOM contents + // before that anchor position. This ensures we match what is reflected on the document to + // as what is reflected in the effect.dom (we always insert before the anchor). const anchor_index = anchor !== null ? current_dom.indexOf(anchor) : null; if (is_array(dom)) { diff --git a/packages/svelte/tests/migrate/samples/svelte-element/output.svelte b/packages/svelte/tests/migrate/samples/svelte-element/output.svelte index 09a9960f56ad..4dc05f351f81 100644 --- a/packages/svelte/tests/migrate/samples/svelte-element/output.svelte +++ b/packages/svelte/tests/migrate/samples/svelte-element/output.svelte @@ -3,4 +3,4 @@ - + \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json b/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json index 3dad9bb4e523..c310754298c8 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json @@ -31,4 +31,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json b/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json index 66ce187c625a..af416ffac254 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json @@ -73,4 +73,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json b/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json index 39a6f5f64702..229ab78006b3 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json @@ -38,4 +38,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json b/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json index 94c60b701a44..5a6529a9335e 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json @@ -39,4 +39,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/action/output.json b/packages/svelte/tests/parser-legacy/samples/action/output.json index d72bf7db1012..55cbff860b63 100644 --- a/packages/svelte/tests/parser-legacy/samples/action/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action/output.json @@ -23,4 +23,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/animation/output.json b/packages/svelte/tests/parser-legacy/samples/animation/output.json index 0d82cb2bb917..6e1d1045bec9 100644 --- a/packages/svelte/tests/parser-legacy/samples/animation/output.json +++ b/packages/svelte/tests/parser-legacy/samples/animation/output.json @@ -88,4 +88,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json index 9efe9acf8dda..8c27c8bcb446 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json @@ -38,4 +38,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json index 2c63b3a43d13..c67811fab964 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json @@ -38,4 +38,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json index 2453dc9e0a07..a137dd795b3f 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json @@ -52,4 +52,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json index 5793afe896fd..5462eaf71333 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json @@ -44,4 +44,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json index 9fd98c80ec27..6acc5ebeb133 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json @@ -80,4 +80,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json index d2a3dcd93bf6..478ba2e52560 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json @@ -105,4 +105,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json index e2eb99f32774..74fa6f2aec1b 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json @@ -30,4 +30,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json index 66b780e53661..80bbdf0e21ed 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json @@ -45,4 +45,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json index 2ae3acfdc7eb..87a01d4b09f3 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json @@ -34,4 +34,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json index 8cb93b75ec08..a059934e4075 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json @@ -22,4 +22,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json index 3e19a4727ea3..94608a0eba0e 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json @@ -30,4 +30,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json index b7de71ff5ae6..45bb6f0e2ec8 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json @@ -15,7 +15,9 @@ "end": 36, "type": "StyleDirective", "name": "color", - "modifiers": ["important"], + "modifiers": [ + "important" + ], "value": [ { "type": "MustacheTag", @@ -45,4 +47,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json index d7f53cb00ca2..4ad7aaf7f78b 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json @@ -23,4 +23,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json index 5acf7d797eaa..9693f9778275 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json @@ -359,4 +359,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json index 2cce9fef952c..08e2032db321 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json @@ -45,4 +45,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json index 1d9a528d6d3d..d029f9ef7108 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json @@ -38,4 +38,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json index 5df4d66ab668..b82bec517d1a 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json @@ -30,4 +30,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json index 4d3a29180869..31652f1fd5ee 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json @@ -46,4 +46,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/await-catch/output.json b/packages/svelte/tests/parser-legacy/samples/await-catch/output.json index 5572d573f89e..5c2fa74e425e 100644 --- a/packages/svelte/tests/parser-legacy/samples/await-catch/output.json +++ b/packages/svelte/tests/parser-legacy/samples/await-catch/output.json @@ -183,4 +183,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json b/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json index b71365f39deb..5548cfc22eb5 100644 --- a/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json +++ b/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json @@ -252,4 +252,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json b/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json index 672014629791..9d31edabf748 100644 --- a/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json +++ b/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json @@ -109,4 +109,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/binding/output.json b/packages/svelte/tests/parser-legacy/samples/binding/output.json index 4ce069bd37c0..288f9182abd7 100644 --- a/packages/svelte/tests/parser-legacy/samples/binding/output.json +++ b/packages/svelte/tests/parser-legacy/samples/binding/output.json @@ -119,4 +119,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json b/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json index cf2dc9f75209..74d0a5270773 100644 --- a/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json +++ b/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json @@ -9,8 +9,11 @@ "start": 0, "end": 31, "data": " svelte-ignore foo, bar ", - "ignores": ["foo", "bar"] + "ignores": [ + "foo", + "bar" + ] } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/comment/output.json b/packages/svelte/tests/parser-legacy/samples/comment/output.json index 6017db404cb9..a721ddd8dc5b 100644 --- a/packages/svelte/tests/parser-legacy/samples/comment/output.json +++ b/packages/svelte/tests/parser-legacy/samples/comment/output.json @@ -13,4 +13,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json b/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json index f624a04c617b..7e7267498fdc 100644 --- a/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json +++ b/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json @@ -77,4 +77,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json b/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json index f7a8a3c67794..3025f2c8007e 100644 --- a/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json +++ b/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json @@ -22,4 +22,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json b/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json index c336a3978c30..c43621cc6bb8 100644 --- a/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json +++ b/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json @@ -13,4 +13,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/css/output.json b/packages/svelte/tests/parser-legacy/samples/css/output.json index b3ecd7b6712a..443d6d2d5000 100644 --- a/packages/svelte/tests/parser-legacy/samples/css/output.json +++ b/packages/svelte/tests/parser-legacy/samples/css/output.json @@ -82,4 +82,4 @@ "comment": null } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json b/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json index 9ba15d604484..5f73e70b5ee7 100644 --- a/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json +++ b/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json @@ -171,4 +171,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json b/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json index 291cdaa73405..7c75c8bc2a5f 100644 --- a/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json +++ b/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json @@ -77,4 +77,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json b/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json index a439b65dd0ec..070bd1724806 100644 --- a/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json +++ b/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json @@ -479,4 +479,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json index d19f5cbbfd8c..68b4b1f535db 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json @@ -265,4 +265,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json index a6db309edb08..f5145063e44c 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json @@ -100,4 +100,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json index bce7fd81a211..ce2f921d86ac 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json @@ -106,4 +106,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json index 2f6206a6cbeb..637dab61b897 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json @@ -126,4 +126,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/each-block/output.json b/packages/svelte/tests/parser-legacy/samples/each-block/output.json index f26f557958db..82390bb62874 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block/output.json @@ -77,4 +77,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json index 7773256d44ea..afdcbf4297cf 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json @@ -61,4 +61,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json index 9477886bb289..b6740a61357c 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json @@ -61,4 +61,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json index ce0dc25e85c6..9bb92244ce68 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json @@ -50,4 +50,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json index fde57c470a64..d8bb9e9c1185 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json @@ -22,4 +22,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/elements/output.json b/packages/svelte/tests/parser-legacy/samples/elements/output.json index 6b51383d9339..97513445d695 100644 --- a/packages/svelte/tests/parser-legacy/samples/elements/output.json +++ b/packages/svelte/tests/parser-legacy/samples/elements/output.json @@ -22,4 +22,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/event-handler/output.json b/packages/svelte/tests/parser-legacy/samples/event-handler/output.json index 45b625667706..396e314da58e 100644 --- a/packages/svelte/tests/parser-legacy/samples/event-handler/output.json +++ b/packages/svelte/tests/parser-legacy/samples/event-handler/output.json @@ -161,4 +161,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json b/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json index 4ba9370d8870..34efb9fd7b22 100644 --- a/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json +++ b/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json @@ -68,4 +68,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json b/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json index 3e6953ab0b3d..2ae1f06cc990 100644 --- a/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json +++ b/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json @@ -158,4 +158,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/if-block/output.json b/packages/svelte/tests/parser-legacy/samples/if-block/output.json index 61ecf6e3b2b4..1c60df0d31c8 100644 --- a/packages/svelte/tests/parser-legacy/samples/if-block/output.json +++ b/packages/svelte/tests/parser-legacy/samples/if-block/output.json @@ -36,4 +36,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json b/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json index a56701894e63..be5fba538e42 100644 --- a/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json +++ b/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json @@ -70,4 +70,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json b/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json index 951cf05ff864..422ce8153558 100644 --- a/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json +++ b/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json @@ -295,4 +295,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/nbsp/output.json b/packages/svelte/tests/parser-legacy/samples/nbsp/output.json index 7d2158955a64..a120b08f327a 100644 --- a/packages/svelte/tests/parser-legacy/samples/nbsp/output.json +++ b/packages/svelte/tests/parser-legacy/samples/nbsp/output.json @@ -22,4 +22,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json b/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json index c60efd4fbaf0..369cd4acc4bf 100644 --- a/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json +++ b/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json @@ -289,4 +289,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json b/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json index 7db0bb7ec15a..b8e1da749937 100644 --- a/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json +++ b/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json @@ -78,4 +78,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/refs/output.json b/packages/svelte/tests/parser-legacy/samples/refs/output.json index e2bda741fa71..0ecccbf957c4 100644 --- a/packages/svelte/tests/parser-legacy/samples/refs/output.json +++ b/packages/svelte/tests/parser-legacy/samples/refs/output.json @@ -119,4 +119,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json b/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json index e0b50e3b92db..e9298ec50c24 100644 --- a/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json @@ -147,4 +147,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json b/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json index b04a823e8db6..502d5df57600 100644 --- a/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json @@ -52,4 +52,4 @@ ] } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json b/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json index 03a526f04e37..7d7e9d1305d5 100644 --- a/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json @@ -175,4 +175,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/script/output.json b/packages/svelte/tests/parser-legacy/samples/script/output.json index d3d4abd6b24f..e30414a2a839 100644 --- a/packages/svelte/tests/parser-legacy/samples/script/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script/output.json @@ -147,4 +147,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json b/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json index f0ba3a5c0d7a..fe59cac4b760 100644 --- a/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json +++ b/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json @@ -14,4 +14,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/self-reference/output.json b/packages/svelte/tests/parser-legacy/samples/self-reference/output.json index 34310fcce46c..44547698fd3c 100644 --- a/packages/svelte/tests/parser-legacy/samples/self-reference/output.json +++ b/packages/svelte/tests/parser-legacy/samples/self-reference/output.json @@ -133,4 +133,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json b/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json index 90ded681031c..c6717f3074bd 100644 --- a/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json +++ b/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json @@ -39,4 +39,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json b/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json index bb6de0bea951..7553651864cc 100644 --- a/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json +++ b/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json @@ -106,4 +106,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/spread/output.json b/packages/svelte/tests/parser-legacy/samples/spread/output.json index 3b79aa967028..b1d80bd5d418 100644 --- a/packages/svelte/tests/parser-legacy/samples/spread/output.json +++ b/packages/svelte/tests/parser-legacy/samples/spread/output.json @@ -36,4 +36,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json b/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json index 733f9e76fff4..25588b950b83 100644 --- a/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json +++ b/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json @@ -30,4 +30,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json b/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json index 60477807b79c..62a295c1352b 100644 --- a/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json +++ b/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json @@ -50,4 +50,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json b/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json index ed3c85b09a07..145de96560cf 100644 --- a/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json +++ b/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json @@ -50,4 +50,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json b/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json index f30788d7583f..bce5a0f281ef 100644 --- a/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json +++ b/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json @@ -33,4 +33,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json b/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json index ae52f72c5d9c..434112ccf519 100644 --- a/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json +++ b/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json @@ -101,4 +101,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json b/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json index 9081b7cb926d..b1595a6839a4 100644 --- a/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json +++ b/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json @@ -77,4 +77,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json index 69b23824423d..dee3ba5f2999 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json @@ -147,4 +147,4 @@ "sourceType": "module" } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json index 2cadbc672f9d..acd9798425f2 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json @@ -82,4 +82,4 @@ "comment": null } } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json index baffebfed7f6..67ffc034368e 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json @@ -29,4 +29,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json index 4fb88b818d83..27f8e537a157 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json @@ -75,4 +75,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json b/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json index 5051d9ba4da1..9df1bf7558a4 100644 --- a/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json +++ b/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json @@ -151,4 +151,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json b/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json index e8f0ca2a4b16..2747fbcbc31d 100644 --- a/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json +++ b/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json @@ -1116,4 +1116,4 @@ "transparent": false }, "options": null -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json b/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json index ed7bd7c8e028..04c5065a11ca 100644 --- a/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json +++ b/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json @@ -407,4 +407,4 @@ "transparent": false }, "options": null -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json b/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json index f89be70f77cf..2e7140d9fb39 100644 --- a/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json +++ b/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json @@ -314,4 +314,4 @@ "transparent": false }, "options": null -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/options/output.json b/packages/svelte/tests/parser-modern/samples/options/output.json index 398c178cb43d..917f24c51690 100644 --- a/packages/svelte/tests/parser-modern/samples/options/output.json +++ b/packages/svelte/tests/parser-modern/samples/options/output.json @@ -205,4 +205,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json b/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json index b900bfc0b3db..8389ebdb72cc 100644 --- a/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json +++ b/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json @@ -113,4 +113,4 @@ "transparent": false }, "options": null -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/snippets/output.json b/packages/svelte/tests/parser-modern/samples/snippets/output.json index 67d30db1b0b1..8ab93ad09204 100644 --- a/packages/svelte/tests/parser-modern/samples/snippets/output.json +++ b/packages/svelte/tests/parser-modern/samples/snippets/output.json @@ -27,8 +27,8 @@ "parameters": [ { "type": "Identifier", - "name": "msg", "start": 43, + "end": 46, "loc": { "start": { "line": 3, @@ -39,7 +39,7 @@ "column": 25 } }, - "end": 46, + "name": "msg", "typeAnnotation": { "type": "TSTypeAnnotation", "start": 46, @@ -233,4 +233,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json b/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json index eb9ffe51de07..af87948be255 100644 --- a/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json +++ b/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json @@ -157,4 +157,4 @@ "transparent": false }, "options": null -} +} \ No newline at end of file diff --git a/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json b/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json index 117496744bdc..9ef0f8d3c6e3 100644 --- a/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json +++ b/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json @@ -499,4 +499,4 @@ } ] } -} +} \ No newline at end of file diff --git a/packages/svelte/tests/snapshot/samples/bind-component-snippet/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/bind-component-snippet/_expected/client/index.svelte.js index 0e193af12d5f..5493a1318eaf 100644 --- a/packages/svelte/tests/snapshot/samples/bind-component-snippet/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/bind-component-snippet/_expected/client/index.svelte.js @@ -7,14 +7,14 @@ var root = $.template(` `, 1); export default function Bind_component_snippet($$anchor) { var snippet = ($$anchor) => { - var fragment = root_1(); + var fragment = root_1($$anchor); $.append($$anchor, fragment); }; let value = $.source(''); const _snippet = snippet; - var fragment_1 = root(); + var fragment_1 = root($$anchor); var node = $.first_child(fragment_1); TextInput(node, { diff --git a/packages/svelte/tests/snapshot/samples/bind-this/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/bind-this/_expected/client/index.svelte.js index c766ee0a79b4..8ed7cb6ad9fd 100644 --- a/packages/svelte/tests/snapshot/samples/bind-this/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/bind-this/_expected/client/index.svelte.js @@ -2,7 +2,7 @@ import "svelte/internal/disclose-version"; import * as $ from "svelte/internal/client"; export default function Bind_this($$anchor) { - var fragment = $.comment(); + var fragment = $.comment($$anchor); var node = $.first_child(fragment); $.bind_this(Foo(node, { $$legacy: true }), ($$value) => foo = $$value, () => foo); diff --git a/packages/svelte/tests/snapshot/samples/dynamic-attributes-casing/_expected/client/main.svelte.js b/packages/svelte/tests/snapshot/samples/dynamic-attributes-casing/_expected/client/main.svelte.js index aa4d22d99a6d..b7324aabb099 100644 --- a/packages/svelte/tests/snapshot/samples/dynamic-attributes-casing/_expected/client/main.svelte.js +++ b/packages/svelte/tests/snapshot/samples/dynamic-attributes-casing/_expected/client/main.svelte.js @@ -7,7 +7,7 @@ export default function Main($$anchor) { // needs to be a snapshot test because jsdom does auto-correct the attribute casing let x = 'test'; let y = () => 'test'; - var fragment = root(); + var fragment = root($$anchor); var div = $.first_child(fragment); var svg = $.sibling($.sibling(div, true)); var custom_element = $.sibling($.sibling(svg, true)); diff --git a/packages/svelte/tests/snapshot/samples/each-string-template/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/each-string-template/_expected/client/index.svelte.js index 5d5e47faf2d6..120ea6f4e0d2 100644 --- a/packages/svelte/tests/snapshot/samples/each-string-template/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/each-string-template/_expected/client/index.svelte.js @@ -2,7 +2,7 @@ import "svelte/internal/disclose-version"; import * as $ from "svelte/internal/client"; export default function Each_string_template($$anchor) { - var fragment = $.comment(); + var fragment = $.comment($$anchor); var node = $.first_child(fragment); $.each(node, 1, () => ['foo', 'bar', 'baz'], $.index, ($$anchor, thing, $$index) => { diff --git a/packages/svelte/tests/snapshot/samples/function-prop-no-getter/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/function-prop-no-getter/_expected/client/index.svelte.js index 2d25ba9fd25c..f20857e33b21 100644 --- a/packages/svelte/tests/snapshot/samples/function-prop-no-getter/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/function-prop-no-getter/_expected/client/index.svelte.js @@ -9,7 +9,7 @@ export default function Function_prop_no_getter($$anchor) { } const plusOne = (num) => num + 1; - var fragment = $.comment(); + var fragment = $.comment($$anchor); var node = $.first_child(fragment); Button(node, { diff --git a/packages/svelte/tests/snapshot/samples/hello-world/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/hello-world/_expected/client/index.svelte.js index 92354d8f1483..ef0633e0d62f 100644 --- a/packages/svelte/tests/snapshot/samples/hello-world/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/hello-world/_expected/client/index.svelte.js @@ -4,7 +4,7 @@ import * as $ from "svelte/internal/client"; var root = $.template(`

    hello world

    `); export default function Hello_world($$anchor) { - var h1 = root(); + var h1 = root($$anchor); $.append($$anchor, h1); } \ No newline at end of file diff --git a/packages/svelte/tests/snapshot/samples/hmr/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/hmr/_expected/client/index.svelte.js index 6cb6845c1cce..fe88cae0f10e 100644 --- a/packages/svelte/tests/snapshot/samples/hmr/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/hmr/_expected/client/index.svelte.js @@ -4,7 +4,7 @@ import * as $ from "svelte/internal/client"; var root = $.template(`

    hello world

    `); function Hmr($$anchor) { - var h1 = root(); + var h1 = root($$anchor); $.append($$anchor, h1); } diff --git a/packages/svelte/tests/snapshot/samples/state-proxy-literal/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/state-proxy-literal/_expected/client/index.svelte.js index 7cb2415bf565..7b568077bb35 100644 --- a/packages/svelte/tests/snapshot/samples/state-proxy-literal/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/state-proxy-literal/_expected/client/index.svelte.js @@ -13,7 +13,7 @@ var root = $.template(` `, 1); export default function State_proxy_literal($$anchor) { let str = $.source(''); let tpl = $.source(``); - var fragment = root(); + var fragment = root($$anchor); var input = $.first_child(fragment); $.remove_input_defaults(input); @@ -30,4 +30,4 @@ export default function State_proxy_literal($$anchor) { $.append($$anchor, fragment); } -$.delegate(["click"]); +$.delegate(["click"]); \ No newline at end of file diff --git a/packages/svelte/tests/snapshot/samples/svelte-element/_expected/client/index.svelte.js b/packages/svelte/tests/snapshot/samples/svelte-element/_expected/client/index.svelte.js index a4bbea582bf3..5caf3181488b 100644 --- a/packages/svelte/tests/snapshot/samples/svelte-element/_expected/client/index.svelte.js +++ b/packages/svelte/tests/snapshot/samples/svelte-element/_expected/client/index.svelte.js @@ -3,7 +3,7 @@ import * as $ from "svelte/internal/client"; export default function Svelte_element($$anchor, $$props) { let tag = $.prop($$props, "tag", 3, 'hr'); - var fragment = $.comment(); + var fragment = $.comment($$anchor); var node = $.first_child(fragment); $.element(node, tag, false); From 887aab33e57a135e783b37fd0912c31988fe4b29 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Wed, 26 Jun 2024 11:28:54 +0100 Subject: [PATCH 05/10] lint --- .../parser-legacy/samples/action-duplicate/output.json | 2 +- .../parser-legacy/samples/action-with-call/output.json | 2 +- .../samples/action-with-identifier/output.json | 2 +- .../parser-legacy/samples/action-with-literal/output.json | 2 +- .../svelte/tests/parser-legacy/samples/action/output.json | 2 +- .../tests/parser-legacy/samples/animation/output.json | 2 +- .../samples/attribute-class-directive/output.json | 2 +- .../samples/attribute-containing-solidus/output.json | 2 +- .../samples/attribute-curly-bracket/output.json | 2 +- .../samples/attribute-dynamic-boolean/output.json | 2 +- .../parser-legacy/samples/attribute-dynamic/output.json | 2 +- .../parser-legacy/samples/attribute-empty/output.json | 2 +- .../parser-legacy/samples/attribute-escaped/output.json | 2 +- .../parser-legacy/samples/attribute-multiple/output.json | 2 +- .../parser-legacy/samples/attribute-shorthand/output.json | 2 +- .../samples/attribute-static-boolean/output.json | 2 +- .../parser-legacy/samples/attribute-static/output.json | 2 +- .../attribute-style-directive-modifiers/output.json | 6 ++---- .../attribute-style-directive-shorthand/output.json | 2 +- .../samples/attribute-style-directive-string/output.json | 2 +- .../samples/attribute-style-directive/output.json | 2 +- .../parser-legacy/samples/attribute-style/output.json | 2 +- .../parser-legacy/samples/attribute-unquoted/output.json | 2 +- .../samples/attribute-with-whitespace/output.json | 2 +- .../tests/parser-legacy/samples/await-catch/output.json | 2 +- .../parser-legacy/samples/await-then-catch/output.json | 2 +- .../parser-legacy/samples/binding-shorthand/output.json | 2 +- .../svelte/tests/parser-legacy/samples/binding/output.json | 2 +- .../parser-legacy/samples/comment-with-ignores/output.json | 7 ++----- .../svelte/tests/parser-legacy/samples/comment/output.json | 2 +- .../parser-legacy/samples/component-dynamic/output.json | 2 +- .../samples/convert-entities-in-element/output.json | 2 +- .../parser-legacy/samples/convert-entities/output.json | 2 +- .../svelte/tests/parser-legacy/samples/css/output.json | 2 +- .../samples/dynamic-element-string/output.json | 2 +- .../samples/dynamic-element-variable/output.json | 2 +- .../tests/parser-legacy/samples/dynamic-import/output.json | 2 +- .../samples/each-block-destructured/output.json | 2 +- .../parser-legacy/samples/each-block-else/output.json | 2 +- .../parser-legacy/samples/each-block-indexed/output.json | 2 +- .../parser-legacy/samples/each-block-keyed/output.json | 2 +- .../tests/parser-legacy/samples/each-block/output.json | 2 +- .../element-with-attribute-empty-string/output.json | 2 +- .../samples/element-with-attribute/output.json | 2 +- .../samples/element-with-mustache/output.json | 2 +- .../parser-legacy/samples/element-with-text/output.json | 2 +- .../tests/parser-legacy/samples/elements/output.json | 2 +- .../tests/parser-legacy/samples/event-handler/output.json | 2 +- .../tests/parser-legacy/samples/if-block-else/output.json | 2 +- .../parser-legacy/samples/if-block-elseif/output.json | 2 +- .../tests/parser-legacy/samples/if-block/output.json | 2 +- .../parser-legacy/samples/implicitly-closed-li/output.json | 2 +- .../parser-legacy/samples/javascript-comments/output.json | 2 +- .../svelte/tests/parser-legacy/samples/nbsp/output.json | 2 +- .../samples/no-error-if-before-closing/output.json | 2 +- .../tests/parser-legacy/samples/raw-mustaches/output.json | 2 +- .../svelte/tests/parser-legacy/samples/refs/output.json | 2 +- .../samples/script-attribute-with-curly-braces/output.json | 2 +- .../parser-legacy/samples/script-comment-only/output.json | 2 +- .../samples/script-context-module-unquoted/output.json | 2 +- .../svelte/tests/parser-legacy/samples/script/output.json | 2 +- .../parser-legacy/samples/self-closing-element/output.json | 2 +- .../tests/parser-legacy/samples/self-reference/output.json | 2 +- .../parser-legacy/samples/slotted-element/output.json | 2 +- .../samples/space-between-mustaches/output.json | 2 +- .../svelte/tests/parser-legacy/samples/spread/output.json | 2 +- .../parser-legacy/samples/style-inside-head/output.json | 2 +- .../parser-legacy/samples/textarea-children/output.json | 2 +- .../parser-legacy/samples/textarea-end-tag/output.json | 2 +- .../samples/transition-intro-no-params/output.json | 2 +- .../parser-legacy/samples/transition-intro/output.json | 2 +- .../parser-legacy/samples/unusual-identifier/output.json | 2 +- .../samples/whitespace-after-script-tag/output.json | 2 +- .../samples/whitespace-after-style-tag/output.json | 2 +- .../samples/whitespace-leading-trailing/output.json | 2 +- .../parser-legacy/samples/whitespace-normal/output.json | 2 +- .../samples/comment-before-script/output.json | 2 +- .../tests/parser-modern/samples/css-nth-syntax/output.json | 2 +- .../parser-modern/samples/css-pseudo-classes/output.json | 2 +- .../samples/each-block-object-pattern/output.json | 2 +- .../svelte/tests/parser-modern/samples/options/output.json | 2 +- .../samples/semicolon-inside-quotes/output.json | 2 +- .../tests/parser-modern/samples/snippets/output.json | 2 +- .../parser-modern/samples/template-shadowroot/output.json | 2 +- .../samples/typescript-in-event-handler/output.json | 2 +- 85 files changed, 87 insertions(+), 92 deletions(-) diff --git a/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json b/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json index c310754298c8..3dad9bb4e523 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-duplicate/output.json @@ -31,4 +31,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json b/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json index af416ffac254..66ce187c625a 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-with-call/output.json @@ -73,4 +73,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json b/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json index 229ab78006b3..39a6f5f64702 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-with-identifier/output.json @@ -38,4 +38,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json b/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json index 5a6529a9335e..94c60b701a44 100644 --- a/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action-with-literal/output.json @@ -39,4 +39,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/action/output.json b/packages/svelte/tests/parser-legacy/samples/action/output.json index 55cbff860b63..d72bf7db1012 100644 --- a/packages/svelte/tests/parser-legacy/samples/action/output.json +++ b/packages/svelte/tests/parser-legacy/samples/action/output.json @@ -23,4 +23,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/animation/output.json b/packages/svelte/tests/parser-legacy/samples/animation/output.json index 6e1d1045bec9..0d82cb2bb917 100644 --- a/packages/svelte/tests/parser-legacy/samples/animation/output.json +++ b/packages/svelte/tests/parser-legacy/samples/animation/output.json @@ -88,4 +88,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json index 8c27c8bcb446..9efe9acf8dda 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-class-directive/output.json @@ -38,4 +38,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json index c67811fab964..2c63b3a43d13 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-containing-solidus/output.json @@ -38,4 +38,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json index a137dd795b3f..2453dc9e0a07 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-curly-bracket/output.json @@ -52,4 +52,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json index 5462eaf71333..5793afe896fd 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic-boolean/output.json @@ -44,4 +44,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json index 6acc5ebeb133..9fd98c80ec27 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-dynamic/output.json @@ -80,4 +80,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json index 478ba2e52560..d2a3dcd93bf6 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-empty/output.json @@ -105,4 +105,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json index 74fa6f2aec1b..e2eb99f32774 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json @@ -30,4 +30,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json index 80bbdf0e21ed..66b780e53661 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-multiple/output.json @@ -45,4 +45,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json index 87a01d4b09f3..2ae3acfdc7eb 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-shorthand/output.json @@ -34,4 +34,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json index a059934e4075..8cb93b75ec08 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-static-boolean/output.json @@ -22,4 +22,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json index 94608a0eba0e..3e19a4727ea3 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-static/output.json @@ -30,4 +30,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json index 45bb6f0e2ec8..b7de71ff5ae6 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-modifiers/output.json @@ -15,9 +15,7 @@ "end": 36, "type": "StyleDirective", "name": "color", - "modifiers": [ - "important" - ], + "modifiers": ["important"], "value": [ { "type": "MustacheTag", @@ -47,4 +45,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json index 4ad7aaf7f78b..d7f53cb00ca2 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-shorthand/output.json @@ -23,4 +23,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json index 9693f9778275..5acf7d797eaa 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive-string/output.json @@ -359,4 +359,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json index 08e2032db321..2cce9fef952c 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style-directive/output.json @@ -45,4 +45,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json index d029f9ef7108..1d9a528d6d3d 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-style/output.json @@ -38,4 +38,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json index b82bec517d1a..5df4d66ab668 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json @@ -30,4 +30,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json b/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json index 31652f1fd5ee..4d3a29180869 100644 --- a/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json +++ b/packages/svelte/tests/parser-legacy/samples/attribute-with-whitespace/output.json @@ -46,4 +46,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/await-catch/output.json b/packages/svelte/tests/parser-legacy/samples/await-catch/output.json index 5c2fa74e425e..5572d573f89e 100644 --- a/packages/svelte/tests/parser-legacy/samples/await-catch/output.json +++ b/packages/svelte/tests/parser-legacy/samples/await-catch/output.json @@ -183,4 +183,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json b/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json index 5548cfc22eb5..b71365f39deb 100644 --- a/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json +++ b/packages/svelte/tests/parser-legacy/samples/await-then-catch/output.json @@ -252,4 +252,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json b/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json index 9d31edabf748..672014629791 100644 --- a/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json +++ b/packages/svelte/tests/parser-legacy/samples/binding-shorthand/output.json @@ -109,4 +109,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/binding/output.json b/packages/svelte/tests/parser-legacy/samples/binding/output.json index 288f9182abd7..4ce069bd37c0 100644 --- a/packages/svelte/tests/parser-legacy/samples/binding/output.json +++ b/packages/svelte/tests/parser-legacy/samples/binding/output.json @@ -119,4 +119,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json b/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json index 74d0a5270773..cf2dc9f75209 100644 --- a/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json +++ b/packages/svelte/tests/parser-legacy/samples/comment-with-ignores/output.json @@ -9,11 +9,8 @@ "start": 0, "end": 31, "data": " svelte-ignore foo, bar ", - "ignores": [ - "foo", - "bar" - ] + "ignores": ["foo", "bar"] } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/comment/output.json b/packages/svelte/tests/parser-legacy/samples/comment/output.json index a721ddd8dc5b..6017db404cb9 100644 --- a/packages/svelte/tests/parser-legacy/samples/comment/output.json +++ b/packages/svelte/tests/parser-legacy/samples/comment/output.json @@ -13,4 +13,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json b/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json index 7e7267498fdc..f624a04c617b 100644 --- a/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json +++ b/packages/svelte/tests/parser-legacy/samples/component-dynamic/output.json @@ -77,4 +77,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json b/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json index 3025f2c8007e..f7a8a3c67794 100644 --- a/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json +++ b/packages/svelte/tests/parser-legacy/samples/convert-entities-in-element/output.json @@ -22,4 +22,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json b/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json index c43621cc6bb8..c336a3978c30 100644 --- a/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json +++ b/packages/svelte/tests/parser-legacy/samples/convert-entities/output.json @@ -13,4 +13,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/css/output.json b/packages/svelte/tests/parser-legacy/samples/css/output.json index 443d6d2d5000..b3ecd7b6712a 100644 --- a/packages/svelte/tests/parser-legacy/samples/css/output.json +++ b/packages/svelte/tests/parser-legacy/samples/css/output.json @@ -82,4 +82,4 @@ "comment": null } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json b/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json index 5f73e70b5ee7..9ba15d604484 100644 --- a/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json +++ b/packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json @@ -171,4 +171,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json b/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json index 7c75c8bc2a5f..291cdaa73405 100644 --- a/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json +++ b/packages/svelte/tests/parser-legacy/samples/dynamic-element-variable/output.json @@ -77,4 +77,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json b/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json index 070bd1724806..a439b65dd0ec 100644 --- a/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json +++ b/packages/svelte/tests/parser-legacy/samples/dynamic-import/output.json @@ -479,4 +479,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json index 68b4b1f535db..d19f5cbbfd8c 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-destructured/output.json @@ -265,4 +265,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json index f5145063e44c..a6db309edb08 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-else/output.json @@ -100,4 +100,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json index ce2f921d86ac..bce7fd81a211 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json @@ -106,4 +106,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json b/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json index 637dab61b897..2f6206a6cbeb 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block-keyed/output.json @@ -126,4 +126,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/each-block/output.json b/packages/svelte/tests/parser-legacy/samples/each-block/output.json index 82390bb62874..f26f557958db 100644 --- a/packages/svelte/tests/parser-legacy/samples/each-block/output.json +++ b/packages/svelte/tests/parser-legacy/samples/each-block/output.json @@ -77,4 +77,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json index afdcbf4297cf..7773256d44ea 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-attribute-empty-string/output.json @@ -61,4 +61,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json index b6740a61357c..9477886bb289 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-attribute/output.json @@ -61,4 +61,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json index 9bb92244ce68..ce0dc25e85c6 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-mustache/output.json @@ -50,4 +50,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json b/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json index d8bb9e9c1185..fde57c470a64 100644 --- a/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json +++ b/packages/svelte/tests/parser-legacy/samples/element-with-text/output.json @@ -22,4 +22,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/elements/output.json b/packages/svelte/tests/parser-legacy/samples/elements/output.json index 97513445d695..6b51383d9339 100644 --- a/packages/svelte/tests/parser-legacy/samples/elements/output.json +++ b/packages/svelte/tests/parser-legacy/samples/elements/output.json @@ -22,4 +22,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/event-handler/output.json b/packages/svelte/tests/parser-legacy/samples/event-handler/output.json index 396e314da58e..45b625667706 100644 --- a/packages/svelte/tests/parser-legacy/samples/event-handler/output.json +++ b/packages/svelte/tests/parser-legacy/samples/event-handler/output.json @@ -161,4 +161,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json b/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json index 34efb9fd7b22..4ba9370d8870 100644 --- a/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json +++ b/packages/svelte/tests/parser-legacy/samples/if-block-else/output.json @@ -68,4 +68,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json b/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json index 2ae1f06cc990..3e6953ab0b3d 100644 --- a/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json +++ b/packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json @@ -158,4 +158,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/if-block/output.json b/packages/svelte/tests/parser-legacy/samples/if-block/output.json index 1c60df0d31c8..61ecf6e3b2b4 100644 --- a/packages/svelte/tests/parser-legacy/samples/if-block/output.json +++ b/packages/svelte/tests/parser-legacy/samples/if-block/output.json @@ -36,4 +36,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json b/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json index be5fba538e42..a56701894e63 100644 --- a/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json +++ b/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li/output.json @@ -70,4 +70,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json b/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json index 422ce8153558..951cf05ff864 100644 --- a/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json +++ b/packages/svelte/tests/parser-legacy/samples/javascript-comments/output.json @@ -295,4 +295,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/nbsp/output.json b/packages/svelte/tests/parser-legacy/samples/nbsp/output.json index a120b08f327a..7d2158955a64 100644 --- a/packages/svelte/tests/parser-legacy/samples/nbsp/output.json +++ b/packages/svelte/tests/parser-legacy/samples/nbsp/output.json @@ -22,4 +22,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json b/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json index 369cd4acc4bf..c60efd4fbaf0 100644 --- a/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json +++ b/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/output.json @@ -289,4 +289,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json b/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json index b8e1da749937..7db0bb7ec15a 100644 --- a/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json +++ b/packages/svelte/tests/parser-legacy/samples/raw-mustaches/output.json @@ -78,4 +78,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/refs/output.json b/packages/svelte/tests/parser-legacy/samples/refs/output.json index 0ecccbf957c4..e2bda741fa71 100644 --- a/packages/svelte/tests/parser-legacy/samples/refs/output.json +++ b/packages/svelte/tests/parser-legacy/samples/refs/output.json @@ -119,4 +119,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json b/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json index e9298ec50c24..e0b50e3b92db 100644 --- a/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script-attribute-with-curly-braces/output.json @@ -147,4 +147,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json b/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json index 502d5df57600..b04a823e8db6 100644 --- a/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script-comment-only/output.json @@ -52,4 +52,4 @@ ] } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json b/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json index 7d7e9d1305d5..03a526f04e37 100644 --- a/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script-context-module-unquoted/output.json @@ -175,4 +175,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/script/output.json b/packages/svelte/tests/parser-legacy/samples/script/output.json index e30414a2a839..d3d4abd6b24f 100644 --- a/packages/svelte/tests/parser-legacy/samples/script/output.json +++ b/packages/svelte/tests/parser-legacy/samples/script/output.json @@ -147,4 +147,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json b/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json index fe59cac4b760..f0ba3a5c0d7a 100644 --- a/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json +++ b/packages/svelte/tests/parser-legacy/samples/self-closing-element/output.json @@ -14,4 +14,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/self-reference/output.json b/packages/svelte/tests/parser-legacy/samples/self-reference/output.json index 44547698fd3c..34310fcce46c 100644 --- a/packages/svelte/tests/parser-legacy/samples/self-reference/output.json +++ b/packages/svelte/tests/parser-legacy/samples/self-reference/output.json @@ -133,4 +133,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json b/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json index c6717f3074bd..90ded681031c 100644 --- a/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json +++ b/packages/svelte/tests/parser-legacy/samples/slotted-element/output.json @@ -39,4 +39,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json b/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json index 7553651864cc..bb6de0bea951 100644 --- a/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json +++ b/packages/svelte/tests/parser-legacy/samples/space-between-mustaches/output.json @@ -106,4 +106,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/spread/output.json b/packages/svelte/tests/parser-legacy/samples/spread/output.json index b1d80bd5d418..3b79aa967028 100644 --- a/packages/svelte/tests/parser-legacy/samples/spread/output.json +++ b/packages/svelte/tests/parser-legacy/samples/spread/output.json @@ -36,4 +36,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json b/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json index 25588b950b83..733f9e76fff4 100644 --- a/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json +++ b/packages/svelte/tests/parser-legacy/samples/style-inside-head/output.json @@ -30,4 +30,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json b/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json index 62a295c1352b..60477807b79c 100644 --- a/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json +++ b/packages/svelte/tests/parser-legacy/samples/textarea-children/output.json @@ -50,4 +50,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json b/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json index 145de96560cf..ed3c85b09a07 100644 --- a/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json +++ b/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/output.json @@ -50,4 +50,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json b/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json index bce5a0f281ef..f30788d7583f 100644 --- a/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json +++ b/packages/svelte/tests/parser-legacy/samples/transition-intro-no-params/output.json @@ -33,4 +33,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json b/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json index 434112ccf519..ae52f72c5d9c 100644 --- a/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json +++ b/packages/svelte/tests/parser-legacy/samples/transition-intro/output.json @@ -101,4 +101,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json b/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json index b1595a6839a4..9081b7cb926d 100644 --- a/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json +++ b/packages/svelte/tests/parser-legacy/samples/unusual-identifier/output.json @@ -77,4 +77,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json index dee3ba5f2999..69b23824423d 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-after-script-tag/output.json @@ -147,4 +147,4 @@ "sourceType": "module" } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json index acd9798425f2..2cadbc672f9d 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-after-style-tag/output.json @@ -82,4 +82,4 @@ "comment": null } } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json index 67ffc034368e..baffebfed7f6 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-leading-trailing/output.json @@ -29,4 +29,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json b/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json index 27f8e537a157..4fb88b818d83 100644 --- a/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json +++ b/packages/svelte/tests/parser-legacy/samples/whitespace-normal/output.json @@ -75,4 +75,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json b/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json index 9df1bf7558a4..5051d9ba4da1 100644 --- a/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json +++ b/packages/svelte/tests/parser-modern/samples/comment-before-script/output.json @@ -151,4 +151,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json b/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json index 2747fbcbc31d..e8f0ca2a4b16 100644 --- a/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json +++ b/packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json @@ -1116,4 +1116,4 @@ "transparent": false }, "options": null -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json b/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json index 04c5065a11ca..ed7bd7c8e028 100644 --- a/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json +++ b/packages/svelte/tests/parser-modern/samples/css-pseudo-classes/output.json @@ -407,4 +407,4 @@ "transparent": false }, "options": null -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json b/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json index 2e7140d9fb39..f89be70f77cf 100644 --- a/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json +++ b/packages/svelte/tests/parser-modern/samples/each-block-object-pattern/output.json @@ -314,4 +314,4 @@ "transparent": false }, "options": null -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/options/output.json b/packages/svelte/tests/parser-modern/samples/options/output.json index 917f24c51690..398c178cb43d 100644 --- a/packages/svelte/tests/parser-modern/samples/options/output.json +++ b/packages/svelte/tests/parser-modern/samples/options/output.json @@ -205,4 +205,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json b/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json index 8389ebdb72cc..b900bfc0b3db 100644 --- a/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json +++ b/packages/svelte/tests/parser-modern/samples/semicolon-inside-quotes/output.json @@ -113,4 +113,4 @@ "transparent": false }, "options": null -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/snippets/output.json b/packages/svelte/tests/parser-modern/samples/snippets/output.json index 8ab93ad09204..0926c2fb2669 100644 --- a/packages/svelte/tests/parser-modern/samples/snippets/output.json +++ b/packages/svelte/tests/parser-modern/samples/snippets/output.json @@ -233,4 +233,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json b/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json index af87948be255..eb9ffe51de07 100644 --- a/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json +++ b/packages/svelte/tests/parser-modern/samples/template-shadowroot/output.json @@ -157,4 +157,4 @@ "transparent": false }, "options": null -} \ No newline at end of file +} diff --git a/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json b/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json index 9ef0f8d3c6e3..117496744bdc 100644 --- a/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json +++ b/packages/svelte/tests/parser-modern/samples/typescript-in-event-handler/output.json @@ -499,4 +499,4 @@ } ] } -} \ No newline at end of file +} From ef4b70ed2c60d84273f2dee4cc00e02472d1efc0 Mon Sep 17 00:00:00 2001 From: Ahmad S Date: Thu, 27 Jun 2024 10:49:48 +0300 Subject: [PATCH 06/10] docs: correct $effect examples (#12196) --- .../src/routes/docs/content/01-api/02-runes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md b/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md index 4a84e3a0f775..b83d347d2b3a 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md +++ b/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md @@ -337,7 +337,7 @@ In general, `$effect` is best considered something of an escape hatch — useful > For things that are more complicated than a simple expression like `count * 2`, you can also use [`$derived.by`](#$derived-by). -You might be tempted to do something convoluted with effects to link one value to another. The following example shows two inputs for "money spent" and "money left" that are connected to each other. If you update one, the other should update accordingly. Don't use effects for this ([demo](/#H4sIAAAAAAAACpVRy2rDMBD8lWXJwYE0dg-9KFYg31H3oNirIJBlYa1DjPG_F8l1XEop9LgzOzP7mFAbSwHF-4ROtYQCL97jAXn0sQh3skx4wNANfR2RMtS98XyuXMWWGLhjZUHCa1GcVix4cgwSdoEVU1bsn4wl_Y1I2kS6inekNdWcZXuQZ5giFDWpfwl5WYyT2fynbB1g1UWbTVbm2w6utOpKNq1TGucHhri6rLBX7kYVwtW4RtyVHUhOyXeGVj3klLxnyJP0i8lXNJUx6en-v6A48K85kTimpi0sYj-yAo-Wlh9FcL1LY4K3ahSgLT1OC3ZTXkBxfKN2uVC6T5LjAduuMdpQg4L7geaP-RNHPuClMQIAAA==)): +You might be tempted to do something convoluted with effects to link one value to another. The following example shows two inputs for "money spent" and "money left" that are connected to each other. If you update one, the other should update accordingly. Don't use effects for this ([demo](/#H4sIAAAAAAAACpVRQWrDMBD8ihA5ONDG7qEXxQ70HXUPir0KgrUsrHWIMf57pXWdlFIKPe6MZmZnNUtjEYJU77N0ugOp5Jv38knS5NMQroAEcQ79ODQJKUMzWE-n2tWEQIJ60igq8VIUxw0LHhxFbBdIE2TF_s4gmG8Ea5mM9A6MgYaybC-qk5gTlDT8fg15Xo3ZbPlTti2w6ZLNQ1bmjw6uRH0G5DqldX6MjWL1qpaDdheopThb16qrxhGqmX0X0elbNbP3InKWfjH5hvKYku7u_wtKC_-aw8Q9Jk0_UgJNCOvvJHC7SGuDRz0pYRBuxxW7aK9EcXiFbr0NX4bl8cO7vrXGQisVDSMsH8sniirsuSsCAAA=)): ```svelte + + + +{#each messages as msg, i (`${msg.id}_${msg.tmpId ?? ""}`)} + {#if i === 0} +

    first

    + {/if} +

    {msg.content}

    +{/each} From 1488aeaea77c459600c1a1cea20615a756f0771a Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 27 Jun 2024 12:40:41 +0100 Subject: [PATCH 10/10] lint --- .../samples/each-updates-8/_config.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/svelte/tests/runtime-runes/samples/each-updates-8/_config.js b/packages/svelte/tests/runtime-runes/samples/each-updates-8/_config.js index e01fcf6f9787..e675dcaf67c1 100644 --- a/packages/svelte/tests/runtime-runes/samples/each-updates-8/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/each-updates-8/_config.js @@ -16,11 +16,17 @@ export default test({ btn1.click(); }); - assert.htmlEqual(target.innerHTML, `

    first

    message 1

    message 2

    `); + assert.htmlEqual( + target.innerHTML, + `

    first

    message 1

    message 2

    ` + ); await Promise.resolve(); - assert.htmlEqual(target.innerHTML, `

    first

    message 1

    message 2

    `); + assert.htmlEqual( + target.innerHTML, + `

    first

    message 1

    message 2

    ` + ); flushSync(() => { btn1.click(); @@ -28,6 +34,9 @@ export default test({ await Promise.resolve(); - assert.htmlEqual(target.innerHTML, `

    first

    message 1

    message 2

    message 3

    `); + assert.htmlEqual( + target.innerHTML, + `

    first

    message 1

    message 2

    message 3

    ` + ); } });