4 ms·
Stupid question: How would you even accomplish an SPA with server-side rendering but no (client-side) JS at all? SPA to me implies that essentially all the con
by quelltext 7y ago
Stupid question: How would you even accomplish an SPA with server-side rendering but no (client-side) JS at all?
SPA to me implies that essentially all the content is fetched not via traditional navigation but AJAX requests fetching pages/content etc. and the local JS code making sure to switch out the currently displayed contents.
My understanding was that server side rendering simply speeds up first load of an SPA since it doesn't need to be rendered on the client, but then you still need JS to actually get any additional content and navigate.
I guess one could build something that looks/behaves like a traditional web app with links leading to new pages that are rendered by the server and if JS is enabled switch to what I described earlier. Would the former really be considered an SPA though?
- why_only_15 7y agoIf you have a blog that lives at `/` for example and posts that live at `/post/:num` for example, your SPA will have a href="/post/5" or whatever link, and then when you navigate there the SPA will get that blog's content from the server and be rendered there. I agree though that if you have comment functionality for example that would probably be made through an AJAX request in Javascript and it probably wouldn't be possible to automatically switch that to a form.
- quelltext 7y ago> A single-page application (SPA) is a web application or web site that interacts with the user by dynamically rewriting the current page rather than loading entire new pages from a server. I guess the definition of an SPA is not as strict as Wikipedia says? But what makes such a web app (like you mention with actual page navigation) an SPA? That's just a ... normal web app/site. I guess the point was that a perfect SPA has a fallback mode that works without JS? I'm just not sure that exists at the moment. If you invest in an SPA and its (perceived) advantages aren't you choosing it precisely because you want it to be more than a traditional web app with individual pages? Hence all the JS and reactiveness in the browser. Building a degraded fallback mode would be admirable but it's a whole lot of added complexity (have to find alternative UX to accomplish those JS interactive pieces). If your SPA isn't actually an SPA maybe just stick with a traditional setup. That's why I don't understand the drift in that original comment.