Hacker News new | ask | show | jobs
by unreal37 1338 days ago
I guess it depends if your website does something valuable or substantial.

If it's just your hobby site... great, develop it without JS.

But if it's a site people pay to access (or requires ads) and they expect some functionality - like Youtube or Netflix say - I don't think this is possible.

1 comments

I’m genuinely curious: why would Netflix or YouTube not work without JS?

As far as I understand it, YouTube and Netflix are a nicer UX with JS but there’s no particular feature that would kill it completely.

Like, for example, I thought that you can play HLS* manifests from plain HTML5 video tags.

EDIT: I was thinking of HLS and not DASH

No browser supports DASH any more; Edge 12–18 did, but that was lost in the Chromium shift. (Source: https://caniuse.com/mpeg-dash.)

But HLS has wide support on mobile browsers, and on desktop Safari. (Source: https://caniuse.com/http-live-streaming.) So YouTube should in theory be able to support JavaScript-free playback for many of its users.

Whups! Thanks for pointing that out!

Do you think that difference would materially affect whether YouTube or Netflix could exist as a website in a meaningful way without JavaScript?

By meaningful: would it fulfil its core competence of finding videos and streaming them to the browser?

One feature that's kind of difficult to emulate without Javascript is the ability to play media continuously while navigating with the back and forward buttons. Rich Harris talked about this at the 5 minute mark of his video on whether or not SPAs have ruined the web [1].

Youtube actually uses this capability specifically. If you add a Youtube video to a queue, it switches to a picture in picture mode where you can navigate while the video is still playing.

The only other technical challenge is handling animations between route changes. There's a browser api in progress (the shared element transition API) [2], that will allow animations during navigations without client side routing, but it still requires Javascript. Navigation animations are arguably just purely aesthetic though.

[1] https://youtu.be/860d8usGC0o?t=299

[2] https://developer.chrome.com/blog/shared-element-transitions...

For regular viewers, the only pieces of functionality I can immediately think of that couldn’t readily be done sans-JavaScript are search autocomplete, annotations, end cards, auto-play (to the next video), and maybe quality selection (I’m fuzzy on what HLS actually lets you do, never actually worked with it).

Even things like voting and commenting are fairly straightforward to do basically, though you could do vastly better with an auto-resizing iframe (https://github.com/whatwg/html/issues/555) which would basically allow you to load new content into the document with a click (though it’ll clutter the history and make the back button behave surprisingly, see also https://github.com/whatwg/html/issues/6501 on that).

Closed captioning would need to be added to the standard video tag. Which IMO is a worthy addition.
The <track> tag has been supported across the board for 8 years.