pull/17038/head
Rich Harris 4 weeks ago
commit 2a2456623b

@ -1,5 +1,13 @@
# svelte # svelte
## 5.42.3
### Patch Changes
- fix: handle `<svelte:head>` rendered asynchronously ([#17052](https://github.com/sveltejs/svelte/pull/17052))
- fix: don't restore batch in `#await` ([#17051](https://github.com/sveltejs/svelte/pull/17051))
## 5.42.2 ## 5.42.2
### Patch Changes ### Patch Changes

@ -2,7 +2,7 @@
"name": "svelte", "name": "svelte",
"description": "Cybernetically enhanced web apps", "description": "Cybernetically enhanced web apps",
"license": "MIT", "license": "MIT",
"version": "5.42.2", "version": "5.42.3",
"type": "module", "type": "module",
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
"engines": { "engines": {

@ -12,7 +12,7 @@ import {
import { queue_micro_task } from '../task.js'; import { queue_micro_task } from '../task.js';
import { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js'; import { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js';
import { is_runes } from '../../context.js'; import { is_runes } from '../../context.js';
import { flushSync, is_flushing_sync } from '../../reactivity/batch.js'; import { Batch, flushSync, is_flushing_sync } from '../../reactivity/batch.js';
import { BranchManager } from './branches.js'; import { BranchManager } from './branches.js';
import { capture, unset_context } from '../../reactivity/async.js'; import { capture, unset_context } from '../../reactivity/async.js';
@ -69,7 +69,11 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
if (destroyed) return; if (destroyed) return;
resolved = true; resolved = true;
restore(); // We don't want to restore the previous batch here; {#await} blocks don't follow the async logic
// we have elsewhere, instead pending/resolve/fail states are each their own batch so to speak.
restore(false);
// Make sure we have a batch, since the branch manager expects one to exist
Batch.ensure();
if (hydrating) { if (hydrating) {
// `restore()` could set `hydrating` to `true`, which we very much // `restore()` could set `hydrating` to `true`, which we very much

@ -33,7 +33,6 @@ import {
set_hydrating, set_hydrating,
skip_nodes skip_nodes
} from '../dom/hydration.js'; } from '../dom/hydration.js';
import { noop } from '../../shared/utils.js';
/** /**
* @param {Array<Promise<void>>} blockers * @param {Array<Promise<void>>} blockers
@ -119,11 +118,11 @@ export function capture() {
var previous_dev_stack = dev_stack; var previous_dev_stack = dev_stack;
} }
return function restore() { return function restore(activate_batch = true) {
set_active_effect(previous_effect); set_active_effect(previous_effect);
set_active_reaction(previous_reaction); set_active_reaction(previous_reaction);
set_component_context(previous_component_context); set_component_context(previous_component_context);
previous_batch?.activate(); if (activate_batch) previous_batch?.activate();
if (was_hydrating) { if (was_hydrating) {
set_hydrating(true); set_hydrating(true);

@ -4,5 +4,5 @@
* The current version, as set in package.json. * The current version, as set in package.json.
* @type {string} * @type {string}
*/ */
export const VERSION = '5.42.2'; export const VERSION = '5.42.3';
export const PUBLIC_VERSION = '5'; export const PUBLIC_VERSION = '5';

Loading…
Cancel
Save