-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Client side flash when navigating #125
Comments
I'm pretty sure this commit is the culprit. e46e85d There was a memory leak issue which should be resolved by that commit, but that started causing the issue with the flash that you're mentioning. Obviously a memory leak is more important to fix so not reverting it for this, but maybe there's something we can do that solves both problems. |
Thank you for the clear explanation @woutdp. Preventing a memory leak is of course higher priority. I'm pretty new to Svelte (only started learning it because of live_svelte, now I'm hooked) so I'm not super familiar with the internals yet but I will try to read up a bit about it. |
Hi again @woutdp. I'm taking some time to investigate this and its true that undoing that commit fixes the flashing issue. But I'd like to know how I can actually test the memory leak? |
That's a tricky one. It can occur if you reload the page multiple times and you see the memory usage go up in your app, but there's no good deterministic way of testing it that I know of. The memory leak might even still be there but unsure |
I'm at a loss on this one. It seems the memory does build up when you don't include the destroy method, even though its relatively slowly. But having components flash between pages is an extremely janky experience (not LiveSvelte's fault of course). I think someone with a better understanding of both LiveView hooks and Svelte internals could probably contribute more, but I'm still more than happy to help where I can. |
Fixed by #134, thank you @louis-smit! |
Available in |
I'm on |
@coveres can you provide something I can test on? I just tested Thank you. |
@louis-smit Here is an example repo, make sure to run |
Hi @coveres, sorry it took so long to get back to you. I can confirm the flashing issue is back, even on my local repo. But I'm not yet sure why. Will see if I can figure it out. |
@louis-smit @woutdp I took a look at the code and found out the |
For anyone stumbling upon this, just want to say it's been fixed on |
TLDR; SSR not working after navigation when JS is enabled.
First of all, absolutely love live_svelte and already using it for some small client-side-only things at work.
However I recently started using it with SSR. It definitely does render on the server (confirmed by disabling JS and refreshing page), but when you navigate between two pages with SSR'd components (with and without LiveView) the Svelte components "flash" as if they are client side rendered. When I disable JS on the browser and navigate they do not flash and render on the server only - like sveltekit, remix etc.
Any idea what might be causing this? Any idea how I can "force" a SSR on page navigation? I can easily provide a reproducible example if necessary, but it seems to also happen on the included
example_project
in the repository so perhaps this is a known issue.I have managed to work around this with HTMX boosting and moving the JS include script into the body tag in the root layout, but that only works on dead views.
Thanks again for all your hard work :)
The text was updated successfully, but these errors were encountered: