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

    gorgeous-ghost-95789

    01/02/2021, 2:13 PM
    Yes. You can use ‘preload-on=“load”’ to load content immediately
  • m

    mysterious-toddler-20573

    01/02/2021, 3:48 PM
    @User one observation: might be nice to make preload inherited so it can be placed on a parent element.
  • m

    mysterious-toddler-20573

    01/02/2021, 3:49 PM
    That would probably require this logic to test if the link is local: https://github.com/bigskysoftware/htmx/blob/530bc1ee7ef1abbdbecadbcf9549fff64933b1b6/src/htmx.js#L847
  • m

    mysterious-toddler-20573

    01/02/2021, 3:49 PM
    (for anchors, anyway)
  • g

    gorgeous-ghost-95789

    01/02/2021, 4:04 PM
    The settings are currently inherited, but my original thought was to require (at least) the
    preload
    attribute on each link, so that the developer is explicitly stating a resource should be preloaded.
  • g

    gorgeous-ghost-95789

    01/02/2021, 4:05 PM
    It’s certainly possible to make it inherited. Perhaps this could be an optional setting.
  • g

    gorgeous-ghost-95789

    01/02/2021, 4:07 PM
    With the current, explicit settings, there’s little need to limit preloads to the current domain. But if it becomes inherited, this might be necessary. I’ll play with this a little more to see how it looks. I there’s still time to experiment and fine tune this, right? When are you targeting for the next release?
  • f

    future-boots-43048

    01/02/2021, 6:28 PM
    I managed to find a little time to continue playing with my project.... and I managed to get a nice little vega-lite chart updating in real time with data sent over SSE ... AND also updating when the chart formatting Javascript changes. Here's the htmx extension that glues the chart drawing logic to the SSE event issued by HTMX:-
  • f

    future-boots-43048

    01/02/2021, 6:28 PM
    https://gist.github.com/wtpayne/b904785398b8411f0d582d135d1fecf6
  • f

    future-boots-43048

    01/02/2021, 6:29 PM
    There's probably a lot to criticize in it, but it seems to work ... at least as an initial prototype.
  • m

    mysterious-toddler-20573

    01/02/2021, 11:18 PM
    I'd like to cut a 1.1 (with this as a headline feature) at the end of next week.
  • g

    gorgeous-ghost-95789

    01/02/2021, 11:19 PM
    Yes, Boss. 😬
  • m

    mysterious-toddler-20573

    01/02/2021, 11:28 PM
    my oldest son is starting to understand how the world works and is trying to be excited about stuff I work on: son: So, htmx is working out? me: Yeah, it's going great! Great community, people are using it, I'm pumped. son: That's awesome. How much money do you make from it? me:
  • m

    mysterious-toddler-20573

    01/02/2021, 11:31 PM
    me: Son, sometimes a man hates a programming language...
  • m

    mysterious-toddler-20573

    01/03/2021, 1:02 AM
    open source life forever
  • b

    blue-manchester-57655

    01/03/2021, 2:45 PM
    But seriously, have you considered enabling Github Sponsors on the HTMX project?
  • m

    most-jelly-15242

    01/03/2021, 2:53 PM
    @User It's enabled. Would be amazing to see more people sponsoring the project in 2021 https://github.com/bigskysoftware
  • m

    mysterious-toddler-20573

    01/03/2021, 2:56 PM
    @User I can't see this url: https://preferences-with-swap.omenapps.repl.co/users/htmx_load_test/
  • m

    mysterious-toddler-20573

    01/03/2021, 2:56 PM
    I want to get this answered, this should be working
  • m

    mysterious-toddler-20573

    01/03/2021, 2:57 PM
    I'm adding a regression test now to see what's going on
  • b

    blue-manchester-57655

    01/03/2021, 3:23 PM
    I forgot that rep.it isn't always-on. I did provide the html, though. I got the same results when I threw it into an html file locally and opened with browser. No effect on the three elements that should disappear after 2 seconds.
  • b

    blue-manchester-57655

    01/03/2021, 3:26 PM
    But again, the
    on click
    removal works perfectly, so I know hyperscript is loaded up and working otherwise as expected.
  • m

    mysterious-toddler-20573

    01/03/2021, 3:41 PM
    roger, I will get to the bottom of it
  • m

    mysterious-toddler-20573

    01/03/2021, 4:10 PM
    OK, so, here's whats up: you can use any useful htmx events because the new content doesn't have any htmx stuff in it, so no events are fired (e.g.
    processedNode
    ) That's kind of a bug or feature shortcoming, IMO. However, the initial hyperscript should work, and does with a slight tweak to hyperscript. So, next week when I release htmx 1.1, I'm going to release a 0.0.3 of hyperscript that supports the
    on load
    syntax
  • m

    mysterious-toddler-20573

    01/03/2021, 4:11 PM
    hyperscript is in a delicate spot: I want to rework the implementation to be interpreted, rather than transpiled. I put a lot of effort into transpiling it, and now I think that's the wrong direction, so I don't want to put a ton of work into it until I have time to undo that.
  • m

    mysterious-toddler-20573

    01/03/2021, 4:12 PM
    but this is small and useful enough (and apparently I thought it worked, since I doc'd it :p) that I'm going to include it
  • b

    blue-manchester-57655

    01/03/2021, 4:12 PM
    Okay, that makes sense. I really appreciate the effort to make that modification!
  • m

    mysterious-toddler-20573

    01/03/2021, 4:12 PM
    No worries, it's small and it's the right thing
  • m

    mysterious-toddler-20573

    01/03/2021, 4:52 PM
    @User if you want to grab the _hyperscript.js from the
    dev
    branch, it should work w/ the
    on load
    syntax
  • m

    mysterious-toddler-20573

    01/03/2021, 4:54 PM
    htmx 1.1.0 is going to be good: https://twitter.com/htmx_org/status/1345775464531566593
1...115116117...1146Latest