News for hackers. Stuff that matters.
Re:Six Figures in 6 days by LandR on Wednesday September 30, 2020 @08:31AM (#24638073)
There is nothing on this blog that I can see except text and some links at the bottom, yet if I have JS disabled I just get a black page.

JS to display text. Brilliant.

Re:Six Figures in 6 days by infraviolet on Wednesday September 30, 2020 @09:50AM (#24638665)
I recently made the switch from a Gatsby-powered version of my blog to a traditional server-templating based one. Currently there's zero JS on my website. The immediate impact is that my website is much more lightweight and loads and renders much faster. I plan to A/B test the visitor behavior across these two versions and share the results.

Though if you really go all in on no-JS (which I understand what OP isn't recommending), there are certain issues. Like if you have a "subscribe" button at the bottom of your page, using a non-AJAX POST request to submit the email will not get you to the bottom of the page by itself (which would come for free if using JS). So using JS can provide a better UX in these aspects.

EDIT: The blog in question: https://pythonautomationtutorial.com

Re:Six Figures in 6 days by lights0123 on Wednesday September 30, 2020 @09:14PM (#24646164)
I really wish HTML5 supported the image loading style where a very low-res image is encoded in base64 with a heavy blur, and then the real image is loaded later and then replaced. That's the default in Gatsby (and its clones), and it truly does feel quite nice. You have a huge (0.25MB, 1080p, never cached due to bad ETAG generation) JPEG that takes at minimum 1.6 seconds to download, and keeps showing the browser loading animation while it's active, while the image is loaded in vertical chunks at a time. Firefox puts a turtle next to that asset to show that it takes a while to download.

> much more lightweight and loads and renders much faster

Were you hosting it on the same host you're currently using? The downside with server-side templating is that you can't use a cheap global CDN like GitHub Pages or Netlify, which will be faster than your own servers in pretty much every case. The few extra KBs of JS (compressed) is likely offset by the latency of physical distance.

Re:Six Figures in 6 days by m1gu3l on Wednesday September 30, 2020 @09:09AM (#24638345)
JS to display text = i don't have to read this.
Re:Six Figures in 6 days by aendruk on Wednesday September 30, 2020 @10:43AM (#24639205)
I feel strongly enough about this that I had “js;dr” stickers made and have been distributing them at conferences for a couple years.
Re:Six Figures in 6 days by traf on Wednesday September 30, 2020 @11:18AM (#24639613)
I think the animsition plugin I was using was causing some issues, so I removed it.
Re:Six Figures in 6 days by rudasn on Wednesday September 30, 2020 @11:14AM (#24639574)
I also have JS disabled on mobile and it loaded fine. Using Chrome on android. Maybe its something else?
Re:Six Figures in 6 days by Igelau on Wednesday September 30, 2020 @01:10PM (#24641031)
I guess you're not a "practicing minimalist"
Re:Six Figures in 6 days by aembleton on Wednesday September 30, 2020 @11:47AM (#24639993)
Works fine for me on Firefox 81 with JS disabled.
Re:Six Figures in 6 days by elliotbnvl on Wednesday September 30, 2020 @08:40AM (#24638155)
React.
Re:Six Figures in 6 days by Uberphallus on Wednesday September 30, 2020 @09:11AM (#24638364)
Doesn't this piss search engines off? Does the content even get indexed?
Re:Six Figures in 6 days by diath on Wednesday September 30, 2020 @09:23AM (#24638445)
I'm sure they're sophisticated enough to be able to render the website properly w/ JS. Search engines aren't just regular simple crawlers (not that I condone the use of JS for what could have been a simple static HTML & CSS page given how minimal it is).
Re:Six Figures in 6 days by reflectiv on Wednesday September 30, 2020 @09:26AM (#24638480)
Google started rendering pages before indexing a while back because of this...so generally it's ok from an indexing perspective (assuming you still have working URLs that can also be loaded in the same way for all your linked-to content).