We're moving from browsers being viewers for simple HTML documents (which can be copied, shared, and linked via simple means), to a platform for running complex applications written in JavaScript which often render data retrieved in proprietary formats from proprietary APIs. The "open by default" nature of plain HTML has become the "closed by default" of the data processed by web apps, much like with many native apps. Native app platforms (e.g. mobile) are also gradually becoming more "closed by default"; I'm not sure if that's a related trend.
Google can say more sternly that using JavaScript can have ugly consequences for user experience and accessibility, but they are swimming upstream: The web seems to be moving on to fancy new technologies regardless of what their SEO says.
Part of the reason is because Google themselves are doing this in many of their products... some of their employees probably disagree with "JS everything", but they're in the minority.
I don't agree with this. Browsers are more user-targeted than ever.
We're moving from browsers being viewers for simple HTML documents (which can be copied, shared, and linked via simple means)
Browsers still allow this.
to a platform for running complex applications written in JavaScript which often render data retrieved in proprietary formats from proprietary APIs.
I have rarely seen a web API that uses anything other than straightforward JSON.
The "open by default" nature of plain HTML has become the "closed by default" of the data processed by web apps
Almost always equally as open as any HTML you would previously received.
Native app platforms (e.g. mobile) are also gradually becoming more "closed by default"; I'm not sure if that's a related trend.
What do you mean by this?
There are differences between HTML vs. AJAX+JSON+Javascript+DOM. JSON has a lot less of a schema than HTML. You don't have to execute custom code from a remote server to render plain HTML. Client-side rendering is more complex for the client. A Javascript-based page is typically going to require more requests for remote resources than inline HTML, potentially meaning more bandwidth and caching/archiving costs. I can't quite put my finger on the implications right now, but I wanted to note that "JSON is a standard." doesn't mean much to me, since JSON is not comparable to HTML.
> Browsers still allow this.
Yes, they allow it. But consider that user stylesheets have been dropped, hardly any improvements have been made with presenting standard html (unless you count giving in to IE and moving from less-stark black-on-grey to too stark black-on-white as an improvement).
Still no browser does a half-decent job of avoiding ragged-right text[1], give you decent margins on un-styled content, etc. There's no real reason for this. You could claim "backwards compatability" -- but if there was genuine interest, there'd be nothing stopping the introduction of a <sane-default-render-html6-whatever> content type.
It's ironic, that browsing a plain html-site in w3m in the console is a better reading experience than opening the same page in a desktop browser. So of course people need to supply a crap-load of stuff just to get decent, basic text layout, that flows well across various screen sizes. No reason a basic, unstyled html-document couldn't look much better than a TeX/LaTeX document published in the 80s, with the added bonus of re-flowing in a sane way for various window/screen sizes -- but they all look awful, too the point that plain html is actually not usable.
You need to wrap a document in js to get sensible layout, and in css to get sensible presentation. Even if the document doesn't contain any other media than text. Add an image or two, and things keep going downhill. It's absurd.
I don't think we can point to this reason to explain the rise of web app's.
Many Devs use Frontend JS in places where it's absolutely not needed. If you're building an App that updates in realtime, shows informations while it's created, i'm fine with Frontend JS, but it's an overkill for most content pages.
Sure, it depends on your implementation details, but as i said, it's just my opinion.
If we want the nice UX without relying too heavily on Javascript, there's a lot that has to change on the HTML/CSS side of things. And I don't see that happening at all.
And let's not forget that you a) don't get accessibility for free just by rendering on the server and b) almost all screen readers today support Javascript.
I think it's perfectly fine to enhance stuff with JS, as long as important content is visible without it.
Some people go head over heels the JS route (since this seems the way people do it today) and build things that can be build way cheaper (measured in hours) with traditional HTML. Since the outcome is the same (static content) it's just not necessary.
Note: I'm focusing on static content here. Pages that mainly show text and images (Blogs, Newssites et al). (Web)Apps are another topic that present good reasons to use Frontend JS.
Sometimes doing it all in react/angular is easier than bolting on jquery extension after extension... bloating everything up. Also, if you're using more modern techniques, you're going through a build/minify step anyways which makes it even easier still to be more JS based than static.
My experience with JS only apps is that they're often less usable, more brittle, and often don't work at all in IE
I agree that Javascript only apps are often less usable, because the devs making them aren't testing enough on different browsers and devices. But the trend of the "Javascript only" approach is certainly driven by more than just frontend devs that want to use shiny new things (even if that is a factor as well).
Sometimes you need additional functionality, maybe a realtime graph of share prices that has to be JS. So progressively enhance just that component, or gracefully degrade if you have to (e.g. put a sign up saying "switch on JS to get this specific functionality") but don't use it as an excuse to turn everyone away. It might be that you will reach people who can live without the stock ticker.
Sometimes you just can't do without JS. I wrote a desktop publishing app on the browser once. Obviously I wrote it in JS - users were forced to use a modern standards compliant browser (this was an internal app) - but if I'm doing an ecommerce site, or really any public site, I'm always challenging the devs who want to "build it in angular" to reconsider that option before ploughing ahead.
It isn't 2010 anymore.
React (just to name an example, there are many others) completely avoids this issue - you get serverside and clientside rendering out of the box.
reddit is almost a chat service.
your example is also very poignant as neither of those would get close to exist without proper urls
We already have a perfectly good web and includes things that are not curable, even if we exclude javascript (trivial example: you can't, meaningfully, curl a live sport event).
Not to mention that when we demand to have a functional js-parser and dom-tree just to get at the content, things like text-to-speech and many other things (including building a search-engine!) becomes much harder. For very little (I'd say no) gain.
Not to sound completely apathetic, but so what? Most of us aren't building sites that we expect to be around in 10 years, much less 1000 years. The ephemeral nature of what we're building isn't lost on us - we're trading that guaranteed longevity for an improved development process (though some obviously disagree).
Frequently, writing a traditional website with any sort of meaningful UI interactions was/is kind of a mess. Most of us don't write these applications (and you're right, they are applications) because we have any particular affinity for JavaScript, but because it makes the whole process much nicer. It still sucks, it's just nicer.
Sure, progressive enhancement is a thing. And it's a great idea. In practice, top-down directives will probably be something akin to "Sure, do that, but do it on your own time and not at the expense of anything else." The realized benefits are very low (the % of users with JavaScript disabled is incredibly small), and saying something like "our site won't be accessible in 1000 years otherwise" is likely to get you mostly blank stares. It's a pretty big investment with very little benefit to most companies.
Sure, 50 years down the road if these sites still exist they'll probably be nigh-unusable without some sort of "ES6 emulator mode", but so what? I don't think we'll go wanting for any historical artifacts from this time period. If we do, it'll be because future generations have no interest in our generation - not because we didn't produce enough relics.
This isn't so much about plain-jane HTML pages (useful as they are, since they have a simple interaction model than many understand and enjoy). It's more about using and exposing data in a visible manner (known formats and semantics) and hyperlinks rather than a single page app with opaque data. This gives you network effects.
Think about the minor uproar over hash-bang URLs around 5 years ago, Twitter being the primary offender. That was single page application oriented rather than hyperlink orientation. There is a reason they've moved away from that.
In the 90s, Google or Yahoo was just something students did with the links that were out there - that eventually generated hundreds of billions in value because of network effects and visbility of the information in HTML (Ie. They could apply algorithms to it like PageRank).
The point of the web architecture is that it enables serendipity. Most anyone who has had massive success in business will explain the role of luck, serendipity, and network effects in their rise.
Designing a web app for today's paycheck by closing it off behind a WebSocket+ JavaScript mess eliminates a proven avenue for network effects. Sometimes that might be OK, but it's unnecessarily limiting for many kinds of ventures.
20 years ago a webpage was just text, but it has evolved in so much more.
I'd be ok with a data site rendering everything from a set of json files. There is more legitimacy in having the presentation done in static html.
Same would go with sites mixing different information sources (twitter, rss etc). You can do the data fetching server side, but the user might prefer having it done client side for a reason or another (transparency for instance).
These kind of sites woyld still be purely informative and yet having them heavily using js makes sense.
I could think of many more situations were generating html from a different format on the client side is the right way to go. Horses for courses.
The answer to these question will depend on your priorities and use case, and the choice can easily be between no site or a js rendered site.
"I understand that everything in HTML could also be represented in another format. But if your master data is in HTML, does it always make sense to convert the data to JSON just for the sake of it? Would you build a separate client-side rendering component only for that conversion?"
There two non-circular considerations that favor HTML:
1. Web pages still render via DOM. JSON data has to be tramsformed, HTML does not.
2. HTML has semantic capabilities. JSON does not.
Contrary to that you are positing that everything should always be based on or converted to plain html before serving to a browser. That's the point where we disagree.
Vale.
The only exceptions are when sites force use of JavaScript. Curiously, often these are sites where money is involved, e.g., banks, merchants, etc. I guess JavaScript makes things safer in those cases? Then one of the popular high complexity (and high security of course) browsers becomes necessary.
Perhaps it is because the type of content I consume is just reading material, listening material or viewing material. Each of which I can usually download and view with a dedicated application, if I so choose.
I used to think JavaScript might become unavoidable for the user and I spent time thinking about how to accomodate it. I often pondered how search engines would cope with it as well. But over the years I have changed my mind; I do not spend any time worrying about JavaScript as a barrier to content.
JavaScript can be a nuisance for non-interactive www usage but, at least in my experience, with some effort this impediment can be overcome. Whether the "user" is a nerd using nc or Googlebot.
Do you think 1000 years from now there will still be one group of people working to make the www more "interactive" and another group of people working to make the www more "machine readable", the later undoing the work of the former?
A plain HTML site is accessible, and will be accessible in a 1000 years. A site depending on (external) JavaScript sources will force John Titor to travel back in time to find version 1.x of jQuery. Starting with JavaScript abandons principles of progressive enhancement. Sometimes there is not even a fallback/graceful degradation, reminding me of these 2001-era: "Best viewed at 800x600 resolution in Netscape"-sites.
Google holds enormous clout among SEO's. Google says they will factor in site-speed and a large fraction of the web will become faster. Google can say more sternly that using JavaScript can have ugly consequences for user experience and accessibility, but they are swimming upstream: The web seems to be moving on to fancy new technologies regardless of what their SEO says.
Not much good comes from HTML5 JavaScript fans forcing your hand. Tor enabled JavaScript, because too much of the web would break without it, leading to a poor user experience. This led to a huge security gaffe, which I fully blame on webdevelopers eschewing basic principles, to get that slideshow running.