News for hackers. Stuff that matters.
Re:Fresh is a new full stack web framework for Deno by leeoniya on Tuesday June 28, 2022 @02:22PM (#31911161)
modern JS runtimes are extremely fast on all hardware that's not a 2000-era phone or an embedded micro-controller with 4MB ram. if your CSR is slow on a modern client, then that same JS code will bring your server to its knees when you simply migrate it to an equivalent V8-powered JS backend. scaling the server will not solve this; you just have to write fast JS code and pay attention when you write it, not merely optimize as an afterthought. test on crappy hardware, test with huge datasets, test on slow connections, test with asset caching disabled, target 60fps+.

https://betterprogramming.pub/creating-a-web-performance-cul...

Re:Fresh is a new full stack web framework for Deno by pier25 on Tuesday June 28, 2022 @03:00PM (#31911670)
In theory yes, but in practice the majority of modern SPAs are slow and bloated.
Re:Fresh is a new full stack web framework for Deno by postalrat on Tuesday June 28, 2022 @03:09PM (#31911779)
Most of the slow SPAs I use are slow because they are waiting for api requests from the server.
Re:Fresh is a new full stack web framework for Deno by pier25 on Tuesday June 28, 2022 @04:35PM (#31912687)
That's one reason.

The other is that those API requests need to be rendered with JS which means downloading the JS upfront + rendering time. JS rendering will always be slower than pure HTML rendering.

I will agree for small apps this is negligible, but for bigger apps this means downloading, parsing, and executing MBs of JS. See the Google Cloud console for example or the Spotify web app.

And yet there is another point which is that with SPAs, ignorant developers can cause more "damage". The other day I opened a simple password recovery form, and it rendered dozens and dozens of divs and downloaded (I shit you not) 2MBs of JS.

Re:Fresh is a new full stack web framework for Deno by postalrat on Tuesday June 28, 2022 @04:51PM (#31912854)
No, usually its some api that's taking 1, 2, 5 or more seconds to respond. Some api written in something that's not javascript.
Re:Fresh is a new full stack web framework for Deno by redox99 on Tuesday June 28, 2022 @08:13PM (#31914830)
> that same JS code will bring your server to its knees when you simply migrate it to an equivalent V8-powered JS backend.

It's not the same because on the server you usually have some form of caching, and the V8 engine will have already JIT'd that code as well.