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

    ripe-action-67367

    02/05/2023, 7:30 PM
    Just remove the element from the dom and WS connection will be closed automatically
  • r

    refined-manchester-67193

    02/05/2023, 7:30 PM
    Hmmm
  • r

    ripe-action-67367

    02/05/2023, 7:31 PM
    , if you are fellow hyperscript connoisseur
  • r

    refined-manchester-67193

    02/05/2023, 7:31 PM
    The ws-connect is on a generic “notifications-area” div which can render multiple wrappers.
  • r

    ripe-action-67367

    02/05/2023, 7:31 PM
    oh
  • r

    refined-manchester-67193

    02/05/2023, 7:32 PM
    I’m flexible though
  • r

    refined-manchester-67193

    02/05/2023, 7:32 PM
    I’m probably over complicating things.
  • r

    refined-manchester-67193

    02/05/2023, 7:33 PM
    I also want the wrapper to be animatable while visible. Will get on my computer as I already have a basic non complete POC.
  • r

    ripe-action-67367

    02/05/2023, 7:34 PM
    I mean, having a common shared webosocket element on the page is fine, I did something like this myself. But yea, making it not sending updates, but only on certain conditions, will be veeeery tricky
  • r

    ripe-action-67367

    02/05/2023, 7:34 PM
    You might set up an event listener and filter messages client side by cancelling events, but they still will be sent and received, just not rendered, so it's a waste of bandwidth
  • r

    refined-manchester-67193

    02/05/2023, 7:35 PM
    I already have something like this with my current (soon to be ex) JS stack, but as you said, it requires quite the roundabout.
  • r

    refined-manchester-67193

    02/05/2023, 7:36 PM
    That is not a huge concern ATM.
  • r

    ripe-action-67367

    02/05/2023, 7:37 PM
    Then it should be a feasible option
  • r

    refined-manchester-67193

    02/05/2023, 7:38 PM
    I’m trying to kill all 8-10 JS deps with HTMX. It has been coming along until now.
  • r

    ripe-action-67367

    02/05/2023, 7:38 PM
    Also, I can never remember, what htmx does when oob element target is not present on the page. Cause if it does not error, you won't even need an event listener. Just remove the target element and nothing will happen (except wasted bandwidth, of course 😅 )
  • r

    refined-manchester-67193

    02/05/2023, 7:39 PM
    I can intercept the message with wsReceive..
  • r

    refined-manchester-67193

    02/05/2023, 7:40 PM
    Hmm, let’s see if I can up with something without too much JS involved. I’ll keep you posted!
  • r

    refined-manchester-67193

    02/05/2023, 7:40 PM
    Thanks @ripe-action-67367!
  • s

    some-airline-73512

    02/05/2023, 9:18 PM
    I'm getting these logs:
    Copy code
    [Violation] 'click' handler took 672ms htmx.js:1318
    Why is it so slow? The code is simple hx-post on table row. There are a lot of rows, though.
  • s

    some-airline-73512

    02/05/2023, 9:23 PM
    In logs I see that
    htmx:confirm
    works immediately, but then
    htmx:configRequest
    is called with delay ~700ms
  • r

    refined-manchester-67193

    02/05/2023, 9:49 PM
    Anyone care to help debug this code?
    Copy code
    on load
    add .opacity-0 to #start-719dc01d-f71a-430c-95d0-0e06ec520 wait for 2200ms then
    remove #start-719c01d-f71a-430c-9590-0e06es520432 then add opacity-100 to me then remove .opacity-0 from me end
    I’m 100% sure the start div with identifier is there. If I remove the
    remove
    part it all works. But the element isn’t removed of course.
  • m

    mysterious-toddler-20573

    02/05/2023, 10:06 PM
    can you run a profiler?
  • r

    refined-manchester-67193

    02/05/2023, 10:07 PM
    Both the replaced and the replacing items are hx-swap-oob=“after-begin”
  • m

    mysterious-toddler-20573

    02/05/2023, 10:07 PM
    https://developer.chrome.com/docs/devtools/performance/
  • m

    mysterious-toddler-20573

    02/05/2023, 10:07 PM
    I would start logging, I'll answer over in the hyperscript channel
  • r

    refined-manchester-67193

    02/05/2023, 10:09 PM
    Not the same dude/tte, but thanks @mysterious-toddler-20573
  • p

    prehistoric-garden-45720

    02/06/2023, 2:03 AM
    I tried both:
    Copy code
    html
    <template>
      <tr hx-swap-oob="afterbegin:#contacts-table">
        <td>Joe Smith</td>
        <td>joe@smith.com</td>
      </tr>
    </template>
    
    <div id="test">
      <p>Test AFTER swap</p>
    </div>
    and:
    Copy code
    html
    <template hx-swap-oob="afterbegin:#contacts-table">
      <tr>
        <td>Joe Smith</td>
        <td>joe@smith.com</td>
      </tr>
    </template>
    
    <div id="test">
      <p>Test AFTER swap</p>
    </div>
    and neither give the expected result (they both differ from each other, and the result without the
    <template>
    tag. Did I misunderstand your suggestion?
  • m

    mysterious-toddler-20573

    02/06/2023, 2:06 AM
    hmm, the later should work
  • m

    mysterious-toddler-20573

    02/06/2023, 2:06 AM
    Let me test
  • l

    little-kilobyte-16316

    02/06/2023, 2:06 AM
    Has anyone here worked with FilePond? And were able to make it work with HTMX?
1...101110121013...1146Latest