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

    tall-dinner-62086

    03/15/2023, 12:21 PM
    It reads to me like this person has an obscenely complicated backend for no good reason
  • m

    mysterious-toddler-20573

    03/15/2023, 1:03 PM
    I read it as a front end engineer who hasn't spent much time building with hypermedia and, thus, thinks about how to do things the SPA way, but with hypermedia. Understandable. And, of course, hypermedia does have its limitations. The good news is that none of this matters.
  • m

    miniature-lizard-24702

    03/15/2023, 1:23 PM
    Dw one day the world will enter enlightenment. Just not today
  • s

    shy-knife-59740

    03/15/2023, 3:35 PM
    People will argue about everything, you cant satisfy everyone
  • a

    abundant-dog-96915

    03/15/2023, 3:41 PM
    Yeah I can't relate with most of those HN comments. I've been spending the past 4 months or so going around and refreshing my knowledge on frontend offerings. There are two massive standouts: - HTMX - Svelte I'll choose svelte for my flashy projects, I'll choose HTMX for the ones I want to last forever
  • s

    shy-knife-59740

    03/15/2023, 3:48 PM
    whats all that svelte hype about tho
  • s

    shy-knife-59740

    03/15/2023, 3:48 PM
    is it a fullstack framework or just frontent?
  • o

    orange-umbrella-16693

    03/15/2023, 3:49 PM
    SolidJS and Qwik too but they're still too early/underdeveloped in places.
  • r

    ripe-action-67367

    03/15/2023, 3:50 PM
    Svelte "revolutionized" frontend by implementing compilation time reactivity. Instead of VDOM, that React and Vue use, Svelte introduced built-time dependency tracking, generating more efficient update logic with less overhead
  • s

    shy-knife-59740

    03/15/2023, 3:51 PM
    what was that message about 2mb something?
  • s

    shy-knife-59740

    03/15/2023, 3:51 PM
    xd
  • r

    ripe-action-67367

    03/15/2023, 3:51 PM
    It ALSO intoduced hacks like
    arr = arr
    because compiler can only track explicit assignments, so if you used mutating array functions or updated specific object fields - tough luck
  • o

    orange-umbrella-16693

    03/15/2023, 3:51 PM
    I said what @ripe-action-67367 sent above but in a cynical way
  • s

    shy-knife-59740

    03/15/2023, 3:52 PM
    ohh thats interesting. I saw fireship io use it a lot
  • a

    abundant-planet-84751

    03/15/2023, 3:52 PM
    I have a need to use hx-target on something without an ID, and it is on a separate part of the page, so I haven't been able to get "closest" or "find" to work on a CSS selector. Is there another way to target perhaps by name or a class?
  • o

    orange-umbrella-16693

    03/15/2023, 3:58 PM
    Check this out https://htmx.org/examples/update-other-content/
  • m

    mysterious-toddler-20573

    03/15/2023, 4:56 PM
    i don't agree!
  • m

    mysterious-toddler-20573

    03/15/2023, 4:58 PM
    is it possible to add an id to it (or around it) so a CSS selector can be created?
  • h

    hundreds-cartoon-20446

    03/15/2023, 6:42 PM
    @mysterious-toddler-20573 I think I've found a memory leak. I've been trying to track down why detached nodes increase significantly over time, when swapping. The obvious cause would be references to nodes that can't be garbage collected. I think the variable
    body
    here is the culprit, as you're using it inside a timeout: https://github.com/bigskysoftware/htmx/blob/560b3140740f4be386acd044af7568ed7ae19557/src/htmx.js#L3403 Changing as follows seems to stop detached dom nodes accumulating:
    Copy code
    js
    setTimeout(function () {
       triggerEvent(body, 'htmx:load', {}); // give ready handlers a chance to load up before firing this event
       body = null; // kill reference for gc
    }, 0);
    Can anyone else verify this? You can test your project by looking at how the graph of dom nodes varies over time in Chrome's performance monitor tool.
  • m

    mysterious-toddler-20573

    03/15/2023, 7:08 PM
    I would expect a memory leak to be up and to the right
  • m

    mysterious-toddler-20573

    03/15/2023, 7:08 PM
    did you do a page refresh at the top?
  • m

    mysterious-toddler-20573

    03/15/2023, 7:09 PM
    that setTimeout doesn't appear to have any particular nodes in context
  • m

    mysterious-toddler-20573

    03/15/2023, 7:09 PM
    otoh, this is javascript
  • h

    hundreds-cartoon-20446

    03/15/2023, 7:27 PM
    That’s a screenshot with my fix. Previously the node count only went upwards.
  • h

    hundreds-cartoon-20446

    03/15/2023, 7:28 PM
    No refresh
  • h

    hundreds-cartoon-20446

    03/15/2023, 7:29 PM
    Would be good to know if that is a general finding or specific to my projects.
  • m

    mysterious-toddler-20573

    03/15/2023, 7:30 PM
    ahh
  • m

    mysterious-toddler-20573

    03/15/2023, 7:32 PM
    boy, I can't see how that would capture and hang on to stuff
  • m

    mysterious-toddler-20573

    03/15/2023, 7:32 PM
    https://grugbrain.dev/#grug-on-closures > javascript developers call very special complexity demon spirit in javascript "callback hell" because too much closure used by javascript libraries very sad but also javascript developer get what deserved let grug be frank
  • h

    hundreds-cartoon-20446

    03/15/2023, 7:45 PM
    I’ve come across the
    setTimeout()
    problem a few times before. It’s usually best to created references to dom nodes inside the function, rather than reuse an existing one, because the garbage collector will refuse to mark it for collection.
1...106810691070...1146Latest