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

    tall-dinner-62086

    07/11/2022, 2:17 PM
    I like the escaped html entities in the name
  • m

    mysterious-toddler-20573

    07/11/2022, 3:55 PM
    Lfg
  • a

    ancient-shoe-86801

    07/11/2022, 4:51 PM
    can't chameleon offer some of that? IIRC it offered an "almost 100% python" syntax for their templating (hopefully I'm not thinking of a different template engine). Unless I am misunderstanding what you mean.
  • a

    ancient-shoe-86801

    07/11/2022, 4:51 PM
    (we might have to move this discussion to #941388608290574336 )
  • m

    mysterious-toddler-20573

    07/11/2022, 6:57 PM
    still thinking hard about this
  • r

    refined-waiter-90422

    07/11/2022, 8:03 PM
    Suggestion, make this configurable. Teams who want to turn it off, can then do so, keeps backwards compatibility.
    Copy code
    html
    <script>
    htmx.config.inheritanceEnabled = false;
    </script>
  • b

    blue-ghost-19146

    07/11/2022, 8:10 PM
    That’s a good idea. It could be nice to have more granular control as well as that catch-all option, like
    htmx.config.inheritanceEnabled.swap = false
    or similar
  • r

    refined-waiter-90422

    07/11/2022, 8:12 PM
    Side benefit of config option: If we ever disable inheritance by default, reverting back to the original behaviour would be simple. Although I personally do think it's a great thing for newcomers/onboarding... keeps friction down, and its intuitive as heck....but option for teams to graduate to a more explicit mode.
  • r

    refined-waiter-90422

    07/11/2022, 8:13 PM
    Neat idea as well.
  • b

    blue-ghost-19146

    07/11/2022, 8:19 PM
    Yeah I like that. Inheritance definitely isn’t a bad thing, it’s more just how is best to keep track of it
  • b

    blue-ghost-19146

    07/11/2022, 8:21 PM
    IDE support would help with that I guess. Imagine hovering over an element and being able to see a summary of its hx- attributes
  • h

    hundreds-camera-24900

    07/11/2022, 8:28 PM
    yeah would make for a nice chrome plugin too
  • s

    steep-lamp-42308

    07/11/2022, 8:29 PM
    my 2 cents: Inheritance is for avoiding duplication, which might be nice in some situations but is not necessary. Much worse, to me, is confusion because of the added complexity, for me or for whoever has to maintain my code later. The duplication is not as big a problem with Htmx as it would be if I was writing JS, since I have other very nice ways of avoiding duplication in my favorite server-side programming language. So if I could disable inheritance, I would.
  • m

    mysterious-toddler-20573

    07/11/2022, 8:31 PM
    I am currently thinking something like this:
    Copy code
    html
    <div hx-target:inherited="this">
      ...
    </div>
  • m

    mysterious-toddler-20573

    07/11/2022, 8:31 PM
    where inheritance is explicitly declared on elements
  • m

    mysterious-toddler-20573

    07/11/2022, 8:31 PM
    rather than auto-inherited
  • m

    mysterious-toddler-20573

    07/11/2022, 8:32 PM
    still thinking
  • r

    refined-waiter-90422

    07/11/2022, 8:36 PM
    Another idea: If
    htmx.config.inherit = false;
    then you can explicitly turn on inheritance for specific properties using
    <div hx-target:inherit="this">
  • r

    refined-waiter-90422

    07/11/2022, 8:36 PM
    keeps the verbosity down until you need it.
  • r

    refined-waiter-90422

    07/11/2022, 8:38 PM
    takes care of the whole "granular control" thing @blue-ghost-19146 was talking about, without having tons of config options.
  • r

    refined-waiter-90422

    07/11/2022, 8:46 PM
    eithers good really, but would love to see inheritance stick around as the default, the feature has merit of being intuitive as heck.
  • m

    mysterious-toddler-20573

    07/11/2022, 8:47 PM
    yeah, I'm still on the fence about this
  • m

    mysterious-toddler-20573

    07/11/2022, 8:47 PM
    it's a major shift and I don't hear a ton of complaints, but the ones I do are often very loud
  • r

    refined-waiter-90422

    07/11/2022, 8:50 PM
    Yeah
  • r

    refined-waiter-90422

    07/11/2022, 8:52 PM
    At the moment there isn't any convenient way to turn it off for the entire page? just
    hx-disinherit
    on a specific element..
  • r

    refined-waiter-90422

    07/11/2022, 8:58 PM
    Could have
    <body hx-inherit="false">
    for some consistency with the
    hx-boost="false"
    API.. but I bet people really using htmx are setting a few
    htmx.config.*
    already anyway... I am.
  • r

    refined-waiter-90422

    07/11/2022, 8:59 PM
    Making it work like the boost API might be nice.
  • r

    refined-waiter-90422

    07/11/2022, 9:11 PM
    I think your idea may be less verbose for the level of granularity though.. It may be a question of which one is more valuable: A) full inheritance with explicitly turning off specific attribute inheritance. B) zero inheritance with explicit turning on specific attribute inheritance.
  • r

    refined-waiter-90422

    07/11/2022, 9:17 PM
    with this you almost get the best of both worlds. Full inheritance or B)
  • b

    blue-ghost-19146

    07/11/2022, 9:19 PM
    Yep, I like the idea of inheritance remaining by default, but able to be disabled (either similar to boost or through config). If disabled, the
    hx-target:inherited=“this”
    example would work nicely to give granular, explicit control over inheritance
1...741742743...1146Latest