Skip to content

Commit 4f50b74

Browse files
committed
cleanup
1 parent 74a3177 commit 4f50b74

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

packages/svelte/src/internal/client/dom/blocks/each.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
HYDRATION_START
1010
} from '../../../../constants.js';
1111
import { hydrate_anchor, hydrate_nodes, hydrating, set_hydrating } from '../hydration.js';
12-
import { clear_text_content, empty, internal_next_sibling } from '../operations.js';
12+
import { clear_text_content, empty, next_sibling } from '../operations.js';
1313
import { remove } from '../reconciler.js';
1414
import { untrack } from '../../runtime.js';
1515
import {
@@ -175,17 +175,15 @@ export function each(anchor, flags, get_collection, get_key, render_fn, fallback
175175
var key = get_key(value, i);
176176
item = create_item(child_open, child_anchor, prev, null, value, key, i, render_fn, flags);
177177
state.items.set(key, item);
178-
child_anchor = /** @type {Comment} */ (internal_next_sibling(child_anchor));
178+
child_anchor = /** @type {Comment} */ (next_sibling(child_anchor));
179179

180180
prev = item;
181181
}
182182

183183
// remove excess nodes
184184
if (length > 0) {
185185
while (child_anchor !== anchor) {
186-
var next = /** @type {import('#client').TemplateNode} */ (
187-
internal_next_sibling(child_anchor)
188-
);
186+
var next = /** @type {import('#client').TemplateNode} */ (next_sibling(child_anchor));
189187
/** @type {import('#client').TemplateNode} */ (child_anchor).remove();
190188
child_anchor = next;
191189
}
@@ -503,7 +501,7 @@ function move(item, next, anchor) {
503501
var node = /** @type {import('#client').TemplateNode} */ (item.o);
504502

505503
while (node !== end) {
506-
var next_node = /** @type {import('#client').TemplateNode} */ (internal_next_sibling(node));
504+
var next_node = /** @type {import('#client').TemplateNode} */ (next_sibling(node));
507505
dest.before(node);
508506
node = next_node;
509507
}

packages/svelte/src/internal/client/dom/blocks/svelte-head.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { hydrate_anchor, hydrate_nodes, hydrating, set_hydrate_nodes } from '../hydration.js';
2-
import { empty, internal_next_sibling } from '../operations.js';
2+
import { empty, next_sibling } from '../operations.js';
33
import { block } from '../../reactivity/effects.js';
4-
import { HYDRATION_END, HYDRATION_START } from '../../../../constants.js';
4+
import { HYDRATION_START } from '../../../../constants.js';
55

66
/**
77
* @type {Node | undefined}
@@ -37,15 +37,11 @@ export function head(render_fn) {
3737
head_anchor.nodeType !== 8 ||
3838
/** @type {Comment} */ (head_anchor).data !== HYDRATION_START
3939
) {
40-
head_anchor = /** @type {import('#client').TemplateNode} */ (
41-
internal_next_sibling(head_anchor)
42-
);
40+
head_anchor = /** @type {import('#client').TemplateNode} */ (next_sibling(head_anchor));
4341
}
4442

4543
head_anchor = /** @type {import('#client').TemplateNode} */ (hydrate_anchor(head_anchor));
46-
head_anchor = /** @type {import('#client').TemplateNode} */ (
47-
internal_next_sibling(head_anchor)
48-
);
44+
head_anchor = /** @type {import('#client').TemplateNode} */ (next_sibling(head_anchor));
4945
} else {
5046
anchor = document.head.appendChild(empty());
5147
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DEV } from 'esm-env';
22
import { HYDRATION_END, HYDRATION_START, HYDRATION_ERROR } from '../../../constants.js';
33
import * as w from '../warnings.js';
4-
import { internal_next_sibling } from './operations.js';
4+
import { next_sibling } from './operations.js';
55

66
/**
77
* Use this variable to guard everything related to hydration code so it can be treeshaken out
@@ -50,7 +50,7 @@ export function hydrate_anchor(node) {
5050
var nodes = [];
5151
var depth = 0;
5252

53-
while ((current = internal_next_sibling(/** @type {Node} */ (current))) !== null) {
53+
while ((current = next_sibling(/** @type {Node} */ (current))) !== null) {
5454
if (current.nodeType === 8) {
5555
var data = /** @type {Comment} */ (current).data;
5656

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function first_child(fragment, is_text) {
179179
* @returns {Node | null}
180180
*/
181181
/*#__NO_SIDE_EFFECTS__*/
182-
export function internal_next_sibling(node) {
182+
export function next_sibling(node) {
183183
return next_sibling_get.call(node);
184184
}
185185

packages/svelte/src/internal/client/render.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
create_element,
66
empty,
77
init_operations,
8-
internal_next_sibling
8+
next_sibling
99
} from './dom/operations.js';
1010
import { HYDRATION_ERROR, HYDRATION_START, PassiveDelegatedEvents } from '../../constants.js';
1111
import { flush_sync, push, pop, current_component_context } from './runtime.js';
@@ -153,7 +153,7 @@ export function hydrate(component, options) {
153153
node &&
154154
(node.nodeType !== 8 || /** @type {Comment} */ (node).data !== HYDRATION_START)
155155
) {
156-
node = internal_next_sibling(node);
156+
node = next_sibling(node);
157157
}
158158

159159
if (!node) {

0 commit comments

Comments
 (0)