Live data from Hacker News

Intercooler.js – Simple AJAX Using HTML Attributes

intercoolerjs.org

21–30 of 53 posts

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#21
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 is cool but it seems more tied to only a rails backend. Anyone know how to use it with Java?

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#22
post #14

Previous thread: https://news.ycombinator.com/item?id=12885980

> This has been reposted so many times by the author and by others that I can't help but finally ask.

Which hilariously begins with the statement:

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

Re: Intercooler.js – Simple AJAX Using HTML Attributes

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

I think it always replaces the entire body element, not parts of it, yes

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#24

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…

There once was (still is?) a proposal for this: https://github.com/jakearchibald/navigation-transitions

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#25

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…

I've done something not the same, but a compromise previously using the Window object's `beforeunload` event to fade out everything in the DOM smoothly, and then using the `beforeload` and `load` events to fade the new DOM back in. It's a bit of a halfway between having sliding transitions, etc. You might be able to simulate that even further than I ever tried.

https://developer.mozilla.org/en-US/docs/Web/Events/beforeun...

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#26

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…

The primary benefit I see from SPAs is to enable pages that changes in a wide variety of ways without having to reload the whole thing at any point.

Funny thing, you can actually serve each page as a separate, stand-alone JS "app/page" and still get this benefit (e.g. each page in your app becomes separate webpack entry point).

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#27

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…

You may be interested in http://barbajs.org/

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#29
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 trying to be solved here.

Re: Intercooler.js – Simple AJAX Using HTML Attributes

#30
post #16

Earlier quoted context omitted.

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

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!
Post reply on HN