Live data from Hacker News

Intercooler.js – Making AJAX as easy as anchor tags

github.com

21–30 of 156 posts

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

#22
post #19

Honestly it feels like intercooler.js is building in functionality that should exist in HTML in the first place. For example, the unintuitive "href" tag sends a GET request, and POST requests are only sent with forms and buttons. What about PUT, PATCH, OPTIONS, or DELETE? According to http://softwareengineering.stackexchange.com/a/211790 , "At this point, it seems that the main reason why there is no support for thes…

Yep, that's the idea. It lets you more fully implement the original REST/HATEOAS concept of the web architecture:

http://intercoolerjs.org/2016/01/18/rescuing-rest.html

http://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.ht...

And then makes a lot of stuff that currently requires javascript (e.g. CSS transitions) accessible via plain old HTML.

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

#24
Very neat! This matches up closely with what we have evolved for my group's legacy codebase to simplify handling AJAX requests. I suspect we're not alone in arriving at this sort of declarative abstraction.

Unfortunately, our implementation is rather scatter-brained and non-uniform. That's partly due to its gradual evolution and partly due to lack of free employee time to clean up bit-rot. I'm going to investigate this a bit more and mock out some examples for our product. I definitely think it'd help us organize our unruly mass of code. Good job!

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

#26
post #4

I'm surprised this needs jQuery. What this seems to be is a simple script that fetches a resource and places it into an element. I really feel opposed to adding more dependencies where they aren't required. That could be written without jQuery or this library fairly easily.

Yeah, it just evolved out of a jQuery-based set of tools. I've looked into breaking the jQuery dependency and it hasn't bubbled up high enough for me to get motivated.

Always happy to take pull requests though...

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

#27

Main intercooler.js author here, glad to answer any questions. Happy to see people are enjoying it!

I'm a huge fan of intercooler.js because most of web dev today is going to monumental lengths to hide the progress bar overtop of what used to be simple client/server RPCs (in other words, the vast majority of it is a waste of all of our time).

I really feel that the web is moving towards a components/modularized system where every tag is built from subtags, a bit like how iframes used to work but without the security implications. For example, I was shocked when I learned back in the 90s that server-side includes where generally disabled on servers, which led to the proliferation of cgi-bin, php, ruby, node.js, etc etc which may not have been necessary otherwise.

To get to my question - is adding websocket/socket.io on the horizon? If intercooler.js can get to a truly push-based method of state synchronization, it would be huge.

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

#29
post #25

Main intercooler.js author here, glad to answer any questions. Happy to see people are enjoying it!

This is sort of a meta thing, but I'm curious how many hits/stars you got on the github page from hn

I started today w/ 1400 stars

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

#30

Main intercooler.js author here, glad to answer any questions. Happy to see people are enjoying it!

I'm a huge fan of intercooler.js because most of web dev today is going to monumental lengths to hide the progress bar overtop of what used to be simple client/server RPCs (in other words, the vast majority of it is a waste of all of our time). I really feel that the web is moving towards a components/modularized system where every tag is built from subtags, a bit like how iframes used to work but without the securit…

Yeah, a core idea of intercooler is to take the original web architecture seriously and not try to shoe-horn 90's style client/server architecture into the web:

http://intercoolerjs.org/docs.html#philosophy

I'm looking to add server-side event support in the next month or so, which would give us a nice way to implement push-based updates:

https://github.com/LeadDyno/intercooler-js/issues/131

I'm working on a demo chat UI myself, so I will be motivated to add it soon. :)

Post reply on HN