Live data from Hacker News

Intercooler.js – Making AJAX as easy as anchor tags

github.com

101–110 of 156 posts

Re: Intercooler.js – Making AJAX as easy as anchor tags

#101
post #90
post #67

Earlier quoted context omitted.

> You have the API inflexibility and UX restrictions of a pure-HTML approach 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 en…

> andybak 7 hours ago | parent | on: Intercooler.js – Making AJAX as easy as anchor tag... > 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 netwo…

> That makes the "feels like a desktop app" experience impossible that originally was one of the major selling points of ajax.

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.

Re: Intercooler.js – Making AJAX as easy as anchor tags

#102

This has been reposted so many times by the author and by others that I can't help but finally ask. What's the point? This would lead to your API being comprised of blocks of HTML which are probably only useable for one product. Why not just use REST + JSON? It would take no more than five minutes to set up client-side rendering, and you could even make it attribute-based like this with barely any more effort. Is it…

I agree. There are instances where I think returning HTML instead of JSON works (think of Rails Actioncable or Phoenix Channels), but I have a hard time conceptually understanding what problem is solved by this library. Thinking of almost all of the full stack, I feel like you could have more flexibility with something like Rails with Angular on the front-end. You can set up a Rails controller to return JSON or HTML…

And that's how the monstrosities are born.

Re: Intercooler.js – Making AJAX as easy as anchor tags

#103
post #63

This has been reposted so many times by the author and by others that I can't help but finally ask. What's the point? This would lead to your API being comprised of blocks of HTML which are probably only useable for one product. Why not just use REST + JSON? It would take no more than five minutes to set up client-side rendering, and you could even make it attribute-based like this with barely any more effort. Is it…

so that i can render the html in microseconds on my server and not waste the users time, or have to write javascript

Also, in many cases you can cache the result so rendering is no longer happening anywhere, neither on the server, nor on the client.

Re: Intercooler.js – Making AJAX as easy as anchor tags

#104

Earlier quoted context omitted.

Why would the server process PUT or DELETE any differently from GET or POST. I already have single-page applications that do DELETE requests to delete items.

I do not know your applications. But PUT and DELETE are more like file operations and unless you do these things in your applications, POST is just fine. A PUT tells the server to make the payload available as is at the given URI. And if you do a GET on the URI, you should receive the exact payload that you put there. That may also include headers you send along with the PUT request (especially the Content-Type heade…

Never so that funny interpretation of REST(ish) architecture. That R in the name is a dead giveaway that you not necessarily will get exactly what you put there. I may put json and request xml, what are you gonna do, stab me?

Re: Intercooler.js – Making AJAX as easy as anchor tags

#105
post #90
post #67

Earlier quoted context omitted.

> You have the API inflexibility and UX restrictions of a pure-HTML approach 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 en…

> andybak 7 hours ago | parent | on: Intercooler.js – Making AJAX as easy as anchor tag... > 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 netwo…

  > 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.

Re: Intercooler.js – Making AJAX as easy as anchor tags

#106
post #90
post #67

Earlier quoted context omitted.

> You have the API inflexibility and UX restrictions of a pure-HTML approach 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 en…

> andybak 7 hours ago | parent | on: Intercooler.js – Making AJAX as easy as anchor tag... > 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 netwo…

> I admit I'm not familiar with that. But how would it deal with clients without JS support?

One could include two attributes:

    foobar
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.

Re: Intercooler.js – Making AJAX as easy as anchor tags

#108
post #81

Earlier quoted context omitted.

The author did post a story about intercooler four times in the last 3 years. Where is the problem? Look at the author's comment history, rather than story history. He has a reputation of plugging intercooler in every discussion related to JS. Not that I mind; but most of the "reposts" that GP is talking about are comments, not actual stories.

Good news: now that this broke through the noise I can relax on the shilling. I assure you I am the person most relieved by this. ;)

I don't think there's anything wrong with sharing your work. This reminds me of a thread last week about sharing what you've made. https://news.ycombinator.com/item?id=12838751

Re: Intercooler.js – Making AJAX as easy as anchor tags

#109
post #77

Earlier quoted context omitted.

This is where things like GraphQL come in.

Customers aren't going to use GraphQL for a public API, so you've just added another (micro) service to talk to the GraphQL server and translate it into a more traditional REST API (or the other way around if you want your internals to be REST). Also, you've pretty much forced an entire ecosystem of complexity onto your front end. And then you've added a ton of complexity, bringing us full circle. Based on the parent…

> Customers aren't going to use GraphQL for a public API

Why not?

Re: Intercooler.js – Making AJAX as easy as anchor tags

#110

Earlier quoted context omitted.

I agree. There are instances where I think returning HTML instead of JSON works (think of Rails Actioncable or Phoenix Channels), but I have a hard time conceptually understanding what problem is solved by this library. Thinking of almost all of the full stack, I feel like you could have more flexibility with something like Rails with Angular on the front-end. You can set up a Rails controller to return JSON or HTML…

And that's how the monstrosities are born.

Yeah he lost me at "angular"
Post reply on HN