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

    adamant-state-54102

    05/08/2023, 2:57 AM
    Are there no template fragment (https://htmx.org/essays/template-fragments/#known-template-fragment-implementations) implementations in JS, then? Speaking of, I've been using ejs or plain template literals to render templates in an express backend. Anyone have other recommendations?
  • g

    great-cartoon-12331

    05/08/2023, 3:44 AM
    is there a way to configure all htmx requests to add a specific query parameter e.g.
    ?x=1
    ? i'm looking at this event: https://htmx.org/events/#htmx:beforeRequest ...but there's no obvious way to add a query parameter to an xhr object
  • g

    great-cartoon-12331

    05/08/2023, 4:03 AM
    whoops, found the correct event: https://htmx.org/events/#htmx:configRequest
  • g

    great-cartoon-12331

    05/08/2023, 4:17 AM
    ok so quick note that i decided to set a query param
    ?hx=1
    on htmx requests and distinguish htmx requests that way, instead of using the
    HX-Request
    header. this is because i need to cache the responses of certain htmx requests (but not the full-page load responses of the non-htmx requests), and when setting different cache responses by header, you need to set the
    Vary: HX-Request
    response header. but the
    HX-Request
    header doesn't exist in non-htmx requests. so the browser can't tell apart the cacheable/non-cacheable responses. using a query param bypasses the problem because the URL is distinct.
  • a

    adamant-state-54102

    05/08/2023, 4:31 AM
    That is surpising. I would think requests with and without HX-Request header should trigger that Vary.
  • (FIXED) View Transition error
    v

    victorious-breakfast-76240

    05/08/2023, 6:30 AM
    Hello, I tried the example of View Transitions as is with htmx 1.9.2, chrome 112, and a small backend in clojure/babashka, but the console is giving me this error
    Copy code
    Unexpected duplicate view-transition-name: slide-it
    and the animation not working at all, how do you debug this? is this an issue?
    m
    • 2
    • 8
  • s

    shy-queen-58364

    05/08/2023, 1:59 PM
    no #crab-htmx? fine
  • a

    adventurous-ocean-93733

    05/08/2023, 2:02 PM
    Do they have a logo yet? We can add it to #996832027083026563
  • a

    adventurous-ocean-93733

    05/08/2023, 2:04 PM
    I feel like the crab trademark policy will be inline with the htmx use of trademark policy.
  • s

    shy-queen-58364

    05/08/2023, 2:06 PM

    https://user-images.githubusercontent.com/8974888/231858967-7c37bf1e-335b-4f5a-9760-da97be9f54bb.png▾

  • a

    adventurous-ocean-93733

    05/08/2023, 2:09 PM
    I was picturing a crab loosening the bolts of the rust logo
  • a

    adventurous-ocean-93733

    05/08/2023, 2:12 PM
    I like it, ninja crab
  • g

    great-cartoon-12331

    05/08/2023, 3:06 PM
    it's possible i messed something up of course, i would be interested to see what others experienced
  • h

    hundreds-cartoon-20446

    05/08/2023, 4:08 PM
    I usually do this with the ajax header extension ti distinguish ajax (htmx) requested template fragments from a full page load when caching. https://htmx.org/extensions/ajax-header
  • g

    great-cartoon-12331

    05/08/2023, 4:15 PM
    interesting, i wonder what the difference is
  • m

    mysterious-toddler-20573

    05/08/2023, 5:44 PM
    https://stackoverflow.blog/2023/05/08/the-2023-developer-survey-is-now-live/
  • r

    ripe-action-67367

    05/08/2023, 5:47 PM

    https://cdn.discordapp.com/attachments/725789747212976259/1105189123041525812/th-2897446172.jpg▾

  • g

    great-article-50141

    05/08/2023, 7:50 PM
    I love this comment from the HN post about "HTMX is the Future"
    Copy code
    Every company I've been a part of has redesigned their front end at least once.
    
    These redesigns would be a lot more difficult if we had to edit HTML on the client and the HTML that a server returns.
    
    Also, HTMX is best styled with semantic classes. Which is a problem for companies using Tailwind and utility classes in their HTML. With class-heavy HTML it's nearly impossible to redesign in two different places. And performance suffers and returning larger chunks of HTML.
    
    Despite all that, I want HTMX to be the standard way companies develop for the web. But these 2 problems need to be addressed first, I feel, before companies (like mine) take the leap.
    I don't even know where to start with that? lol I just don't understand how so many programmers have "stockholmed syndromed" themselves into views like this
  • g

    gorgeous-airport-54386

    05/08/2023, 7:50 PM
    > if we had to edit HTML on the client and the HTML that a server returns how can i even begin to explain that those two things are one and the same
  • b

    boundless-author-22679

    05/08/2023, 7:51 PM
    that is a certified react™️ moment
  • g

    great-article-50141

    05/08/2023, 7:54 PM
    So, like, just to prove this wrong with facts which don't care about this idiots feelings: at my company, we had a vue front-end and we use tailwind and I was building the APIs via JSON REST calls. I took over the front-end in HTMX in approx one week, still using tailwind and it's infinitely faster
  • g

    great-article-50141

    05/08/2023, 7:55 PM
    like, holy shit man, how out of touch with reality are you?
  • g

    great-article-50141

    05/08/2023, 7:55 PM
    anyways, that's my rant for the day, going to go code a new htmx page for an advanced search form that would take months in React and will only take me maybe a few days in htmx
  • g

    great-article-50141

    05/08/2023, 7:55 PM
    talk amongst yourselves
  • r

    refined-waiter-90422

    05/08/2023, 7:55 PM
    gotta keep in mind man, most people are fresh off a decade of react
  • r

    refined-waiter-90422

    05/08/2023, 7:57 PM
    some people haven't known any other way
  • b

    boundless-author-22679

    05/08/2023, 7:58 PM
    that is scary to think about but you're right yeah
  • b

    boundless-author-22679

    05/08/2023, 7:58 PM
    a lot of people probably jumped straight into react without ever working on separate front and back with barer languages
  • g

    great-article-50141

    05/08/2023, 7:59 PM
    I've seen this a lot and, almost 100% of the time, with two exceptions, those programmers can't actually code their way out of a paper bag
  • g

    great-article-50141

    05/08/2023, 7:59 PM
    They learn nothing about the inner workings of what they're doing in their little bubbled off sheltered world
1...111711181119...1146Latest