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

    few-fish-46602

    01/04/2023, 2:26 PM
    Ohh somehow i mixed up the link in the scriptblock, fixed it now. thanks for your help!
  • m

    mysterious-toddler-20573

    01/04/2023, 2:39 PM
    how are you including htmx?
  • r

    rich-television-50179

    01/04/2023, 2:52 PM
    I have a js file called
    htmx.min.js
    and include it by this
    <script src="{% static 'includes/htmx/htmx.min.js' %}"></script>
  • r

    rich-television-50179

    01/04/2023, 3:26 PM
    I figured it out 😄
  • r

    rhythmic-shoe-62185

    01/04/2023, 4:11 PM
    htmx friends + Gophers - I've finally open-sourced Pushup. I really want it to embrace enhance hypermedia at its core so interested in any design feedback to support that. https://github.com/adhocteam/pushup
  • m

    mysterious-toddler-20573

    01/04/2023, 4:33 PM
    awesome! do you have a tweet about it I can boost?
  • h

    handsome-room-10543

    01/04/2023, 5:36 PM
    Going through https://hypermedia.systems rn. Does
    <body hx-boost="true">
    affect plain old forms with the action attribute and a submit input?
  • m

    mysterious-toddler-20573

    01/04/2023, 5:37 PM
    yes
  • h

    handsome-room-10543

    01/04/2023, 5:39 PM
    Ok. So if the form is supposed to download a file attachment I should add hx-boost="false" to the form element (if I still want to boost everything else)?
  • m

    mysterious-toddler-20573

    01/04/2023, 5:40 PM
    yep
  • w

    white-london-59674

    01/04/2023, 6:01 PM
    I actually think I found a JS-less example. I think this interactive map is based on an SVG, with hover effects? Is that more up the hypermedia alley? (I've seen several GIS approaches that substitute SVGs in place of webmaps, and then I guess you translate GIS coordinates to X,Y coordinates on the page? Found an example of this in the past, maybe I can dig it up again) https://bplant.org/regions.php
  • i

    important-van-94053

    01/04/2023, 6:26 PM
    Oh, pretty interesting
  • m

    mysterious-toddler-20573

    01/04/2023, 6:48 PM
    somebody explain astro to me like I'm an idiot
  • m

    mysterious-toddler-20573

    01/04/2023, 6:48 PM
    just pretent
  • r

    rhythmic-shoe-62185

    01/04/2023, 9:38 PM
    https://twitter.com/paulsmith/status/1610751968796102657?s=46&t=s5CBpbTf6c7wqZg4LFMNTQ
  • a

    aloof-ambulance-27312

    01/04/2023, 10:13 PM
    Smooth static site generator that delivers HTML + CSS. With only the JavaScript—if any—you decide to include. (With easy control over when it gets loaded.) Astro components are as close as you’ll get to HTML with JSX-like superpowers, and if you want it there’s a whole system for routing, SSR, and integrating your favorite UI framework—again only if you want to. tl;dr more convenient than HTML and CSS without necessarily shipping more than that.
  • g

    gorgeous-airport-54386

    01/04/2023, 10:18 PM
    it's an SSG that makes it really easy to use the Sprinkles Architecture ™️
  • a

    aloof-ambulance-27312

    01/04/2023, 10:21 PM
    FWIW I’m still newish to it but this fella’s videos have been really helpful:

    https://www.youtube.com/watch?v=zrPVTf761OI▾

  • l

    limited-potato-46306

    01/05/2023, 8:46 AM
    @hundreds-cartoon-20446 I do not believe that hx-history-preserve works with the Hx-Location response header. On this line (https://gist.github.com/croxton/e2c33bd22591f9a5bd8c9d23a56c9edc#file-history-preserve-extension-js-L22) there is a comment which says that htmx:beforeSwap is called before htmx:beforeHistorySave. However, when using Hx-Location response header, this is not the case. I verified it with htmx.logAll() and stepping through in the JS debugger in Chrome. This results in wonky-ness where if page 1 has an hx-preserve-history element and page 2 has one as well, if after the redirect from page 1 to page 2 you press backwards and forwards, the pages merge their contents. If you'd like, I can put together a repro. As a newcomer to HTMX in the last few weeks, I don't feel confident in saying that Hx-Location is the only place in which we would encounter behavior where htmx:beforeHistorySave is triggered without first triggering htmx:beforeSwap. Does anyone happen to have any thoughts or insights on this?
  • r

    rich-television-50179

    01/05/2023, 12:13 PM
    1cg could I run something by you?
    m
    r
    • 3
    • 98
  • l

    late-king-98305

    01/05/2023, 2:02 PM
    1. I just used the default theme - Bootstrap's CSS from a CDN - and did a few overrides in CSS that I loaded after it. I also loaded the Bootstrap JS "bundle". I did end up writing some interesting (to me, anyway) code around toasts and modals, which I wrote about at https://bitbadger.solutions/blog/2021/a-tour-of-myprayerjournal-v3/bootstrap-integration.html . 2. I have this feeling that if I picked up hyperscript and it clicked in my mind, I'd end up wanting to use it everywhere. 🙂 The practical difference between the two (which I've observed as a non-user of either) is that hyperscript seems to be better suited to define behavior alongside the element, while Alpine is a bit more of a lightweight framework.
  • c

    crooked-afternoon-55514

    01/05/2023, 2:18 PM
    Anyone have any experience with htmx behind Cloudflare? It seems cloudflare does not support Vary as a way to differentiate on a header which is going to give problems. Is there a way to maybe switch htmx to use a query parameter instead of headers (via custom logic or otherwise)?
  • m

    mysterious-toddler-20573

    01/05/2023, 2:29 PM
    i am planning on implementing this as an option today, @melodic-advantage-28381 is also requesting it.
  • c

    crooked-afternoon-55514

    01/05/2023, 2:30 PM
    oh wow! That's great.
  • c

    crooked-afternoon-55514

    01/05/2023, 2:44 PM
    this would be both for boosted and 'regular" hx-requests?
  • c

    crooked-afternoon-55514

    01/05/2023, 2:46 PM
    (I'm thinking of /search returning infinite scrolling for /search?page=1 which differs on having a surrounding layout based HX-Request vs none)
  • m

    magnificent-boots-1658

    01/05/2023, 4:41 PM
    Hi gang! I've got a is-this-a-bug question (or perhaps is-this-illegal-HTML-and-not-even-an-HTMX-problem)! I have a
    <button type="submit">
    with an
    hx-post
    on it. The
    <button>
    has a
    name
    and
    value
    attribute to pass some information about which submit button was clicked to the backend. This works fine at this level of complexity. Easy peasy. However, if I add a child element (a legal one like a
    <span>
    ) and the click technically originates from the
    <span>
    , the `name`/`value` data does not pass onto the backend in the
    POST
    data. Do we think that: 1. This is an HTMX issue? 2. This is intentional in-spec behavior for HTML? 3. Something else?
  • m

    mysterious-toddler-20573

    01/05/2023, 4:42 PM
    That’s a bug and there is a pull request open for it
  • m

    magnificent-boots-1658

    01/05/2023, 4:42 PM
    Oh hell yeah!
  • m

    mysterious-toddler-20573

    01/05/2023, 4:42 PM
    Still thinking
1...969970971...1146Latest