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

    boundless-author-22679

    05/08/2023, 10:03 PM
    i still don't prefer that style though
  • b

    boundless-author-22679

    05/08/2023, 10:03 PM
    hence why I'm here 😁
  • g

    great-cartoon-12331

    05/08/2023, 10:03 PM
    same!
  • g

    great-article-50141

    05/08/2023, 10:08 PM
    it decides when to interleave them
    <<-- there's one gripe I have Another: you typically end up having to use another library to manage more complicated states (Redux, MobX being examples). Well now you've increased your bundle size. Then you have to change your api (don't care if it's rest or graphql) to meet the needs of the frontend and keep that performant too
  • g

    great-article-50141

    05/08/2023, 10:09 PM
    you don't only kick the problems down the road with frameworks like react but you also complicate already solved problems
  • g

    great-article-50141

    05/08/2023, 10:09 PM
    htmx makes way more sense to this crotchedy old programmer who's seen it all over 25 years
  • b

    bitter-monkey-50309

    05/08/2023, 10:10 PM
    why grug go into complexity demon spirit lairs
  • q

    quiet-nightfall-51817

    05/08/2023, 10:17 PM
    Architectures like React, IMO, only really start to make sense when you're solving Facebook app level problems. Where you have multiple islands of interactivity (or refreshing) on a single page, often delivered by entirely separate teams and integrated by yet another team. If you're not living in that world, you are probably better off with some simpler model.
  • q

    quiet-nightfall-51817

    05/08/2023, 10:19 PM
    But cargo cult and voodoo coding say if Facebook or Google tempt battles with complexity demon, so should Grug.
  • r

    ripe-agency-69289

    05/08/2023, 10:36 PM
    My 2 cents: I like writing applications in Go, but I am not a fan of writing website backends in it because for starters I don't like the standard template engine. I tried other template engines but the tooling around them sucks. I didn't want to try front end frameworks either because they seemed so complicated. At some point I decided to try using a couple different front end frameworks that just call JSON API endpoints and I really prefer it. The tooling around front end frameworks is great: hot module replacement, easy Tailwind integration, out of the box TypeScript support, minifying assets, adding the hash to the file name for caching, etc. I also like client-side routing, no full page refreshes, not having to keep all state on the server, etc. Of course there are solutions like adding HTMX and Alpine.js in the mix, but it just doesn't feel as polished to me. My Go app is primarily a JSON API anyway so I just reuse existing code. But then again, this is for a personal project and I have too much time on my hands so I can imagine that for a lot of people just using HTMX is the way to go. Front end frameworks and libraries move rapidly, so unless you want to spend a bunch of time keeping your code up to date with the latest versions, it might not be the best choice. Anyway, if anyone has questions about React, Next.js, Vue, Nuxt, Svelte or SvelteKit, let me know.
  • q

    quiet-nightfall-51817

    05/08/2023, 10:43 PM
    I don't actually use it much myself, though I would if I had appropriate use cases. As is my app is a non-PWA SPA. It's pure Javascript and DOM with no back end at all, and uses hyperscript for UI interactivity and JS libraries to implement the actual functionality.
  • m

    mysterious-toddler-20573

    05/08/2023, 10:50 PM
    avi checks out
  • r

    ripe-agency-69289

    05/08/2023, 10:50 PM
    🤣
  • r

    ripe-agency-69289

    05/08/2023, 10:50 PM
    Front end frameworks are a psyop
  • m

    mysterious-toddler-20573

    05/08/2023, 10:51 PM
    i don't even know who's psyoping who anymore
  • q

    quiet-nightfall-51817

    05/08/2023, 10:51 PM
    Pysops have become memetically self-aware and choose their own targets.
  • a

    aloof-crayon-56651

    05/09/2023, 12:30 AM
    Luke Plant (core Django dev and htmx + django patterns wizard) suggested using only GET and POST. Given how long we've been using those two verbs, and given that well established frameworks don't use those verbs natively, what's the value proposition of taking the time to figure out how to use them?
  • b

    bitter-machine-55943

    05/09/2023, 12:33 AM
    I found using a client-side store makes React/etc somewhat better. Astro to glue components together, and all React/etc do is update the store. Clicking a button updates the store. Then the store handles the logic (API call, etc). Usually just one hook, to rerender on a change in the store. So update a table is just cramming the API response into a store variable, and the hook rerenders the table. Astro+nanostores has been good for this.
  • a

    aloof-crayon-56651

    05/09/2023, 12:35 AM
    > Also, HTMX is best styled with semantic classes. Which is a problem for companies using Tailwind and utility classes in their HTML. This critique is actually more accurate about hyperscript, I think. Django-widget-tweaks fixes the Tailwind problem in Django easily.
  • g

    great-article-50141

    05/09/2023, 12:38 AM
    Can you expand on that a little bit? I just don't see how semantic classes makes noticeable difference in htmx/hyperscript but if I'm wrong, I'm wrong.
  • a

    aloof-crayon-56651

    05/09/2023, 12:40 AM
    I've had the same thought. I want to take the time to learn how to increment a count properly in React to make a comparison video based off this video:

    https://www.youtube.com/watch?v=1UOAI7pFDek▾

  • a

    aloof-crayon-56651

    05/09/2023, 12:40 AM
    Things might have changed, but last I saw, you couldn't
    add
    or
    remove
    multiple classes in my command.
  • a

    aloof-crayon-56651

    05/09/2023, 12:41 AM
    Also, hyperscript doesn't support Tailwind classes like .bg-red-500/50 or arbitrary classes.
  • a

    aloof-crayon-56651

    05/09/2023, 12:44 AM
    Just checked, and it looks like
    add
    and
    remove
    can work on multiple classes at once now. Still, the other things are true.
  • g

    great-article-50141

    05/09/2023, 12:49 AM
    ok so you're right BUT
  • g

    great-article-50141

    05/09/2023, 12:49 AM
    Copy code
    on click
        set x to ' .bg-red-500/50'
        ....
        append x to my@class
  • g

    great-article-50141

    05/09/2023, 12:50 AM
    I mean, hacky, but it was the quickest I could think of
  • g

    great-article-50141

    05/09/2023, 12:50 AM
    might be smarter ways to do that
  • g

    great-article-50141

    05/09/2023, 12:51 AM
    If I wanted to get crazy, I could have a hidden element on page that housed the classes I wanted to use for any given state of an element and then use hyperscript to pull
    <element>@class as string
    and then put it into my element on some event
  • g

    great-article-50141

    05/09/2023, 12:51 AM
    so, like... I dunno, I just feel like there are some easy and creative escape hatches
1...111911201121...1146Latest