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

    incalculable-translator-75647

    05/12/2023, 4:02 PM
    (
  • c

    cold-parrot-94106

    05/12/2023, 5:55 PM
    )
  • f

    faint-forest-70429

    05/12/2023, 8:07 PM
    Hi all, Thank you very much for this project. It made me believe I can build GUI again.
  • f

    faint-forest-70429

    05/12/2023, 8:09 PM
    Wondering where is the right place to ask a question about HTTP response codes and HTMX. I've implemented the delete button with swap as it shows in the examples but if my API returns 204 instead of 200 it does not replace my hx-target. Since the delete does not return anything in the body. I thought the correct response code should be 204 and not 200. Thoughts? Thank you again for this awesome project.
  • g

    great-cartoon-12331

    05/12/2023, 8:11 PM
    if there's no response body there's nothing to swap. so not swapping is expected
  • f

    faint-forest-70429

    05/12/2023, 8:11 PM
    I want to remove the line from the table. What I'm doing wrong?
  • g

    great-cartoon-12331

    05/12/2023, 8:12 PM
    you need to return 200 OK with a body that somehow removes or says that it will remove the table row. for example, what i do is, return an HTML fragment wrapped in a
    <del>
    tag, that the browser will render with strikethrough
  • f

    faint-forest-70429

    05/12/2023, 8:13 PM
    gotcha! thanks a lot!
  • a

    astonishing-oil-69230

    05/12/2023, 8:43 PM
    hi guys! how can i prevent a hx-get to swap a auth page inestead of the disired route when the session is over? i'm tring this body tag, but it's still rendering the login page
  • m

    mysterious-toddler-20573

    05/12/2023, 8:55 PM
    I would send an
    HX-Redirect
    header to redirect them to a login screen
  • a

    astonishing-oil-69230

    05/12/2023, 9:01 PM
    yeah.. that would solve.. but i'm using a @login_required decorator.. so i'll have to make my own login decorator
  • a

    astonishing-oil-69230

    05/12/2023, 9:02 PM
    isn't there a way to abort a request in that phase?
  • g

    great-cartoon-12331

    05/12/2023, 9:11 PM
    see https://discord.com/channels/725789699527933952/864934037381971988/1106656121760002231
  • a

    astonishing-oil-69230

    05/12/2023, 9:42 PM
    thanks! it gave me the direction.. i'll recreate that decorator with the flask syntax
  • b

    busy-tomato-43957

    05/12/2023, 11:36 PM
    Hello fellow kids.
  • b

    busy-tomato-43957

    05/12/2023, 11:36 PM
    Observe my latest htmx ~~monstrosity~~creation, in which I build an entire htmx todo app in a single go template file, including html document and fragments, styles, routing for hx requests, db schema definitions, and db queries in a single 100 line file. https://github.com/infogulch/go-htmx/blob/master/templates/todos.html
  • m

    mysterious-toddler-20573

    05/13/2023, 12:58 AM
    I am being asked if there is a canonical implementation of TODO-MVC for htmx
  • m

    mysterious-toddler-20573

    05/13/2023, 12:58 AM
    https://github.com/tastejs/todomvc
  • m

    mysterious-toddler-20573

    05/13/2023, 12:58 AM
    https://github.com/quii/todo is the most recent once I've seen
  • m

    mysterious-toddler-20573

    05/13/2023, 12:59 AM
    does anyone have any recommendations?
  • m

    mysterious-toddler-20573

    05/13/2023, 12:59 AM
    i hate that I have to pick a particular back end
  • g

    great-cartoon-12331

    05/13/2023, 1:03 AM
    hmm, it should be possible to make a TodoMVC backend purely with Nginx or some other proxy that can access query parameters and return HTML
  • g

    great-cartoon-12331

    05/13/2023, 1:05 AM
    at least good enough for demo purposes
  • m

    mysterious-toddler-20573

    05/13/2023, 3:49 AM
    it was suggest to use web workers
  • w

    witty-iron-33803

    05/13/2023, 6:00 AM
    @busy-tomato-43957 nice one, but before using websockets you might try sse (server side events)
  • b

    busy-tomato-43957

    05/13/2023, 6:01 AM
    There's this one that uses a service worker https://github.com/richardanaya/wasm-service
  • b

    busy-tomato-43957

    05/13/2023, 6:05 AM
    I haven't integrated either yet, but it seems interesting
  • w

    witty-iron-33803

    05/13/2023, 6:07 AM
    played with htmx and sse and it's really nice first used the sse extension and then went the hyperscript route really nice to use, hyperscript has a little bug there but that's no problem
  • w

    witty-iron-33803

    05/13/2023, 6:08 AM
    I'd say that sse in general is underrated 😉
  • c

    cuddly-keyboard-70746

    05/13/2023, 8:20 AM
    we could have a repo with a readme pointing to different languages/libs
1...112711281129...1146Latest