Closed drKreso closed 10 months ago
Still not smarter after a whole day of looking into this. So many moving parts :)
I belive it is somewhere in Elixir-NodeJS bridge.
Looks properly encoded in svelte app.js entrypoint as Unicode Character “š” (U+0161)
When called from elixir it gives back garbage
NodeJS.call!({"server", "render"}, ["OpenToday", %{}, %{}])
Figured it out.
NodeJS.call!({"server", "render"}, ["OpenToday", %{}, %{}], binary: true)
When I have a non ASCII code in .svelte script. It flickers on first render, as it is wrongly encoded at the start. I was reading up it has to with the fact that Svelte does assumes UTF8 encoding, but browser does not and that I somehow need to manually set this up. Not sure where to look, or if it's something that would fit nicely in this hex.
Refreshig page for dramatic effect :)
https://github.com/woutdp/live_svelte/assets/32063/d17af1b2-c7cf-47ca-b39b-ea08f612273f
This snippet from the image
Behavior definetly looks like SSR issue, as it gets corrected by client rerender and is not manifesting if I use :ssr=false (but then it flickers due to client render)