Live data from Hacker News

A day without JavaScript

sonniesedge.co.uk

241–250 of 412 posts

Re: A day without JavaScript

#241

Earlier quoted context omitted.

I tried using uBlock (EDIT: uMatrix) for a while, but I felt like it was a lot of hassle, and most of the time it still wasn't granular enough to actually block the things I wanted to without breaking sites. It seemed like usually all of the bullshit javascript making sites sluggish came from the same domain as the few bits I might actually want. (Or at least needed to make the site useful.)

> wasn't granular enough to actually block the things I wanted to without breaking sites I don't understand the criticism: it's no less granular than NoScript. If considering only the dynamic filtering panel[1], it can be argued it's more granular given that one can block inline-script tags only, and also one can block/allow on a per-site basis. Static and dynamic URL filtering of course allows you to filter on a per…

> it's no less granular than NoScript.

Sorry, to clarify, I wasn't comparing uMatrix to NoScript, merely commenting that it didn't seem particularly useful to me when I tried it.

I was considering trying NoScript at some point, but from what you've said, it doesn't sound like it would be much better for my purposes?

Re: A day without JavaScript

#242
This is everyday for me. Just whitelist the few sites that actually need it and most of the rest are fine. This should be the default. What do I care if some images don't load or CSS is slightly off? The main content is there. For sites that won't do anything without JS, I can consider whether I want to use them or not. Mostly not. Fuck other people running code unnecessarily, without my permission, on my computer. Especially Javascript. It was an extremely stupid and costly decision to have a scripting language like this run by default in browsers... though great for doing things against the user's wishes and making money off of it. And security holes. And privacy issues. Etc etc. The irony is that AJAX and SPAs were created as a response to the request/response model that was seen as too slow. Now it's these SPAs that are unbearably slow and buggy while the request/response model has only improved as hardware and networking have gotten better. I think if more people understood how the Internet works and what is actually happening, they would also turn off JS. No chance of that happening though.

Re: A day without JavaScript

#243

Earlier quoted context omitted.

It is not ridiculous, machine crippling JS malware is a click a way and you will never know until you click. The safe strategy is JS off by default plus whitelisting. > wouldn't use a browser because I once went to a website that displayed a popup you would use a popup blocker though.

> machine crippling JS malware is a click a way I have been using the internet nearly daily for about 20 years now. I can't recall a single time I clicked on something that gave me "machine crippling JS malware". Barring some serious security gaps, JS isn't even capable of doing anything more than lock up the browser and maybe send some extremely minimal information about you back to someone elses server.

> Barring some serious security gaps, JS isn't even capable of doing anything more than lock up the browser and maybe send some extremely minimal information about you back to someone elses server.

Not true. First JavaScript Rowhammer exploit was publicized in 2015: https://www.youtube.com/watch?v=9L5MJ43nbkI

Re: A day without JavaScript

#244

One of my clients loads a 4.5 Mb bower.js (including Angular with a lot of components and jQuery), they also include an extra jQuery script, a full jQuery UI and several other scripts on each pageload . Nothing is minimized. The bower file alone has 300k in comments. The CSS file is also nearly 1 Mb. It's just a simple website with some forms. They have 2 developers working on the site, a scrum master, a project mana…

> Serious question: are there any tools that can scan a full website for unused code and unused CSS?

From my limited knowledge of your situation this seems like the last move to take. I would try the following, in roughly this order:

Serve libraries (Angular, jQuery) from a CDN to at least have the chance of hitting a browser cache on a visitor's first encounter with your site.

Use a minifier to strip all the unnecessary comments and whitespace (in addition to other benefits from minimization).

use gzip to compress the remaining minified files.

Those alone will likely significantly impact your load times. At this point, the remaining dead code should be relatively small and you can look into tools for surgically removing it.

Re: A day without JavaScript

#245
post #38

> For me it’s a matter of elegance and simplicity over unnecessary complexity. Simplicity is having one place where the DOM is created and managed, and optimizing for the 99% use case. Complexity is splitting up DOM rendering over two networked systems for servicing a 1% use case. Browsers are JS runtimes now. Get over it.

I'd be very interested to see some proper analysis of the difference in speed between HTML/CSS vs just JS, it seems obvious to me that the former would be much faster but then again I know how often "obvious" things are wrong.

As a very general answer, JS webapps will typically be slower on the first load because they require an extra step to show the content.

Subsequently loaded-pages or resources can be significantly faster in webapps however, as they can request (or generate) exactly what they need.

The problem of slow initial loads is being addressed by tools like React by offering server-generated pages on the first load, and then transitioning to JS-based loading for subsequent loads. This offers the best of both worlds.

Re: A day without JavaScript

#246
post #152

Earlier quoted context omitted.

Even though I am a frequent advocate of leaning on more old school techniques for building web apps (even with new school tools), I vehemently disagree that this is a generally worthy cause. A small list of (I think non-controversial) things: 1. You browse without JS. You're a power user. You already know why the page doesn't work. A courtesy message would be nice, I guess, but it seems fairly pointless. 2. Should my…

>1. You browse without JS. You're a power user. You already know why the page doesn't work. A courtesy message would be nice, I guess, but it seems fairly pointless. Well, the point is that a lot of people post their site on HN as "Show HN", and the "intended audience" is then (or should be) "power users", which should also mean that "power users" (few as they might be) are potentially interested to your site, but yo…

Honestly if you're so persistent that you must have a message that you need Javascript then you're not the type of customer I want viewing my site anyway. Someone that picky will find another problem anyway.

Re: A day without JavaScript

#247

Earlier quoted context omitted.

> machine crippling JS malware is a click a way I have been using the internet nearly daily for about 20 years now. I can't recall a single time I clicked on something that gave me "machine crippling JS malware". Barring some serious security gaps, JS isn't even capable of doing anything more than lock up the browser and maybe send some extremely minimal information about you back to someone elses server.

> Barring some serious security gaps, JS isn't even capable of doing anything more than lock up the browser and maybe send some extremely minimal information about you back to someone elses server. Not true. First JavaScript Rowhammer exploit was publicized in 2015: https://www.youtube.com/watch?v=9L5MJ43nbkI

Interesting. I stand corrected.

Re: A day without JavaScript

#248

Simplicity matters, correct: What is simplest: A full website in Elm, or a website developed in a plethora of HTML, CSS each with at least a handful of libraries? Well, Elm needs javascript.. All in all: there is not need to be religious about the tech stack.

HTML isn't just simple to the programmer, it's also simple in other ways which gives it unrivalled accessibility (to disabled folks, different browsers and devices, web crawlers). Not sure any SPA framework can compete.

Web crawlers and screen readers have supported Javascript for years. This is an outdated argument.

SPAs can also support traditional URLs for bookmarking, indexing, etc.

Re: A day without JavaScript

#249

What is the motivation behind this mentality? Sure there are still webpages on the web, but there are also web apps. Why or even how would you expect a web app to work without JS? Why would you expect developers to spend time writing a non JS version of their app? Before taking on this endeavor, I would prioritize native apps, optimizations of all sorts, adding features, etc. Unless your app is gmail, why would you e…

The content is the main thing users care about and it should be available as soon as possible even on a low-bandwidth connection, or a low-end device, or using a screen reader. This is what Progressive Enhancement https://en.wikipedia.org/wiki/Progressive_enhancement is about.

Progressive enchancement is a rubbish paradigm because it's incredibly difficult to implement. React isometric rendering has made it slightly easier but it's still one of these catchphrases people throw around lightly until they try it.

Re: A day without JavaScript

#250

Earlier quoted context omitted.

How would you "go 20 miles north" without JavaScript? The only sensible way would be by clicking a link, at which point you can load your new tiles.

I think OpenLayers did this a looooooong time ago.

Google maps did this a looooooong time ago.
Post reply on HN