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

    polite-oil-80202

    10/12/2022, 3:37 PM
    thanks a lot for all this informations. I understand a bit more the behaviour of
    hx-boost
    . 2 more questions : If I have a
    <script src=""></script>
    that loads a file at the end of a
    <body>
    will it be executed each time like embedded
    <script></script>
    ? From the screenshots we can see that we have
    click
    ,
    keydown
    &
    keyup
    registered 3 times instead of one, could this lead to potential issue or this is something know with boosting and it's ok to have a lot of duplicated events ?
  • l

    late-king-98305

    10/12/2022, 3:44 PM
    Inside the closing tag, it would; outside - I'm not sure. Maybe some of the other folks here could answer that. 🙂 The events may not be duplicates; there could be separate handlers registered that will only take actions based on the event target, or some other criteria. If they are true dupes, though, that could start slowing things down - and depending on what those events do, there could be issues with them happening 3 times. (Transferring $1,000? Oof!) If your stakes are low (or you're learning other things and want to come back to this), you'd probably be OK with a few duplicates. I wouldn't go live with it before resolving that problem, though.
  • p

    powerful-army-90860

    10/13/2022, 1:04 AM
    I'm not sure if this has already been reported in Discord but infinite scroll is not working in 1.8.1. The
    data-hx-revealed
    attribute is added to the element but the get request is not triggered.
  • p

    powerful-army-90860

    10/13/2022, 1:05 AM
    It's also been reported in Github by someone else. I added a comment indicating I'm having the same issue: https://github.com/bigskysoftware/htmx/issues/1075
  • m

    mysterious-toddler-20573

    10/13/2022, 1:36 AM
    Dammit I’ll look tonight
  • m

    mysterious-toddler-20573

    10/13/2022, 4:52 AM
    fixed w/ v1.8.2
  • a

    ancient-shoe-86801

    10/13/2022, 5:36 AM
    ugh
  • a

    ancient-shoe-86801

    10/13/2022, 5:37 AM
    I was ready to release an flask extension for htmx
  • a

    ancient-shoe-86801

    10/13/2022, 5:37 AM
    and just found out at the very last moment somebody already took the name flask-htmx on PyPI
  • a

    ancient-shoe-86801

    10/13/2022, 5:38 AM
    had no idea that that existed... and didn't think to search for it on pypi
  • a

    ancient-shoe-86801

    10/13/2022, 5:38 AM
    now I need to think a different package name...
  • a

    ancient-shoe-86801

    10/13/2022, 5:41 AM
    I guess htmx-flask will be :\
  • a

    ancient-shoe-86801

    10/13/2022, 5:57 AM
    well, here is is! https://pypi.org/project/htmx-flask/
  • h

    hundreds-cartoon-20446

    10/13/2022, 10:02 AM
    In case anyone comes across this issue, after many hours of head scratching I think I figured out how to make back/forward buttons work sensibly in the latest Safari iOS: https://github.com/bigskysoftware/htmx/issues/1076#issuecomment-1277353203
  • m

    mysterious-toddler-20573

    10/13/2022, 1:13 PM
    holy smokes, what a deep dive
  • m

    mysterious-toddler-20573

    10/13/2022, 1:13 PM
    sorry about that!
  • h

    hundreds-cartoon-20446

    10/13/2022, 1:16 PM
    No worries. I thought I was going mad because nothing I tried worked (because I was testing with a self-signed SSL cert). Btw, I think it would be really helpful if there was some documentation around these kind of gotchas when trying to use htmx as for full-page transitions and the like.
  • h

    hundreds-cartoon-20446

    10/13/2022, 1:18 PM
    Essentially, using
    hx-boost
    opens a huge can o' worms. It's wonderful though and I thank you for making it.
  • m

    mysterious-toddler-20573

    10/13/2022, 1:18 PM
    facts
  • m

    mysterious-toddler-20573

    10/13/2022, 1:28 PM
    In 2.0 I want to step back and think hard about boost, which needs to get much better. Head merging is coming as an extension for the 1.9 release, and will likely be baked in in 2.0. History in the presence of partial updates is hard, and needs another big think.
  • t

    tall-dinner-62086

    10/13/2022, 1:36 PM
    I like boost, but I don't do much with the history api at the moment. It's great for easily upgrading boring old forms. Just my 2 eurocents.
  • h

    hundreds-cartoon-20446

    10/13/2022, 1:38 PM
    I have built a sort of component framework which attempts to solve the problem of scripts needing a lifecycle (mount / unmount / update) so that memory is used efficiently, when using htmx as a SPA. I'm not sure how generalisable it is but I'll probably make it a repo. Maybe you can take some ideas from it.
  • h

    hundreds-cartoon-20446

    10/13/2022, 1:41 PM
    It incorporates loading strategies like lazyload (triggered when components enter the viewport) and idle loading of scripts. Handling of scripts is the trickiest issue I think that
    hx-boost
    exposes.
  • h

    hundreds-cartoon-20446

    10/13/2022, 1:50 PM
    Regarding
    <head>
    merging - beyond
    <title>
    I found that the most common requirement is to swap metadata. That actually includes JSON-LD structured data which tend to sit in the
    <body>
    . This was my brute force approach: https://gist.github.com/croxton/8a12a19e10f3b8a395d5546ff070aa93
  • h

    hundreds-cartoon-20446

    10/13/2022, 1:51 PM
    I've used this on a few sites now with good SEO outcomes (all pages indexed properly).
  • h

    hundreds-camera-24900

    10/13/2022, 1:56 PM
    I have been thinking that boost might deserve a custom swap method
  • h

    hundreds-camera-24900

    10/13/2022, 1:57 PM
    some place to do all the boost wierdniss that doesn't mess with vanilla swaps
  • m

    mysterious-toddler-20573

    10/13/2022, 2:02 PM
    Interesting
  • h

    hundreds-camera-24900

    10/13/2022, 2:16 PM
    you've talked about moving it to an extension anyway - it feels like a lot of boost work is "normal swap AND"
  • h

    hundreds-camera-24900

    10/13/2022, 2:16 PM
    and it might surface places that are missing a hook
1...852853854...1146Latest