mirror of https://github.com/sveltejs/svelte
chore: improve code generation for `bind:this` in SSR mode (#10524)
* chore: improve code generation for `bind:this` in SSR mode * test --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/10531/head
parent
b5628af72e
commit
3da6cef29b
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
chore: improve code generation for `bind:this` in SSR mode
|
@ -0,0 +1,3 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({});
|
@ -0,0 +1,17 @@
|
|||||||
|
// index.svelte (Svelte VERSION)
|
||||||
|
// Note: compiler output will change before 5.0 is released!
|
||||||
|
import "svelte/internal/disclose-version";
|
||||||
|
import * as $ from "svelte/internal";
|
||||||
|
|
||||||
|
export default function Bind_this($$anchor, $$props) {
|
||||||
|
$.push($$props, false);
|
||||||
|
$.init();
|
||||||
|
|
||||||
|
/* Init */
|
||||||
|
var fragment = $.comment($$anchor);
|
||||||
|
var node = $.child_frag(fragment);
|
||||||
|
|
||||||
|
$.bind_this(Foo(node, {}), ($$value) => foo = $$value, foo);
|
||||||
|
$.close_frag($$anchor, fragment);
|
||||||
|
$.pop();
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
// index.svelte (Svelte VERSION)
|
||||||
|
// Note: compiler output will change before 5.0 is released!
|
||||||
|
import * as $ from "svelte/internal/server";
|
||||||
|
|
||||||
|
export default function Bind_this($$payload, $$props) {
|
||||||
|
$.push(false);
|
||||||
|
|
||||||
|
const anchor = $.create_anchor($$payload);
|
||||||
|
|
||||||
|
$$payload.out += `${anchor}`;
|
||||||
|
Foo($$payload, {});
|
||||||
|
$$payload.out += `${anchor}`;
|
||||||
|
$.pop();
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<Foo bind:this={foo} />
|
Loading…
Reference in new issue