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

    refined-ice-80461

    12/05/2020, 5:05 PM
    Really, the hardest part is generating the html from the server in such a way that it is resilient and reusable. That's why I think using htmx and similar tools with a really well designed Web Components library and building in better server side integrations is going to be a game changer going forward.
  • g

    gorgeous-ghost-95789

    12/05/2020, 5:10 PM
    Yes. I’m still on the lookout for a high quality, open source web component library. Maybe in 2025...
  • r

    refined-ice-80461

    12/05/2020, 5:11 PM
    Maybe sooner than that. 😉
  • g

    glamorous-honey-42686

    12/05/2020, 7:42 PM
    Yes, I was planning on generating events when it receives something, but it seems like hx-trigger is only built for issuing ajax requests, as far as I understand the source code at least.
  • g

    gorgeous-ghost-95789

    12/05/2020, 7:47 PM
    Yeah, I didn’t really dig in very far, but what you’re saying sounds right.
  • g

    gorgeous-ghost-95789

    12/05/2020, 7:49 PM
    @glamorous-honey-42686 — I’m going to try to make a list of use cases / proposals for extensions soon, and I’ll make sure to include this in my list. I’m hoping I can get it up as a GitHub issue in the next week or so. Let’s lobby for the features that would make this possible as an extension.
  • g

    gorgeous-airport-54386

    12/05/2020, 8:39 PM
    so I was doodling while listening to the devmode episode and
  • g

    gorgeous-ghost-95789

    12/05/2020, 9:49 PM
    my hero!
  • m

    mysterious-toddler-20573

    12/05/2020, 11:39 PM
    That's incredible
  • m

    mysterious-toddler-20573

    12/06/2020, 3:24 PM
    Would you be OK if I tweeted that out?
  • g

    gorgeous-airport-54386

    12/06/2020, 3:45 PM
    I'd be delighted!
  • m

    mysterious-toddler-20573

    12/06/2020, 3:49 PM
    Do you have a twitter handle I can credit?
  • g

    gorgeous-airport-54386

    12/06/2020, 3:50 PM
    @DenizAksimsek
  • m

    mysterious-toddler-20573

    12/06/2020, 3:51 PM
    https://twitter.com/htmx_org/status/1335612851675832322
  • m

    mysterious-toddler-20573

    12/06/2020, 3:52 PM
    Very cool, thank you for sharing this!
  • g

    gorgeous-airport-54386

    12/06/2020, 3:52 PM
    Thanks!
  • p

    powerful-evening-99811

    12/06/2020, 6:35 PM
    the ease of creating your own extension inline is very handy. Though, can we add a "transformRequest" callback to the extension framework? This would be the dual to "transformResponse". By having both, we can write drivers to interface to non-htmx friendly backends (eg: postgrest, legacy, so-on)
  • m

    mysterious-toddler-20573

    12/06/2020, 6:38 PM
    @User excellent idea, can you create a github request?
  • m

    mysterious-toddler-20573

    12/06/2020, 6:39 PM
    I want to maximize the flexibility and easy of creating an extension so I can keep the core small, so I'm very interestedin extending that mechanism
  • p

    powerful-evening-99811

    12/06/2020, 6:55 PM
    @User https://github.com/bigskysoftware/htmx/issues/254
  • f

    future-boots-43048

    12/07/2020, 5:24 PM
    Is there any way I can get a SSE event to trigger hyperscript?
  • f

    future-boots-43048

    12/07/2020, 5:25 PM
    I'd like to do this sort of thing:
    Copy code
    html.div(data_script = 'on sse:myeventname call alert("SSE!")')
  • f

    future-boots-43048

    12/07/2020, 5:30 PM
    (Sorry for the weird html-but-it's Python syntax)
  • f

    future-boots-43048

    12/07/2020, 5:40 PM
    I'm still loving HTMX & dominate ... as it's letting me compose my UI components The Way God Intended: With function calls:-
  • f

    future-boots-43048

    12/07/2020, 5:40 PM
    Copy code
    def live_page(title, id_topic, list_id_resource_toplevel, **kwargs):
        """
        Return a 'live' page.
    
        The page subscribes to the specified
        SSE EventSource (id_topic).
    
        Events received from id_topic are
        used to trigger updates to the
        corresponding 'live_view' nested
        element, enabling 'server-push'
        style updates.
    
        """
        doc = html_boilerplate(title = title)
        with doc:
            with subscription(id_topic = id_topic, **kwargs):
                live_view(list_id_resource = list_id_resource_toplevel)
        return doc
  • f

    future-boots-43048

    12/07/2020, 5:42 PM
    (And, orthogonally, The Way The Other God Intended: With distributed components and dataflow).
  • m

    mysterious-toddler-20573

    12/07/2020, 7:25 PM
    Unfortunately sse events don't trigger the normal manner, so hyperscript won't see them, but we should pass the events on w/ an htmx prefix so you can use hyperscript w/ it
  • f

    future-boots-43048

    12/07/2020, 8:40 PM
    Hmmm ... a thought just occurred to me ... would HTMX work with SVG as well as HTML, I wonder.... got to be worth an experiment, at least.
  • g

    gorgeous-ghost-95789

    12/07/2020, 8:44 PM
    Hey @User, SSE seemed like a real mystery to me when I first started looking into it, but setting up a connection is a tiny bit of code. It should be really easy to make your own SSE connection outside of htmx, then trigger browser events when you receive messages. htmx and hyperscript can both respond to those browser events if you like.
  • g

    gorgeous-ghost-95789

    12/07/2020, 8:44 PM
    The Mozilla docs are fantastic, btw: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
1...878889...1146Latest