Skip to content

Commit d268bf1

Browse files
committed
rename close to append
1 parent 78ab30c commit d268bf1

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ function serialize_bind_this(bind_this, context, node) {
933933
* // for the main block:
934934
* const id = block_name();
935935
* // init stuff and possibly render effect
936-
* $.close($$anchor, id);
936+
* $.append($$anchor, id);
937937
* ```
938938
* Adds the hoisted parts to `context.state.hoisted` and returns the statements of the main block.
939939
* @param {import('#compiler').SvelteNode} parent
@@ -1015,7 +1015,7 @@ function create_block(parent, name, nodes, context) {
10151015
);
10161016

10171017
body.push(b.var(id, b.call(template_name)), ...state.before_init, ...state.init);
1018-
close = b.stmt(b.call('$.close', b.id('$$anchor'), id));
1018+
close = b.stmt(b.call('$.append', b.id('$$anchor'), id));
10191019
} else if (is_single_child_not_needing_template) {
10201020
context.visit(trimmed[0], state);
10211021
body.push(...state.before_init, ...state.init);
@@ -1036,7 +1036,7 @@ function create_block(parent, name, nodes, context) {
10361036
});
10371037

10381038
body.push(b.var(id, b.call('$.text', b.id('$$anchor'))), ...state.before_init, ...state.init);
1039-
close = b.stmt(b.call('$.close', b.id('$$anchor'), id));
1039+
close = b.stmt(b.call('$.append', b.id('$$anchor'), id));
10401040
} else {
10411041
/** @type {(is_text: boolean) => import('estree').Expression} */
10421042
const expression = (is_text) =>
@@ -1072,7 +1072,7 @@ function create_block(parent, name, nodes, context) {
10721072

10731073
body.push(...state.before_init, ...state.init);
10741074

1075-
close = b.stmt(b.call('$.close', b.id('$$anchor'), id));
1075+
close = b.stmt(b.call('$.append', b.id('$$anchor'), id));
10761076
}
10771077
} else {
10781078
body.push(...state.before_init, ...state.init);

packages/svelte/src/internal/client/dom/elements/custom-element.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClassComponent } from '../../../../legacy/legacy-client.js';
22
import { destroy_effect, render_effect } from '../../reactivity/effects.js';
3-
import { close } from '../template.js';
3+
import { append } from '../template.js';
44
import { define_property } from '../../utils.js';
55

66
/**
@@ -101,7 +101,7 @@ if (typeof HTMLElement === 'function') {
101101
const slot = document.createElement('slot');
102102
if (name !== 'default') slot.name = name;
103103

104-
close(anchor, slot);
104+
append(anchor, slot);
105105
};
106106
}
107107
/** @type {Record<string, any>} */

packages/svelte/src/internal/client/dom/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export const comment = template('<!>', TEMPLATE_FRAGMENT);
159159
* @param {import('#client').Dom} dom
160160
* @returns {import('#client').Dom}
161161
*/
162-
export function close(anchor, dom) {
162+
export function append(anchor, dom) {
163163
var current = dom;
164164

165165
if (!hydrating) {

packages/svelte/tests/snapshot/samples/bind-this/_expected/client/index.svelte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export default function Bind_this($$anchor, $$props) {
1111
var node = $.first_child(fragment);
1212

1313
$.bind_this(Foo(node, {}), ($$value) => foo = $$value, () => foo);
14-
$.close($$anchor, fragment);
14+
$.append($$anchor, fragment);
1515
$.pop();
1616
}

packages/svelte/tests/snapshot/samples/dynamic-attributes-casing/_expected/client/main.svelte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ export default function Main($$anchor, $$props) {
3333
$.set_custom_element_data(custom_element, "fooBar", x);
3434
});
3535

36-
$.close($$anchor, fragment);
36+
$.append($$anchor, fragment);
3737
$.pop();
3838
}

packages/svelte/tests/snapshot/samples/each-string-template/_expected/client/index.svelte.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export default function Each_string_template($$anchor, $$props) {
1414
var text = $.text($$anchor);
1515

1616
$.render_effect(() => $.set_text(text, `${$.stringify($.unwrap(thing))}, `));
17-
return $.close($$anchor, text);
17+
return $.append($$anchor, text);
1818
});
1919

20-
$.close($$anchor, fragment);
20+
$.append($$anchor, fragment);
2121
$.pop();
2222
}

packages/svelte/tests/snapshot/samples/function-prop-no-getter/_expected/client/index.svelte.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export default function Function_prop_no_getter($$anchor, $$props) {
2424
var text = $.text($$anchor);
2525

2626
$.render_effect(() => $.set_text(text, `clicks: ${$.stringify($.get(count))}`));
27-
return $.close($$anchor, text);
27+
return $.append($$anchor, text);
2828
}
2929
});
3030

31-
$.close($$anchor, fragment);
31+
$.append($$anchor, fragment);
3232
$.pop();
3333
}

packages/svelte/tests/snapshot/samples/hello-world/_expected/client/index.svelte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export default function Hello_world($$anchor, $$props) {
1111

1212
var h1 = frag();
1313

14-
$.close($$anchor, h1);
14+
$.append($$anchor, h1);
1515
$.pop();
1616
}

packages/svelte/tests/snapshot/samples/state-proxy-literal/_expected/client/index.svelte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function State_proxy_literal($$anchor, $$props) {
3131
button.__click = [reset, str, tpl];
3232
$.bind_value(input, () => $.get(str), ($$value) => $.set(str, $$value));
3333
$.bind_value(input_1, () => $.get(tpl), ($$value) => $.set(tpl, $$value));
34-
$.close($$anchor, fragment);
34+
$.append($$anchor, fragment);
3535
$.pop();
3636
}
3737

packages/svelte/tests/snapshot/samples/svelte-element/_expected/client/index.svelte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export default function Svelte_element($$anchor, $$props) {
1111
var node = $.first_child(fragment);
1212

1313
$.element(node, tag, false);
14-
$.close($$anchor, fragment);
14+
$.append($$anchor, fragment);
1515
$.pop();
1616
}

0 commit comments

Comments
 (0)