Htmx Webring
htmx.org
htmx.org
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! :-)
>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.
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.
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.
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.
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.
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
Type synchronization is becoming a very popular story. Now I get IDE awareness of all my endpoints and whether I'm using them right.
Not saying you have to prefer it, but some of the htmx articles imply there is a difference.
I'm itching to compare notes.
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?
https://www.reddit.com/r/htmx/comments/160uuzd/whats_the_dif...
You’ve been able to do this in JS for over a decade now. So…
It's like you forgot what we were discussing?
> 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.
And the developers didn't want to use JS...
But yeah I'll bail here. Best of luck.
Therefore "Just use Phoenix". It's like saying manual transmission cars suck, just learn to fly a plane.
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...
I think the learning curve is not all that steep.
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.
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.
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.
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.
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?
these are not mutually exclusive outcomes.
He has a great book explaining the philosophy behind the project: https://hypermedia.systems
https://htmx.org/examples/sortable/ https://htmx.org/examples/modal-bootstrap/
Neither worked for me in Chrome or Safari
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.
But beware of the deep layers of nerd humour.