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

    mysterious-toddler-20573

    08/13/2020, 2:05 PM
    I really do need a guru on the htmx project that can help me ensure it is compatible with all the build tools, but also without introducing any build tools to the project. :/
  • b

    bland-twilight-77339

    08/13/2020, 5:00 PM
    hi 🙂 simple question: I have an HTML form doing a GET using htmx, but I would like to avoid sending empty params; is there a trick in htmx to do that?
  • t

    tall-dinner-62086

    08/14/2020, 8:33 AM
    > https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L936 @mysterious-toddler-20573 This doesn't seem to work for me. I'm appending rows to the end of a table that have a few inputs and a button each. I call _hyperscript.start() on initial page load. The hyperscript on the added inputs and buttons only works if I call _hyperscript.start() again after each ajax load.
  • t

    tall-dinner-62086

    08/14/2020, 8:33 AM
    @bland-twilight-77339 No. What's your use case for not sending empty params in a form?
  • b

    bland-twilight-77339

    08/14/2020, 8:52 AM
    @tall-dinner-62086 it's is just a get request, and the server is not happy if you specify empty parameters; it says that they are invalid, as they are interpreted as empty strings, while they are optional, so you can set arg1=5 (a number) or you do not set it at all, because "arg=" is an empty string
  • t

    tall-dinner-62086

    08/14/2020, 9:25 AM
    The server should know how to handle empty strings. You can probably make an extension that intercepts your requests and removes empty parameters
  • b

    bland-twilight-77339

    08/14/2020, 9:30 AM
    I could do that; thanks 🙂 I would not like to change the server, as having an argument with an empty value is different for not having that argument in the first place (NULL vs empty string for example)
  • t

    tall-dinner-62086

    08/14/2020, 9:53 AM
    I figured out my loading issue. The query selector for elements to initialize on load is only looking for htmx attributes,
    a
    , and
    form
    tags. I'm trying to get it to initialize hyperscript on
    input
    and
    button
    tags that don't have htmx attributes on them.
  • t

    tall-dinner-62086

    08/14/2020, 9:54 AM
    interestingly it does call
    _hyperscript.init()
    on the root
    tr
    element, but that doesn't initialize its children
  • s

    salmon-truck-9425

    08/14/2020, 1:00 PM
    Hi, is this an omission here? https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L316 It doesn't provide a "find" selector (was present in intercooler) to search children: Can add:
    Copy code
    } else if (targetStr.indexOf("find ") === 0) {
                        return find(elt, targetStr.substr(5));
        }
  • m

    mysterious-toddler-20573

    08/14/2020, 1:07 PM
    @User ugh, that's a pretty bad bug, my bad
  • s

    salmon-truck-9425

    08/14/2020, 1:08 PM
    i can submit pr for karma points if you dont mind lol 🙂
  • m

    mysterious-toddler-20573

    08/14/2020, 1:09 PM
    @User we should follow the way that forms behave, so if forms include the empty parameter, so should htmx
  • m

    mysterious-toddler-20573

    08/14/2020, 1:10 PM
    @User that seems like an easy fix, sure a PR would be great
  • m

    mysterious-toddler-20573

    08/14/2020, 1:10 PM
    please include docs
  • g

    gorgeous-ghost-95789

    08/14/2020, 3:58 PM
    re: build tools — I’m feeling a little guilty as one person who brought this up. Ironically, I fought this battle myself, against other developers who wanted to overcomplicate our “build pipeline” long ago. Too many of us get lost in the “meta” of building a built system for building builds (I kid you not) and lose the forest for the trees.
  • g

    gorgeous-ghost-95789

    08/14/2020, 3:59 PM
    I put this in github, too — my favorite “build pipeline” was a Typescript compile on save hook built straight in to my IDE, and then let the CDN sort out the rest. It worked great because I could control the production environment.
  • g

    gorgeous-ghost-95789

    08/14/2020, 4:08 PM
    Unfortunately, HTMX can’t control the production environment, so some basic tools would be really helpful. For instance, you already have some great automated tests set up, and minification as well. I think a lot of this could be done on the github side after checkins. The important thing to avoid would be a lengthy “compile” step that has to happen before you can check your work.
  • m

    mysterious-toddler-20573

    08/14/2020, 6:54 PM
    @User I'm just a simple cave man...
  • m

    mysterious-toddler-20573

    08/14/2020, 6:54 PM
    your build tools serve only to confuse and frighten me
  • m

    mysterious-toddler-20573

    08/14/2020, 6:55 PM
    btw, thanks for all the input on github, I'm still slammed but hoping to be available again in September, really appreciate the contributions
  • g

    gorgeous-ghost-95789

    08/14/2020, 7:17 PM

    https://i.imgflip.com/4bhflu.jpgâ–ľ

  • g

    gorgeous-ghost-95789

    08/14/2020, 7:22 PM
    No worries on being busy — my pull requests can wait. I’m very interested in the potential of what you’ve built, so I’ll keep plugging away, if that’s ok. Maybe we can chat when you free up in September?
  • m

    mysterious-toddler-20573

    08/14/2020, 7:23 PM
    yeb
  • p

    powerful-evening-99811

    08/16/2020, 6:18 PM
    hello
  • b

    big-airline-13935

    08/17/2020, 5:26 PM
    Is anyone else able to confirm whether the
    htmx:afterOnLoad
    event is being triggered after a successful htmx request using 0.0.8? In my tests it is not...
  • b

    big-airline-13935

    08/17/2020, 5:39 PM
    Added some automated tests to help confirm this: https://github.com/bigskysoftware/htmx/pull/166
  • g

    glamorous-beach-89957

    08/17/2020, 7:07 PM
    Hey y'all!!! I was wondering if there are any thought, guides or best practices toward managing js behaviors (sprinkles) with htmx? more specifically: if there a need for something like https://github.com/rstacruz/onmount or stimulus.js to manage/organize js spinkle code that would not fall in htmx realm of things ?
  • b

    big-airline-13935

    08/17/2020, 7:29 PM
    @User It's in early development, but check out https://github.com/bigskysoftware/_hyperscript from the author of htmx.
  • g

    glamorous-beach-89957

    08/17/2020, 8:16 PM
    thank you! @User !
1...151617...1146Latest