Hacker News new | ask | show | jobs
by purerandomness 1633 days ago
I think you misunderstood the entire point of the author, especially since you have called it an 'anti-js essay'.

From the article:

> Accept that sometimes, or for some people, your JavaScript will not work. Put some thought into what that means. Err on the side of basing your work on existing HTML mechanisms whenever you can

As you have observed, disabling JavaScript does not make the site stop working entirely for no reason. It degrades meaningfully, and the author put thought into what that means

Moreover, enabling JS does not break browser functionality you're used to.

That's the entire point.

1 comments

> As you have observed, disabling JavaScript does not make the site stop working entirely for no reason.

Such is the case for most JS sites, the site typically doesn't break "entirely", but I consider being unable to post or even read comments to be a major functional breakdown. Comments are non-interactive text, there's no justifiable reason why I should need JS to read them.

> I consider being unable to post or even read comments to be a major functional breakdown.

For a blog? I disagree, because the point of a blog is to read the author’s comments, not those of third parties.

> Comments are non-interactive text, there's no justifiable reason why I should need JS to read them.

I kinda agree. The issue is that it is very rare to find a static site generator which can interface with a dynamic comment storage. To be honest, I don’t know that one exists, although of course it is completely possible. I can understand as a pragmatic matter why someone might have a static blog, want to add comments and not be willing to run his own dynamic comment system, esp. if that would entail writing said system.

All that being written, it would be awesome to have a static site generator which were called by a hook in a dynamic comment server. I actually would like to write one someday!

> For a blog? I disagree, because the point of a blog is to read the author’s comments, not those of third parties.

The author has posted several comments in the comment section, so even by your definition the blog fails to meet functional standards. However, IMO, the distinction between the author's comments and user comments is arbitrary, both are text meant to be read by readers, and those readers without JS are missing a ton of discussion that's happening in the comments, including discussion with the author. There's actually more to read in the comment section than in the blog post itself.

> All that being written, it would be awesome to have a static site generator which were called by a hook in a dynamic comment server. I actually would like to write one someday!

I have actually seen a system like this implemented at company I used to work for. A posted comment would be stored in a sqlite database before a request to rebuild the comment section is fired (as a partial, to avoid re-rendering the whole page/site), subsequently dumping the new build into the CDN (with some debounce logic to throttle high comment traffic). The rebuild was typically sub-second and performed very well.

Minor improvement; a rebuild queue. Workers scaled to platform capability (or just one). When a worker fires, scan the queue for other requests for the same content and use the freshest version / mark the future requests completed when the refresh finishes.
It does seem like it'd be neat of these embedded comment services to have a server side rendered page that just shows all the comments for a specific post, which could be linked to when JS is disabled. Yes, the link sends you off-site, but you'd still be able to read and probably even participate without JS. I'm sure there's at least one service that can do this.
They do have such an off site page[0] but hilariously it just embeds the widget.

[0] - https://disqus.com/home/discussion/veekun/maybe_we_could_ton...

This seems to be exactly how Gatsby et al work, by pulling in "dynamic" content over an API at build time. I've never seen this being used to re-render a site based on third-party changes like comments, but it's popular to pull data from a first-party system like a CMS containing e.g. the blog posts.

Though I wonder if the prevalence of programmable edge networks will leapfrog that before it becomes really mainstream, and allow site owners to add a small bit of edge dynamism to pull dynamic content in without client-side JS.

In fact the site you're using right here doesn't need JS to post nor read comments.
It isnt. They always show "This app needs Javascript enabled" even if its a simple blog.