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

    refined-waiter-90422

    01/16/2023, 7:08 PM
    https://discord.com/channels/725789699527933952/1046573806547910677/1050283677810167818
  • r

    refined-waiter-90422

    01/16/2023, 7:11 PM
    tl;dr:
    hx-boost
    and
    hx-disable
    don't work intuitively with "zero inheritance"
  • s

    some-airline-73512

    01/16/2023, 7:18 PM
    I was trying to reduce the fix to a smallest code change possible. Turned out removing
    hx-target
    fixed as well. No need to use hx-swap-oob then. It seems that when we have situation with
    hx-select-oob
    +
    hx-target
    +
    morph
    then the oob element gets removed entirely.
  • r

    ripe-action-67367

    01/16/2023, 7:19 PM
    curious
  • s

    some-airline-73512

    01/16/2023, 7:19 PM
    I will try and make a small reproducting example when I ship the first version of the product. Right now my ass is burning to deliver.
  • r

    refined-waiter-90422

    01/16/2023, 7:28 PM
    I see htmx as a flexible set of foundational building blocks. there's usually more than one way.. which can be amazing because htmx can work for situations nobody has considered yet... But it can take a little patience to properly combine the atomic building blocks htmx has to find the patterns.
  • s

    some-airline-73512

    01/16/2023, 7:30 PM
    Yep, I would prefer a hardcore version of htmx. Zero implicitness, zero defaults, fail if some attribute is not specified, etc.
  • s

    some-airline-73512

    01/16/2023, 7:31 PM
    All these defaults and stuff are nice for beginners to pick up the library. But once you've written production application with it, you know what you want, you need this explicitness to get robustness.
  • s

    some-airline-73512

    01/16/2023, 7:33 PM
    Also, heavy debug mode in which it would visualize its behaviour. Like what settings are specified, what came from the server, how it got swapped. What was missing, etc.
  • s

    some-airline-73512

    01/16/2023, 7:33 PM
    Imagine you would have to debug html with logs. That's what we do now with htmx.logAll()
  • b

    boundless-vase-80440

    01/16/2023, 7:33 PM
    nightmare mode πŸ™‚
  • s

    some-airline-73512

    01/16/2023, 7:35 PM
    Dependency between nodes creates complexity. Usually it's not a problem to call a function. The problem is when this function assumes it has to be called only in certain context. That's what attribute inheritance does.
  • r

    refined-waiter-90422

    01/16/2023, 7:39 PM
    I could see htmx 2 getting an inheritance whitelist or blacklist- with a default list. A hard "no inheritance" just makes some attributes too unintuitive to use.
  • s

    some-airline-73512

    01/16/2023, 7:40 PM
    Yeah sure. That's why I say it's a "hardcore" mode. Not for everyone
  • s

    some-airline-73512

    01/16/2023, 7:41 PM
    Depends what you care about. If a person wants intuitiveness and less code - go on, enable "light" mode and get all the defaults, inheritance and stuff. If a person cares about robustness when refactoring, production stability - enable hardcore mode.
  • b

    boundless-vase-80440

    01/16/2023, 7:59 PM
    if you care about your job, enable hardcore mode. πŸ˜„
  • b

    boundless-vase-80440

    01/16/2023, 8:01 PM
    and thats a joke. I love htmx just the way it is and I welcome more options regarding strictness.
  • s

    some-airline-73512

    01/16/2023, 8:02 PM
    Well, I don't have a job, so I care even more, because if it fails, I'm out of business) kidding, maybe not that critical, but anyway. I want to create great products.
  • s

    some-airline-73512

    01/16/2023, 8:03 PM
    I'm very grateful to htmx as well. Internet is still amazing with great people and great ideas
  • q

    quaint-hair-61231

    01/17/2023, 12:59 AM
    Hey ya'll - have any of you tried to use the scrolling behavior with the SSE plugin? I'm not able to get it to work right now. I can get it to work fine with request/response but am not able to get it to work at all with SSE. Below is both a regular hx-post example that works and an SSE example that doesn't work. Any help/insights would be greatly appreciated!
    Copy code
    html
    <div>
      {{!-- This works --}}
      <button type="button" hx-post="/admin/content" hx-target="#content" hx-swap="beforeend show:window:bottom"
        class="inline-flex items-center rounded border border-transparent bg-indigo-600 px-2.5 py-1.5 text-xs font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
        Click to add
      </button>
    
    </div>
    
    {{!-- This doesnt work --}}
    <div hx-ext="sse" sse-connect="/sse/events?stream=123">
      <ul id="content" role="list" class="divide-y divide-gray-200" sse-swap="demo" hx-swap="beforeend show:window:bottom">
      </ul>
    </div>
  • s

    some-airline-73512

    01/17/2023, 8:28 AM
    How are you guys deploying production? I don't wanna go with Docker. I'm thinking using just plain Linux with pm2 (Node).
  • t

    tall-dinner-62086

    01/17/2023, 9:45 AM
    I just
    git pull
    on production but that's because I'm too lazy to set up a proper deploy script
  • b

    bulky-kilobyte-96254

    01/17/2023, 9:47 AM
    I use Ploi with its ci/cd features. Push to repo auto deploys on staging, and then deploy to production with a click on a button.
  • s

    sparse-traffic-23652

    01/17/2023, 9:50 AM
    I've run into a slight pickle with HTMX. I have a slider which I want send live updates to the server. By using hx-trigger="input throttle:1s" this works great. However I want to use the information in the reply to update the text field next to the slider, so I added a hx-target to put the reply text in the correct spot. Still everything works fine. However for server API/code structure reasons it would be much prettier if I could replace the entire "section" with the slider and the text in one. But this means the slider loses focus and I can no longer drag it. Is there a way to replace a tree of nodes but omit a certain ID (that of the slider)? Or some other solution?
  • s

    sparse-traffic-23652

    01/17/2023, 9:51 AM
    I could of course use out-of-band swapping for this, but I would really like to have the response for getting and setting values the same for API reasons.
  • t

    tall-dinner-62086

    01/17/2023, 9:52 AM
    I think you're looking for
    hx-preserve
  • t

    tall-dinner-62086

    01/17/2023, 9:52 AM
  • s

    sparse-traffic-23652

    01/17/2023, 9:59 AM
    Ooh, thank you! That works perfectly
  • h

    happy-knife-63802

    01/17/2023, 10:29 AM
    If I have an element which is triggered with a delay:500ms is there any event that fires when the trigger is initiated at the start of the 500ms? I checked the logs and configrequest is the first one that appears and that isn’t until the 500ms has expired
  • h

    happy-knife-63802

    01/17/2023, 10:30 AM
    I want to flash the div background while the delay is in effect
1...988989990...1146Latest