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

    miniature-window-68019

    03/22/2023, 6:33 PM
    Isn't this kinda just svelte
  • m

    miniature-window-68019

    03/22/2023, 6:33 PM
    but like, coffeescriptified
  • s

    some-airline-73512

    03/22/2023, 6:58 PM
    Seems like it
  • r

    refined-waiter-90422

    03/22/2023, 7:00 PM
    Yeah I remember when this came on HN. Looks nice on the surface, but was turned off by all the compile steps + DSL's everywhere
  • r

    refined-waiter-90422

    03/22/2023, 7:02 PM
    htmx could really use a tailwind, that just isn't as super thicc as tailwind. Same design philosophy as htmx, just a bunch of Locality of Behavior atomic blocks you can chain together to build shit.
  • r

    refined-waiter-90422

    03/22/2023, 7:03 PM
    Single file, etc.
  • r

    refined-waiter-90422

    03/22/2023, 7:47 PM
    2 tix left until jquery 4.
  • r

    refined-waiter-90422

    03/22/2023, 7:49 PM
    3 -> 4 is a code removal release. replacing internals with standard
    querySelectorAll()
    etc.
  • r

    refined-waiter-90422

    03/22/2023, 7:52 PM
    Still, gonna be great to just use htmx for everything in some projects with the new
    hx-on
  • g

    gorgeous-airport-54386

    03/22/2023, 7:53 PM
    thought: if we require an
    hx-on
    attribute for using event listeners, we don't need to require
    hx-
    before the actual event listeners
  • r

    refined-waiter-90422

    03/22/2023, 7:54 PM
    oooo, good point.
  • g

    gorgeous-airport-54386

    03/22/2023, 7:54 PM
    Copy code
    html
    <button hx-on onmycustomevent="doStuff()" on-htmx:before-request="doOtherStuff()">
  • g

    gorgeous-airport-54386

    03/22/2023, 7:54 PM
    just parse
    on
    attributes normally, with an optional
    -
    or
    :
    after the
    on
  • r

    refined-waiter-90422

    03/22/2023, 7:55 PM
    Copy code
    html
    <div hx-on on-click="..." />
    More minimum example for people following.
  • r

    refined-waiter-90422

    03/22/2023, 7:56 PM
    Yeah, I agree! Nice.
  • g

    gorgeous-airport-54386

    03/22/2023, 7:56 PM
    we might need to avoid parsing the built-in event attributes
  • m

    miniature-window-68019

    03/22/2023, 7:58 PM
    Isn't this what you get by putting your templates in different files? I guess you don't get the backend behavior...
  • m

    miniature-window-68019

    03/22/2023, 7:59 PM
    You can always just write your templates next to the corresponding backend function,
  • o

    orange-umbrella-16693

    03/22/2023, 7:59 PM
    how can you de-thicc something that is based entirely on being bloat
  • r

    refined-waiter-90422

    03/22/2023, 8:01 PM
    the original concept of bite sized styles came way before tailwind, it just fell out of fashion, came back into fashion.
  • r

    refined-waiter-90422

    03/22/2023, 8:03 PM
    it used to fall apart quickly because some browsers had horrible consistency with others.. but with modern standards, makes sense again.
  • s

    some-airline-73512

    03/22/2023, 8:12 PM
    Agree. So going back to building with boring tools
  • o

    orange-umbrella-16693

    03/22/2023, 8:16 PM
    I still don't get what you're proposing.
  • b

    broad-pencil-64390

    03/22/2023, 9:37 PM
    Copy code
    <div hx-get="/some/view" hx-params="*" hx-trigger="load">
      <div hx-get="/another/view" hx-params="*" hx-trigger="click">
        <input name="foo" value="bar" />
      </div
    </div>
    Is it expected that the outer div doesn't include
    ?foo=bar
    when triggered even though specifying
    hx-params="*"
    , if yes is it because nesting
    hx-get
    will make the inner div "shadow" the outer one?
  • b

    broad-pencil-64390

    03/22/2023, 9:43 PM
    (I could work around this using
    hx-include
    so mostly just curious)
  • l

    limited-teacher-83117

    03/23/2023, 4:32 AM
    I always thought the
    hx
    syntax was just for the naming convention, but semantically this is my favorite version of the
    hx-on
    proposal (valueless "listen" attribute, named attributes for each event)
  • h

    high-holiday-5113

    03/23/2023, 5:18 AM
    - with
    hx-
    prefix it's easier to add / remove a single attribute, no risk to forget about necessity of handling
    hx-on
    - multiple
    hx-
    attributes is nicely sorted by an editor, so you see everything related to logic close together - it feels similar to flat vs nested structure
  • t

    tall-sundown-41732

    03/23/2023, 9:54 AM
    I got it to work 🥲 Thanks for your help!
  • r

    refined-waiter-90422

    03/23/2023, 1:00 PM
    Completely agreed, but unfortunately, as discussed fairly extensively in #1079191774976802867 ...
    hx-on
    is required to prevent re-scanning the entire DOM when setting up event listeners because
    querySelectorAll()
    does not have the ability to use wildcards for attribute names, only attribute values.
  • r

    ripe-action-67367

    03/23/2023, 1:23 PM
    I think that we should have
    hx-on
    +
    hx-on-[event]
    to highlight that these attribute are implemented by htmx. Just having `on:`/`on-`/`on` prefix without
    hx-
    may lead to conflicts. Also, I'm not a fan of ambiguity with optional
    :-
    separators.
1...107710781079...1146Latest