5 ms·
Yeah, pageload based frameworks and design strategies are a whole mess of complexity that SPAs actually avoid completely. That said, one has to be careful to do
by CamTin 8y ago
Yeah, pageload based frameworks and design strategies are a whole mess of complexity that SPAs actually avoid completely. That said, one has to be careful to do reasonable things with the URL bar, so bookmarking, etc works as users expect. This adds some of the complexity back, but not nearly as much as page-load based forms can. The SPA design pattern also creates a nice separation of concerns between the front-end and back-end services. It really is much simpler, conceptually and practically.
- paulddraper 8y agoHonestly, if you're going to use browser JavaScript, I don't see why you wouldn't do an SPA. Cookies and injection attacks vs Local storage Fat server sessions vs fat client sessions Forms and CSRF vs XHR JSON Let's not pretend that web tech has somehow been Nirvana at any point in the past.
- sametmax 8y agoNo but it's been automated very well, battle tested, and plays well with the browser. While I still stumble upon SPA that can't even get navigation right. But the main reason is still this: I compared the serverless website (considered a state of the art SPA) with the hackernews website (considered a student level website) on an edge connection in the German country side: Hacker news: - first load: 6 seconds - next loads: 3.5 seconds Serverless: - first load: 26 seconds - next loads: 7.5 seconds For a webpage displaying static text.
- realusername 8y agoI agree with you as well, SPA are generally slower and the navigation always has issues as the application grows. I guess reimplementing the browser navigation is a bit complex. I think a good SPA is a superior experience but a bad SPA is worse than a traditional page load approach.
- paulddraper 8y ago> 26 seconds It takes like 4s for me. Though I think you're kidding yourself if you think HN is typical. I can't see any reason why there should be anything but a very small difference on way or the other.
- sametmax 8y ago> It takes like 4s for me. You are not on an edge connection then. > Though I think you're kidding yourself if you think HN is typical. No, but serverless and NH have the same purpose of mostly displaying text.
- paulddraper 8y agoWhat's an "edge connection"? http://edgeconnection.net/ http://edgeconnection.net/ ?
- sametmax 8y ago2g
- jermaustin1 8y agobut pageload based frameworks abstract almost all of that mess away from the developer, where was an SPA has less of that mess, but a bunch of different messes. I don't advocate for pageload-based frame works (asp.net webforms, cf, a bunch of roll your own phps, etc), and I believe a lot of the vendors of them have been kind of moving away from them toward a more bare-metal HTTP approach, but that doesn't mean they don't have a place. In RAD and click and drag IDEs that large corporations prefer, you can hand a single Junior level developer a requirements document, and expect them to be able to build a back-office type application.
- spdustin 8y agoYou've made a key point here that I continue to struggle with handling consistently: managing the address/history for an SPA. Is there any prescriptive guidance for doing so that is consistent within a given framework (e.g. Vue, React)?
- eropple 8y agoI dunno about prescriptive, but in React the use of `react-router` and `history.push` certainly seem to tick the boxes in my use cases.