this post was submitted on 08 Jul 2023
1 points (100.0% liked)
Photon (moved to lemdro.id)
47 readers
1 users here now
We've moved to lemdro.id:
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The issue with those is that I'm trying to make this usable without JavaScript. Would it be fine if I passed the data onto the new route so that the post page loads instantly? Perhaps for the infinite scrolling I'll keep a "next" button in a
<noscript>
. I also hesitated adding infinite scroll to posts because eventually the memory usage would grow so high and just crash.I think of you look at real world numbers of people that dont't use JavaScript, you will find it vanishingly small. It's not really a concern for most people any more. It's not some big boogey man that is the root cause of all evil, it's just a tool that has been misused by advertisers. Luckily, with lemmy, we don't have that problem.
If I can easily avoid using JS for a task, I prefer that, since it typically improves performance and compatibility as well. However I'm starting to lean away, comments are an example. They require JS to be fetched to speed up post page load.
Not using JS does not "typically improve performance" unless you are using a thousand libraries and don't know how to code.
A good example is thus: I see a post and want to open it. Two things can happen:
No Js so a whole new page opens, renders, dom tree is generated, layout is thrashed as css comes in, all requests to all services are made (again) to load a whole new page.
Use Js to just load the new content in a model, styling and layout has already been loaded with the initial page load.
Your app is a primary example of how not using JS actually slows things down. To open a post needs a whole new page, and each time I'm finished I need to load the whole app again to go back
Sorry, but what you are doing is breaking the user experience entirely and making it worse to fight a battle that was lost 10 years ago.
JS is used quite heavily. The page isn't reloaded, see that white progress bar at the top? That's it fetching the necessary data and having the client swap out the DOM. That's a feature of SvelteKit.
I unfortunately can't really find a way to fix the back cache issue. Ironically, disabling JS on my client fixes back cache.
Most of the slowness comes from Lemmy itself. Since the CORS headers are broken, I need to route everything through a proxy, massively slowing things down. A modal based approach convolutes things more since instead of a +page.ts where data is fetched separately I have to have a weird modal and a svelte store to show the current post, it just gets really annoying.
I'll try to make it so that it passes the data to the new route to instantly show the post, and hopefully fix back cache later.
Is Imagi what you're envisioning?
The Imagi behaviour is a lot better for user flow.
I didn't know you were using svelte for this. I guess it explains the weirdness you mention. Personally not a fan myself, as I can across similar issues. My "new hotness" stack or choice became solid and then qwik, as there was less "magic" and more possibility to take control when things get fucky.
Svelte is NOT Sveltekit. Very different purposes. The reason I use Sveltekit is because I love Svelte. I could use another server if I wanted to.
Most meta frameworks (Solid Start, Qwik City) use this rendering method as well.
How long is it taking for the post pages to load for you? It takes me about 0.5 - 1 second for the page to load with the client renderer.