https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • o

    orange-umbrella-16693

    03/14/2023, 10:07 PM
    How did we get here?
  • o

    orange-umbrella-16693

    03/14/2023, 10:07 PM
    Oh, right, Facebook.
  • g

    gorgeous-airport-54386

    03/14/2023, 10:09 PM
    spa: server: run app.js to generate vdom -> serialize to html -> send client: receive html -> deserialize to dom -> download app.js -> run app.js to generate vdom (again) -> attach event listeners from vdom to dom htmx: server: run app.howl to generate html with htmx attributes -> send client: receive html -> deserialize to dom -> download htmx.js -> run htmx.js to attach event listeners
  • g

    gorgeous-airport-54386

    03/14/2023, 10:10 PM
    and for anything that you can't do with htmx, you can use javascript or hyperscript with progressive enhancement, which again only runs on the client
  • a

    abundant-dog-96915

    03/15/2023, 2:02 AM
    did you all see https://primatejs.com/quick-start/ posted on HN today?
  • a

    abundant-dog-96915

    03/15/2023, 2:02 AM
    not sure what the value prop is for htmx written in js. Does anyone have a breakdown?
  • g

    gorgeous-airport-54386

    03/15/2023, 2:03 AM
    same as htmx written in any other language
  • a

    abundant-dog-96915

    03/15/2023, 2:03 AM
    lack of context switching?
  • a

    abundant-dog-96915

    03/15/2023, 2:04 AM
    localization of behavior?
  • a

    abundant-dog-96915

    03/15/2023, 2:13 AM
    ah I see it's just a router that returns html that happens to be htmx
  • m

    miniature-window-68019

    03/15/2023, 4:50 AM
    Is it possible to call an async function in htmx:configRequest?
  • m

    miniature-window-68019

    03/15/2023, 4:51 AM
    i.e. modify the request that a form is sending based on reading a file asynchronously
  • r

    refined-waiter-90422

    03/15/2023, 6:01 AM
    related, got a small mention in #1079191774976802867 recently: and related: The current workaround as far as I know, is to do it in vanilla js: 🟢 form wants to be submitted āž”ļø trigger event to vanilla js āž”ļø do async thing āž”ļø async result āž”ļø trigger htmx submit event šŸ›‘ done
  • r

    refined-waiter-90422

    03/15/2023, 6:03 AM
    Of course, if you don't need to get the result from the async thing, you can just fire it off in htmx as usual. The issue is when you actually need the result.
  • r

    refined-waiter-90422

    03/15/2023, 6:09 AM
    its not one size fits all in this case, typically: Result not needed (fire and forget): analytics, logging, .... Result needed: captcha, pre-validation, client-side file processing, ...
  • m

    miniature-window-68019

    03/15/2023, 6:10 AM
    That's a cool workaround, didn't even consider that, thank you
  • r

    refined-waiter-90422

    03/15/2023, 6:11 AM
    You're welcome dude, do leave a +1 on the issue šŸ˜‰ it would be nice to get that convenience in someday.
  • p

    proud-librarian-99598

    03/15/2023, 7:03 AM
    No, unfortunately not
  • a

    agreeable-soccer-32139

    03/15/2023, 7:05 AM
    @proud-librarian-99598 don' you think it's worth a patch? I'll comment on your issue, read the source code and see if I can come up with an extension or something...
  • m

    mysterious-toddler-20573

    03/15/2023, 10:40 AM
    > Speaking as a long-time UI guy... The only thing I can imagine being worse than HTMX's design philosophy is then writing another layer of JavaScript on top of it
  • r

    refined-waiter-90422

    03/15/2023, 11:31 AM
    ikr, compliment and neg all in one lol. good old HN.
  • m

    mysterious-toddler-20573

    03/15/2023, 11:35 AM
    > People who like HTMX dislike good UIs, it's that simple.
  • m

    mysterious-toddler-20573

    03/15/2023, 11:37 AM
    \> reading HN \> ever
  • m

    mysterious-toddler-20573

    03/15/2023, 11:39 AM
    \> Using htmx is reminiscent of the dark times of web development directly over ftp without using a version control system.
  • m

    mysterious-toddler-20573

    03/15/2023, 11:39 AM
    there are plenty of nice comments too, i shouldn't focus on the negative
  • r

    refined-waiter-90422

    03/15/2023, 11:49 AM
    Yeah the rebuttals to the troll were really cool.
  • f

    freezing-waitress-26396

    03/15/2023, 11:53 AM
    where are these quotes even coming from
  • r

    refined-waiter-90422

    03/15/2023, 11:55 AM
    htmx is universally beloved by Fullstack devs. Frontend devs may not appreciate the simplicity if they aren't able to influence or see the backend.
  • r

    refined-waiter-90422

    03/15/2023, 11:57 AM
    HN thread:
  • n

    numerous-agent-22346

    03/15/2023, 12:18 PM
    In the answers I read: "Also, this HTML renderer logic needs to be aware of the rest of my app, so the reverse is true; when I'm going to write some new UI, I have to go put it somewhere random, associate it with a frontend route and backend endpoint it loads from, and then attach all the possible nested user-actions from this HTML." I do not agree with this, in my opinion the end-point should be driving the interaction with the network application not with the client-application consuming hypermedia API. I see those as two different things. In the end it turns out that I write less js in any case by having the state being driven by the interaction with the network application
1...106710681069...1146Latest