Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-starfishes-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: flush when pending boundaries resolve
7 changes: 7 additions & 0 deletions packages/svelte/src/internal/client/dom/blocks/boundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ export class Boundary {
this.#anchor.before(this.#offscreen_fragment);
this.#offscreen_fragment = null;
}

// TODO this feels like a little bit of a kludge, but until we
// overhaul the boundary/batch relationship it's probably
// the most pragmatic solution available to us
queue_micro_task(() => {
Batch.ensure().flush();
});
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { tick } from 'svelte';
import { test } from '../../test';

export default test({
mode: ['client', 'hydrate'],

async test({ assert, target }) {
await tick();
assert.htmlEqual(target.innerHTML, '<div>attachment ran</div>');
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{#if await true}
<div
{@attach (node) => {
node.textContent = 'attachment ran';
}}
>
attachment did not run
</div>
{/if}
Loading