diff --git a/packages/svelte/elements.d.ts b/packages/svelte/elements.d.ts index e604505d96..b0c2fae2de 100644 --- a/packages/svelte/elements.d.ts +++ b/packages/svelte/elements.d.ts @@ -1268,7 +1268,7 @@ export interface HTMLMetaAttributes extends HTMLAttributes { charset?: string | undefined | null; content?: string | undefined | null; 'http-equiv'?: - | 'accept-ch' + | 'accept-ch' | 'content-security-policy' | 'content-type' | 'default-style' diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 2f05dca73b..82f1de67a9 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -187,8 +187,7 @@ export class Batch { // if there are multiple batches, we are 'time travelling' — // we need to undo the changes belonging to any batch // other than the current one - // TODO this is wrong when flushSync is called while another batch is active, can be two when there's actually no time traveling - if (batches.size > 1) { + if (async_mode_flag && batches.size > 1) { current_values = new Map(); batch_deriveds = new Map(); @@ -485,8 +484,8 @@ export class Batch { */ export function flushSync(fn) { if (async_mode_flag && active_effect !== null) { - // TODO why do we disallow this? - // e.flush_sync_in_effect(); + // We disallow this because it creates super-hard to reason about stack trace and because it's generally a bad idea + e.flush_sync_in_effect(); } var was_flushing_sync = is_flushing_sync;