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

    miniature-lizard-24702

    11/02/2022, 7:28 PM
    but I know enough
  • g

    gorgeous-airport-54386

    11/02/2022, 7:28 PM
    as in
  • g

    gorgeous-airport-54386

    11/02/2022, 7:29 PM
    Copy code
    js
    element.addEventListener("remove", e => cleanupState(element));
  • g

    gorgeous-airport-54386

    11/02/2022, 7:29 PM
    why do I need to use a MutationObserver and get a performance penalty for this
  • m

    miniature-lizard-24702

    11/02/2022, 7:30 PM
    what about adding?
  • g

    gorgeous-airport-54386

    11/02/2022, 7:30 PM
    eh
  • g

    gorgeous-airport-54386

    11/02/2022, 7:30 PM
    the code that adds an element usually knows what it's adding
  • g

    gorgeous-airport-54386

    11/02/2022, 7:31 PM
    so it can call the
    initializeFoos(subtree)
  • g

    gorgeous-airport-54386

    11/02/2022, 7:31 PM
    cleanup is harder
  • m

    miniature-lizard-24702

    11/02/2022, 7:31 PM
    but if htmx appends to the dom, how does stimulus know something was added? dont tell me it periodically checks
  • g

    gorgeous-airport-54386

    11/02/2022, 7:31 PM
    it uses mutationobserver
  • g

    gorgeous-airport-54386

    11/02/2022, 7:31 PM
    which is unfortunate, because it makes all dom operations slower
  • g

    gorgeous-airport-54386

    11/02/2022, 7:32 PM
    if you were writing custom js you could instead listen to
    htmx:load
  • m

    miniature-lizard-24702

    11/02/2022, 7:32 PM
    how much slower?
  • g

    gorgeous-airport-54386

    11/02/2022, 7:32 PM
    caleb from alpine benchmarked it i think
  • m

    miniature-lizard-24702

    11/02/2022, 7:35 PM
    I only found this but no results
  • m

    miniature-lizard-24702

    11/02/2022, 7:35 PM
    https://github.com/alpinejs/alpine/blob/main/benchmarks/mutation_observer.html
  • g

    gorgeous-airport-54386

    11/02/2022, 7:35 PM
    i'm looking for it
  • g

    gorgeous-airport-54386

    11/02/2022, 7:36 PM
    alpine will disconnect and reconnect its global observer any time it modifies the dom because of this
  • m

    miniature-lizard-24702

    11/02/2022, 7:37 PM
    ic
  • m

    miniature-lizard-24702

    11/02/2022, 7:37 PM
    but if stimulus performance is similar to alpine it's all good
  • m

    miniature-lizard-24702

    11/02/2022, 7:37 PM
    alpine is fast
  • g

    gorgeous-airport-54386

    11/02/2022, 7:39 PM
    i guess i just don't like the
    data-action="click->hello#greet"
    syntax
  • m

    miniature-lizard-24702

    11/02/2022, 7:40 PM
    neither do I tbh. Maybe it'll grow on me as I use it
  • m

    miniature-lizard-24702

    11/02/2022, 7:40 PM
    but for now I'm using alpine to move fast
  • m

    miniature-lizard-24702

    11/02/2022, 7:41 PM
    for prototyping
  • m

    miniature-lizard-24702

    11/02/2022, 7:41 PM
    and then when I have something I think works well I might try making it into a stimulus controller
  • m

    miniature-lizard-24702

    11/02/2022, 7:42 PM
    I like the idea of however these small controllers for accessibility enhancements and other things. these things can get complicated and I don't want them in the html
  • s

    salmon-church-58191

    11/03/2022, 5:17 AM
    Switching to to HTMX from React. Like that moment when a massive group of jabbering tourists get on their bus and leave me alone to enjoy a beautiful and tranquil view.
  • l

    limited-scientist-86362

    11/03/2022, 8:29 AM
    I see. But then this suggests the back-end system needs to be returning HTML based on the requests. So it is very likely the back-end system is going to be a more custom framework or are there are CMS already suited for this?
1...888889890...1146Latest