Earlier quoted context omitted.
Completely agree. For me the biggest advantage is eliminating the need to learn, debug, and maintain components on an additional frontend framework (Angular/React/Vue). I just built a rough toy project [0] that was my first time with FastAPI and HTMX and it was fun and fast. [0] https://www.truebuy.com/ (like rotten tomatoes for product reviews but just for TVs right now)
It's consumer reports but faster :)
The future (and the past) of the web is server side rendering
201–210 of 371 posts
Re: The future (and the past) of the web is server side rendering
#202Much more prefer the htmx way of SSR parts of the page dynamically. Also, totally server-side agnostic, so we can use what we prefer. Clojure in our case. https://htmx.org/
Re: The future (and the past) of the web is server side rendering
#203Earlier quoted context omitted.
You can swap out my examples for anything really. The point is the more work the server does, the more data you have to send them to do that work. As far as trusting it's client-side only, opening the network tab in devtools would suffice. If you think they broke the sandbox (Google would pay millions for that!), yes sniffing would be the next step. At least you have a sandbox on web, you usually don't have that for…
With a couple of necessary exceptions, I don't use websites to store or process personal data, so that's not really the use case I have in mind. What I have for native applications that I don't for the web is the ability to firewall off the native applications.
There you're placing trust on the firewall's sandbox. Are you sure the application can't communicate with the outside at all? DNS exfliltration for example?
Re: The future (and the past) of the web is server side rendering
#204If you don't do server side rendering, you don't (almost) automatically get a set of nice REST endpoints that return JSON/XML/ETC? I get that the abstraction might be nice for security, but at least for corporate intranet applications, a nicely structured, secured (e.g ODATA) webapi you query for client side rendering has the added benefit that it can be invoked programmatically with REST by other authorized parties.…
Just pass a header for request content type json. Then the server returns data in json format as opposed to html.
Re: The future (and the past) of the web is server side rendering
#205Much more prefer the htmx way of SSR parts of the page dynamically. Also, totally server-side agnostic, so we can use what we prefer. Clojure in our case. https://htmx.org/
Completely agree. For me the biggest advantage is eliminating the need to learn, debug, and maintain components on an additional frontend framework (Angular/React/Vue). I just built a rough toy project [0] that was my first time with FastAPI and HTMX and it was fun and fast. [0] https://www.truebuy.com/ (like rotten tomatoes for product reviews but just for TVs right now)
Re: The future (and the past) of the web is server side rendering
#206Earlier quoted context omitted.
> Isn't it also nice from a computation cost standpoint to let the client do the rendering? Aside from all other implications, letting each client render the same stuff is a massive waste of energy and compute.
If it was truly the same computation then it could be a static site generator, but with typical server side rendering you are still doing a new render per user no?
Re: The future (and the past) of the web is server side rendering
#207If you can reasonably cache the response, SSR wins on first page load, no question. On the first page dynamic render "it depends", can be SPA or SSR. 2nd page render a well built SPA just wins.
"it depends....." Server CPU cores are slower than consumer cores of similar eras. They run in energy efficient bands because of data center power concerns. They are long lived and therefore are often old. They are often segmented and on shared infrastructure. And if the server is experiencing load, seldom an issue on the client's system, you have that to deal with also. Your latency for generating said page can easily be multi-second. As I've experienced on many a dynamic site.
Using the client's system as a rendering system can reduce your overall cloud compute requirements allowing you to scale more easily and cheaply. The user's system can be made more responsive by not shipping any additional full page markup for a navigation and minimizing latency by avoiding network calls where reasonable.
On dynamic pages, do you compress on the fly? This can increase latency for the response. If not, page weight suffers compared to static compressed assets such as a JS ball that can be highly compressed well ahead of time at brotli -11. I never brotli -11 in flight compression. Brotli -0 and gzip -1.
This is for well built systems. Crap SPAs will be crap, just as crap SSR will similarly be crap. I think crap SPAs smell worse to most - so there's that.
> Compatibility is higher with server-side rendering because, again, the HTML is generated on the server, so it is not dependent on the end browser.
If you use features the end client doesn't support, regardless of where you generate the markup, then it won't work. Both servers and clients can be very feature aware. caniuse is your friend. This is not a rule you can generalize.
> Complexity is lower because the server does most of the work of generating the HTML so can often be implemented with a simpler and smaller codebase.
Meh. Debatable. What's hard is mixing the two. Where is your state and how do you manage it?
If you're primarily a backend engineer the backend will feel more natural. If you're primarily a front end engineer the SPA will feel more natural.
Re: The future (and the past) of the web is server side rendering
#208Earlier quoted context omitted.
> Well done, modern devs! A plain .html file does that. Yes but a plain html file is static, so that's not going to work unless your site is purely static (i.e. a blog).
You can do both post and get. That is all you need really to make anything work unless your are doing spyware and like graphical applications such as maps and what not. Static pages are easier on Mother Earth too.
Re: The future (and the past) of the web is server side rendering
#209Therefore, they are not solving all the problems of client-server + best UX constraints. Basically the problems we have all this time comes from:
1) There's a long physical distance between client and server
2) Resource and its authorization have to be on server.
2) There's the need for fast interaction so some copy of data and optimistic logic need to be on client.
The "isomorphic" reusable code doesn't solve [latency + chatty + consistent data] VS [fast interaction + bloat client + inconsistent data] trade-off. At this point I don't know why they think that is innovation.Re: The future (and the past) of the web is server side rendering
#210Earlier quoted context omitted.
Is it though? Is composing a response into a graphql or JSON or XML format that much more expensive than into an HTML format? Is {"comment": {"body: "lol"}} notably expensive than
I assume a modern webpage has some logic to it which besides the redering also needs to be processed and if you apply that to a scale of billions x years I guess yes. But as I said I'm not an expert in the field nor have I any numbers. It's just what I thought. Edit: Thinking of having only to serve a state once and having each action processed on the client side instead of making for each a call the backend which ha…