Progressive enhancement is faster
jakearchibald.com
jakearchibald.com
If I'm trying to get a product out and I can reach 99% of my audience by assuming they have JS enabled, then I'm going to do that. I'm not going to spend 2x as long (at least) to reach that extra 1%.
Progressive enhancement actually decreases your testing surfaces by moving more logic to the server which is under your control, whereas the clients are running a variety of different implementations.
Only if you're doing it wrong. (I.e. if you re-implement planned JS functionality in HTML, which sounds like what you're describing.)
Progressive enhancement done right starts with a fully functional prototype of the application done in HTML. Then you enhance your workflow and performance with JavaScript. Enhance, not re-implement.
One big advantage of PE is that it encourages semantic use of HTML, which allows for declarative and reusable JS libraries.
Every single person I've met who said it's "impossible" or "too expensive" never really tried. You don't sound like you've ever really tried it either.
The upside is that progressive enhancement can refer to a spectrum of techniques. Deliver only above-the-fold content as HTML, inline your CSS/JS, inline the initial JSON data, omit <form> POST support, etc. Two templating systems do not need to be supported. It's a straightforward technical problem to apply JS templates server-side (and I'm speaking as a boring old .NET developer--Nustache and Edge.js come to mind).
Btw, another benefit of progressive enhancement can be SEO.
Either way, to say that the Dale piece "conclusively" shows progressive enhancement to be "a futile act" is, in the OP's word, "misrepresenting."
"Exceptional" or not, the key is to recognize when you're dealing with one of those cases -- sites which, like Wikipedia, could be great on Web 1.0 browsers. In those cases, your focus is likely to be more on the content and its structure. In the "progressive enhancement est mort" view, you'll have to spend more time on engineering.
I'm not convinced progressive enhancement is more effort unless you make it more effort. I covered these arguments and more in my previous post http://jakearchibald.com/2013/progressive-enhancement-still-...
Sometimes, but only by coincidence. The baseline of supporting JS off is that you have the render the entire page contents server-side. If the progressive enhancement is addition of content that is only supported by JS then you are correct. However the ideal progressive rendering is to send a generic static HTML shell with no personalized content that can be delivered instantaneously from a web server without any back-end chatter, then load in the dynamic content from the client side. Facebook is probably the most advanced implementation of this technique, and it yields a dramatic increase in perceived performance due to the fact that page starts visually appearing faster which psychologically extends the user's patience.
Yes, what Facebook does is progressive rendering, but I disagree that it's the ideal since it's still blocked by JS. The ideal is serving HTML from the server which can get content on the screen before JS downloads.
"That is just built-in browser technology to achieve the same goal" - exactly. Tweetdeck does progressive rendering, but it avoids the simplest way of doing it and instead reinvents the technique with JavaScript. You can see what this does to performance.
Whether they should optimize for that 99.99% or the other 0.01% on philosophical grounds is a point you are free to debate. However the facts are the facts.
1) supporting 2 templating systems (server & client) 2) no graceful degradation (or "progressive enhancement" depending on your opinion) (i.e. being able to get a page's content with a simple wget)
In any case, since it hasn't been mentioned in this discussion, I'd like to direct people's attention to PJAX (http://pjax.heroku.com/).
I've found this to be a nice, simple solution to have pages work identically with and without javascript. The initial page load is rendered by the server and the HTML of the subsequent sections of the page are rendered on the server but loaded via ajax and updated with one jQuery .html() call. The app URLs and the ajax URLs are the same but they return the page's full contents (<html>...</html>) when requested regularly and the page's partial contents (<div id="#content">...</div>) when requested asynchronously.
Check it out if you haven't.
That's quite the stretch, given what I wrote. I only said it was inefficient.
There's also something to be said for the fact that rendering templates on the server will make any meaningful client-side caching almost impossible. And mobile is the new dial-up; while some are fortunate to have mobile broadband, it's certainly not ubiquitous, and multi-core phones certainly aren't the norm either unless you only want to consider the HN readership for your sample.
If you're gzipping your responses (and you should if they're over a couple of k) the overhead compared to JSON is minimal.
2. It needs to work offline, and for me to support that, I would have to double up on work, and maintaining two levels of templating.
3. No framework has made this easy, in fact new frameworks seem hell bent on making it even harder. See http://bone.io
4. Telling us to "do that." is not going to make it happen. It has to be easier, and clearly it is not: Otherwise more developers would be doing it. I want someone to convince me, but I have yet to see a post going in depth on the technical implementation of such a solution (- that adheres to the 3 points mentioned above).
5. Document-oriented sites (blogs, wikis, maybe even forums) should never have been implemented with only JS in mind anyway.
* The server-rendered web (python)
* The enhanced & offline web (javascript)
* The ios app, where native views aren't used
* The android app, as above
The client code is pretty dumb, it knows how to turn a link into an API call, the api response basically says "Render template x or equivalent native view) with this data…"
It seems like a huge step for me, I don’t understand why it’s not more popular on HN.
The article is missing one optimization in the js case: the initial xhr can be inlined as static json data in the original html page. Ofcourse, if you have a static original html page then it can be cached on a cdn or in appcache, so really the perf story is not clear cut.
Meanwhile your backend could be Python, Ruby, whatever and can easily inline the initial chunk of JSON without needing support for any of the frontend technologies doing the actual template rendering (such as Handlebars+Backbone for example).
So far as still needing to wait for JavaScript to download it becomes a matter of how the ROI works out for one's particular use case. Let's say simply inlining the JSON for the initial content narrows that 'time to initial content' gap to a few hundred milliseconds. Is removing that gap still a worthy return on your investment?