Hacker News new | past | comments | ask | show | jobs | submit login
Htmx Webring (htmx.org)
75 points by satya71 on Nov 27, 2023 | hide | past | favorite | 55 comments



I love this!

I've never used HTMX, but it looks interesting.

I just love the spirit of webrings!

When I think back to early days of the web, I recall the joy and excitement of discovering websites from parts of the world I'd never been and likely never will!

The web doesn't need to be social media network scale. It can be about slow personal discovery.

Sites used to be built for expression and utility, not SEO and the glorification of Likes.

SEO and Google ruined blogging. Facebook ruined social media.

The people need to take the web back! :-)


I'm for people creating things they want to use. I also have a negative, possibly unfounded reaction to the stated purposes of htmx:

>Why should only <a> and <form> be able to make HTTP requests?

>Why should only click & submit events trigger them?

>Why should only GET & POST methods be available?

>Why should you only be able to replace the entire screen?

>By removing these arbitrary constraints, htmx completes HTML as a hypertext"

I guess people do all of these things with javascript anyways but it gave me a "get off my lawn" reaction when I read these bullets.


My favorite thing about HTMX is being able to do SPA-like experiences without writing anything besides my Common Lisp server code. Making hypertext just a view layer again really increases the joy of web programming for me.


The best thing about HTMX is that jinja2 (well, minijinja in Rust) has finally become my view layer again. Bootstrap + HTMX + sprinkle in a tiny bit of jQuery and I have a fully-featured interactive webapp. Returning partial HTML from the server is a game-changing paradigm in web development.


I've written some demos in CL with htmx( https://github.com/wmealing/learn-htmx ) and have it shipping in production. Sadly, I can't share the source for those. You got any public repos of your work ?

I'm itching to compare notes.



Same here. It’s been a game changer for me and enables me to build UI experiences that I wouldn’t be able to otherwise since I suck at JS.


I've already linked in another comment on this thread so I won't repeat it, but there's a book explaining why. I didn't know this prior to reading the book, but the original intent of RESTful APIs were to use hypermedia as the engine of application state (HATEOAS). Terrible acronym, but a really interesting idea.

There's a lot to say about it, but the essential idea is that if you let the server control the state of the application via hypermedia requests/responses, you eliminate a lot of the complexity that is associated with client-side web apps.


I read a good chunk of the Hypermedia book and much of the argument is an appeal to authority around the fact that "real" REST design uses HATEOAS and well because Roy Fielding said so in 2000.

Yes, I get that duplicating state on the client and the server is a headache. But are people really doing that? You're just moving the state toward the client and keeping the backend much more thin. Are we going to ignore the past twenty or so years of CPU improvements? I'm not saying just yolo it and do loads of pointless expensive work on the client but 5G and modern phones should have some place in this calculus.


The latter half of your comment seems to assume that the primary reason for hateoas would be performance. I'm sure many people would make that argument, and I do think it makes sense even today, but that's not really why I'm into it.

I personally find consuming JSON APIs cumbersome and prone to errors. It seemed like a great idea when we first started doing it, but these days I'm keen to explore other options. I'm under no illusion that HTMX doesn't have it's own tradeoffs, but I like the return-to-tradition approach it's taking.


I can definitely get on board with that idea. It is indeed cumbersome dealing with some JSON api that you may or may not have written. The amount of boilerplate you must write in react just to fetch the freaking thing and do some work an display a result is rough compared to the same thing in django-htmx.

But we are talking mostly about developer-experience here and while that is great, it is a compromise compared to user experience. Getting a little delay for an ajax call on much many more interactions is a thing and its there. Maybe that makes sense for many but it should be noted just like deciding to write a react PWA instead of a fully native ios app is a tradeoff for developer experience (or a dozen other reasons) instead of user experience.


> Getting a little delay for an ajax call on much many more interactions is a thing and its there.

HTMX has a preload extension which has fully eliminated these delays in my experience. YMMV of course but so far both my UX and DX are dramatically improved over what the previous SPA offered


> I personally find consuming JSON APIs cumbersome and prone to errors.

Type synchronization is becoming a very popular story. Now I get IDE awareness of all my endpoints and whether I'm using them right.


Are you against using something like json-ld, hal,... for embedding links? Adding arbitrary hx- attributes to html which require a javascript application to make use of comes across as un-RESTful as doing so in json to me.

Not saying you have to prefer it, but some of the htmx articles imply there is a difference.


[flagged]


I think that dismissing it out of hand as useless is unproductive.

From my understanding Roy Fieldings dissertation was a description and formalization of the web as it has been built, not just prescriptive advice on software architecture. To say it's not useful is to ignore how humans browse the web.


my memory is hazy but aren't semantic web, ontology and all that HATEOAS stuff for bots instead of humans? Now that LLM is here, what use do they have?


Funny enough I recently ran into a very relevant blog post: https://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.h...

HATEOAS is for humans

I haven't really thoughy about REST in relation to all the recent ML advancements. REST (With HATEOAS) might actually be a good way to expose APIs to these agents since they now have some ability to "reason" about responses beyond a hardcoded set of handlers


Structured data doesn't magically go away because you have better interpretation of unstructured data that doesn't blow goats; it's still orders of magnitude easier to manage, store, and retrieve structured data.


the web is not data, this is the fundamental thing that's problematic about that way of thinking. We already have structured data, it's called database


It's amusing to me with how poor the state of javascript and FE software development is, a group of people commenting on htmx negatively. It seems to really boil down to the fact that non-JS people don't want to write JS, and JS people dislike that.

Look at your average JS frontend and you'll find stuff way worse than the things you're complaining about wrt htmx. Live and let live, as they say.


Its definitely a cheeky sales pitch, but I've yet to see a great argument against it. At best, HTMX isn't the right solution if you're already committed to one of the many client-side frameworks that HTMX attempts to offer am alternative to.

To clarify, if you just use a bit of react that would work well with HTMX. But how many sites use a bit of react without a larger framework wrapped around it?


Why not just use Phoenix/Elixir? This is no more HTML or official than elixir, and I think the bikeshedding would ensue if people decided to agree upon a syntax and add it to the HTML spec.

https://www.reddit.com/r/htmx/comments/160uuzd/whats_the_dif...


“Just”? It is a decent learning curve. Might as well say “why not just use React”.


I believe it's pretty clear that htmx (and Phoenix) exist (at least in part) because people specifically _do not_ want to use Javascript.


Instead they'll write element attribute monstrosities. We've been here at least twice in history already.


I like to use these things so I don't have to use JS for business and server-side logic, so I don't have to replicate certain things on both ends, and so I don't have to write myself a web API just so two applications I control can talk to each other. I have no problem writing JS for more complex UI stuff which is what I originally learned JS to do, and I enjoy it (though I enjoy the outcome more than the language). I know I'm not the only one who feels this way but I'm probably a minority.in


My point is that in terms of complexity and amount to learn, I bet Phoenix would be equal to React. Regardless of other reasons for choosing either.

Therefore "Just use Phoenix". It's like saying manual transmission cars suck, just learn to fly a plane.


I find Phoenix way more complicated than React and I don't think it's even close


Well, React markets itself as a library and not a framework. This implies there is some overhead of using a framework. There isn't really - you really can just use what you need from a framework like Phoenix and ship it. The parts you don't need, you don't usually have to learn.

What does React provide for the use case of clicking on things and submitting forms, and having the feedback update in place instead of a full page reload? For me it's worse than vanilla js unless I use uncontrolled components, which isn't suggested by the React docs. https://dev.to/kevinkh89/how-to-solve-input-delay-lagging-in...


More specifically they want to use one language for the front and back end


Well…yes, and that they don’t want that language to be JavaScript.


That's a conflation. I'm certain for at least some, the choice is more about using a single language than avoiding JS. I'm sure there are people using htmx who use a JS backend. That there are at least 5 LiveView clones for JS also are evidence that there's a desire to use JS for both front and back end for dynamic websites: https://github.com/liveviews/liveviews#javascripttypescript


> he choice is more about using a single language than avoiding JS

You’ve been able to do this in JS for over a decade now. So…


Not only has it been an option for a long time, it’s also popular. Next.js on Vercel is more or less a goto these days. I don’t see a trend of people avoiding JS, much the opposite


Exactly. So if JS has been able to do something for a long time, why would someone create new tools in different languages that do similar things? Because they don't want to write JS...

It's like you forgot what we were discussing?


Nope. What I'm saying is entirely compatible with my earlier statement.

> More specifically they want to use one language for the front and back end

What I mean here is exactly what I mean. Excuse the tautology because I don't think I can express it any clearer. It was in contrast to this:

> I believe it's pretty clear that htmx (and Phoenix) exist (at least in part) because people specifically _do not_ want to use Javascript.

Taking your example, Phoenix Liveview exists because Elixir developers want to use the same language across the stack. This might be because they are unfamiliar with JS, and learning a new language might be a pain. Or perhaps they are familiar with JS, but the context switch to another language still presents enough friction to avoid it. Choosing a single-language stack doesn't imply an aversion to JS in particular.


> Phoenix Liveview exists because Elixir developers want to use the same language across the stack

And the developers didn't want to use JS...

But yeah I'll bail here. Best of luck.


Here's a tutorial and the docs of forms: https://github.com/dwyl/phoenix-liveview-counter-tutorial https://hexdocs.pm/phoenix_live_view/form-bindings.html

I think the learning curve is not all that steep.


~60 pages on a 1920/1080 monitor, and looks to first example, with stuff like this.

    Finally the forth function render/1 receives the assigns argument which contains the :val state and renders the template using the @val template variable.

    The render/1 function renders the template included in the function. The ~H""" syntax just means "treat this multiline string as a LiveView template" The ~H sigil is a macro included when the use Phoenix.LiveView is invoked at the top of the file.
The resource looks excellent, but I think it demonstrates that this is more complex than the equivalent Rails.

Which is not even a criticism of Phoenix - it obviously has a lot of power, and "scales right up TM". But I wouldn't think it was a "just do this" kind of a thing.


> I guess people do all of these things with javascript anyways but it gave me a "get off my lawn" reaction when I read these bullets.

So here's a response from the "get off my lawn" crowd.

It's about hypertext. It's always been about hypertext. HTTP is literally "Hypertext Transfer Protocol". The term Hypertext was coined in 1963.

Without Hypertext, Javascript is nothing.


I only love it because I'm paid huge amounts of $$$ to shill for it.


I just started using HTMX.

It replaced a small volume of VueJS code that I wrote to facilitate a few XHR interactions. Pagination and filtering and search-as-you-type interactions are all so much more pleasant now. Logic is de-duplicated, since it can all live on the server.

I'm a fan.


For those of us who need a refresher: https://en.wikipedia.org/wiki/Webring

Also, on another note I think HTMX has successfully positioned itself as a meme, for better or worse. I have tried using it on a few side projects and I do like the simplicity of it, but is there a goal of it being credible software, or just something the creators are having fun with?


> but is there a goal of it being credible software, or just something the creators are having fun with?

these are not mutually exclusive outcomes.


>has successfully positioned itself as a meme

https://htmx.org/essays/#memes


It's definitely a real, credible project. I'd played with HTMX a couple years ago when it was first announced. It was only recently that the author began using memes on Twitter and attained a large following from that.

He has a great book explaining the philosophy behind the project: https://hypermedia.systems


While clicking around on the htmx website, I noticed that these two examples are broken:

https://htmx.org/examples/sortable/ https://htmx.org/examples/modal-bootstrap/

Neither worked for me in Chrome or Safari


Both worked for me on iOS Safari


worked for me in netscape navigator 4.0


My favorite part about Htmx - other than being very useful for 90% of all web-apps/websites since the intercooler.js days - it's just the fun of the whole "marketing" side and seeing "young" people ( aka. started their web career in the last 10 years ) royally annoyed and in disbelief how someone can build stuff without using "industry standard React" or Vue or Svelte. ( more than the framework, the way of thinking about web development ).

Seeing "web boomers" having fun and doing their own thing and "young and serious" frontend dev professionals with a career to have acting like the typical know-it-all curmudgeon just warms my heart.


I don't see that anywhere. Where are you seeing it?


Here:

https://twitter.com/htmx_org

But beware of the deep layers of nerd humour.


I'm with the boomers tbqh


To really understand HTMX you need to follow the Twitter/X account

https://x.com/htmx_org?t=RUZzNxOdTAihrieKNq8iIg&s=09


Can’t tell if all of this is satire, both the webring and the comments here.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: