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

    mysterious-toddler-20573

    09/02/2022, 10:07 PM
    \> me, accepting dynamic typing
  • m

    mysterious-toddler-20573

    09/02/2022, 10:07 PM
    \> (for templates only)
  • m

    miniature-lizard-24702

    09/02/2022, 10:08 PM
    hmmm
  • m

    miniature-lizard-24702

    09/02/2022, 10:08 PM
    feels conflicted
  • m

    miniature-lizard-24702

    09/02/2022, 10:09 PM
    at least I get compile time error when my template fails
  • m

    miniature-lizard-24702

    09/02/2022, 10:09 PM
    for this template codegen I'm using
  • m

    miniature-lizard-24702

    09/02/2022, 10:10 PM
    I can't fuck up by using a type which doesn't exist
  • m

    mysterious-toddler-20573

    09/02/2022, 10:10 PM
    very true
  • m

    mysterious-toddler-20573

    09/02/2022, 10:10 PM
    I accepted it because Java doesn't have a good metaprogramming API
  • m

    mysterious-toddler-20573

    09/02/2022, 10:10 PM
    I am not broadly endorsing it
  • m

    mysterious-toddler-20573

    09/02/2022, 10:10 PM
    all sorts of garbage comes alone w/ it
  • m

    mysterious-toddler-20573

    09/02/2022, 10:11 PM
    I hope the above image communicates some ambivalence to the current situation one finds oneself in
  • m

    miniature-lizard-24702

    09/02/2022, 10:13 PM
    looks like a man who has given up and decided "to hell with it, can't beat em, join em"
  • m

    miniature-lizard-24702

    09/02/2022, 10:27 PM
    hmm. At what point does using html fragments go from simple/just wanting to avoid having to write a partial to this is getting complex and should probably be a partial
  • m

    miniature-lizard-24702

    09/02/2022, 10:28 PM
    I don't know about you but I dont like to look at a large html template
  • m

    mysterious-toddler-20573

    09/02/2022, 10:35 PM
    Definitely a matter of taste
  • m

    mysterious-toddler-20573

    09/02/2022, 10:36 PM
    what I like about fragments is that it divorces the "this file is too big, time to pull stuff out" situation from the "I want to re-render this bit of the template" situation
  • m

    mysterious-toddler-20573

    09/02/2022, 10:37 PM
    I'm personally OK w/ larger files (and, in general, classes) than most people are, as evidenced by this: https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js
  • m

    miniature-lizard-24702

    09/02/2022, 10:45 PM
    Honestly I’m impressed you can get anything done when it feels like you are in discord 24/7
  • m

    miniature-lizard-24702

    09/02/2022, 10:46 PM
    Discord is such a distraction
  • m

    mysterious-toddler-20573

    09/02/2022, 10:49 PM
    no lie, I need to stop
  • a

    ancient-shoe-86801

    09/02/2022, 11:23 PM
    I like the distinction between: - I break this on multiple files, because this "child" fragment will be reused by multiple parents - This fragment will always have the same parent (or be on its own), so let's have them together on a single file
  • c

    cold-author-74038

    09/03/2022, 1:31 AM
    @mysterious-toddler-20573 I've adopted your Template Fragments stuff in my Django app, using django-render-block as suggested. It turned out pretty nice! Here is a full description of the pattern with example Django code - please consider linking it :
  • m

    mysterious-toddler-20573

    09/03/2022, 2:55 AM
    sure, what's the link?
  • c

    cold-author-74038

    09/03/2022, 7:18 AM
    Don't know how copy-paste failed there! Here it is - https://github.com/spookylukey/django-htmx-patterns/blob/master/inline_partials.rst
  • b

    bland-coat-6833

    09/03/2022, 8:39 AM
    Thinking about templating that doesn’t have fragments, I suppose a work around would be to render the whole template and then pull out the parts you need with some standard selectors. Eg
    Copy code
    python
    return html_parser(my_template.render(context)).select(“#myFragmentID”)
  • b

    bland-coat-6833

    09/03/2022, 8:41 AM
    Assumes rendering a whole template doesn’t have side effects. Eg hitting the database for a part you won’t use.
  • m

    miniature-lizard-24702

    09/03/2022, 11:54 AM
    is there a way I can have two kinds of triggers for two different events on the same element?
  • m

    miniature-lizard-24702

    09/03/2022, 11:55 AM
    I want to send a hx-post on update event client side when Sortable has detected I changed the sort order
  • m

    miniature-lizard-24702

    09/03/2022, 11:55 AM
    and the other when I add something to the list from another list
1...811812813...1146Latest