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

    busy-kangaroo-68336

    01/10/2023, 11:42 PM
    it's not an easy answer, in dev it's eventually an http call, but at release time, i think it goes through COM on windows, and no idea what it does on other OSes
  • m

    mysterious-toddler-20573

    01/10/2023, 11:42 PM
    mmm
  • b

    busy-kangaroo-68336

    01/10/2023, 11:43 PM
    i'm absolutely not trying to get you guys implementing stuff for this use case, that's all on me, i'm just not sure if there even is an extension point in htmx
  • b

    busy-kangaroo-68336

    01/10/2023, 11:43 PM
    for this use case i mean
  • m

    mysterious-toddler-20573

    01/10/2023, 11:43 PM
    so, depending on where you want to go w/ this, I think you'd probably want to rip out and reimplement the stuff below this: https://github.com/bigskysoftware/htmx/blob/613f7b61d59e8ac4741e02d9f468ca635773ab2d/src/htmx.js#L2747
  • b

    busy-kangaroo-68336

    01/10/2023, 11:44 PM
    ah thanks !
  • m

    mysterious-toddler-20573

    01/10/2023, 11:44 PM
    it's a lot though
  • m

    mysterious-toddler-20573

    01/10/2023, 11:44 PM
    there is history support and a lot of other browser specific stuff in there
  • m

    mysterious-toddler-20573

    01/10/2023, 11:44 PM
    htmx really wants to be HTML over HTTP
  • b

    busy-kangaroo-68336

    01/10/2023, 11:45 PM
    yes, and i like it very much =) that's why i'm trying to get it to work in this less than ideal scenario =)
  • m

    mysterious-toddler-20573

    01/10/2023, 11:45 PM
    i have thought about supporting a
    js:
    prefix
  • m

    mysterious-toddler-20573

    01/10/2023, 11:46 PM
    e.g.
    hx-get="js:foo(params)"
  • b

    busy-kangaroo-68336

    01/10/2023, 11:46 PM
    that's what i'm trying to do yes
  • m

    mysterious-toddler-20573

    01/10/2023, 11:46 PM
    but it would still expect back HTML-ish results from
    foo()
  • b

    busy-kangaroo-68336

    01/10/2023, 11:46 PM
    how about headers and so on ?
  • b

    busy-kangaroo-68336

    01/10/2023, 11:47 PM
    just html, not http ?
  • m

    mysterious-toddler-20573

    01/10/2023, 11:47 PM
    probably make them all symbols, so you can pass them along if you want
  • m

    mysterious-toddler-20573

    01/10/2023, 11:47 PM
    as well as a
    config
    object that just contains all the metadata that htmx collects (effectively
    requestConfig
    if you are looking at the code)
  • b

    busy-kangaroo-68336

    01/10/2023, 11:48 PM
    mhhh food for thought indeed
  • b

    busy-kangaroo-68336

    01/10/2023, 11:48 PM
    i'll go and mull over this perusing the code, thanks for the pointers
  • m

    mysterious-toddler-20573

    01/10/2023, 11:48 PM
    that wouldn't be so bad. It would involve eval() though
  • b

    busy-kangaroo-68336

    01/10/2023, 11:49 PM
    i don't care too much about eval, that's for internal tools in my case, so yeah
  • b

    busy-kangaroo-68336

    01/10/2023, 11:49 PM
    thanks again
  • m

    mysterious-toddler-20573

    01/10/2023, 11:53 PM
    yep, looking at the code and pondering for a bit, I wonder if mocking out the xhr flow would be the easiest way forward, setting the
    status
    and
    response
    properties directly w/ the results of the JS and invoking the
    xhr.onload()
    method, not sure if possible but it would do the least violence to the normal code path
  • b

    busy-kangaroo-68336

    01/10/2023, 11:55 PM
    i'll let you know if i manage to get anywhere with this
  • l

    late-king-98305

    01/11/2023, 12:13 AM
    OK. Checkboxes can be funky; on the server, the value will be "on" (or the
    value
    attribute, if you specify it), but if it's not checked, it won't even be in the form data that's submitted. Given that caveat, though, you should be able to use an
    hx-post="/my/end/point"
    attribute on the checkbox, and it should include its maybe-value in the request. (That's what the first sentence at https://htmx.org/docs/#parameters says; I haven't personally done a post on a single checkbox.)
  • a

    abundant-spring-38265

    01/11/2023, 10:33 AM
    i'm observing interesting behaviour with them
  • a

    abundant-spring-38265

    01/11/2023, 10:33 AM
    enabling (checked) works
  • a

    abundant-spring-38265

    01/11/2023, 10:33 AM
    however when i untick it, POST method submits None
  • a

    abundant-spring-38265

    01/11/2023, 10:33 AM
    well, just the csrf_token
1...977978979...1146Latest