Live data from Hacker News

Show HN: I made a HTMX Playground 100% in the browser

lassebomh.github.io

1–10 of 126 posts

Show HN: I made a HTMX Playground 100% in the browser

#1
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.

Show HN: I made a HTMX Playground 100% in the browser
lassebomh.github.io

Re: Show HN: I made a HTMX Playground 100% in the browser

#3
post #2

Nice! I have been using maplibre with django and htmx. I should try and put an example up there to share with others.

Thanks, and you are very welcome to post it here. Also, if you or anyone else wants to adapt more of the official examples, create an issue with the link, and I'll add them to the repo :)

Re: Show HN: I made a HTMX Playground 100% in the browser

#5
post #2

Nice! I have been using maplibre with django and htmx. I should try and put an example up there to share with others.

I'd like to see this. I don't have anything I can share publicly, but I've been making stuff with Django, htmx, SQLAlchemy and plotly and I've found it to be pretty robust

Re: Show HN: I made a HTMX Playground 100% in the browser

#6
post #5
post #2

Nice! I have been using maplibre with django and htmx. I should try and put an example up there to share with others.

I'd like to see this. I don't have anything I can share publicly, but I've been making stuff with Django, htmx, SQLAlchemy and plotly and I've found it to be pretty robust

I'm curious about why you use Django together with SQLAlchemy, instead of using the built-in ORM? Or is it just separate projects?

Re: Show HN: I made a HTMX Playground 100% in the browser

#8
post #5

Earlier quoted context omitted.

I'd like to see this. I don't have anything I can share publicly, but I've been making stuff with Django, htmx, SQLAlchemy and plotly and I've found it to be pretty robust

I'm curious about why you use Django together with SQLAlchemy, instead of using the built-in ORM? Or is it just separate projects?

I'm using SQLAlchemy to access external data sources to build reports on. Essentially, I'm using it as a dumb BI connector (mostly to access a Databricks metastore), while my Django ORM manages any app information.

I'm not sure it's the most elegant solution, but it has been pretty functional

Re: Show HN: I made a HTMX Playground 100% in the browser

#10
post #7

Is Htmx just the long overdue successor to DHTML that was all the hype in, say, 1997?

believe it or not I was around back then and, no, htmx is not the successor to DHTML, which was very JavaScript heavy

htmx is an attempt to generalize the two core hypermedia controls in HTML (anchors & forms). It does this by making any element able to respond to any event by issuing any type of HTTP request and then placing the returned HTML anywhere (and in any manner) in the DOM. This last idea is called transclusion and is probably the most important part, because it lets you build much more dynamic user interfaces within the standard HTML/hypermedia paradigm.

we have a book here if you are interested:

https://hypermedia.systems

Post reply on HN