Hacker News new | past | comments | ask | show | jobs | submit | maddalax's comments login

I'm the creator of https://htmgo.dev and I'll say that is definitely the biggest issue I've run into with htmx. It's definitely not an overall replacement, you will have to either rebuilt the date picker from scratch in js, or find a vanilla js library

so unfortunately the major downside I see so far is it's fairly hard to find good open source vanilla js libraries for things, as most things seem to be written for react.

other examples include: - virtualized list - combobox


Iam using templ https://templ.guide/ in combination with htmx. I rebuilded various of html components of https://www.patternfly.org/components/all-components/ - but as you mentioned, I also couldnt find good vanilla JS libraries for more complex components - and I dont feel I am capable to build a e.g. battle tested datepicker from scratch.

How others handle this?

P.S. I have seen some people using e.g. flowbite, but I havent tried it out: https://github.com/themesberg/flowbite/issues/812


Right now I'm working on https://htmgo.dev



Reposts are ok after a year or so in most cases, a few days is too soon, take a look at https://news.ycombinator.com/newsfaq.html under 'reposts'.


why websockets and not just SSE + XHR? Or even just XHR

Edit: SSE*


It is SSR, in the sense that the server sends HTML over the websocket. HTMX swaps out content based on the element id. Doc: https://v1.htmx.org/extensions/web-sockets/

If you mean SSE, then yes that would work just as well (unless you need the bidirectionality for the client to modify some aspect of the connection after the page has loaded). There is an htmx-sse extension too.

I'm not sure how XHR alone would let you automatically get backend state changes reflected to the frontend. You can poll one or more endpoint, but that's more complicated to get right and less efficient.


> I'm not sure how XHR alone would let you automatically get backend state changes reflected to the frontend.

Long polling.

Check out (history of) "Comet": https://en.wikipedia.org/wiki/Comet_(programming)#Implementa...


SSR is effectively long polling with a standardised format and is browser native.

Also writing a client ontop of an existing HTML client is very very easy so even when not on web it's east to implement...


Mostly just thinking that XHR to mutate (form submissions, etc) and then SSE to send the updated DOM elements would be a good combo


Sorry yes I meant SSE, mistyped!


> Mostly just thinking that XHR to mutate (form submissions, etc) and then SSE to send the updated DOM elements would be a good combo

Yes, that's basically the idea.


imo htmx is good but its a bit too low level to use directly, you sort of have to rebuild all the features frameworks like React have, such as components in your server programming language.

I'm building https://htmgo.dev to do that with go + htmx, and http://fastht.ml seems like a good contender for python


I’m not quite sure what the roadmap looks like for gocomponents but it looks similar but I think it’s only filling one part of the puzzle. My plan for htmgo is to become essentially a ready to use framework for building your whole app, using very fast/lean modules, similar to Ruby on Rails, especially rails 8, and not just an HTML builder


I’m on mobile at the moment so could probably give you a more detailed answer tomorrow, but check out https://htmgo.dev/docs#interactivity-events


What makes you believe the prefix can’t be omitted in htmgo? You just alias it the same way with a ‘.’


Sorry, I made a mistake. I thought the HTML tag functions were accessed through `ctx`, which is passed to the page function. It's true that we can import them directly to access `Div`, `Class`, etc.


This is very cool, I like the website too


that looks nice, I've enjoyed Kotlin when I used it in the past


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

Search: