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

    thankful-addition-60522

    12/18/2022, 3:47 AM
    also plates https://platesphp.com/
  • t

    thankful-addition-60522

    12/18/2022, 3:49 AM
    if you want to be pegged erb style - here you go https://ejs.co/
  • t

    thankful-addition-60522

    12/18/2022, 3:50 AM
    pug is also available for js https://pugjs.org/
  • t

    thankful-addition-60522

    12/18/2022, 3:52 AM
    there's also https://squirrelly.js.org/
  • t

    thankful-addition-60522

    12/18/2022, 3:53 AM
    but i think it's nuts
  • r

    refined-waiter-90422

    12/18/2022, 3:53 AM
    pugs always enticing because less code, everything else there is more typing man
  • t

    thankful-addition-60522

    12/18/2022, 3:53 AM
    less typing - pug,haml
  • r

    refined-waiter-90422

    12/18/2022, 3:54 AM
    yup lol
  • t

    thankful-addition-60522

    12/18/2022, 3:55 AM
    i like my curly braces and nunjucks and want to use it in my userscripts
  • s

    some-airline-73512

    12/18/2022, 8:12 PM
    I'm happy with nunjucks. The thing that it is lacking is streaming support.
  • s

    some-airline-73512

    12/18/2022, 8:13 PM
    Ultimately I would prefer having native rendering. Why use js engine for that - I don't see a point in that, since it's CPU-intensive task.
  • s

    some-airline-73512

    12/18/2022, 8:14 PM
    There is marcojs. It supports streaming and does 90% of the work at compile time. But it requires a bundler. I'm not ready to add a bundler to the stack yet
  • s

    some-airline-73512

    12/18/2022, 8:14 PM
    I will fight against bundlers till I die haha
  • j

    jolly-motorcycle-88169

    12/19/2022, 3:43 AM
    is there a way to stop a hx-vals from being sent? ive tried null and just returning nothing but that seems to send that value still
  • r

    ripe-action-67367

    12/19/2022, 6:48 AM
    I think there was "unset" value for this purpose?
  • b

    boundless-vase-80440

    12/19/2022, 2:00 PM
    what do you mean by native rendering?
  • b

    boundless-vase-80440

    12/19/2022, 2:01 PM
    I hate webpack, but I found esbuild to be pretty harmless
  • r

    red-france-69804

    12/19/2022, 3:34 PM
    Hi there. I'm using preload HTMX extension. Preloading works as expected, however when clicking the button after preloading has been done, the request is issued a second time. It does not hit a cache. Did I miss something?
    Copy code
    html
    <button
      hx-get="{% querystring table.prefixed_page_field=table.page.next_page_number %}"
      preload="mouseover"
      hx-trigger="click"
      hx-target="#table-wrapper"
      hx-swap="outerHTML"
      hx-push-url="true"
    >
      »
    </button>
  • a

    abundant-spring-38265

    12/19/2022, 5:21 PM
    Guys, how would one use: htmx:afterRequest? Planning to display a message after successful POST (200/201)
  • m

    mysterious-toddler-20573

    12/19/2022, 5:22 PM
    are you sending the correct header to tell the browser to cache it? https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
  • m

    mysterious-toddler-20573

    12/19/2022, 5:23 PM
    you might want the example using `htmx:beforeSwap`: https://htmx.org/docs/#modifying_swapping_behavior_with_events
  • a

    ancient-shoe-86801

    12/19/2022, 5:39 PM
    @red-france-69804 adding https://htmx.org/docs/#caching
  • r

    red-france-69804

    12/19/2022, 7:15 PM
    Thanks! So if I understand, basically, I just need to inject the
    Vary: HX-Request
    in all my requests to ensure caching occurs properly with urls that can load full pages AND htmx fragments. Right?
  • a

    ancient-shoe-86801

    12/19/2022, 7:33 PM
    yes
  • a

    ancient-shoe-86801

    12/19/2022, 7:33 PM
    also, your server must generate the right response caching headers
  • a

    ancient-shoe-86801

    12/19/2022, 7:34 PM
    otherwise, the browser doesn't know that it can cache that response
  • r

    red-france-69804

    12/19/2022, 7:49 PM
    Ok. I'm using Django and never managed caching headers manually. I was expecting that somehow the default behaviour was the right one. I may be wrong.
  • m

    mysterious-toddler-20573

    12/19/2022, 8:29 PM
    typically application server responses from dynamic end points are set up not to cache, since their content is dynamic
  • m

    mysterious-toddler-20573

    12/19/2022, 8:30 PM
    not familiar w/ how django works, but that's been my experience
  • r

    red-france-69804

    12/19/2022, 9:16 PM
    Thanks it's a lot clearer now. I'd suggest adding a small warning in https://htmx.org/extensions/preload/ doc to remind caching needs to be configured separately. I know this sounds obvious to most of you, but having never configured HTTP cache before, I was expecting preload config was the only thing I needed 😣
1...954955956...1146Latest