Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intercooler.js worth adding to libraries? #42

Open
1cg opened this issue Feb 10, 2020 · 3 comments
Open

intercooler.js worth adding to libraries? #42

1cg opened this issue Feb 10, 2020 · 3 comments

Comments

@1cg
Copy link

1cg commented Feb 10, 2020

Hi There,

I don't want to presume that intercooler.js matches up exactly with what you are outlining here, so before I create a pull request I'd like to get your opinion:

http://intercoolerjs.org

It allows you to add ajax to your system using HTML attributes that follow and extend the standard HTML/HTTP model.

@stilkov
Copy link
Contributor

stilkov commented Feb 10, 2020

It seems to me there’s a fundamental difference: The intercooler example <a ic-post-to="/button_click">Click Me!</a> would not work as intended if JS were disabled (or not yet loaded or not yet available for whatever reason). It proposes a syntax that’s an alternative to standard HTML, it doesn’t extend it. So I’m not sure it follows the same philosophy.

A different (and more ROCA-compliant) approach would be something like <a ic-some-additional-info="..." href="/button_click">Click Me!</a> because that would preserve HTML semantics and add fancy behavior progressively.

@1cg
Copy link
Author

1cg commented Feb 10, 2020

That's reasonable. There is the ic-enhance attribute, which acts more inline with this philosophy:

http://intercoolerjs.org/attributes/ic-enhance.html

Also might be worth looking at turbolinks:

https://github.com/turbolinks/turbolinks

@mechanoid
Copy link

Hi, to me the standard behaviour described by that library leads people really a bit in a different direction. Especially extending anchor links to send a post or a put changes the behaviour largely from what the link is doing without js.

Giving a look to the guide, yes, for sure there are some functionalities that can be seen as ROCA compatible, but in large in my opinion it is not.

Regarding turbolinks, which is around quite a while might really something for the list. Pjax does basically the similar thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants