I don't see this. Can you elaborate?
> combined with the overhead
In what sense? Bandwidth? Rendering? Conceptual?
> and need for graceful degradation of a full-ajax approach.
I've found intercooler suits a 'graceful degradation' approach rather well. It is a small evolution of on from pjax/turbolinks - which itself epitomises progressive enhancement/graceful degradation.
> You have the API inflexibility and UX restrictions of a pure-HTML approach I don't see this. Can you elaborate?
No client-side rendering. More precisely, the core idea of intercooler is that every UI update polls the server for new markup. So for each non-trivial UI change, you have to take into account the latency of a network request, even if you already sent the data to the client before in another request. That makes the "feels like a desktop app" experience impossible that originally was one of the major selling points of ajax.
The "markup snippet" means that if you want to change your UI, congratulations, you have to change your template and your API - whereas with client-side rendering you wouldn't have to touch the API at all in many cases.
> In what sense? Bandwidth? Rendering? Conceptual?
Conceptual. You have the same complexity costs as a full ajax page compared to a plain-html page (data gathering spread over multiple requests, need to define an API boundary, need to care about clients without JS support, need to track client-side state, etc.) - but it seems to me you get a lot less benefits for that cost.
> It is a small evolution of on from pjax/turbolinks - which itself epitomises progressive enhancement/graceful degradation.
I admit I'm not familiar with that. But how would it deal with clients without JS support?
The vast majority of single-page applications I see on the internet nowadays still function in a way that would be perfectly serviceable if they were implemented without AJAX.
Absolutely there's cases where the request-response cycle doesn't map well to what actually happens in the app, but I don't think anyone is claiming that Intercooler, or serving HTML from an AJAX request, is the final answer in building web apps.
Everyone seems to forget about using the right tool for the job when the right tool is unsexy.
1. You may not plan to switch to JSON anyway. Serving HTML, whether through a full request or AJAX can be perfectly fine. The site we're on now has no real Javascript of note, for instance.
2. You might introduce a JSON API for customers, but that doesn't mean that it needs to or even should be the same API you use internally.
3. Even assuming that you know that you'll ultimately move to a JSON API, it can be advantageous to take a quicker approach while you're still figuring out the solution. When you come back to the API, you'll have a better idea of precisely how it should be used.
> No client-side rendering
That's a good thing. Devs should really spend some time thinking why they do something in particular way instead of just parroting others.One could include two attributes:
<a href="/foobar" ic-get-from="/foobar">foobar</a>
There's likely some edge cases that would fail doing it this way, like when including other inputs outside of the form tags when submitting forms.This gives clients that do have java script the feel of an SPA and clients that do not have java script see the traditional full page refresh without any additional server side logic deciding to return snippets or not.