Earlier quoted context omitted.
Yeah, no. Don’t get me wrong, I’m very unhappy with the state of today’s JS ecosystem but if you’re building a project of any complexity ditching absolutely everything that can help you along the way is not going to work out. Nor is it going to work out for the person taking over the code from you. Every now and then I’ll be putting together a tiny landing page type thing and write it all in vanilla JS and it’s bliss…
Most people overuse frontend state. It seems like every new React programmer goes through a phase where they think that everything needs to be in state, especially things that never change.
Server-side rendering is a better choice for many applications (2020)
241–250 of 286 posts
Re: Server-side rendering is a better choice for many applications (2020)
#242One of the fastest, lowest latency websites I use is HN, and it’s entirely server rendered. It’s also a massively popular website with probably thousands of hits per minute. Anyone who tells you server side rendering is too slow, probably has no idea what they’re talking about.
Hitting the “Reply” button on HN takes you to a new page with a textbox, taking over 500ms and a complete page reload. On some websites, that amount of latency is acceptable. But that could be instantaneous.
Re: Server-side rendering is a better choice for many applications (2020)
#243Re: Server-side rendering is a better choice for many applications (2020)
#244Earlier quoted context omitted.
Since JS people target multiple browser versions and vendors, building is basically a requirement.
Builds are absolutely not a requirement for targeting multiple browser versions and vendors.
Re: Server-side rendering is a better choice for many applications (2020)
#245Re: Server-side rendering is a better choice for many applications (2020)
#246Earlier quoted context omitted.
To be clear, there is a difference between SSR and SSG. SSG is something like PHP, which generates the full page HTML in the backend. I think HN is SSG? Many news websites or wordpress blogs also fall in this category...
I've never heard the term SSG before. Apparently stands for "static site generating" and is a `next.js` thing. No, hacker news is not a static site. It just makes use of caching HTML on unchanged pages, and as I understand it that cache is often bypassed for logged in users. This is why sometimes when hackernews is overloaded you can still view the site in private browsing, since you're not logged in it hits the cach…
What I actually mean is, that there is a difference between SSR with react, which requires some kind of rehydration on the client, in contrast to a website generated by, e.g., PHP on the server, which doesn't require this.
The PHP website doesn't require the client to rehydrate and produces less load on the client. With the disadvantage, that a subsequent page view requires again a full load, while the SSR loaded react page, doesn't require that.
I didn't check the HN code yet, but it feels like a server- side generated website and not a SSR delivered react (or similar js framework) website...
Re: Server-side rendering is a better choice for many applications (2020)
#247Earlier quoted context omitted.
The argument that 'simplistic' technologies don't scale is dismissive of the robust, enterprise-level applications that have been successfully built without heavy frontend frameworks. It's not the tool that scales; it's the architecture and the development practices.
> enterprise-level applications that have been successfully built Who? When? Where? I refuse to believe this assertion. Are we talking past or present? The whole reason why these frontend focused frameworks exist is because either the existing solutions (pure html, even with preprocessors like handlebars, pure vanilla JS, lower level libs like jQuery) did not scale to meet demand or existing frameworks (JSP, PHP, etc…
Your assertion that older frameworks 'became a mess at scale' is a sweeping generalization. Any technology can become a mess if not properly managed; that's not a failing of the technology but of the architecture and development practices. PHP, for instance, powers Wikipedia, one of the top-ten most visited websites in the world, and it handles this scale quite well.
The emergence of frontend frameworks was not solely because 'existing solutions did not scale'; it was also driven by the industry's evolving needs for richer user experiences and faster development cycles. These frameworks solve specific problems but come with their own trade-offs, including complexity and steep learning curves. To dismiss alternative approaches as unscalable without evidence is not just intellectually lazy; it's a disservice to the field of software engineering, which thrives on diverse solutions to complex problems.
Re: Server-side rendering is a better choice for many applications (2020)
#248Earlier quoted context omitted.
Server-side rendering can absolutely be slow, and client-side can absolutely be fast. It's all dependent on the quality of the developer.
Server-side has the best chance of providing an ideal experience in the worst case situation: The user's very first visit to the website on a mobile device in a crappy network environment. Information-theoretic, there is no way you can beat SSR in this scenario. You will not win against a machine that returns a complete HTML document on the very first request if your users only receive hints regarding where to actual…
If you do SSR, the client is much more limited in terms of caching because the page contents is not constant. In my opinion, SSR is actually more for slow CPUs than for slow networks since you can make the network usage for client side rendering very efficient as well, but client side rendering will always be worse in terms of client CPU.
Re: Server-side rendering is a better choice for many applications (2020)
#249This article misses the single most important reason to use SSR: single language applications are single build applications. Frontend builds are basically a requirement for any application with a UI. You're always going to have CSS, and some degree of user interaction for even the simplest website, which means JS/TS. One of the most important developments for frontend assets in the past decade is dependency managemen…
> So, given that the frontend build is baked into _any_ application build, if you decide to do template rendering in any language other than JS/TS, you are adding another build to your project. That means you need to configure that build for all environments, configure CI, and support that build going forward. Save yourself the trouble and just render everything server-side in JS. You had me until the last part which…
Re: Server-side rendering is a better choice for many applications (2020)
#250One of the fastest, lowest latency websites I use is HN, and it’s entirely server rendered. It’s also a massively popular website with probably thousands of hits per minute. Anyone who tells you server side rendering is too slow, probably has no idea what they’re talking about.
Mostly true--the hn.js would indicate otherwise: function vote (id, how, auth, _goto) { ... $('unv_' + id).innerHTML = unv; new Image().src = vurl(id, how, auth, _goto); }