Live data from Hacker News

Intercooler.js – Making AJAX as easy as anchor tags

github.com

11–20 of 156 posts

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

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

I am by no means a js expert, but doesn't jquery essentially act as an abstraction layer to smooth over differences in browser behavior?

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

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

I am by no means a js expert, but doesn't jquery essentially act as an abstraction layer to smooth over differences in browser behavior?

That was the one of the original use cases for jQuery, but browsers have gotten more compatible recently, so you may not need it anymore.

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

#16
post #5

I love that you can use this without having to build anything with babel/webpack. Given the scope of my web apps, anything that transpiles or mutates my sourcecode is a non starter because it makes debugging it weird since I'm not looking at my own code anymore.

I am interested in getting a more secure footing on the front-end side of things. Can anyone recommend other ES5 front-end code bases like this that are easy to study without encountering build tools, endless dependencies, ES6 features and so on? Particularly that use a declarative approach.

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

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

I am by no means a js expert, but doesn't jquery essentially act as an abstraction layer to smooth over differences in browser behavior?

its extremely unnecessary in ES6 w/ isomorphic-fetch and promises. In fact I much prefer what's happening in that area. Really this seems unnecessary. Async JS isn't that hard and ES6 has come a long way to solving the issues imo.

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

#18

Earlier quoted context omitted.

I am by no means a js expert, but doesn't jquery essentially act as an abstraction layer to smooth over differences in browser behavior?

That was the one of the original use cases for jQuery, but browsers have gotten more compatible recently, so you may not need it anymore.

ES6+ Async/Wait make it extremely unnecessary

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

#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 these methods is simply that nobody has taken the time to write a comprehensive specification for it."

Intercooler.js makes them seem a little more "built in" to html, which I like.

Post reply on HN