remove dev_effect_stack stuff, it's not very helpful

pull/16405/head
Rich Harris 2 months ago
parent dbd5750e7f
commit f5ae2634d3

@ -46,9 +46,6 @@ export let current_batch = null;
*/
export let batch_deriveds = null;
/** @type {Effect[]} Stack of effects, dev only */
export let dev_effect_stack = [];
/** @type {Set<() => void>} */
export let effect_pending_updates = new Set();
@ -378,9 +375,6 @@ export class Batch {
set_is_updating_effect(was_updating_effect);
last_scheduled_effect = null;
if (DEV) {
dev_effect_stack = [];
}
}
}
@ -493,10 +487,6 @@ export function flushSync(fn) {
// we need to reset it here as well in case the first time there's 0 queued root effects
last_scheduled_effect = null;
if (DEV) {
dev_effect_stack = [];
}
return /** @type {T} */ (result);
}
@ -504,15 +494,6 @@ export function flushSync(fn) {
}
}
function log_effect_stack() {
// eslint-disable-next-line no-console
console.error(
'Last ten effects were: ',
dev_effect_stack.slice(-10).map((d) => d.fn)
);
dev_effect_stack = [];
}
function infinite_loop_guard() {
try {
e.effect_update_depth_exceeded();
@ -526,21 +507,8 @@ function infinite_loop_guard() {
// Try and handle the error so it can be caught at a boundary, that's
// if there's an effect available from when it was last scheduled
if (last_scheduled_effect !== null) {
if (DEV) {
try {
invoke_error_boundary(error, last_scheduled_effect);
} catch (e) {
// Only log the effect stack if the error is re-thrown
log_effect_stack();
throw e;
}
} else {
invoke_error_boundary(error, last_scheduled_effect);
}
invoke_error_boundary(error, last_scheduled_effect);
} else {
if (DEV) {
log_effect_stack();
}
throw error;
}
}

@ -42,13 +42,7 @@ import {
set_dev_stack
} from './context.js';
import * as w from './warnings.js';
import {
Batch,
batch_deriveds,
dev_effect_stack,
flushSync,
schedule_effect
} from './reactivity/batch.js';
import { Batch, batch_deriveds, flushSync, schedule_effect } from './reactivity/batch.js';
import { handle_error } from './error-handling.js';
import { UNINITIALIZED } from '../../constants.js';
@ -491,10 +485,6 @@ export function update_effect(effect) {
}
}
}
if (DEV) {
dev_effect_stack.push(effect);
}
} finally {
is_updating_effect = was_updating_effect;
active_effect = previous_effect;

Loading…
Cancel
Save