slightly off topic but I've been having the best time getting back into rails version 7. (I left the rails world back in 2014) This tutorial https://www.hotrails.dev/turbo-rails/css-ruby-on-rails makes clean views with auto magical css that just works. It is amazing.
Htmx in a Nutshell
321–330 of 414 posts
Re: Htmx in a Nutshell
#322Earlier quoted context omitted.
Is the argument here that there are too many JS frameworks, or that the complexity of the frameworks themselves tends to grow over time? If the former, totally agree. If the latter, Java frameworks are plenty complicated. Also not sure how you've missed a lot of other frameworks; Spring and J2EE are certainly not the only ones that have been around for 10+ years. Dropwizard, Vert.x, akka-http, GWT, Play... just to na…
The argument is that I could learn Spring in 2002, find a Job then I could learn Spring in 2008 and find a job and then I could learn Spring in 2013 and find a job and then learn Spring in 2018 and find a job and then learn Spring in 2023 and find a job. Spring IS complex, but you learn it once and you are done with it.
I think the key distinction is that these languages and libraries evolve over time.
Re: Htmx in a Nutshell
#323I am burnt out (but recovering!) with web dev and htmx is what I am using for my project. Django, DRF, Postgres, tailwind and HTMX. I am so tired of all the front end frameworks and all the complexity that gets added. At some point I think you need it and you get returns from it but hearing more people in the industry recognize and talk about how JS everything isn't always the answer gives me hope. I like what HTMX h…
Re: Htmx in a Nutshell
#324Earlier quoted context omitted.
Yeah, that I understand. I am not a huge fan of sending JSON that's not backwards compatible. Sending HTML is probably a good choice for some applications, but that was already well supported 20 years ago. Why is htmx better than one line of javascript saying `onload = function() { e.innerHTML = response.body` } ?
In practice you don't want to just swap the content 100% of the time. Appending to the current content is quite common too, as is deleting from it. You sometimes need to touch other elements too, or maybe show a progress spinner. Or perhaps push a URL to the navigation history. Htmx provides a batteries-included data-driven experience. It is a means to avoid having to write dozens of slightly different variants of th…
Re: Htmx in a Nutshell
#325Earlier quoted context omitted.
Yeah, but why? Why is it better to remember a bunch of attributes than to remember 3-4 javascript functions?
It's pretty clear that TFA means that this is better because that's how HTML should have been, in their opinion. Is it better? Well, I think so. Practically speaking, for example, if you use NoScript or something like that, it kind of would be if you could block scripts but not HTMX. Also practically speaking the cognitive load of HTMX should be lower than the cognitive load of JS (especially for beginners). More gen…
And how is it lower cognitive load? You have to learn JavaScript, but now you also have to learn htmx. I don't call that a win. Code is read by a lot more people than wrote it. It's not great if you constantly have to be learning some flavor-of-the-week framework. (No problem learning new things where it's warranted, but this isn't even interesting, it's just a DSL.)
Re: Htmx in a Nutshell
#326Earlier quoted context omitted.
This idea used to be called microformats. The premise was that you send an HTML snippet, and all the semantic attributes plus a protocol definition will let you parse it as either data or a part of the UX. It's self-documenting in the sense that, if you do it right, the snippet has clear semantic meaning. However, it's not backward and forward compatible as either UI or data, because that was never an explicit goal o…
Um, 'parsing...data out of an HTML microformat' sounds like a fancy way and obscure way of saying 'the browser renders HTML, something it has been optimized to the gills for'. > Parsing a protobuf is probably at least 10x faster Faster than a browser rendering HTML? That would be quite a feat.
Re: Htmx in a Nutshell
#327Earlier quoted context omitted.
After going through a fever swamp project involving React, I am definitely in the camp of getting back to basics.
Wait till you end up on a fever swamp project involving templated HTML generation. Or even a fever swamp project involving jQuery.
Re: Htmx in a Nutshell
#328Earlier quoted context omitted.
It's pretty clear that TFA means that this is better because that's how HTML should have been, in their opinion. Is it better? Well, I think so. Practically speaking, for example, if you use NoScript or something like that, it kind of would be if you could block scripts but not HTMX. Also practically speaking the cognitive load of HTMX should be lower than the cognitive load of JS (especially for beginners). More gen…
But if you disable JavaScript, then htmx won't work either, right? And how is it lower cognitive load? You have to learn JavaScript, but now you also have to learn htmx. I don't call that a win. Code is read by a lot more people than wrote it. It's not great if you constantly have to be learning some flavor-of-the-week framework. (No problem learning new things where it's warranted, but this isn't even interesting, i…
It would work if either HTMX became standardized and implemented by the browser, or if I could allow HTMX (the JS) and not other scripts [selectively].
Re: Htmx in a Nutshell
#329Earlier quoted context omitted.
We already did in favor of TypeScript.
Typescript is a bandaid. We need improved DOM access for web assembly, followed by a new icon in the URL bar that indicates you're on a "legacy" site if it's using javascript (my vote is for a cute snail emoji)