Live data from Hacker News

A day without JavaScript

sonniesedge.co.uk

281–290 of 412 posts

Re: A day without JavaScript

#281

Earlier quoted context omitted.

Nonsense. This is definitively YAGNI. Good engineering is accommodating the greatest number of people with the resources you have in the least amount of time. Thinking about some abstract future scenario is categorically not good engineering.

You misspelled "good bean-counting". Good engineering requires you to cover for everything you can. Case in point: car seatbelts and airbags. Most people don't crash, right? But you aren't seeing the car manufacturers remove seatbelts and airbags.

Consumers by in large know driving is dangerous and safety features are something car manufacturers advertise to consumers. Not to mention over the last 30-40 years drivers have come to expect these sorts of features in cars because accidents happens and those features increase survivability, by a lot.

The same sort of consumer expectation doesn't exist for no-javascript. Major browsers default it enabled. The web has developed to be seriously built on top of javascript for the last 15 years. Consumers have expectations for how the web should work in 2017 (for better or worse) and no-javascript isn't anywhere on the radar.

Consumer expect cars to have airbags and seatbelts, consumers expect websites to behave as they always have and that means javascript.

Re: A day without JavaScript

#282
I wrote a chrome extension to disable js. It's pretty simple and it works well:

    var contentSettings = chrome.contentSettings;

    contentSettings.javascript.clear({}, function() {

        contentSettings.javascript.set({
                primaryPattern: '*://*/*',
                setting: 'block'
        });

    });

Re: A day without JavaScript

#283

Are there any JS frameworks that make it easy to build SPAs that degrade gracefully when JS isn't available? I know there's a lot of work done on making server-side rendering work with React / Vue / whatever, but I'm wondering if there's a framework available that asks for some tradeoffs in how your SPA is structured in order to maximize the amount of functionality available when scripting is off (similar to how Redu…

I don't have a specific answer to your question. What I think would be much more sensible is to design your website without JS, and then sprinkle it here and there.

Ex: Make a request to an API upon page load. Populate tables or whatever you want. Then if JS is enabled, load a script that makes AJAX calls to the API to update the data every x seconds. That way your site gets "enhanced" by JS and is completely usable without it.

Re: A day without JavaScript

#284
post #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. E…

I find myself doing the same if I'm not on WiFi. I'll tether my samsung phone to my laptop, disable JS on chrome, whitelist what I like, jump into incognito to temporarily whitelist some page that requires JS; when done in incognito, the site isn't permanently whitelisted, it's just for that incognito session.

I know! Laborious, but it must be done.

I got into this habit because of the insane number of websites that have gotten into autoplay which essentially eats up all my mobile bundles. I love forbes for instance but it's essentially unreadable when on bundles.

Re: A day without JavaScript

#285
post #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. E…

I fully agree. Do you stop to think flash/action script was "obsolete" because all this? and now we have the exact same problems...

May very well be the case. All things flash are permanently disabled on my browser. If a site requires flash, I would much rather ignore the content altogether no matter how juicy it is.

Re: A day without JavaScript

#286

Are there any JS frameworks that make it easy to build SPAs that degrade gracefully when JS isn't available? I know there's a lot of work done on making server-side rendering work with React / Vue / whatever, but I'm wondering if there's a framework available that asks for some tradeoffs in how your SPA is structured in order to maximize the amount of functionality available when scripting is off (similar to how Redu…

On the topic of server-side rendering, Ember's Fastboot is worth checking out.

https://ember-fastboot.com/

Re: A day without JavaScript

#287
post #20

It's 2017. All modern browsers support JS and it's no longer reasonable to expect all websites to work very well without it.

import ReactDOM; const HowQuestion = (text) => { return ( How {text}? ); } const Comment = () => { const text = \ "the year justifies using Turing-complete programs" "to express what could be a simple static text document"; return ; }; const el = document.querySelector("#14507550 .comment"); ReactDOM.render( , el);

thank you for the reminder that it is current year, all too easy to forget!

Re: A day without JavaScript

#288

Are there any JS frameworks that make it easy to build SPAs that degrade gracefully when JS isn't available? I know there's a lot of work done on making server-side rendering work with React / Vue / whatever, but I'm wondering if there's a framework available that asks for some tradeoffs in how your SPA is structured in order to maximize the amount of functionality available when scripting is off (similar to how Redu…

If you use Redux and React server side rendering, you can quite easily wrap forms/interactions on your page with a tag and a hidden input with the Redux action name, and then handle the actions/reducers on the server. I've played around with it in the past and managed to convert a SPA which was using redux-form heavily to work fully without Javascript enabled, and it was only like ~200sloc.

Re: A day without JavaScript

#289
post #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. E…

> Fuck other people running code unnecessarily, without my permission, on my computer.

You gave them permission. Actually, you asked them to do it when you sent that GET request to their servers that returned a bunch of HTML that included script tags.

Re: A day without JavaScript

#290
post #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. E…

I fully agree. Do you stop to think flash/action script was "obsolete" because all this? and now we have the exact same problems...

flash was obsoleted because 1) iphone didn't support it, 2) iphone didn't support it, 3) iphone didn't support it, and 4) JS replaced the non-DRM use cases (and now even replaced that).
Post reply on HN