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

    green-activity-6102

    10/17/2022, 11:27 PM
    > Falcon encourages the REST architectural style example shows JSON API @mysterious-toddler-20573 and HATEOAS enters the chat
  • c

    cuddly-keyboard-70746

    10/18/2022, 4:45 AM
    I personally think they are overrated, js is enough specially if you are not building a mothership of a web app.
  • m

    melodic-advantage-28381

    10/18/2022, 9:29 AM
    Yeah we use Stimulus for that same reason. In Stimulus, the data-attributes approach was introduced in order to make it easily pluggable to existing HTML. But for Turbo they thought the architecture differently: they added the abstraction layer for the partials/frames for some reason, probably because legacy HTML was not something that mattered as much as for Stimulus...
  • p

    polite-oil-80202

    10/18/2022, 3:20 PM
    Hello, I'm having a weird problem with a form and HTMX not working after a swap. Imagine I have something like that
    Copy code
    html
    <button hx-get="/someurl">Replace name</button>
    <form hx-put="/somemethod" hx-target="#the-target">
        <div id="my-input">
            <input type="text" name="name" value="john">
        </div>
        <button type="submit">submit</button>
    </form>
    If I click on
    submit
    without changing anything everything works fine. I I click
    Replace name
    , the input is replaced with this
    Copy code
    html
    <input type="text" name="name" value="jane">
    Then if I click on
    submit
    nothing happens. How would you troubleshoot what is happening ?
  • m

    mysterious-toddler-20573

    10/18/2022, 3:26 PM
    working here: https://codepen.io/1cg/pen/bGMygZK?editors=1000
  • m

    mysterious-toddler-20573

    10/18/2022, 3:26 PM
    had to add a few more attributes and such, but working
  • m

    mysterious-toddler-20573

    10/18/2022, 3:26 PM
    can you verify you aren't accidentally nuking the form in any way?
  • p

    polite-oil-80202

    10/18/2022, 3:27 PM
    the form is still here, i checked the html that has been swapped and its the same
  • p

    polite-oil-80202

    10/18/2022, 3:29 PM
    The sample I gave is working, but in my application the form is a bit complicated
  • m

    mysterious-toddler-20573

    10/18/2022, 3:29 PM
    🙂
  • p

    polite-oil-80202

    10/18/2022, 3:29 PM
    But it's doing the same
  • p

    polite-oil-80202

    10/18/2022, 3:30 PM
    swap a part of the form and the submit button is not working anymore
  • p

    polite-oil-80202

    10/18/2022, 3:41 PM
    ok, I was messing with the event and disabled click 😦
  • m

    mysterious-toddler-20573

    10/18/2022, 4:00 PM
    many such cases 🙂
  • b

    bitter-machine-55943

    10/18/2022, 4:39 PM
    So with HTMX I can just write HTML/CSS files, maybe with a bit of Alpine, and compose them together similar to Vue components. Like a nav bar component`` and it has everything it needs, like links/CSS all included 🤯
  • b

    big-engine-22348

    10/18/2022, 4:47 PM
    I have a general question about htmx. (First of all thanks! Its amazing to use). But i didn't find anything about performance on big websites or different browsers. Has someone some experience?
  • m

    mysterious-toddler-20573

    10/18/2022, 4:51 PM
    perf should be relatively good on large web pages, and web sites with lots of pages don't really factor in how well it performs. There is one current issue I am aware of with history support in mobile safari when pages are slow, but otherwise it should be pretty clean across the board. We test in Chrome, Firefox and Safari before most releases: https://htmx.org/test/. (Where "we" is me, on my phone and laptop. 🙂
  • b

    big-engine-22348

    10/18/2022, 5:01 PM
    Thanks for your fast answer. I will try it with a few Websites. Anyway great work from you! Thanks alot for your hard work ❤️
  • m

    mysterious-toddler-20573

    10/18/2022, 7:52 PM
    Here are docs for the upcoming head-tag merge support extension (probably going to release next week). Please take a look and let me know what you think: https://dev.htmx.org/extensions/head-support/
  • b

    brainy-ice-92385

    10/18/2022, 8:45 PM
    "Elements that exist in the current head will be left along" s/along/alone/ I think two things could be clarified: the head tag can be anywhere? Some may assume they have to use a whole tag to get this behavior. Second, the matching/swapping relies on an exact textual match of each tag in head? As opposed to a structural match e.g. The order and whitespace of attributes matters. No need to answer me here but I feel like those are two immediate questions
  • m

    mysterious-toddler-20573

    10/18/2022, 9:01 PM
    updated based on your feedback
  • r

    refined-waiter-90422

    10/18/2022, 9:22 PM
    Oooo new progressive enhancements. Niceeee
  • b

    bitter-machine-55943

    10/18/2022, 10:15 PM
    This looks dope. Considering skipping my kid’s soccer practice to try it 🤔
  • m

    melodic-france-58143

    10/18/2022, 11:04 PM
    So... I have a form, with a submit button, some fields and it points at an endpoint. That endpoint recieves the hx-post, but the request doesn't seem to contain any values from the form. Is there something I might be missing?
  • m

    melodic-france-58143

    10/18/2022, 11:08 PM
    The answer is the name attributes on the field
  • m

    mysterious-toddler-20573

    10/18/2022, 11:39 PM
    no, please don't!
  • b

    bitter-machine-55943

    10/18/2022, 11:40 PM
    No worries. We went to practice 😊
  • m

    melodic-france-58143

    10/18/2022, 11:54 PM
    Further question... Now I have a form, and it submits and updates the backend... How does the rest of the page update? I tried putting an hx-boost to the same page, or returning a redirect from the backend to the same page.
  • m

    mysterious-toddler-20573

    10/18/2022, 11:57 PM
    You would probably target the body and render the entire page as the response to the forms request
  • m

    mysterious-toddler-20573

    10/18/2022, 11:57 PM
    Or just boost the whole form
1...862863864...1146Latest