138 points · by kaycebasques · 7y ago · 98 comments
Some might even say it is better to mostly ship HTML with minimal JS.
ducks
It's sad how most websites these days are fully-featured web applications. Take this blog page by Google. A simple web page with some pictures loading over 300kB of Javascript libraries and tooling. And this isn't even an exception. It's sad, really, and a waste of readers' bandwidth.
The problem I find is usually misaligned incentives. When you go to BuzzFeed you just want to read an article, but BuzzFeed wants to track you and sell you ads. It's not in their best interest to keep it simple.
If you're not going to, don't tell me how to work with code I gotta work with.
Can we just agree to let this meme die? React and vue didn't appear because developers wanted bloat.
If you want to reduce bloat, take that to corporate greedy actors stuffing pages with tracking and don't ever touch tools that make my life easier.
Spring, JEE, ASP.NET, Rails, Django,...
Same question. Who's going to write all those 'components' wrapping libraries for each of those when everyone has already moved on to react or vue? Some disgruntled retrograde? Am I supposed to waste time on it so that you can bask in the glory of 'pure html and js'?
Does my text only newspaper article really need all this crap? Like, it's text, with maybe one image or two. Just give me the damn text and cut out the cruft.
Why are browsers now competing with reader modes? We're sending a bunch of data just to have the browser remove it. Just don't send it to begin with!
"Consider whether static rendering or server rendering can get you 90% of the way there. It's perfectly okay to mostly ship HTML with minimal JS to get an experience interactive."
In other words, just serve some HTML so your users can read your content.
On the other hand, your newspaper writers still need to get paid and unless you're a subscriber, that means ads and cruft on your page for ads.
There is no reason why the following MUST be done client-side:
var label = new Label();
var result = await server.getResult();
label.setText(label);
It was this that led me to invent this for one of my own products.Initially, I had thought server-side React would do this, but apparently it's only for first-load.
raises the question. Sorry, it's a pet peeve.
Petitio principii as the conclusion is a restatement of the premise.
Also it's a rant, not a formal logical argument. Go outside, pet a dog, drink a nice beer, stop wasting your time correcting modern vernacular.
I really don't think that anyone who's been in web dev for more than a couple years still disagrees with the above points.
Take addons.mozilla.org. It's a simple, tiny website with a list of browser addons and a button to download each one. Perfect fit for server-rendered HTML, right? Nah, front-end developers rewrote it in React. [1]
Or blogs. Blogs are just a collection of text pages with occasional images and links. Surely you should use static HTML for those, right? Well, okay, but only for the initial page load; after that, make sure you let React take over so it can "improve" your page navigation. [2]
[1] https://blog.mozilla.org/addons/2017/10/25/test-new-look-add...
[2] https://www.gatsbyjs.org/blog/2017-07-19-creating-a-blog-wit...
ALL (all) of the problems they face are either self-inflicted or due to other web developers, such as those who design web advertisements or bloated JavaScript libraries. The problems with sending multiple simultaneous streams to a browser are due to web developers deciding to design a web page with hundreds of individual files to be downloaded. Rendering times are long because of the complexity that today's sites are built to attain.
I can view simple sites EXTREMELY quickly today -- that is to say, sites that designers have not "improved" to the point that the site is no longer worth visiting. A simple page shows me what I want to see, and doesn't take a designer 400 hours to come up with.
All of today's problems on the web are due to web developers.
I'll fight and die on this hill, and no amount of downvotes will change my mind about this in the slightest.
I have the scars to prove it... currently dying on said hill.
I don't think anyone would fight you on that.
Not sure if we're on same boat here :). By rendered twice I mean:
Let's imagine we use React and some store management like redux.
1. Visit some SSR rendered site. Browser receives html (which represents some initial state of an app - rendered by the server)
2. Browser fetches some json representing initial state (hydration). It's the same state that server used for rendering html.
3. State atom was null in step 1. and changed to some initial state in step 2, which basically means full rerender (second) of an app.
For those here who use other systems like DuckDuckGo that makes a difference. I really started to notice this when I visited some sites (not apps) via the Internet Archive to get old versions and found things broken.
> Streaming server rendering allows you to send HTML in chunks that the browser can progressively render as it's received.
Hasn't PHP done this by default since, like, forever?
...but last time i checked PHP itself was a templating system. What changed?
All of these features and more have to be implemented as a third party framework for PHP to be effective as a templating system, which is why such systems exist.
Merely echoing HTML strings and wrapping variables in htmlspecialchars() does not a "templating system" make. If it did, then every programming language would also be a templating system as long as it could output a string of characters to the necessary port.
That's a fake, not the uncanny valley
It is perhaps possible that google indexed it from a previous version that did have html, or they are using a sitemap.
(I've just joined the project, and I intend to get them set up with proper SSR soon.)
It's that easy - just one liner to use it in ExpressJS and a server side template system.
Facebook indexes many sites themself for link preview functionality. Preview images, page title, description are all derived from open graph tags.
Can somebody shed some light on this?
For Hacker News, "Server Rendering" is taking the top 25 stories, creating a large string containing all the HTML tags, then serializing that to a byte stream.
A hypothetical "Client Rendering" alternative to HN might be downloading a JSON chunk containing the data about the top stories, then using a JavaScript framework to create DOM nodes in the user's browser that create the same document client-side.
Reduces from 1.2 MB to around 500 KB.
I'm sounding like my grandpa, but... back in my day, things were fast, simple and they worked Now we got this huge mess of technology just so we can track users, sell ads and annoy our site visitors?
[1]: https://jeffy.info/2017/01/24/offline-first-for-your-templat...
The page also received a "Redirection error" on https://stats.g.doubleclick.net/r/collect and https://www.google-analytics.com/r/collect
301 and 302 redirects are also returning a redirection error.
What does "DX" stand for here?
(I also do find this one to be not very well copy-edited/written).
a) From the way your comment is written, it's pretty clear that you actually just want to say what's between the brackets in your second comment. It comes accros as passive aggressive and doesn't contribute anything.
b) The page mentions who have written this article. The names, positions at Google and pictures are all there.