News for hackers. Stuff that matters.
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by xg15 on Wednesday January 01, 2020 @07:48PM (#21931996)
I find this development incredibly sad. Originally, SPAs looked promising from a technical perspective because they could potentially eliminate lots of redundant server-side HTML rendering and duplicate transmission of data (because templates, code and data items could be cached on the client and assembled as needed).

Today, we somehow seem to have gotten the worst of both worlds: We got the additional overhead of client-side rendering but we can still not reliably cache data, so not a lot of processing or bandwidth can be saved.

Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by freehunter on Wednesday January 01, 2020 @08:50PM (#21932315)
I think Turbolinks is a good answer. Only serve what’s changed, which on a normal website isn’t a lot. And it works without having to switch your whole stack to Javascript which is a plus.
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by purerandomness on Thursday January 02, 2020 @02:17PM (#21938663)
Turblinks, and/or https://intercoolerjs.org/ with a very similar, but more generalized approach.
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by speakwithalisp on Wednesday January 01, 2020 @09:24PM (#21932469)
Anecdotally I can say this is because people either fail to implement or actively fight browser based caching techniques. I can forgive people for not taking the time to implement ETags, but it's surprisingly common practice to include headers on REST calls to disable caching.
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by peteforde on Thursday January 02, 2020 @01:13AM (#21933363)
I know that it's gauche to post links to other parts of a thread, but I didn't want you to miss this:

https://news.ycombinator.com/item?id=21933356

Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by mikekchar on Thursday January 02, 2020 @04:01AM (#21933906)
For me the main appeal to SPAs are testing oriented. Assuming I need some kind of interactive functionality that can't be done using a form, testing across the browser interface is difficult when doing HTML view production on the server side. If you are doing HTML view production on the client side, suddenly it's much easier. I test that the server produces the correct data given a request and I test that the client renders the correct views given the data. In Michael Feather's parlance, I've got a viable "seam" for testing against.
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by cousin_it on Thursday January 02, 2020 @04:51AM (#21934071)
But if something can be done with links and forms, SPA makes it harder to test. So I prefer using JS only for islands of interactivity within specific pages, not making the whole application one big island.
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by ericb on Thursday January 02, 2020 @08:46AM (#21935270)
I mean, yes, but from a broader perspective, didn't you create your "seam" by adding in an entire second application?
Re:Putting Devs Before Users: How Frameworks Destroyed Web P... by xg15 on Thursday January 02, 2020 @06:49PM (#21941321)
Out of couriosity, how is testing on the client easier?

I'd think you still have to verify the same way that the results are correctly rendered - except now you have to verify that the DOM is correctly generated as well.