Hacker News new | ask | show | jobs
by speedgoose 2 days ago
The 500 people browsing internet without JavaScript enabled by default would have to enable it. Difficult times.
2 comments

I'll avoid getting into the whole discussion about people on slow connections, accessibility, etc., as I get the impression you really don't care about them, and just point out the obvious fact that everyone has JavaScript disabled whilst your JavaScript is downloading.
You'll avoid it, because you don't have any valid arguments.

Slow connections are not a problem, because React is ~40KB and Preact is ~3KB. If downloading 3KB is too much for your network, it's not the fault of React, JavaScript or any web developer that you're gonna miss out. Also, server-rendered HTML would NOT be smaller than 3kB - in fact it would require MUCH more bandwidth since server-rendered HTML can't be cached as easily, so every page will re-transfer the exact same HTML for shared things like navigation bars, footers, etc.!

Accessibility isn't any issue either, this is a ridiculous argument to even try to make, accessibility tools use HTML and are fully aware of the existence of JavaScript - React doesn't magically bypass HTML to display something on the page.

> everyone has JavaScript disabled whilst your JavaScript is downloading

Everyone has HTML disabled whilst your HTML is downloading.

Since we are talking about _typical_ React sites, accessibility is immediately out of the window, when it only renders a white page. Even if it renders a proper page and even if one allows its JS to run, accessibility is usually still not even an afterthought, because the typical React page breaks back and forth buttons and standard browser functionality. The typical React app also will use some "components" thingy, instead of standard HTML form elements, and in the process makeing a complete mess of the DOM, so accessibility is also out there.

The number of things this paradigm breaks, only to then have to fix them again, but this time by implementing them in JS partially correctly is just too high, for the average web dev to manage on the short time budget they get assigned in their day to day scrum managed job, where new feature requests and KPIs are more important than actual usability of their pages, and few people even properly test on multiple browsers, let alone screen readers and the noscript situation. It is just too tempting for them to use some component "someone else already made" "do not reinvent the wheel" etc., while constantly being discouraged to spend more time on making things actually work well.

> accessibility is immediately out of the window, when it only renders a white page

That's not the case for 99.9% of users.

> if one allows its JS to run

JS is enabled by default in every major browser. It's the _standard_, _typical_ way to browse the web.

> The typical React app also will use some "components" thingy, instead of standard HTML form elements

Components only exist in JS, not in the DOM. In DOM, they show up as regular HTML input elements.

> It is just too tempting for them to use some component "someone else already made"

HTML is also something "someone else already made".

> Components only exist in JS, not in the DOM. In DOM, they show up as regular HTML input elements.

That doesn't really deal with the consequences we experience at all. The mess is still created and 5-10 additional layers of nodes deep. The idea of making general use components, that "everyone can use in any situation" inside a JS framework, necessarily leads to this. The general purpose components handle cases, that one doesn't even have in one's scenario. Also they are usually dependent on JS, even when it is unnecessary.

We wouldn't have all those shitty JS only pages, that still only show us content, that we could just as well have seen without running any JS at all. Tons and tons of such websites.

This may also partially be due to people in bootcamps learning one trick, a JS framework, and then being let loose on the world of web development, while the basics are still lacking. I have seen people being well paid frontend devs working with NextJS, but then "learning HTML5". So guess what they will build using React. You personally might do the right thing, and in general we have seen somewhat of a push back to server side rendering, which people new to the show think of as a new greatest thing since sliced bread, but still we face an avalanche of badly made web apps, that could just as well be static pages, simply based on modern standard HTML and a touch of modern CSS. In many cases they would serve us better, because they would not break browser functionality, and everything would have a URL, that we can bookmark.

> HTML is also something "someone else already made".

True! But at least it was made by people with vastly more expertise than the average web dev. HTML elements have semantic ideas, and they are very composable and clean. They also already cover almost every use-case one can think of, especially, when composing them into compound structures.

I wouldn't say it is impossible to make good web components, that then render out as clean HTML elements, only doing the bare minimum of what is needed, without breaking anything, but so far I have not seen many sites succeeding at this.

> made by people with vastly more expertise than the average web dev

https://github.com/hober/tangler/blob/main/index.html

Does this look like it was written by a person who has "vastly more expertise"? This was made by the Chair of HTML Working Group and President of ECMA. It's an awful, unreadable mess. How is that person supposed to lead and shape the future of the Web?

The myth that people at W3C and ECMA are somehow god-tier engineers and designers is just not true at all and it's been proven many, many times. They are completely disconnected from reality and don't build modern apps at all, how are they supposed to know how to do it well? It's why we have TypeScript, why SASS/SCSS was popular, why we need component libraries to add basic fucking features to HTML or why half of browser APIs are abstracted away into JavaScript libraries by people who got frustrated one too many times.

> already cover almost every use-case one can think of

They literally don't, if they did we wouldn't have to build extra stuff on top - no one wants to do all this abstraction work, but there isn't any other way.

If you wanted to build a stupid autocomplete dropdown in native HTML, you literally just can't. You HAVE to use JavaScript. This is a pattern used on MANY websites today, understood and liked by users and it's still impossible to implement natively.

Also competing business interests from Apple, Google and Mozilla make it so even if something IS a standard, it's not actually implemented the same way in all browsers or is not implemented at all.

But have you considered the absolute existential horror of a user clicking a link and a whole new page loads (modulo cached elements) rather than an entirely client side routing? Such a horrific concept of JavaScript as an enhancement would let all varieties of user agents from text message previews to web crawlers to AI agents handle the page without running an entire JavaScript engine and JavaScript resources from all your friendly data collection services.

The thought frankly horrifies me. I hate an accessible and efficient web!

Whilst I am sure every React website you create downloads in the blink of an eye and is 100% accessible, sadly the same cannot be said of your peers.

It's easy to do the right thing if you use the right tools, as they were designed to be used.

It's incredibly difficult to do the right thing if you insist on using the one hammer in your toolbox.

Streaming HTML and Transfer-Encoding: chunked have existed since 1999 at least. I don't actually care about this argument one way or the other, but you can continue updating the site with HTML/CSS indefinitely, zero js required, simply by never completing page load.
I think the complaint is mainly about the failure mode. I guess it would be trivial to use the noscript tag to display a message saying JavaScript is required, instead of showing a blank page that keeps loading.
Yes I agree. A no script tag is a nice to have.