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

    adventurous-ocean-93733

    12/31/2022, 2:41 AM
    If that works, then I’d try a plain classless span inside the td with the hx attributes
  • j

    jolly-waitress-42858

    12/31/2022, 4:39 AM
    Just wanted to check - we are planning to use a Bootstrap 5 based admin theme template and convert it to HTMX (with Java+thymeleaf). Has anyone used Bootstrap 5 based themes in HTMX. Does it work well ? First time doing htmx ..so a little unsure. https://github.com/creativetimofficial/soft-ui-dashboard
  • l

    limited-potato-46306

    12/31/2022, 6:51 AM
    @mysterious-toddler-20573 @hundreds-cartoon-20446 Would you all be willing to make @hundreds-cartoon-20446 's extension that snapshots pages before JS effects occur as part of htmx's core or an officially included extension? It has helped me tremendously. https://gist.github.com/croxton/e2c33bd22591f9a5bd8c9d23a56c9edc
  • h

    hundreds-cartoon-20446

    12/31/2022, 6:59 AM
    Yes, it does assumes you have
    hx-swap="outerHTML"
    for your boosted links and the returned response includes the hx-history element not just its innerHTML. I should probably make that clear, or maybe detect boosted link responses another way.
  • l

    limited-potato-46306

    12/31/2022, 7:09 AM
    FWIW I really like the current behavior, perhaps including an example in a README or something would be useful as it is not immediately obvious (though the code is short / clean, so it can be understood with some digging)
  • b

    broad-pencil-64390

    12/31/2022, 12:01 PM
    Aha that's clever, works great thanks!
  • e

    echoing-lion-55988

    12/31/2022, 4:21 PM
    Just write code, not types 😉
  • c

    clever-activity-24633

    12/31/2022, 4:28 PM
    You can't write big code bases without static analysis and documentation. That's a recipe for troubles. Bugs should be found by developers while developing, not by users on run-time.
  • e

    echoing-lion-55988

    12/31/2022, 4:33 PM
    You can’t, that’s why ~60% is run by php
  • e

    echoing-lion-55988

    12/31/2022, 4:33 PM
    Of the whole internet
  • e

    echoing-lion-55988

    12/31/2022, 4:34 PM
    I’m not saying static typing is not handy, I write most of the stuff in go and I find it super useful, but statically typed html? Seriously?
  • e

    echoing-lion-55988

    12/31/2022, 4:35 PM
    There is some line between static typing being useful and types stand in the way of your work
  • c

    clever-activity-24633

    12/31/2022, 4:36 PM
    The fact that ~60% is run by PHP doesn't say it's easy, robust and scalable.
  • e

    echoing-lion-55988

    12/31/2022, 4:36 PM
    Not every app and website has to be like that
  • e

    echoing-lion-55988

    12/31/2022, 4:37 PM
    It’s like hypermedia, there is whole class of software that will run fine with just hypermedia instead of spa or other solutions.
  • e

    echoing-lion-55988

    12/31/2022, 4:37 PM
    Just pick the right tool for the job
  • e

    echoing-lion-55988

    12/31/2022, 4:38 PM
    Are you going to write new database engine? Then it makes to chose something more statically “typish”.
  • c

    clever-activity-24633

    12/31/2022, 4:38 PM
    Why not? If I'm gonna use Web Components that's gonna be used many times in many HTMl templates, I need some tools to guide developers on how to use it and that will warn them when they misuse it.
  • e

    echoing-lion-55988

    12/31/2022, 4:39 PM
    Are you going to write new social network app for dogs with userbase equal roughly to ten? Then python could be a better choice.
  • c

    clever-activity-24633

    12/31/2022, 4:39 PM
    I didn't say it.
  • c

    clever-activity-24633

    12/31/2022, 4:39 PM
    You're right.
  • c

    clever-activity-24633

    12/31/2022, 4:41 PM
    Man, I just asked for HTML static analysis tool, and without knowing which kind of software I want to write you said "write code, not types". 🙂
  • e

    echoing-lion-55988

    12/31/2022, 4:42 PM
    I’m sorry, maybe you’re right. Ive just been here, designing types instead of just writing code, that’s why I’ve wrote that.
  • e

    echoing-lion-55988

    12/31/2022, 4:42 PM
    For me it’s dead end. You can spend hundreds of hours trying to verify everything, so you have to put some line
  • e

    echoing-lion-55988

    12/31/2022, 4:43 PM
    For me typed html is behind this line
  • c

    clever-activity-24633

    12/31/2022, 4:44 PM
    The types are already there. I just need a tool that is awerof the documention and will warn when misuse the code.
  • c

    clever-activity-24633

    12/31/2022, 4:47 PM
    I have 80 developers that writes 100,000 lines of code of "just HTML". It won't be responsible of me to not providing them with a tool that will improve the correctness of their code, will make them more productive and will increase their DX.
  • c

    clever-activity-24633

    12/31/2022, 4:51 PM
    Generally, all the code we write has types, including HTML (see MDN, it's all descriptinos of the types and protocols of HTML elements). It's just that some techonolgoes have tools that reflect and utilise it, and some are not and require the develoepr to click on many buttons in order to find a basic bug.
  • i

    important-cricket-63511

    12/31/2022, 7:49 PM
    Is there a good way to build the equivalent of nested forms? Example:
    Copy code
    <form hx-post="...">
        <input name="a" .../>
        <input name="b" .../>
    
        <input name="c" id="1234567" type="hidden" .../>
        <NESTED FORM>
           <input name="autocompleted" ... hx-post="..." hx-target="#1234567" />
        </NESTED FORM>
    
        <button type="submit">SUBMIT</button>
    </form>
    When the user types in the
    autocompleted
    (which is text), I want to hit an endpoint, which will be used to replace input
    "c"
    (
    id="1234567"
    ) with a database ID. My main problem is that all of the form data (
    a
    b
    and
    c
    ) are sent to the autocomplete endpoint every time the user changes the autocomplete. This is making it hard for me to build an encapsulated auto-complete server-side component that doesn't get polluted by whatever elements surround it in a form. The other solution is for me to break out of HTMX and simply build this autocomplete in some other way (and hit a different, non-HTMX endpoint for the autocomplete results and use some JS to update form input
    c
    when the user makes a selection)
  • i

    important-cricket-63511

    12/31/2022, 7:57 PM
    I think the answer is to use
    hx-get
    instead of
    hx-post
    in the autocomplete --
    hx-post
    includes form data by default while
    hx-get
    does not (I was using
    hx-post
    because the autocomplete can potentially create new database IDs if the user ends a new string value that has not yet been seen before -- but frankly this sort of idempotent is probably find to put in a
    get
    )
1...963964965...1146Latest