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

    refined-waiter-90422

    02/22/2023, 4:48 PM
    @mysterious-car-3675 you'll move to them once they are in the standard anyway, no doubt.
  • m

    miniature-lizard-24702

    02/22/2023, 4:48 PM
    that makes sense. like KeyPress/Keydown/Keyup
  • g

    gorgeous-airport-54386

    02/22/2023, 4:49 PM
    > seems like the actual standard is moving towards JSDoc types anyway. source?
  • m

    mysterious-car-3675

    02/22/2023, 4:49 PM
    @refined-waiter-90422 JSDoc is a typeassert, its not actually a type
  • m

    mysterious-toddler-20573

    02/22/2023, 4:49 PM
    I hereby declare a jsdoc/typescript holiday for the next week, let us all brood for a bit
  • m

    miniature-lizard-24702

    02/22/2023, 4:50 PM
    aren't typescript types fake too?
  • m

    miniature-lizard-24702

    02/22/2023, 4:50 PM
    it's not js
  • a

    adventurous-ocean-93733

    02/22/2023, 4:51 PM
    Maybe a separate architecture channel is necessary to make the general channel a bit more approachable to people looking for htmx help, and a bit less like a medieval battlefield
  • r

    refined-waiter-90422

    02/22/2023, 4:51 PM
    typescript folks just evangelising.
  • r

    refined-waiter-90422

    02/22/2023, 4:52 PM
    https://github.com/tc39/proposal-type-annotations
  • g

    gorgeous-airport-54386

    02/22/2023, 4:53 PM
    ... that's adding (ignored) typescript syntax to js, the opposite of "moving to JSDoc types"
  • r

    refined-waiter-90422

    02/22/2023, 4:54 PM
    Oh dang, my bad.
  • m

    mysterious-toddler-20573

    02/22/2023, 4:56 PM
    #1077997241211568228
  • r

    refined-waiter-90422

    02/22/2023, 4:56 PM
    Welp, regardless, jsdoc gives us the best of both worlds without the build step and clutter.
  • a

    adventurous-bear-7424

    02/22/2023, 5:32 PM
    Noob here. I gather that one of the design goals of htmx is to reduce client side (user code) Javascript. Great. But what I don’t understand is why this is not just transferring the burden to the server. If it (let’s say a lambda function on AWS) returns HTML doesn’t it need to know client HTML/CSS architecture? So now my lambda needs to annotate HTML with correct CSS names? How does this enhance separation of concerns (as opposed to lambda just returning data — JSON. It seems like it’s just moved “the problem” elsewhere. What am I missing on this? Thanks!
  • s

    sparse-musician-64201

    02/22/2023, 5:35 PM
    templating html is not that much more expensive on the server than templating json.
  • e

    echoing-dress-67727

    02/22/2023, 5:35 PM
    @adventurous-bear-7424 I might be wrong, but I think if your backend doesn't already produce HTML, I don't think you're in the target audience for HTMX. From my view, I've got a Rails backend that already produces HTML via templates and components and such. So, producing JSON and manipulating the DOM in JS is more work in my system.
  • a

    adventurous-bear-7424

    02/22/2023, 5:36 PM
    @sparse-musician-64201 It’s not the templating that’s a concern, it’s that my server code needs to know client architecture (CSS in particular).
  • s

    sparse-musician-64201

    02/22/2023, 5:37 PM
    This is where I put my architechture hat on and split the server code into a few layers, in most of my web apps I have a layer / folder that is sepfically for 'presenting' data.
  • e

    enough-petabyte-50314

    02/22/2023, 5:37 PM
    yes. HTMX puts the burden on the server to generate the expected markup
  • a

    adventurous-bear-7424

    02/22/2023, 5:38 PM
    @echoing-dress-67727 Roget that. I’m looking at is from the perspective of a new application.
  • s

    sparse-musician-64201

    02/22/2023, 5:38 PM
    The idea is that the area of the server code is that is concerned with data presentation is isolated from the area that is concerned with business logic.
  • e

    enough-petabyte-50314

    02/22/2023, 5:38 PM
    it's a shift in thinking compared to modern frameworks. but its a shift back to "normal" web thinking
  • s

    sparse-musician-64201

    02/22/2023, 5:39 PM
    On top of that I use tailwind v3 for 99% of styling concerns, so I simply style to tailwind classes wether the frontend or backend does the styling.
  • a

    adventurous-bear-7424

    02/22/2023, 5:39 PM
    @sparse-musician-64201 OK, I get that. I just wanted to make sure I understand the lay of the land. Thanks.
  • s

    sparse-musician-64201

    02/22/2023, 5:39 PM
    I think thiis style of architechture makes using a shared set of css classes (ideally froma known frasmework) much more ideal.
  • s

    sparse-musician-64201

    02/22/2023, 5:40 PM
    so the server isn't written specifically for whatever random css classes the frontend team decided to cook up
  • g

    gorgeous-airport-54386

    02/22/2023, 5:40 PM
    > If [the server] returns HTML doesn’t it need to know client HTML/CSS architecture? No, because it's all in the server. It needs to know its own html architecture.
  • s

    sparse-musician-64201

    02/22/2023, 5:40 PM
    but im simply styling from the tailwind documentation.
  • g

    gorgeous-airport-54386

    02/22/2023, 5:40 PM
    In an htmx app, the browser itself is the client.
1...103910401041...1146Latest