News for hackers. Stuff that matters.
Re:Htmx Is the Future by ukuina on Friday May 05, 2023 @08:00PM (#35836597)
Doesn't this make serverless read-only apps (that only require a fileserver) effectively impossible?

In a serverless read-only app, all business logic and state is maintained on the browser.

Re:Htmx Is the Future by _heimdall on Friday May 05, 2023 @10:13PM (#35837312)
Serverless and static are different. Static sites will likely be limited to maintaining state in the browser. Serverless is terribly named but still have a short lived server with access to request query parameters, cookies, headers, and a database depending on your setup
Re:Htmx Is the Future by decross on Sunday May 07, 2023 @08:41PM (#35856945)
You can embed a "backend" as a service worker and use htmx to interact with it. A proof of concept here: https://github.com/richardanaya/wasm-service
Re:Htmx Is the Future by ukuina on Monday May 08, 2023 @01:50AM (#35858540)
This is cool!

A possible extension to HTMX would be to allow this kind of offloading to pure JS functions instead of requiring hacky intercepts.

You would still have a clear separation of responsibilities between frontend rendering (by the browser only) and application logic (which only generates HTML as output).

Re:Htmx Is the Future by nymanjon on Sunday May 14, 2023 @04:31PM (#35941134)
I've done the same thing with vanilla JS in a service worker. I did it with my HTMF library -- similar to HTMX -- but not production ready and based on forms rather than being able to put your attributes everywhere. I'll have to create a simple to do app with HTMX that shows this same functionality. The Rust one is cool as you can do it with 150kB library. But I can do the same thing with 10kB with just simple JS.