Live data from Hacker News

Htmx is part of the GitHub Accelerator

htmx.org

511–520 of 520 posts

Re: Htmx is part of the GitHub Accelerator

#511

Earlier quoted context omitted.

Not hostile at all, and we arent degrading the user experience -- much improving it, in my opinion. With HTMX you can do real-time validation on each input element on the server and provide instant visual cues to the user anytime one fails. https://htmx.org/examples/inline-validation/ Moreover, HTMX makes it incredibly easy to change the whole paradigm of submitting data. You can eliminate some forms entirely and jus…

Disagree that it’s good UX. Now the user only gets feedback when they lose focus on the field, forcing them to go back and refocus it. In conventional React they get feedback on each keystroke allowing errors to be fixed while the field is still focused.

So when the person is starting to enter an email address, the page goes red until he enters the .com at the end? He gets an error for the first 9 digits of a phone number? Do you implement debouncing?

There isn't one thing called "conventional React", there are all kinds of validation libraries on npm and many strategies laid out on Stack Overflow. https://stackoverflow.com/questions/41296668/how-do-i-add-va...

I think it's fair to say we have different opinions on good UX, no need to debate it any further

Re: Htmx is part of the GitHub Accelerator

#512
post #349

Earlier quoted context omitted.

> and quick start on the homepage what do you think the project does? It adds some special attributes to HTML that magically perform some logic and it is not clear how and why. Why would I use something like this over React? What this thing is trying to solve? > You render the HTML using the frameworks/tools/languages you fancy. HTMX provides custom attributes you can use to update content within a page without havin…

> I still can't see what's the point of it. Why would I want to do it? It depends on how you like to build projects. If you like the current state of client-side rendering there is no point to using HTMX. If you like server-side rendering (my personal preference) then HTMX fills the gap of doing partial DOM updates without needing to reload the entire page. Some people will argue about perf metrics until they're blue…

In the olden days I remember having backend returning an ID of the DOM element to update and a tiny function would look at it and update. There was no need for HTMX.

Re: Htmx is part of the GitHub Accelerator

#513
post #383

Earlier quoted context omitted.

> Mobile phones have less powerful CPUs True - but not by much > Parsing large json objects and then building up a corresponding html structure may be more difficult than on the server I doubt it. And you'd only be doing "large JSON objects" for a desktop web app, where CPU differences vs web servers are even smaller > where you already have it loaded into memory anyway Likely not true if implementation uses streamin…

> true - but not by much. False. https://infrequently.org/2022/12/performance-baseline-2023/

I always see these claims but isn't network the more limiting factor?

Or do people study this while thinking about IoT which may use more limited resources while still relying on the internet?

Especially since a server has to handle multiple request concurrently, it doesn't seem to be remotely the same workload that a single device CPU would see anyway?

Re: Htmx is part of the GitHub Accelerator

#514

Earlier quoted context omitted.

>The fact your HTML barely reads like HTML after Tailwind, and reads more like your file is corrupted is I guess not mentioned in the tagline. Not my experience for the record. I use Tailwind in my side project, and it is exactly as convenient as it sounds to write my styles directly into HTML rather than think of a class name, add it in HTML, switch to the proper CSS file (or create it if it doesn't exist and make s…

I’ve messed around with tailwind a bit now, and honestly I could never use it in even a moderately complex site without some sort of “component” framework. I think you’re talking about just serving a .html file for every page in a site right? Having all of your styles duplicated everywhere would be much more confusing than writing CSS (and having to invent one name per groups of common things.) IMO it’s only viable i…

Locality is great, actually. One of the worst things about CSS is the fact that nothing is ever local. Blows my mind people like this fact.

Re: Htmx is part of the GitHub Accelerator

#515
Not willing to be the party pooper, but isn't htmx's appeal the simplicity of it?

I would expect it to be "done", or maybe could be refined with a couple more little things, but definitely not needing full-time dedication on making a version 2.0 or adding new features.

Aren't we going to end up with a new react?

Re: Htmx is part of the GitHub Accelerator

#516
post #440

Earlier quoted context omitted.

Congrats on the GitHub program! Very cool. I just had a fresh read of the docs and htmx is refreshingly, gloriously simple--such a breath of fresh air. So natural, self-documenting, and well thought out. It _does_ feel like a natural extension of html. To me, the only "missing" piece of htmx is a component model, but for anyone looking for that, htmx would pair amazingly well with Astro[1] which allows you to define…

Not sure what you mean by html components. That's kind of missing the point of HTMX, no? Most backend frameworks like Django or templating engines like Jinja2 have the concept of blocks or fragments so its easy to render out component pieces to send back to the frontend. If you combine that with the OOB options in HTMX and/or the Hyperscript or Alpine libraries, then I'm not sure what you would gain by using Astro.

I mean, I just don’t think you should have to have Django for a simple website. Astro is an alternative to those backend frameworks. It’s a backend framework itself in many ways.

Re: Htmx is part of the GitHub Accelerator

#517

Not willing to be the party pooper, but isn't htmx's appeal the simplicity of it? I would expect it to be "done", or maybe could be refined with a couple more little things, but definitely not needing full-time dedication on making a version 2.0 or adding new features. Aren't we going to end up with a new react?

i certainly hope not

the 2.0 would drop IE support, remove the older SSE and WebSocket support, and switch a couple of defaults (e.g, using template wrapping for parsing partial content, which handles troublesome elements like table rows better, but isn't available in IE) so it would be a breaking change (not for most folks, but still, breaking for some) which I only like to do w/ major versions.

we may have one major addition: a morph swap based on idiomorph:

https://github.com/bigskysoftware/idiomorph/

i'm on the fence on that one: it is currently available as an extension and maybe doesn't belong in the core, still thinking about it

so, in comparison with most libraries, 2.0 is going to be very minor

Re: Htmx is part of the GitHub Accelerator

#518

Earlier quoted context omitted.

"The fact your HTML barely reads like HTML after Tailwind, and reads more like your file is corrupted is I guess not mentioned in the tagline." There are a ton of ways to solve this issue but most people just look at tailwind on the surface and go shitpost about it on social media. Its the equivalent of saying "I wrote this 2k line program in one file, its so bad and disorganized is bad!"

Yeah, ok. Do tell me what are those ways. Maybe @apply? Then put some effort into realizing this is literally what you could do in CSS the entire time, but better, shorter, simpler, and with clear precedence rules, and complete assistance from the browser dev tools. Look at this here and the ridiculous extent they insist on "NO, YOU MUST COPY AND PASTE ZEH STYLES!": https://tailwindcss.com/docs/reusing-styles It's ra…

"precedence rules, and complete assistance from the browser dev tools"

Huh? I am not sure what you mean here. Tailwind generates css that is completely explorable in any browser dev tooling. Its precedence is the order of the css classes just like any other css class.

You can solve class overload by just making components. Create a Button component one time, have it contain the tailwind classes you want, and then all through your app, just call your Button component and never think about it again.

You can also just define custom tailwind classes in the config you want to do something really specific or crazy.

If that is too much work you can use Daisy UI which is just a tailwind plugin and it creates a ton of classes that essentially compress tailwind classes down to manageable chunks if you are fine with Daisy's style.

Re: Htmx is part of the GitHub Accelerator

#519

Earlier quoted context omitted.

The idea of rights can be seen to emerge in large part from multiagent decision theory. This should not be surprising because moral intuitions arose as humans evolved living in groups. http://www.daviddfriedman.com/Academic/Property/Property.htm...

Sure but that doesn’t imply that it’s objective. I mean, I think there are two levels of objective: objective among humans, and objective among the universe. I don’t know any secular person who believes that morals fall into the latter category. As for the former, I don’t think anyone can suggest that the (lack of) a right to privacy falls into in that

I'm not sure quite what you mean by the last sentence.

A "right to be forgotten" seems to mean a conflict with the classic rights of others to remember what they know, and to tell each other what they know.

Re: Htmx is part of the GitHub Accelerator

#520

Earlier quoted context omitted.

HTMX is just a convenient way of handling user-initiated UI updates AJAX calls (for whatever purpose). So instead of writing some JavaScript that looks for a specific element to attach an `onclick` event and subsequently makes an AJAX call then again searches for an element on the page to update with the result you can put some (very simple) HTMX code in the HTML directly and it'll handle that sort of thing automatic…

So my apis need to return html specific to the page its called from with the data embedded? I guess my apis would need different endpoints that return json for other clients. And different endpoints for the exact same data if they need to be displayed differently? It just seems like a bad thing to couple. What about CSS? I guess you have to look at what the server returns to figure out how to select/style it. I recog…

In there book, the authors specify that it is valid and normal to have additionnal endpoints for json. For exemple, Mastodon provide html endpoints as a interface for the user's browser, but also json endpoints for other clients (mobile app, cli tools, or others web app providing an alternative ui)
Post reply on HN