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

    helpful-nail-91069

    09/13/2020, 6:21 PM
    @User and @User thanks for your replies, makes sense. For now I will use htmx and Stimulus together - the first for requests, the second for other behaviour on the content. That way it may not be a "downside" at all that htmx doesn't process all nodes. I will try OOB swaps for now, if that works fine, adding an extra header may be overkill(?).
  • w

    wooden-wall-85896

    09/14/2020, 8:56 PM
    @User curious why HyperScript (HyperTalk?) instead of JavaScript?
  • m

    mysterious-toddler-20573

    09/14/2020, 8:56 PM
    tell me more
  • m

    mysterious-toddler-20573

    09/14/2020, 8:56 PM
    like, why would you use hyperscript instead of javascript?
  • w

    wooden-wall-85896

    09/14/2020, 8:57 PM
    So I may have misunderstood, but I think you're implementing HyperScript as a way to add scripting to htmx?
  • m

    mysterious-toddler-20573

    09/14/2020, 8:58 PM
    Hyperscript is a complementary technology, but you can use javascript for sure to hook into all the events that htmx emits
  • m

    mysterious-toddler-20573

    09/14/2020, 8:58 PM
    or alpine, or whatever
  • m

    mysterious-toddler-20573

    09/14/2020, 8:59 PM
    but hyperscript is tuned for handling events and doing basic DOM manipulation
  • m

    mysterious-toddler-20573

    09/14/2020, 8:59 PM
    with less noise than javascript
  • w

    wooden-wall-85896

    09/14/2020, 8:59 PM
    Ah phew. As long as it's optional 🙂
  • m

    mysterious-toddler-20573

    09/14/2020, 8:59 PM
    it's also going to be async-transparent
  • m

    mysterious-toddler-20573

    09/14/2020, 8:59 PM
    yes
  • b

    big-airline-13935

    09/14/2020, 8:59 PM
    Didn't you say that it adds some of the functionality that Intercooler provided out of the box?
  • w

    wooden-wall-85896

    09/14/2020, 9:00 PM
    Getting flashbacks from HyperCard
  • w

    wooden-wall-85896

    09/14/2020, 9:00 PM
    Bill Atkinson's baby
  • m

    mysterious-toddler-20573

    09/14/2020, 9:00 PM
    in the next release, htmx will not have any references to hyperscript
  • m

    mysterious-toddler-20573

    09/14/2020, 9:00 PM
    @User yeah, there was some stuff in ic-action that hyperscript provides
  • b

    big-airline-13935

    09/14/2020, 9:00 PM
    So will hyperscript then reference htmx?
  • m

    mysterious-toddler-20573

    09/14/2020, 9:01 PM
    Copy code
    html
      <button _="on click add .foo to me then wait 3s then remove .foo from me">Click Me</button>
  • m

    mysterious-toddler-20573

    09/14/2020, 9:01 PM
    Yes, but it's only as an event listener, one sec
  • m

    mysterious-toddler-20573

    09/14/2020, 9:02 PM
    https://github.com/bigskysoftware/_hyperscript/blob/04f8fd2d6161f7269ca7f1ca4217beadac64df1f/src/_hyperscript.js#L1771
  • m

    mysterious-toddler-20573

    09/14/2020, 9:02 PM
    that's the only connection between the two after the next release
  • m

    mysterious-toddler-20573

    09/14/2020, 9:02 PM
    hyperscript listening for the htmx event and processing new nodes
  • b

    big-airline-13935

    09/14/2020, 9:02 PM
    Nice!
  • m

    mysterious-toddler-20573

    09/14/2020, 9:02 PM
    yeah, it's the right thing
  • m

    mysterious-toddler-20573

    09/14/2020, 9:02 PM
    should have been that way from the start :/
  • m

    mysterious-toddler-20573

    09/14/2020, 9:03 PM
    but, to show you why hyperscript is different, look at that code above, and note that there is a
    wait 3s
    in it
  • m

    mysterious-toddler-20573

    09/14/2020, 9:03 PM
    hyperscript linearizes the code, even though that causes a
    setTimeout()
    and the equivalent javascript would be a lot more verbose
  • m

    mysterious-toddler-20573

    09/14/2020, 9:04 PM
    so w/ hyperscript you can write stuff like that inline and have it be readable without a ton of callbacks or awaits or whatever
  • m

    mysterious-toddler-20573

    09/14/2020, 9:05 PM
    so @User that's the idea w/ hyperscript (when it's further along) to provide the ability to express things that are complex in javascript in a simple and embed-friendly manner. And, sorry, I did take the syntax from HyperTalk. 🙂
1...282930...1146Latest