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

    mysterious-toddler-20573

    12/23/2020, 1:13 AM
    I am worried about feature creep though
  • m

    mysterious-toddler-20573

    12/23/2020, 1:13 AM
    like, should this be done via
    <link>
    tags or something...
  • l

    lively-beach-14291

    12/23/2020, 1:17 AM
    I think for a public-facing website where lots of your resources are cached, it's a great idea. Like, if one were replacing https://teacherspayteachers.com or something; ie, as user moves about the page you could pre-load thingies.
  • m

    mysterious-toddler-20573

    12/23/2020, 1:21 AM
    looking at the code base, this might be a bit violent
  • l

    lively-beach-14291

    12/23/2020, 1:38 AM
    perhaps it's an htmx plugin opportunity
  • b

    big-airline-13935

    12/23/2020, 9:06 AM
    I'm for
    hx-preload
    , provided it doesn't add too much complexity to the code. I think it does fit in the scope of what htmx does and would be a useful feature. Github itself preloads requests when interactive elements are hovered over (using Pjax), which makes it feel snappy.
  • s

    salmon-xylophone-28580

    12/23/2020, 9:13 AM
    I had a look at several html-over-the-wire frameworks during the last weeks and wrote down my findings. Feedback is welcome: https://github.com/guettli/html-over-the-wire
  • c

    colossal-glass-79762

    12/23/2020, 9:55 AM
    Im having a hard time choosing between AlpineJS and Stimulus , do you guys have any suggestions/feedback based on experience working with htmx and alpine/stimulus ?
  • a

    adamant-exabyte-92636

    12/23/2020, 9:57 AM
    Hi! I'm the idiot who posted the preload question in Twitter πŸ€“ I'm a long-time fan and user of Intercooler, but like a lot of folks would like to wean off JQuery over time, hence htmx (plus I feel Carson is my brother-from-another-mother, or at least as far as our philosophy over web development goes 😁 ). Looking around at what Hotwire and unpoly is doing (and trying out hey.com), I can't help but notice that apps built with those do feel a little snappier, due in large part to the preloading stuff I think. Hence my question about preloading for htmx. Whether it should be part of the core or an extension, I will leave up to the big brains here to decide.. but I do feel that it's a very natural fit for the "htmx way". Thoughts?
  • a

    adamant-exabyte-92636

    12/23/2020, 9:57 AM
    Great write-up, thanks!
  • s

    straight-alligator-25627

    12/23/2020, 11:11 AM
    I think over HTTP or WebSocks is just a lower level choice; I don't think it fundamentally changes the mechanism. HTTP has lots of advantages with well built proxy ecosystem, load balancing, etc. While websocks can be more parsimonious, but it's really going to tie your client to a particular backend server.
  • s

    straight-alligator-25627

    12/23/2020, 11:18 AM
    What's new about Tturbo, I think is the features that in HTMX's space... Turbo Frames & Turbo Streams -- however, they seem less developed than HTMX.
  • a

    adamant-exabyte-92636

    12/23/2020, 11:40 AM
    Berlin, baby 😎 Hamburg is pretty dope thoughπŸ‘Œ
  • h

    helpful-secretary-3515

    12/23/2020, 2:46 PM
    yeah! πŸ˜ƒ nice to hear
  • l

    lively-beach-14291

    12/23/2020, 3:37 PM
    There was a TodoMVC implementation using HTMX, anyone remember the link?
  • a

    adamant-exabyte-92636

    12/23/2020, 3:49 PM
    Oh! I just stumbled upon this: https://instant.page. 200 lines of code. I dropped the script into one of our apps that heavily uses Intercooler and it seems to work just fine. It uses url prefetching, is supported by default by all major browsers (although notably not enabled in Safari by default. See https://caniuse.com/link-rel-prefetch). Thoughts on this approach?
  • l

    lively-beach-14291

    12/23/2020, 3:55 PM
    @User much less complex than https://caniuse.com/?search=pushState ?
  • a

    adamant-exabyte-92636

    12/23/2020, 3:55 PM
    https://instant.page/ seems to be done by the same guy who did https://instantclick.io , "which uses Ajax and history.pushState instead of " (see https://instant.page/tech, the "History" section). I'm thinking url prefetching is cheap but cheerful enough, as opposed to explicitly ajax loading + history.pushState? But I'm keen to hear opinions πŸ™‚
  • a

    adamant-exabyte-92636

    12/23/2020, 3:56 PM
    That's what I'm thinking
  • a

    adamant-exabyte-92636

    12/23/2020, 4:23 PM
    Ugh, I take it back. I only thought it was working well with Intercooler as-is ... what in fact happens is that yes, it prefetches the url on link hover... and then when you actually click the link, the intercooler "get" fires and fetches it again πŸ€¦β€β™‚οΈ
  • a

    adamant-exabyte-92636

    12/23/2020, 4:25 PM
    So I think you'll definitely have to roll it into htmx (core or extension) if this is too work. No idea if you could even hook into the url prefetch option.. as it is something that the browser does natively? Grrr... back to the drawing board I guess
  • l

    lively-beach-14291

    12/23/2020, 4:26 PM
    nods.
  • a

    adamant-exabyte-92636

    12/23/2020, 5:08 PM
    Ok, I feel like I'm spamming this channel now on this topic, so I'll leave it with one more thought. According to this: https://stackoverflow.com/questions/30088731/can-an-ajax-request-utilize-link-prefetching, XHR requests will actually use the prefetched html instead of requesting it again. I've been unable to verify this through quick local testing, but perhaps there is still something there. It is however starting to feel like perhaps this is barking up the wrong tree 😬
  • g

    gorgeous-ghost-95789

    12/23/2020, 5:08 PM
    It's not spam if it's interesting πŸ™‚
  • g

    gorgeous-ghost-95789

    12/23/2020, 5:13 PM
    FWIW, here's a PR that adds preload as an extension: https://github.com/bigskysoftware/htmx/pull/273
  • g

    gorgeous-ghost-95789

    12/23/2020, 5:16 PM
    I'm sure there are things that could be improved (suggestions welcome) but it shows that preloading can work via AJAX
  • a

    adamant-exabyte-92636

    12/23/2020, 5:21 PM
    Ha! This seems like a good approach to me? I see you only implemented mouseover event handling for now. Perhaps one could add touchstart etc later .. but I would love to get feedback from other folks about this direction. I'm going to run out of time today to test it (these crazy Germans for some reason celebrates Christmas on the 24th, so it's technically almost Christmas eve for me 😁 ), but will check back in the next few days. Thanks for the effort @gorgeous-ghost-95789 !!
  • g

    gorgeous-ghost-95789

    12/23/2020, 5:21 PM
    Sure. Those should be easy changes. We might also add an option to preload something when the page first loads.
  • g

    gorgeous-ghost-95789

    12/23/2020, 5:22 PM
    Would you mind adding your thoughts as issues on the PR? I'm happy to make improvements.
  • a

    adamant-exabyte-92636

    12/23/2020, 5:23 PM
    Will do πŸ‘
1...107108109...1146Latest