Skip to content

Commit 3ea2d51

Browse files
committed
remove current_block
1 parent 3ea5c31 commit 3ea2d51

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { is_array } from '../../utils.js';
1212
import { set_should_intro } from '../../render.js';
1313
import { current_each_item, set_current_each_item } from './each.js';
1414
import { create_block } from './utils.js';
15-
import { current_block, current_effect } from '../../runtime.js';
15+
import { current_effect } from '../../runtime.js';
1616

1717
/**
1818
* @param {import('#client').Effect} effect

packages/svelte/src/internal/client/dom/elements/misc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { hydrating } from '../hydration.js';
22
import { render_effect } from '../../reactivity/effects.js';
3-
import { current_block } from '../../runtime.js';
43

54
/**
65
* @param {HTMLElement} dom
@@ -17,7 +16,7 @@ export function autofocus(dom, value) {
1716
dom.focus();
1817
}
1918
},
20-
current_block,
19+
null,
2120
true,
2221
false
2322
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
create_fragment_with_script_from_html,
66
insert
77
} from './reconciler.js';
8-
import { current_block, current_effect } from '../runtime.js';
8+
import { current_effect } from '../runtime.js';
99
import { is_array } from '../utils.js';
1010

1111
/**

packages/svelte/src/internal/client/reactivity/effects.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { DEV } from 'esm-env';
22
import {
33
check_dirtiness,
4-
current_block,
54
current_component_context,
65
current_effect,
76
current_reaction,
@@ -34,7 +33,7 @@ import { noop } from '../../common.js';
3433
* @param {boolean} init
3534
* @returns {import('#client').Effect}
3635
*/
37-
function create_effect(type, fn, sync, block = current_block, init = true) {
36+
function create_effect(type, fn, sync, block = null, init = true) {
3837
/** @type {import('#client').Effect} */
3938
const signal = {
4039
parent: current_effect,
@@ -99,7 +98,7 @@ export function user_effect(fn) {
9998
current_component_context !== null &&
10099
!current_component_context.m;
101100

102-
const effect = create_effect(EFFECT, fn, false, current_block, !defer);
101+
const effect = create_effect(EFFECT, fn, false, null, !defer);
103102

104103
if (defer) {
105104
const context = /** @type {import('#client').ComponentContext} */ (current_component_context);
@@ -115,7 +114,7 @@ export function user_effect(fn) {
115114
* @returns {() => void}
116115
*/
117116
export function user_root_effect(fn) {
118-
const effect = render_effect(fn, current_block, true);
117+
const effect = render_effect(fn, null, true);
119118
return () => {
120119
destroy_effect(effect);
121120
};
@@ -221,7 +220,7 @@ export function invalidate_effect(fn) {
221220
* @param {any} sync
222221
* @returns {import('#client').Effect}
223222
*/
224-
export function render_effect(fn, block = current_block, managed = false, sync = true) {
223+
export function render_effect(fn, block = null, managed = false, sync = true) {
225224
let flags = RENDER_EFFECT;
226225
if (managed) {
227226
flags |= MANAGED;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ export let inspect_fn = null;
107107
/** @type {Array<import('./types.js').ValueDebug>} */
108108
let inspect_captured_signals = [];
109109

110-
// Handle rendering tree blocks and anchors
111-
/** @type {null | import('./types.js').Block} */
112-
export let current_block = null;
113110
// Handling runtime component context
114-
115111
/** @type {import('./types.js').ComponentContext | null} */
116112
export let current_component_context = null;
117113

0 commit comments

Comments
 (0)