Live data from Hacker News

Intercooler.js – Simple AJAX Using HTML Attributes

intercoolerjs.org

31–40 of 53 posts

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#31

I'm missing something. What's the problem they are solving? It looks like they are offering a more limited way to make AJAX calls. Why? To add -- it depends on jQuery? Yeah, I'm gonna have to pass. What this thing does is so small that I can't fathom why they would need to import all of jQuery just to provide a new way to do AJAX requests. I'll just keep using React, it probably already solves whatever problem is try…

It's supposed to be used before you reach for a full blown SPA framework when you just need sprinklings of AJAX.

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#34

I'm missing something. What's the problem they are solving? It looks like they are offering a more limited way to make AJAX calls. Why? To add -- it depends on jQuery? Yeah, I'm gonna have to pass. What this thing does is so small that I can't fathom why they would need to import all of jQuery just to provide a new way to do AJAX requests. I'll just keep using React, it probably already solves whatever problem is try…

It's supposed to be used before you reach for a full blown SPA framework when you just need sprinklings of AJAX.

> when you just need sprinklings of AJAX

Then it is even more antithetical to import jQuery. I might as well use an SPA framework instead.

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#35
post #30

Earlier quoted context omitted.

Turbolinks is cool but it seems more tied to only a rails backend. Anyone know how to use it with Java?

It's not tied to Rails at all. I'm using it with a Phoenix backend. You just include the JS and presto!

So you don’t you need to configure the Phoenix backend or whatnot? That’s even more awesome!

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#36
i work on intercooler, you can AMA

as usual, a lot of negative comments from HN on the approach (which is admittedly against the grain) but I've used it for a relatively large and successful web app (rails back end) and it has worked out well compared to the SPA architectures I've had to deal with

i think the philosophical roots in REST/HATEOAS are worth considering, if you are open minded:

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

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

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#37

Great, another 60KB library (not including dependencies!) that can replaced with a few lines of plain Javascript without any dependencies.

It's 10KB gzipped (30KB non-gzipped) + jQuery. And that is pretty much everything you need.

Even 10KB is way too much for a simple

   r.text()).then(t => this.innerText = t); return false;">Click me!

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#38
post #16

Earlier quoted context omitted.

https://github.com/turbolinks/turbolinks is pretty close?

Neat! Though the point of my idea is having animated transitions between pages, by replacing contents of sticky elements and letting their CSS transitions work as usual. As far as I can tell, turbolinks doesn't do that.

Kinda like this? https://github.com/miguel-perez/smoothState.js

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#39
post #38

Earlier quoted context omitted.

Neat! Though the point of my idea is having animated transitions between pages, by replacing contents of sticky elements and letting their CSS transitions work as usual. As far as I can tell, turbolinks doesn't do that.

Kinda like this? https://github.com/miguel-perez/smoothState.js

Yeah, well... that still requires you to write custom JS. The thing I'm imagining would be based only on markup - which sticky ids exist in both pages. But the idea is really similar, thanks for the link!

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#40
post #16

Sometime ago I had an idea that SPAs exist mostly because animated transitions between pages make managers happy, not to serve any actual user need. If that's true, maybe we could add support for animated transitions between server-side rendered pages, and make SPAs mostly go away. Then I realized we could do that easily with a JS library! We could give some divs a "sticky-id" attribute, so they stay as part of the D…

https://github.com/turbolinks/turbolinks is pretty close?

Turbolinks looks neat, but our Ruby app selectively includes CSS and Javascript snippets outside the tag depending on what page is loaded (using :content_for declarations in our templates). I am guessing that Turbolinks will not work for us in this case, as the relevant external files will not be called on page load?
Post reply on HN