Live data from Hacker News

Htmx is part of the GitHub Accelerator

htmx.org

461–470 of 520 posts

Re: Htmx is part of the GitHub Accelerator

#461

It's so odd to live long enough and see the steady pipeline of "look at this much simpler way of doing web apps, just write HTML, not like the previous complex way" projects, which then turn into the previous complex way as the eyes turn towards the next "simple way of doing web apps, just write HTML...". Angular and React started this way on the frontend, while ASP and PHP started this way on the backend (of course…

"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 rampant dysfunction on full display, my friend. It's as clear as daylight. Copy/paste is the rookie approach, and Tailwind targets rookies. So it focuses on "it's not your fault, copy paste is good, they... they don't get you" approach and then throw @apply in there as some half-baked solution for those who are starting to wake up from the Matrix.

You are in an abusive relationship. Seek counsel.

Re: Htmx is part of the GitHub Accelerator

#462

Can someone explain to me how state management is done in HTMX? I'm a native Django developer, and I really do like HTMX and wrote my own personal website with it (nothing special, a digital garden). But for my startup, I chose react, and it has pretty much become a SPA, where I need to keep track of so much state. Now, I would love to transition to HTMX, because I find Django a lot more ergonomic to work with. But I…

I don't think there is a single answer to state management with htmx as in "put your key-value pairs here“. Instead the page depicts the application state and offers ways to change it or to change what is depicted each time updating parts of the page. So the state is what's on the page so to say. However some options are: 1. you can have some form of state in your url by having every user actions change a param, returning the updated page with updated links/forms. 2. You could keep a session on the backend. Never used this myself, however Django which you speak of above should have support for sessions without a user/login. 3. you can keep state in the database if is important enough and you have a user. 4. htmx also sends a lot of js events which you can react to by using some plain Javascript yourself. You can also send your own events and have htmx listen on them to have different components react to a page/state update elsewhere with their own page update.

Re: Htmx is part of the GitHub Accelerator

#463

Earlier quoted context omitted.

there already is! https://hyperview.org/ Adam Stepinski, the creator of Hypreview, built it after his experience with intercooler.js, the predecessor to htmx. It is a very interesting piece of technology and, through the magic of HATEOAS, allows you to update your mobile app instantly for all your users, without dealing with the mobile store! There is an entire section on Hyperview, written by Adam, in part three of…

Looks cool but it seems it requires React which makes it a lot more difficult to use than regular HTMX. Form the GitHub repo: “More importantly, the client is designed to be incorporated into an existing React Native project”

Well, you need some cross platform native UI toolkit that can dynamically render the hxml, and React native is hard to beat there.

Re: Htmx is part of the GitHub Accelerator

#464
I like the idea of htmx, it's more familiar with me since when I was involve on web developing, it was mostly jQuery, PHP, vanila JS, django. But I don't think I will change my current app from Vue to htmx, too many changes.

Re: Htmx is part of the GitHub Accelerator

#465

hi there, as many of you know, i am the creator of htmx and I'm happy to answer any questions about it htmx has seen a surge in popularity, triggered by a video by fireship dev ( https://www.youtube.com/watch?v=r-GSGH2RxJs ) and a series of videos by ThePrimeagen, a popular twitch streamer on it hacker news readers might be interested in the essays I have written on htmx & hypermedia in general here: https://htmx.org…

Hi, I've been skimming over your book. There might be a typo under [1], where you write: "An HTTP response to this htmx-driven request might look something like this", but then the next figure's header is "JSON"

Also, I love your username!

[1] https://hypermedia.systems/hypermedia-reintroduction/#_hyper...

Re: Htmx is part of the GitHub Accelerator

#466

I started with Perl in ‘96 and have lived through what feels like everything — PHP, jQuery, Drupal, Backbone, Node, Angular, ClojureScript, React, GraphQL, and NextJS. Htmx feels like a divergence from the trend, and is worth thinking about. Htmx asks us a good question: “does the complexity of your work reside essentially on the server or essentially on the client?” The complexity for the vast majority of websites r…

As I understand it https://github.com/hyperfiddle/electric provides an abstraction at least over the network divide.

Re: Htmx is part of the GitHub Accelerator

#467

Can someone explain to me how state management is done in HTMX? I'm a native Django developer, and I really do like HTMX and wrote my own personal website with it (nothing special, a digital garden). But for my startup, I chose react, and it has pretty much become a SPA, where I need to keep track of so much state. Now, I would love to transition to HTMX, because I find Django a lot more ergonomic to work with. But I…

State management is done in whatever day your backend does it. HTMX is mostly concerned with sending requests to the backend and shoving the HTML response in the right place in the DOM

Re: Htmx is part of the GitHub Accelerator

#468
post #424

Earlier quoted context omitted.

I’m not a fan of vendors “not supporting something” as a reason to not use something. Either get a new vendor, put pressure on the vendor, or ignore the feature you want to use. I personally don’t care about what cloudflare does because I don’t use them. The rest is RTFM for whatever API you are calling and you usually have to send auth or cookies anyway, so an accept header isn’t that big of a deal.

I dropped Accept header support from https://datasette.io/ because it's open source software that I build for other people to use, and I knew that it was very likely one of my users would choose to run it behind Cloudflare (or run it on a vendor like Vercel who might have a partnership with Cloudflare). https://github.com/simonw/datasette/issues/1534

FWIW, WordPress uses the Vary: Accept header for a number of apis and it seems to always work fine behind cloudflare and runs a sufficiently large portion of the internet. But, you're telling me I can hit all these site's public api's that are behind cloudflare and start a DOS by simply sending an uncommon ACCEPT header? Sounds like an easy way to pressure cloudflare to 'do the right thing' if you own a botnet.

Anyway, I guess this is yet another reason to not use cloudflare. Thanks for your comment.

Re: Htmx is part of the GitHub Accelerator

#469

Earlier quoted context omitted.

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…

> some sort of “component” framework It's implicitly expected you're already doing so, such as web components or whatever your selected framework uses to abstract components. > Having all of your styles duplicated everywhere Locality is a feature. It's much easier to jump into any random bit of HTML and understand what's going on and confidently make changes without having to pull up multiple other files to grok the…

"Compression" doesn't solve change management, where you need to consistently change together things that are meant to change together. Intead of letting them fragment, diverge in millions of tiny ways until entropy takes over your project and kills it.

Copy/pasting, which Tailwind is so proud of, is to fork, and never merge. Let's fork all the things. We end up with a bazillion little things and no coherence/alignment between them. Hello, second law of thermodynamics.

Quick detour: our universe is so organized, that inanimate matters forks, and animate matters looks at the forks and is trying to find ways to solve these pieces together into coherent systems by merging putting together, deduplicating, generalizing. Inanimate and animate are two opposing forces, increasing entropy requires no intelligence, decreasing it does. It's no surprise Tailwind promotes lack of intelligence by saying "copy paste bro, it's good, turns out". Because that's who they target. People afraid of thinking. "Oh no you gonna like have to name a class, that's terrible". Woah woah... rocket engineering territory here!

For those starting to get back to their senses... they added @apply. But @apply is by Tailwind's own admission "like using CSS". I'd add it's like using CSS but with 1/1000 the capability, unclear/surprising precedence, and tons of extra steps/indirection, because... you could've been using CSS, simply.

And one more word about "compression". Do you know what you're doing when you name a reusable case and put it behind a class, function, package, module, library? You're compressing. So yes compression does solve issue of repetition, but intelligent compression (YOUR BRAIN) does this in a much better way aligned to your project's needs, compared to, say, GZip. GZip can't think for you. It can shrink things for transmission, but its only job is to shrink transmission. Your project still needs to evolve in time, and when you look at it... you're looking at the repetition, not at the GZip.

Or maybe I'm wrong, do you edit the .gz directly? Heheh. If so, I take all I said back.

But compression, in the context of broader space (your project, your industry, your target audience, coworkers, customers) and broader time (project evolution, change management, new requirements adaptation, changing platforms) is your job. The job of intelligence. The moment a computer compresses better than you, is the moment you become useless. LLM is a form of compression, because compression relies on prediction of what's next, whether it be what we desire is next (needs, desires, goals) or what is next regardless (outcomes, events, probabilities). When I tell an LLM "code me a modern site" and it does better than you (i.e. not using Tailwind, but with proper minimal CSS with well named classes), compression replaced you.

^_O

Re: Htmx is part of the GitHub Accelerator

#470
post #376

hi there, as many of you know, i am the creator of htmx and I'm happy to answer any questions about it htmx has seen a surge in popularity, triggered by a video by fireship dev ( https://www.youtube.com/watch?v=r-GSGH2RxJs ) and a series of videos by ThePrimeagen, a popular twitch streamer on it hacker news readers might be interested in the essays I have written on htmx & hypermedia in general here: https://htmx.org…

Are you also the writer of https://grugbrain.dev/ ?

> javascript developer get what deserved let grug be frank
Post reply on HN