Live data from Hacker News

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

lassebomh.github.io

71–80 of 126 posts

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

#71
post #22

Earlier quoted context omitted.

This is a great question. I love htmx but in situations that have to work offline I can't use it. Would be a great hack to be able to just run your server code in a worker.

I am not sure if I understand the definition of offline here. HTMX has graceful degradation options. What else could you do when the client is offline?

There are many apps that work when the user is entirely offline and HTMX is not a good option if that is a key requirement of your app.

Figma is an example.

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

#72
post #62

I was seriously thinking about using HTMX myself, but I'm kinda scared it's developer pool seems too small to hire devs from. I'm used to proprietary frameworks, in my case I worked with intershop which uses isml. (this is comparible to something like thymeleaf). In recent years we tried to move away from this approach and go to the angular front end Stack because it's easier to hire a dedicated frontend developer th…

How to counter it. HTMX takes no more than half a day to pick up, probably quicker than that. Keep in mind HTMX does not solve all scenarios, there are times when a SPA using a JS framework is required.

I know nothing about HTMX. Where do I look first?

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

#73

I wonder if it would be a good idea to move the whole HATEOAS thing towards things like desktop and mobile apps. Might be a fun experiment.

I have only ever seen HATEOAS as an abstract concept, but never actually seen a real UI where I think "wow that is actually an improvement in user interaction".

REST was a welcome simplification of the SOAP monstrosities, but it comes with a lot of dogma. REST aligns natural user concepts with data with the service architecture, so I see its purpose fundamentally.

HATEOAS seemed like a product of people wanting even more dogma / pretentious drivel in architecture meetings without really concentrating on if the user experience is improved by the model.

Does anyone have a HATEOAS UI example that highlights why you would use it as some founding principle? I mean fundamentally each page has links to "what to do next", and my impression of HATEOAS is a blinged up way of trying to bring some sort of similar state model to REST service calls.

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

#74
post #62

Earlier quoted context omitted.

How to counter it. HTMX takes no more than half a day to pick up, probably quicker than that. Keep in mind HTMX does not solve all scenarios, there are times when a SPA using a JS framework is required.

I know nothing about HTMX. Where do I look first?

https://htmx.org/

The examples at https://htmx.org/examples/ may also be helpful

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

#77

hey there, I'm the creator of htmx, and I really appreciate you making this! very cool!

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.…

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.

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

#78

hey there, I'm the creator of htmx, and I really appreciate you making this! very cool!

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.…

in addition to the other tools mentioned in sibling comments, there is a multi-swap extension:

https://htmx.org/extensions/multi-swap/

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

#79
post #62

Earlier quoted context omitted.

How to counter it. HTMX takes no more than half a day to pick up, probably quicker than that. Keep in mind HTMX does not solve all scenarios, there are times when a SPA using a JS framework is required.

I know nothing about HTMX. Where do I look first?

If you want a longer introduction you can read out book (free online): https://hypermedia.systems

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

#80
post #59

Earlier quoted context omitted.

I have been using HTMX with Django for over 3 years on multiple (client) projects. In 99% of the cases, it works just fine. In the 1% of highly interactive components that aren’t working well with HTMX, you can just put in some Vue or alpineJS. whichever works best for you. I have migrated all of my own and client apps from a decoupled Vue/django setup to HTMX. It was a ton of work, but it’s awesome having a clean se…

I think you mention a very valid point that is worth reiterating: Even when you enter territory where HTMX gets cumbersome for some reason, you can still use custom JS or some other library to work around it. I admit that I initially started to use HTMX to avoid JS, but I am now more comfortable than ever before to fall back to some lines of Javascript in the few cases where HTMX does not feel like a great fit to sol…

> I admit that I initially started to use HTMX to avoid JS, but I am now more comfortable than ever before to fall back to some lines of Javascript in the few cases where HTMX does not feel like a great fit to solve the problem at hand.

Many people don't realize that great engineering happens under constraints. When you're faced with an empty project and the full power of JavaScript, you have 5,000,000 ways to do something and the chance to make a series of wrong choices that back you into a corner is high. By contrast, when you're working within a system that constrains the available choices, the possible design paths are considerably fewer and so the system becomes more understandable and maintainable, which makes for a very straightforward, comfortable dev experience.

Post reply on HN