Live data from Hacker News

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

lassebomh.github.io

121–126 of 126 posts

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

#121

Wonder if there is there anybody who is making an offline app with request-reponse with html(with HTMX) and a virtual server defined in a service worker?

Yes, here is one. https://github.com/jon49/htmx-todomvc

I use this pattern for all my personal apps. I use my own little htmx-like library though. But wouldn't be that hard to swap in HTMX.

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

#122
post #23
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.

> Would be a great hack to be able to just run your server code in a worker. This is exactly why some people build heavy offline-first SPAs in JS. HTMX tries to avoid this entirely. Conceptually (seen from the perspective of HTMX), it makes zero sense to put the server code in a worker and run a client-server architecture in the client‘s browser. This would be an over-engineered thing that HTMX explicitly tries to av…

I made an app doing this with an HTMX-like library with a total of 100 kB minified/zipped code. Not bloated at all. The code to make it work is about 10 kB. The rest is the code for the actual app.

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

#123
post #23

Earlier quoted context omitted.

> Would be a great hack to be able to just run your server code in a worker. This is exactly why some people build heavy offline-first SPAs in JS. HTMX tries to avoid this entirely. Conceptually (seen from the perspective of HTMX), it makes zero sense to put the server code in a worker and run a client-server architecture in the client‘s browser. This would be an over-engineered thing that HTMX explicitly tries to av…

I'm not sure "zero sense" is true. An app designed around REST and hypermedia imposes sensible constraints, like how you handle state, navigation, etc., and this can still yield plenty of benefits.

Yes, I've done this and the code is really simple to understand compared to a SPA.

https://github.com/jon49/Soccer

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

#124

Earlier quoted context omitted.

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.

I've done this. HTMX offline-first is an elegant way to build apps.
Post reply on HN