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

    gifted-appointment-5037

    04/24/2023, 7:19 PM
    I've never used Go.
  • g

    gifted-appointment-5037

    04/24/2023, 7:20 PM
    I'll take a look at Azure then ... thanks so much for the heads-up
  • g

    gifted-appointment-5037

    04/24/2023, 7:23 PM
    I am actually working on it right now. Got it working locally. But it's fiddly. (I'm using serverless) Need to get the static files hosted on S3 instead of in the lambda instance, and get it building with serverless-bundle instead of my hand-rolled tsc build. (need the tree-shaking stuff in webpack to get the deliverable size down). I may get it on a public github tomorrow and you can have a look if you like. I'm using express with the lambda one. It uses the wildcard handler and basically implements the NextJS routing approach again.
  • g

    gifted-appointment-5037

    04/24/2023, 7:23 PM
    (doing it in Typescript though ... what's so good about Go?)
  • b

    bitter-machine-55943

    04/24/2023, 7:26 PM
    Go was just what @miniature-lizard-24702 mentioned. I don’t use Go much myself. Was just pointing out other options for serverless. For small sites they all have a nice free tier
  • g

    gifted-appointment-5037

    04/24/2023, 7:27 PM
    been using AWS since 2009 for scalable web architecture. Trying to move away from it now. It's clunky and expensive. Cloudflare is excellent but still lacking some key features.
  • g

    great-cartoon-12331

    04/24/2023, 8:03 PM
    they also support Rust
  • g

    great-lifeguard-29000

    04/25/2023, 5:49 AM
    Does innerHTML work with svg elements? I have an svg canvas with a few elements (e.g.
    <circle cx="50" cy="50" fill="lightgray" hx-post="/svg/canvas/circle" hx-swap="outerHTML" r="20" stroke-width="4" stroke="#1c87c9"></circle>
    ). When I return the following from the
    /svg/canvas/circle
    endpoint on the click event
    <circle cx="60" cy="60" fill="lightgray" hx-post="/svg/canvas/circle" hx-swap="outerHTML" r="30" stroke-width="4" stroke="#ff0000"></circle>
    the element just disappears from the canvas. I can only get the image update to work if I target the entire
    <svg>
    element and replace that.
  • Hi all after reading up a lot on HTMX I
    s

    steep-oil-94824

    04/25/2023, 7:43 AM
    Hi all, after reading up a lot on HTMX I now try to get my hands dirty myself: Right now I want to toggle a class on an element to use it as an indicator:
    Copy code
    <button
           hx-post="{{ path('app_installation_update', {'id': installation.id}) }}"
           hx-target="body"
           hx-on="
                   htmx:beforeRequest: this.querySelector('svg').classList.add('animate-spin')
                   htmx:afterRequest:  this.querySelector('svg').classList.remove('animate-spin')
                 "
    >
        {% include 'icons/sync.html.twig' with { 'size': 24, 'class': 'stroke-gray-800'} %}
    </button>
    The SVG starts spinning, But I get the following error:
    Copy code
    peError: internalData.onHandlers is not iterable
        at deInitNode (htmx.js:907:1)
        at cleanUpElement (htmx.js:915:1)
        at htmx.js:917:61
        at forEach (htmx.js:375:1)
        at cleanUpElement (htmx.js:917:1)
        at htmx.js:917:61
        at forEach (htmx.js:375:1)
        at cleanUpElement (htmx.js:917:1)
        at htmx.js:917:61
        at forEach (htmx.js:375:1)
    Could somebody point me to the right direction?
    f
    m
    • 3
    • 5
  • m

    mysterious-toddler-20573

    04/25/2023, 1:19 PM
    might be a browser constraint
  • e

    enough-petabyte-50314

    04/25/2023, 1:58 PM
    Built With knows about HTMX. in case anyone's curious https://trends.builtwith.com/javascript/Htmx
  • Creating dynamic SVG elements with JavaS...
    p

    proud-librarian-99598

    04/25/2023, 3:01 PM
    According to https://www.motiontricks.com/creating-dynamic-svg-elements-with-javascript/ you need to use
    createElementNS()
    instead of
    createElement()
    , but I don’t know if we could somehow have htmx do that.
    g
    • 2
    • 1
  • g

    gorgeous-airport-54386

    04/25/2023, 3:14 PM
    typescript fixes this
  • g

    gorgeous-airport-54386

    04/25/2023, 3:14 PM
    runs
  • m

    mysterious-toddler-20573

    04/25/2023, 3:28 PM
    FITE ME
  • b

    billions-window-36824

    04/25/2023, 6:39 PM
    Yet another day of preaching about HTMX and Hyperscript to literally every developer I encounter
  • b

    billions-window-36824

    04/25/2023, 6:39 PM
    Life is good :)
  • m

    magnificent-barista-99118

    04/25/2023, 6:40 PM
    Hey everyone, just created https://github.com/PyHAT-stack/awesome-python-htmx, love feedback. See the #941388608290574336 channel for more info
  • m

    miniature-lizard-24702

    04/25/2023, 8:15 PM
    Hyperscript is an unnecessary abstraction.
  • m

    miniature-lizard-24702

    04/25/2023, 8:15 PM
    runs
  • b

    billions-window-36824

    04/25/2023, 8:17 PM
    Better than this to be honest

    https://cdn.discordapp.com/attachments/725789747212976259/1100515874722545804/image.png▾

  • m

    miniature-lizard-24702

    04/25/2023, 8:17 PM
    Use alpine then
  • m

    miniature-lizard-24702

    04/25/2023, 8:17 PM
    Or stimulus
  • b

    billions-window-36824

    04/25/2023, 8:17 PM
    but how else do i feel superior :/
  • m

    miniature-lizard-24702

    04/25/2023, 8:18 PM
    Ah.
  • m

    miniature-lizard-24702

    04/25/2023, 8:18 PM
    Use vim instead?
  • b

    billions-window-36824

    04/25/2023, 8:18 PM
    I said superior not mentally challenged
  • m

    miniature-lizard-24702

    04/25/2023, 8:18 PM
    Lmao
  • b

    billions-window-36824

    04/25/2023, 8:18 PM
    jetbrains is da 🐐
  • m

    miniature-lizard-24702

    04/25/2023, 8:19 PM
    I use jetbrains as well but I secretly find vim users cool
1...110211031104...1146Latest