Lurker News
I recently dug up an old project in an attempt to improve on it. It's a code sandbox for playing around with HTMX in the browser, that runs a mock server within the sandbox iframe. The server "framework" is loosely based on Django, so if you're familiar with Django, you'll immediately understand what's going on.

I recommend clicking through the examples.
Github repo: https://github.com/lassebomh/htmx-playground
Probably my favorite part is the lack of HTMX specific code. It's designed to mimic the client and server, but really nothing else. In principle, this means that it is agnostic to whatever frontend framework is being used.
Known problems: Limited mobile support, Ace Editor (should just be Monaco) and lack of proper error outputs.
Feel free to give feedback, suggestions or questions.
I learned a lot when making it, and I hope you'll something about HTMX! Happy tinkering.

Comments (118) 19 threads

Show all comments

Showing thread 1 of 19

recursivedoubts4 replies#
hey there, I'm the creator of htmx, and I really appreciate you making this! very cool!
bitterblotter2 replies#
Likewise man. In the face of avoiding JS, I think we've both taken one for the team here
thisgoesnowhere3 replies#
Wait til you find out I'm using htmx with node.
chatmasta#
Wait til he finds out what htmx is built with.
recursivedoubts#
based
bitterblotter#
Me when I buy a face mask and immediately ask people to spit in my eyes
doublerabbit1 reply#
> In the face of avoiding JS, I think we've both taken one for the team here

In which, you still need to include a JS file. I'd still count that as Javascript.

rideontime1 reply#
Pretty clear that they mean "avoid writing javascript," not "avoid executing javascript"

Continue this thread — 1 reply

quickthrower25 replies#
Thankyou for the awesome library! I have a question.

Is there a way to use HTMX with minimal server side changes. Specifically if I have an existing page that you fill in a form and submit and response is of course the entire page. I think it would be cool to tell htmx that the whole page is being returned BUT I only want to update #my-form and that way you don’t need any “if htmx request” kinda stuff on the server.
This is for people who care about their site working without JS. But also it allows you to have a single backend endpoint to handle multiple things (for example comments, sign up to email, like button, all in one)

quickthrower2#
That could be it! I missed that one. Will try it next time.
sethammons1 reply#
Oh that's neat - so you can return more than htmx will use and it can select the element it needs in the response and discard the rest

Continue this thread — 1 reply

broomhall1 reply#
I'm not sure about HTMX, but this kind of behaviour is what Unpoly https://unpoly.com/ excels at

I played with it recently and it was pretty easy to enhance a completely non-js CRUD type app and have it fall-back gracefully. Seems a similar concept to HTMX but has a more batteries included / high-level approach.

spiffytech#
I'm in the early stages of an Unpoly project and I'm happy with it so far. It's nice to have things built-in like modals and attaching data & logic to incoming elements. Feels like I have less need to integrate with Alpine.
naasking#
hx-boost is the simplest way to do this, but it updates the body content rather than the form. In most cases this will probably be effectively the same.
throwaway167#
hx-target="closest " hx-swap="outerHTML swap:1s" hx-push-url="false"

That'll return whatever partial thing you want to return and replace (with 1sec effect).

a_c1 reply#
Haven’t tried htmx. Have you heard of phoenix liveview? Are they similar concepts?
recursivedoubts#
htmx is lower level than the various liveview implementations

this makes htmx more work, in general, to accomplish things but also less opaque
htmx is laser focused on generalizing hypermedia controls in HTML (anchors & forms)

tomberek#
As a CEO of htmx, I second this appreciation. Well done!