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

    mysterious-toddler-20573

    04/14/2023, 4:20 PM
    Request For Contribution: I'd like to include some documentation on integrating datatables.js w/ htmx including: - properly initializing data tables in new content received by htmx - properly de-initializing data tables before snapshotting for history - properly initializing dynamically added content within datatable itself I think this would be a good thing to have on the docs page, to show how a big, heavy, DOM-mutation happy JS library should be integrated w/ htmx
  • m

    mysterious-toddler-20573

    04/14/2023, 4:21 PM
    if anyone has experience w/ datatables and htmx, please let me know if you'd be interested in this
  • s

    salmon-xylophone-28580

    04/15/2023, 3:26 PM
    I would like to use htmx to create a terminal GUI. This means I need a tool which can render html on the terminal and supports JS. Lynx does not support JS. There are browser which connect to a real browser which render to unicode characters (eg browsh). But that's not what I was looking for. I would like to see html rendered to text (which I can copy and paste). Background: I am too lazy to use ncurses or a modern alternative. I don't need support for CSS or pictures, since there is no need to render arbitrary html. Support for tables would be great. Goal: write a modern pager like 'less', for showing and filtering structured logs (json lines).
  • b

    bitter-machine-55943

    04/15/2023, 4:03 PM
    https://github.com/textualize/textual Not HTMX or even web related but I’ve used Textual and Rich for visual CLI needs. It has a CSS-ish model applied to terminal graphics.
  • b

    bland-coat-6833

    04/15/2023, 5:29 PM
    Seconded for textual. They have a Discord server as well
  • m

    mysterious-toddler-20573

    04/15/2023, 7:23 PM
    A textual based hypermedia client + a new terminal hypermedia !
  • m

    mysterious-toddler-20573

    04/15/2023, 7:31 PM
    Hyperview for the terminal!
  • r

    red-rose-79375

    04/15/2023, 8:43 PM
    Just some loose newcomer thoughts: I am trying to wrap my head around performance if I move a lot of the usual fronted to the backend, and I found a case that occupied me a bit. A preview that converts e.g. markdown to its visual representation as the user types. This seems expensive to send back and forth and therefore JavaScript would be more ideal. And then I would already have the functionality for converting markdown to it visual representation, so it does not make sense to this on the backend in other cases. But this is not necessarily bad, just how it is…
  • o

    orange-umbrella-16693

    04/15/2023, 8:58 PM
    There are cases where moving everything to the backend is a bad idea, and whatever you are building you are eventually bound to find that case where you'll need clientside code. HTMX/Unpoly and other "hypermedia-driven frameworks" just allows you to minimise writing unnecessary clientside code.
  • o

    orange-umbrella-16693

    04/15/2023, 9:02 PM
    I personally go by a couple rules deciding what should be on the backend and what should be on the frontend: If it doesn't demand a network request, I (USUALLY) keep it clientside. If it does - if it's simple "filling in the template", I SSR it. If it's something more complex like drawing a graph or formatting text - I (try) keep it clientside
  • r

    red-rose-79375

    04/15/2023, 9:06 PM
    Thanks for commenting. Seems reasonable!
  • o

    orange-umbrella-16693

    04/15/2023, 9:08 PM
    if I recall htmx had an article for that
  • o

    orange-umbrella-16693

    04/15/2023, 9:08 PM
  • n

    numerous-agent-22346

    04/15/2023, 9:14 PM
    I've found this tweet also very useful: https://twitter.com/htmx_org/status/1646542857485049859
  • m

    miniature-lizard-24702

    04/15/2023, 10:55 PM
    Now I feel like writing one that supports htmx attributes
  • m

    miniature-lizard-24702

    04/15/2023, 10:55 PM
    I’ll have to write that one down
  • m

    miniature-lizard-24702

    04/15/2023, 10:55 PM
    It sounds like fun
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:35 AM
    why htmx? why not a server sending strings to the terminal?
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:35 AM
    uhm
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:36 AM
    hyperview for terminal.l iguess clicks better for me
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:36 AM
    so instead of clicking links I could think of you are given a set of allowed commands to allow for hateoas?
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:38 AM
    i still dont think you need the full extend of htmx or js ( i am assuming you inly want js because you wanting htmx)
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:38 AM
    what i think you need is some sort of lightweight protocol...
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:39 AM
    web server returns regular html (perhaps with some extra attributes on links)
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:40 AM
    terminal renders html (no need of js) and reads the extra attributes on links to list a series of "commands". if you send one of those commands the http call is performed
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:40 AM
    i feel like ajax doesnt make sense on terminal therefore htmx doesnt and js doesnt
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:41 AM
    a web 1.0 GET, POST redirect, full page refresh sound better
  • c

    cuddly-keyboard-70746

    04/16/2023, 1:41 AM
    but i am not well versed on terminals as browser so maybe i am way off
  • e

    eager-plumber-49649

    04/16/2023, 6:41 AM
    I use _hyperscript for client side stuff, it plays very well with htmx (obviously :)) and keeps everything readable. Some rudimentary JS can also be integrated using hx-on.
  • b

    brainy-london-27928

    04/16/2023, 6:44 AM
    Second this. But if you really want to do something with htmx, I would actually say going into the backend Route gives you more opportunities to use it. For example we have two kind of projects in our company: full scale, which include separate front and backend. And then we have the smaller projects which are just build by a backend dev using Django and it’s templating system. There, I currently introduce htmx to make them prettier. I guess where backend devs are not locked in the cellar, there is a higher chance to use it
1...109410951096...1146Latest