Happy to answer questions.
Happy to answer questions.
to better simulate real network latency for things like progress indicators, etc.
I know the post says not to do it, but I'm planning to convert an existing project from Intercooler. Anything specific that I should watch out for while doing it, or recommendations for new capabilities that I could take advantage of as part of the switch?
- you got deep into the custom headers
- you used ic-action heavily
- you used the path-dependency mechanism heavily
On a sibling comment I mentioned some new features in htmx:
- no jQuery dependency
- trigger filters: https://htmx.org/attributes/hx-trigger/
- HTML validation integration: https://htmx.org/docs/#validation
- Out of band swaps: https://htmx.org/docs/#oob_swaps
- htmx has a more advanced swapping mechanism (swap and settle, not documented well yet) that makes it easier to use CSS transitions
Happy to help out with the transition if you jump on the discord:
I'll move that into the /js directory instead, thanks for the heads up
By the way, thanks!
- no jQuery dependency
- trigger filters: https://htmx.org/attributes/hx-trigger/
- HTML validation integration: https://htmx.org/docs/#validation
- Out of band swaps: https://htmx.org/docs/#oob_swaps
- htmx has a more advanced swapping mechanism (swap and settle, not documented well yet) that makes it easier to use CSS transitions
The way I understand htmx, it will replace the tag itself with an ajax response from the server. This is great for submit feedback and flash messages.
What if you want to click a htmx-button and replace something else outside of the tag with htmx?
https://htmx.org/attributes/hx-target/
You can also use Out of Band swaps to replace arbitrary DOM content:
There are a couple of places in the code where eval()/Function code are fire off which require some security-thinking:
https://htmx.org/attributes/hx-trigger/
hx-trigger evaluate expressions for the event filter. This typically isn't an issue since you would be unlikely to use user input in this context.
https://htmx.org/attributes/hx-vars/
hx-vars evaluate expressions to include in the request. This is a bit more dangerous, because you might try to pass values through with this mechanism. If this includes user input then you should use hx-vals instead:
It still needs some pretty basic stuff like for loops and so forth. The goal is for it to be a embeddable, DOM-friendly & transparently asynchronous scripting language so you don't need to deal w/ callbacks:
on click
add .throb to me
wait 3s
remove .throb from me
end
I'd like to make ajax and web workers trivial to use from it. I hope to have a lot more time for it in the next year, now that htmx is stable. We'll see. Suggestions welcome!edit: one thing I'm pretty sure about is that I'm going to go back to an interpreted runtime over the transpilation I'm doing now
Btw I used htmx for a small project a few months ago and it was super easy to get working. Definitely recommend it, and looking forward to trying out 1.0 as soon as I have a chance!
Reference: https://stimulusjs.org/
htmx extends HTML as a hypertext, it isn't tied to any particular backend and doesn't have any binding concepts. It's really a complete different concept.
I'd recommend reading the docs:
So who’s the target audience? I’m curious to know the typical developer attracted to libraries like this.
That is t saying it’s bad or anything. It’s different enough I have a genuine curiosity
I think htmx scales up and down pretty well: web developer newbs who don't want to sink a ton of time into a JS framework, as well as veteran web developers who want to stick with hypertext for the majority of their web apps.
Thanks for mentioning it!