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

    echoing-dress-67727

    02/22/2023, 6:53 PM
    Yeah, at the request of this community. IMO, the new one is not better than the old. But I'll take it, if that's what's required to get ESM support
  • r

    refined-waiter-90422

    02/22/2023, 7:32 PM
    Yeah honestly Derek did good on that one. Solid PR.
  • e

    enough-petabyte-50314

    02/22/2023, 7:58 PM
    SolidPR? is that that new JS framework? 🧌
  • e

    enough-petabyte-50314

    02/22/2023, 8:45 PM
    BTW - what would be helpful for this "revealed with delay" functionality? Should I create a Github Issues or anything?
  • m

    mysterious-toddler-20573

    02/22/2023, 9:09 PM
    a github issue would be good
  • m

    mysterious-toddler-20573

    02/22/2023, 9:09 PM
    how urgent?
  • e

    enough-petabyte-50314

    02/22/2023, 9:55 PM
    Not
  • m

    mysterious-toddler-20573

    02/22/2023, 9:57 PM
    are you interested in doing some work on it?
    e
    • 2
    • 8
  • p

    powerful-football-56791

    02/22/2023, 11:19 PM
    I feel like htmx has more mechanical sympathy than the mess we've made in the past 10 years. just putting that out there.
  • l

    limited-potato-46306

    02/23/2023, 2:14 AM
    With the Hx-Trigger response header, is it possible to specify the target element? This pattern could be quite nice when paired with alpine. For instance if there is an element that is listening to an event like:
    Copy code
    <div id="targetElement" x-on:myevent="performSomeJS()"></div>
    Could the Hx-Trigger response header cause it to fire, rather than targeting the element that caused the request and bubbling up to the body? Currently, as a workaround, I have an event listener on the element that caused the request and another event listener on the element that I would like to actually receive the event, and I use htmx.trigger("#targetElement", ...) to target the element that I would actually like to receive the event.
  • l

    limited-teacher-83117

    02/23/2023, 2:47 AM
    Semantically, basically an
    HX-Trigger-OOB
  • l

    limited-potato-46306

    02/23/2023, 2:48 AM
    yes, that is an awesome way of putting it
  • e

    enough-petabyte-50314

    02/23/2023, 3:39 PM
    what's this communities opinion on a good IDE for plain-js development?
  • m

    mysterious-toddler-20573

    02/23/2023, 4:10 PM
    WebStorm
  • m

    mysterious-toddler-20573

    02/23/2023, 4:10 PM
    this discord brought to you by JetBrains ™️
  • s

    some-airline-73512

    02/23/2023, 4:53 PM
    I was 2 years on Eclipse - then 9 years on JetBrains - and now 1 year of VSCode. To me VSCode is the best for js. What I mean by the best: 1. More lightweight than JetBrains 2. Easier to customize. For example I want
    await
    to be highlighted, so I see immediately where async points are in the function. Another example I want to dimm asserts and logs, I don't care about those most of the time when reading code. I'm pretty sure in JB it would be possible, but in VSCode it was just super simple to do, and because of this simplicity - I actually did it, whereas in JB I never did because I didn't knew it was possible.
  • s

    some-airline-73512

    02/23/2023, 4:54 PM
    Example await highlight:
  • s

    some-airline-73512

    02/23/2023, 4:55 PM
    example assert dimm:
  • s

    some-airline-73512

    02/23/2023, 4:58 PM
    I also tend to use themes with zero syntax highlighting. I don't know, it's just simpler to me, less distractions from the actual logic.
  • s

    some-airline-73512

    02/23/2023, 4:59 PM
    The stuff that I want to highlight - I want to pick it by myself (awaits as an example here). Syntax is just a noise.
  • e

    enough-petabyte-50314

    02/23/2023, 6:02 PM
    ya I'm using IntelliJ. I have tried VSCode multiple times but something about the hotkeys and controls doesn't click with me. A lot of JS focused devs like it though
  • r

    refined-manchester-67193

    02/23/2023, 6:06 PM
    Is it normal for
    htmx-indicator
    to appear on initial page load and subsequently get hidden? isn't supposed to be hidden on first page load?
  • r

    refined-manchester-67193

    02/23/2023, 6:16 PM
    Had to add the CSS specified here (https://htmx.org/attributes/hx-indicator/) #readthedocs
  • m

    mysterious-car-3675

    02/23/2023, 7:00 PM
    @mysterious-toddler-20573 doesn't like vscode cause it is a successful project that's fast and stable written in typescript 😛
  • m

    mysterious-toddler-20573

    02/23/2023, 7:05 PM
    nah, I just don't like its name
  • m

    mysterious-toddler-20573

    02/23/2023, 7:05 PM
    vscode? c'mon
  • m

    mysterious-toddler-20573

    02/23/2023, 7:05 PM
    more like vsdumb
  • r

    refined-manchester-67193

    02/23/2023, 7:22 PM
    Question re: replacing my websockets implementation with HTMX's. This is the current JS code I have:
    Copy code
    js
    var ws_scheme = window.location.protocol == "http:" ? "ws" : "wss";
    var ws_path = ws_scheme + '://' + window.location.host + "/";
    var mysocket = new ReconnectingWebSocket(ws_path);
    mysocket.maxReconnectAttempts = 3;
    mysocket.timeoutInterval = 8000;
    I'm almost 100% certain the mechanism described under "Automatic Reconnection" in the docs (https://htmx.org/extensions/web-sockets/) is better than my implementation, but just wanna be sure I'm not missing anything here? 1. Does HTMX automatically choose between
    ws
    and
    wss
    based on the HTTP(S) protocol?
    2. What are the default max **re**connection attempts?
  • o

    orange-umbrella-16693

    02/23/2023, 8:42 PM
    2. To my knowledge, infinite, it just uses exponential backoff to increase the retry delay with every try, up until a limit [citation needed]
  • o

    orange-umbrella-16693

    02/23/2023, 8:44 PM
    https://github.com/bigskysoftware/htmx/blob/160e2a4fc2f8d9fc26c9b117ced7ca04de9f6039/src/ext/ws.js#L400
1...104110421043...1146Latest