Merge branch 'main' into fix-ssr-boundary-in-async

pull/16962/head
ottomated 3 weeks ago committed by GitHub
commit 81caa4f786
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: add hydration markers in `pending` branch of SSR boundary

@ -49,7 +49,7 @@ export function SvelteBoundary(node, context) {
context.state.template.push(
b.if(
callee,
b.block([b.stmt(pending)]),
b.block(build_template([block_open_else, b.stmt(pending), block_close])),
b.block(build_template([block_open, statement, block_close]))
)
);

@ -0,0 +1,10 @@
import { flushSync } from 'svelte';
import { assert_ok, test } from '../../test';
export default test({
compileOptions: {
experimental: {
async: true
}
}
});

@ -0,0 +1 @@
<!--[--><!--[!--><!---->loading...<!--]--><!--]-->

@ -0,0 +1,8 @@
{#snippet pending()}
loading...
{/snippet}
<svelte:boundary {pending}>
{@const data = await Promise.resolve("data")}
{data}
</svelte:boundary>
Loading…
Cancel
Save