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

    gorgeous-airport-54386

    02/24/2023, 9:38 AM
    for oob, instead of putting disparate elements directly in the root of a fragment, we could have people wrap them in elements so they don't influence each other parsing wise
  • b

    busy-tomato-43957

    02/24/2023, 9:41 AM
    I see. what if you wrapped whatever the response was with template tags in htmx.js? like
    "<template>" + (http.response.content) + "</template>"
    ? would that run into the same problems?
  • g

    gorgeous-airport-54386

    02/24/2023, 9:43 AM
    that wouldn't do much for multiple oob swaps. for a single fragment, this is the way we do it:
    Copy code
    js
    const tmpl = document.createElement("template");
    tmpl.innerHTML = http.response.content;
    return tmpl.content;
  • b

    busy-tomato-43957

    02/24/2023, 9:44 AM
    oh so you already use template tags like that
  • b

    busy-tomato-43957

    02/24/2023, 9:47 AM
    yes https://github.com/bigskysoftware/htmx/blob/master/dist/htmx.js#L268-L272
  • b

    busy-tomato-43957

    02/24/2023, 10:20 AM
    so how is this design still deficient?
  • o

    orange-umbrella-16693

    02/24/2023, 11:54 AM
    It doesn't always play well with table elements, especially with oob swaps
  • o

    orange-umbrella-16693

    02/24/2023, 11:56 AM
    It's better but still broken sometimes because of how the html parser works
  • o

    orange-umbrella-16693

    02/24/2023, 11:56 AM
    And there is no good solution for it besides hacks and writing your own parser in js (from what I've seen)
  • f

    freezing-waitress-26396

    02/24/2023, 12:56 PM
    Why would you have a div above a td
  • f

    freezing-waitress-26396

    02/24/2023, 12:56 PM
    Just asking, maybe I am missing something
  • l

    late-king-98305

    02/24/2023, 1:17 PM
    I am surprised that there isn't some sort of rolled-up, all-in-one install for it. I have to use the manual unzip on my work computer, and there's the EXE and a few DLLs, then you wait while it basically builds its
    node_modules
    directory underneath. And, while I don't see all the little files getting installs, the snap install on this Linux machine also has it. (FTR: This is a statement neither pro or against that; just observations and surprise.)
  • l

    late-king-98305

    02/24/2023, 1:18 PM
    I used JetBrains stuff via an open-source license, but had a really busy time at my day job for a few months before renewal time, and they rejected my renewal because I wasn't active enough. :/
  • g

    gorgeous-airport-54386

    02/24/2023, 1:19 PM
    vscodium is pretty usable if you don't need the container tools
  • l

    late-king-98305

    02/24/2023, 1:45 PM
    Re: oob swaps - I've built several apps with htmx at this point, and I briefly considered it for menus, so I could get the active page highlighted. In reality, just expanding the payload to include the item was much easier, and was still crazy-fast. I realize with keeping focus, etc., this isn't always possible; just don't dismiss this as an option without considering it (or trying it). "Don't use tables for layout." This is sound advice; "`div` soup" has its own drawbacks, but it does bring one benefit - consistency. There are no surprises about padding, margin, borders, shading, etc. because they're using the same model as the rest of the page. "`div` soup" isn't the only option, though. I've found that learning flexbox, and the time I've put in so far learning CSS grid (nowhere near expert, but approaching proficient), has paid dividends. The fact that it plays nicely with htmx is a side benefit. One other thing - the leaner your HTML, the less of a size difference it is compared with a JSON payload a SPA would use to render the same thing. It's simplified, smaller, and easier to remember 2 years from now when you come back to it to make some changes.
  • l

    late-king-98305

    02/24/2023, 1:45 PM
    This has been this week's episode of "Philosophy Friday"
  • s

    sparse-musician-64201

    02/24/2023, 1:59 PM
    ya, don't use tables for layout, but imo: "Do use the semantically relevant HTML elements when you can", a lot of times when devs reach for a div they really should use another element.
  • s

    sparse-musician-64201

    02/24/2023, 1:59 PM
    All frotnend devs should real through a full list of html elements eveyr few years, if I had my way anyway.
  • f

    freezing-waitress-26396

    02/24/2023, 2:04 PM
    don't use tables for layout except if you're making emails 😂
  • m

    mysterious-car-3675

    02/24/2023, 2:11 PM
    Sounds like you are on Windows...
    winget install vscode
    in cmd or powershell IIRC.
  • l

    late-king-98305

    02/24/2023, 2:13 PM
    On a US Air Force controlled computer over AFNET?
  • m

    mysterious-toddler-20573

    02/24/2023, 2:13 PM
    🥲
  • m

    mysterious-car-3675

    02/24/2023, 2:14 PM
    afnet does have some proxies for well known vendors, what base are you stationed at?
  • l

    late-king-98305

    02/24/2023, 2:20 PM
    I contract remote, usually connect via Langley or Lackland. We have licenses for VS Professional 2017, but that just doesn't get the job done for some things. When I was working on a Java 6 EE app (yeah), their instructions were on how to start a version of Eclipse that I used on an assignment I left in 2013... I was like "yeah, I think I can do better than that." The local install in a subdirectory of
    Documents
    has worked well (along with git, SQL Developer, various iterations of Node, etc.). 🙂 I'll have to try that - can you control where that gets installed? If I "install-install" something, it would get flagged; an unzipped
    .zip
    doesn't trip that wire.
  • m

    mysterious-car-3675

    02/24/2023, 2:20 PM
    There is a regular exe installer it the release section too IIRC
  • l

    late-king-98305

    02/24/2023, 2:21 PM
    I can download the VSCode ZIP file over AFNET.
  • m

    mysterious-car-3675

    02/24/2023, 2:22 PM
    https://code.visualstudio.com/docs/?dv=win64user that's the exe version
  • l

    late-king-98305

    02/24/2023, 2:23 PM
    We're on a path that may take us to commercial access vs. day-to-day on AFNET; at that point, we'll be able to install what we want, and have the output vetted, instead of our current every-step-is-vetted-like-its-production model. :/
  • m

    mysterious-car-3675

    02/24/2023, 2:24 PM
    Hopefully you aren't dealing with scif trailers. I've done quite a bit in the afrl space and they are trying to modernize.... Slowly
  • m

    mysterious-car-3675

    02/24/2023, 2:24 PM
    Specially in the mdo context
1...104310441045...1146Latest