Live data from Hacker News

Htmx – high power tools for HTML

htmx.org

111–120 of 175 posts

Re: Htmx – high power tools for HTML

#111
post #47
post #37

Earlier quoted context omitted.

I am sure you must be referring to someone from the Katholieke Universiteit Tilburg.

it's a funny meme, but it was never called that. See from wikipedia: >Omdat Katholieke Universiteit Tilburg tot een ongewenste afkorting zou leiden, werd het Katholieke Universiteit Brabant (KUB).

Ah - like the old University of North Texas gag: https://www.chemicalcode.com/litmus-week-29-2/cunt-mug-unive...

Re: Htmx – high power tools for HTML

#113
post #95

Similar projects: https://github.com/stimulusjs/stimulus https://github.com/alpinejs/alpine https://github.com/intercoolerjs/intercooler-js

You are comparing apple to oranges :) alpine and stimulus are frameworks (doing all sorts of stuff: css animation, data objects, etc) while htmx is a library focusing solely on ajax. From your list, the only similar project to htmx is intercooler-js, but... htmx is actually the new version of intercooler-js (both projects by the same author).

Re: Htmx – high power tools for HTML

#114

Earlier quoted context omitted.

Yes, but you shouldn't use it as a simple drop-in. The minified version via CDN is like 1.7 MB ... at least they mention you should not use it in the docs and instead configure it to your needs.

tailwind is 1.7MB of CSS? ....whyy?

id imagine that you get a lot of rules when you have a whole bunch of different "margin-top-". the idea is probably to rely on some CSS tree-shaking/"dead CSS elimination" tool to only keep the ones you need

Re: Htmx – high power tools for HTML

#115
post #113
post #95

Similar projects: https://github.com/stimulusjs/stimulus https://github.com/alpinejs/alpine https://github.com/intercoolerjs/intercooler-js

You are comparing apple to oranges :) alpine and stimulus are frameworks (doing all sorts of stuff: css animation, data objects, etc) while htmx is a library focusing solely on ajax. From your list, the only similar project to htmx is intercooler-js, but... htmx is actually the new version of intercooler-js (both projects by the same author).

> htmx is a library focusing solely on ajax

htmx supports animations too, and it has extensions to add further functionality. Of course those projects differ in their functional range, but they share the way they work; by adding attributes to HTML.

Re: Htmx – high power tools for HTML

#116
post #80

Earlier quoted context omitted.

I'm not sure I get what you're saying? I think you're saying that having html returned from the backend "seems questionable" and is a "type of bad programming". But that can't be right because that's mostly how the web works? Make a request to a server, server returns html. Is your issue that it's partial "random" content? How does that make it worse? It's a tried and true solution. The hamburger menu in amazon.com d…

I agree that the objection doesn't hold up given how many websites are made, but I think they mean that a REST API shouldn't be returning HTML, which is true. Unfortunately using the replace feature would mean rewriting existing APIs. Or, you could use the client side template feature of htmx which supports rendering JSON into HTML using a templating language: https://htmx.org/extensions/client-side-templates/

REST is the architectural style of the web, so returning HTML is the primary use case.

Re: Htmx – high power tools for HTML

#117
post #6

For similar-goal prior-art, see Unpoly[1]. Also the IETF asks[2] that you please stop using "X-" to prepend your custom HTTP headers[3] [1] https://unpoly.com/tutorial [2] https://tools.ietf.org/html/rfc6648 [3] https://htmx.org/reference/#headers

Off topic, but that's a shame about them recommending not to prefix X- for custom headers. Their entire reason (Appendix B) is that "well, if the header eventually becomes a standard header, then there will be old apps that will only work with X-, and we'll have to keep the X- version around forever!" That seems like a very weak reason to me. Most custom headers are not going to become standard headers, and those tha…

I agree there. Browsers started to have this issue to, but to fix it they actually got more aggressive about deprecating prefixed stuff. Now if you use -moz-foo, they guarantee that it will break at some point in the future.

Re: Htmx – high power tools for HTML

#118

hello, I'm the creator of htmx (and originally intercooler) I just released 0.0.4, so htmx is still very young, but it's got a decent test suite: https://htmx.org/test/0.0.4/test/ there is a nice extension mechanism: https://htmx.org/extensions/ and some very rough docs on how to pull off pure HTML animations: https://htmx.org/examples/animations/ happy to answer questions

This is super cool, and you probably have a business model here: create a proxy, allow people to pay you for it, and use it transparently with htmx.

This way they can create entire products with zero backend code by simply calling 3rd party API.

This is probably also some very nice static blog engine concept to imagine around this.

And some mix with VueJS as well.

Re: Htmx – high power tools for HTML

#119
post #114

Earlier quoted context omitted.

tailwind is 1.7MB of CSS? ....whyy?

id imagine that you get a lot of rules when you have a whole bunch of different "margin-top- ". the idea is probably to rely on some CSS tree-shaking/"dead CSS elimination" tool to only keep the ones you need

exactly

Re: Htmx – high power tools for HTML

#120
post #76

Earlier quoted context omitted.

On a related note, I recently discovered that when you use semantically styled HTML, the difference between a JSON payload and an HTML payload is almost negligible (basically, the close tags). Why not transmit in a format that the browser already understands natively?

yeah, the payload is almost zero difference, a round off error compared w/ connection latency a lot of folks conflate AJAX w/ JSON apis, and can't easily imagine an endpoint returning partial bits of HTML that have nothing to do with a public JSON API worse, people have been misled to believe that JSON APIs are REST-ful we have a lot of work to do

> a lot of folks conflate AJAX w/ JSON apis

That matches by experience and is kind of ironic, considering that the X in "AJAX" once stood for XML. ;)

Post reply on HN