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

    mysterious-toddler-20573

    10/02/2020, 3:34 PM
    seems like these techniques should all work w/ htmx:
  • m

    mysterious-toddler-20573

    10/02/2020, 3:34 PM
    https://css-tricks.com/prefetching-preloading-prebrowsing/
  • l

    lively-beach-14291

    10/02/2020, 3:36 PM
    This thread resonated with me... https://github.com/bigskysoftware/htmx/issues/130
  • m

    mysterious-toddler-20573

    10/02/2020, 3:37 PM
    Right, the ability to limit elements
  • m

    mysterious-toddler-20573

    10/02/2020, 3:37 PM
    yeah, I need to think more about that
  • m

    most-jelly-15242

    10/02/2020, 3:42 PM
    btw, i put the examples i am building for Yoyo live here http://yoyo-app.beyondcritical.com/ Most of them are reproductions of what @User has done for Sprig, but implementations may vary.
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:22 PM
    Hey all.. I'm jumping in late -- that's what I get for sleeping in 🙂 Two issues that are important to me have come back to the top Improving Trigger Syntax and Limiting / Autoloading Pages. Yay!
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:25 PM
    If you're looking in to additions to the Trigger Syntax, I'd like to ask that we try to incorporate https://github.com/bigskysoftware/htmx/issues/183 -- by being able to limit events by Mouse Button. It looks like your last suggestion would do the trick:
    hx-trigger="keydown(key:'enter') condition:value!=''"
  • m

    mysterious-toddler-20573

    10/02/2020, 6:29 PM
    yeah, for that issue the trigger would look like this:
    Copy code
    html
      <div hx-trigger="mousedown(button!=1)" ...>...</div>
  • m

    mysterious-toddler-20573

    10/02/2020, 6:29 PM
    I'll support arbitrary expressions there
  • m

    mysterious-toddler-20573

    10/02/2020, 6:29 PM
    based on the event as the root
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:30 PM
    That would be amaze-balls.
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:30 PM
    Can I have it right now? 😉
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:30 PM
    On #130 -- I put forward some hacky, preliminary code that got halfway there, but stopped short on including pagination. One of the (many) issues was how to identify page URLs to HTMX. I suggested new attributes
    hx-prev
    and
    hx-next
    -- or possibly piggybacking on the standard HTTP Header
    Link:
    which is a little harder to use on some servers, but is intended for this purpose. I'd be happy to take another shot at this, or rewrite it from scratch once we have a clear direction on where to go.
  • m

    mysterious-toddler-20573

    10/02/2020, 6:31 PM
    similarly the condition option will look like this:
    Copy code
    html
      <div hx-trigger="mousedown condition:(value!='') " ...>...</div>
  • m

    mysterious-toddler-20573

    10/02/2020, 6:31 PM
    where the conditions apply to the element
  • m

    mysterious-toddler-20573

    10/02/2020, 6:32 PM
    I'll look at 130 once I have the trigger filtering working
  • m

    mysterious-toddler-20573

    10/02/2020, 6:32 PM
    I'd like to have you implement it
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:32 PM
    On these contitions, will this be simple enough to parse? Hopefully, we're not adding too much complexity (download size) to the library. You mentioned Hyperscript, as well. Perhaps this, more sophisticated syntax might work well as an integration in there.
  • m

    mysterious-toddler-20573

    10/02/2020, 6:32 PM
    this isn't too much parsing
  • m

    mysterious-toddler-20573

    10/02/2020, 6:33 PM
    a bit of tokenization and then some paren matching. No worries.
  • m

    mysterious-toddler-20573

    10/02/2020, 6:33 PM
    Guessing about 30-40 new lines of code
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:33 PM
    For instance
    Copy code
    <div hx-trigger="hyperscript" _="on mousedown(button!=1) send htmx:trigger"
    Or something like that.
  • m

    mysterious-toddler-20573

    10/02/2020, 6:34 PM
    yeah, I'm definitely going to include it in hyperscript too
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:34 PM
    I'm just putting that forward, because I believe Hyperscript already has a lot of that parsing code, and that might save on duplication.
  • m

    mysterious-toddler-20573

    10/02/2020, 6:34 PM
    Copy code
    html
    <div hx-trigger="doIt" _="on mousedown(button!=1) send doIt" ..>...</div>
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:35 PM
    It would also help position HTMX as the simple, declarative version, and leave Hyperscript as the (slightly) more advanced event-based/programmatic version.
  • m

    mysterious-toddler-20573

    10/02/2020, 6:35 PM
    Yeah, if it were any more complex than the simple expression stuff, I'd say move it to hyperscript, but this is really just glorified tokenization so I'm OK with it
  • m

    mysterious-toddler-20573

    10/02/2020, 6:35 PM
    we'll see
  • g

    gorgeous-ghost-95789

    10/02/2020, 6:35 PM
    Yes. On the last code you posted . Yes Yes Yes.
1...474849...1146Latest