Open WaltzingPenguin opened 2 years ago
I haven't tried this out, but, looking at the compiled code, it seems quite unlikely that there would be a difference in behavior between count++
and count+=1
in SSR mode. Is this what you're seeing?
If the issue is that this doesn't work at all in either case, this would probably be a 'won't fix' currently, because of the way SSR works.
I haven't tried this out, but, looking at the compiled code, it seems quite unlikely that there would be a difference in behavior between
count++
andcount+=1
in SSR mode. Is this what you're seeing?
Yes, it looks like I wasn't careful in testing. bind:count
in the example is acting the exact same as { count }
during SSR. I've updated the examples to reflect that.
Are you sure that is a "won't fix"? The SSR output certainly looks like it is supposed to catch updates.
do {
$$settled = true;
$$rendered = `${validate_component(Child, "Child").$$render(
$$result,
{ count },
{
count: $$value => {
count = $$value;
$$settled = false;
}
},
{}
)}
Outside: ${escape(count)}`;
} while (!$$settled);
Describe the bug
Variables that are initialized to a value and passed to a child component are not being updated for SSR.
Reproduction
https://svelte.dev/repl/c3bf2fa592004e21b0ff22a791dc81f5?version=3.44.0 Use two components:
File: _child.svelte
File: index.svelte
During SSR of
index.svelte
, you would expect the output to read:Actual output is
System Info
Severity
annoyance