Show HN: kutty, jQuery-free intercooler.js
kutty.org
kutty.org
For others interested in this field of “graceful enhancement” see also unpoly: https://unpoly.com/
OP may also want to look into integrating some features/ideas from there as it is very similar to intercooler.
I’m currently using it in a project that’s a PWA and its been a pleasure to work with.
https://blog.makandra.com/2019/01/performance-impact-of-remo...
Can you explain your switch and the library choice a bit more? Turbolinks seems to me to be a very primitive version of Intercooler/Unpoly.
One quick (fix/)suggestion: the kutty header on the top left, even being a clickable link to home as expected, changes the cursor to textual selection cursor upon hover instead of the usual link/hand/finger pointer. :)
I'll fix it up.
update: fixed, thanks for calling me out for being lazy
I do have one question. Is there a specific reason why you chose not to follow the standardized specification[0] of using data-* prefixes for HTML attributes? I realize it's pedantic, but I'd like to see this project receive wide support and usage. I'm concerned many potential users will criticize this.
[0]: https://html.spec.whatwg.org/multipage/dom.html#embedding-cu...
Edit: Nevermind, I just looked through the docs from the start. You do support it!
Btw, check out the kt-classes attribute if you want to do some slick CSS transitions w/o javascript:
That's part of the rename, I want it to break out of that comparison.
Glad to see the project is going strong and getting a makeover. Especially in web development, the constant obsession with the Next Big Thing can be a real deterrent against some really cool ideas. Kutty won't make you a more desirable job candidate or force you to develop new and challenging mental models (afaiu); it'll never give rise to an ecosystem of plugins and extensions the way React has; and with Webpack integration in the latest release of Rails (where I'm coming from), frontend frameworks are being normalized as the default approach (or at least the final destination) of any web application these days.
But engineering is about trade-offs. There's a sizable chunk of projects out there whose requirements are modest enough to be met with HTML, AJAX, and a little glue to hold them together, and kutty seems to provide a really clean abstraction layer there.
Really looking forward to trying it out soon.
This is why I build SPAs: binding a button to a fetch request is the easy part. Managing lots of data in an dynamic/interactive UI is where I spend most of my time.
and why is that? Though mithril.js fan here, but intercooler, kitty, unpoly - they look fantastic kit for SPA. These libraries just look like what Golang is against C++ and Java.
https://www.urbandictionary.com/define.php?term=kutty
Maybe in dutch it can be called mutty.
What, you don't like kutty?
A few days ago, instead of going this route, I just used a `.js` view in Rails to replace the necessary elements in the DOM. This is even easier than having to load something like kutty and specifying in attributes what it needs to do:
Taken from the Rails guides:
$("<%= escape_javascript(render @user) %>").appendTo("#users");
This uses jQuery, but you can all imagine how to do this with vanilla js and it works so well.Here are some off the top of my head:
- the dependency mechanism (too magical)
- the ic-action attribute (sometimes it's OK to write some javascript)
Generally I'm trying to reduce the number of attributes and add a bit of syntax if necessary, e.g. kt-trigger="every 1s" vs. a separate ic-poll attribute.
Also I'm trying to make it pluggable so that people can add their own functionality rather than pressuring me to add a new attribute or feature. :)
Hyperview is an awesome library btw, everyone check it out:
Hypertext: the once and future king.
Love it, thank you for putting so much effort into it!