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

@ -1,5 +1,13 @@
# 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
### Patch Changes

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

@ -12,7 +12,7 @@ import {
import { queue_micro_task } from '../task.js';
import { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.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 { 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;
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) {
// `restore()` could set `hydrating` to `true`, which we very much

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

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

Loading…
Cancel
Save