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

    echoing-dress-67727

    02/21/2023, 7:50 PM
    Really, this is the only change we need for ESM support
  • e

    echoing-dress-67727

    02/21/2023, 7:52 PM
    My understanding (I'm also new to this stuff, not an expert) is that this is UMD (universal module... something), which is basically a little wrapper that sets things up for three module: ESM (ES6 browsers), AMD (outdated, nobody uses it), and globals (most everyone here uses it). CommonJS support comes through ESM I think.
  • e

    echoing-dress-67727

    02/21/2023, 7:54 PM
    But for modern browsers, which most devs are aiming for these days, ES6 is perfect. So my PR creates a separate file
    htmx.esm.js
    which has things in the cleaner ESM syntax of
    export default ...
  • e

    echoing-dress-67727

    02/21/2023, 7:54 PM
    So the dev can choose: use UMD via
    htmx.js
    or use ESM via
    htmx.esm.js
  • e

    echoing-dress-67727

    02/21/2023, 7:54 PM
    And for each of those, on production you can use
    htmx.min.js
    or
    htmx.esm.min.js
  • m

    mysterious-toddler-20573

    02/21/2023, 7:59 PM
    OK, I vote for the 1.x branch, if you are willing, we just make this change
  • m

    mysterious-toddler-20573

    02/21/2023, 8:00 PM
    for 2.0 I nominate @echoing-dress-67727 and @mysterious-car-3675 as chairs of the "which build tool do we use, if any" committee
  • e

    echoing-dress-67727

    02/21/2023, 8:00 PM
    haha
  • m

    mysterious-toddler-20573

    02/21/2023, 8:00 PM
    i also will say: I am a single-file extremist in the case of htmx
  • m

    mysterious-toddler-20573

    02/21/2023, 8:02 PM
    once SSE and Web Sockets are out of the core, the only thing that looks logically separable to me is history, and that's not big enough to justify the cost of not being able to just grab the .js file from github or wherever and dump to a file and it just works
  • e

    echoing-dress-67727

    02/21/2023, 8:02 PM
    I'll make a new PR
  • m

    mysterious-toddler-20573

    02/21/2023, 8:02 PM
    regarding the API, the test coverage is terrible because it was an afterthought, I need to do work on that 😑
  • e

    echoing-dress-67727

    02/21/2023, 8:05 PM
    Just to provide a counter-point: no offense, but you're the main maintainer of htmx. Of course it's straightforward to you. But from a newcomer's perspective, I was interested in troubleshooting and debugging htmx, and it was pretty tricky to figure out what was going on and why
  • m

    mysterious-toddler-20573

    02/21/2023, 8:06 PM
    fair
  • m

    mysterious-toddler-20573

    02/21/2023, 8:06 PM
    htmx 2.0 will be perfect
  • m

    mysterious-toddler-20573

    02/21/2023, 8:06 PM
    with many comments
  • m

    mysterious-toddler-20573

    02/21/2023, 8:06 PM
    😑
  • m

    mysterious-toddler-20573

    02/21/2023, 8:07 PM
    my javascript style is idiosyncratic, for sure
  • m

    mysterious-toddler-20573

    02/21/2023, 8:07 PM
    (I am told that java developers understand it)
  • m

    mysterious-car-3675

    02/21/2023, 8:08 PM
    you see how that's a problem? right? right?
  • e

    echoing-dress-67727

    02/21/2023, 8:08 PM
    For example, I would say
    handleAjaxResponse
    is the real golden code of HTMX that makes it what it is. It's 200 lines and does all of these things: - handles HX-* headers, - Handles the special 286 response code - Triggers a variety of events - Checks for other status codes - Handles swapping, including DOM manipulation - More.
  • e

    echoing-dress-67727

    02/21/2023, 8:08 PM
    IMHO, that should be at least 6 different functions, each with their own responsibility
  • e

    echoing-dress-67727

    02/21/2023, 8:09 PM
    Impossible 😛 Perfect code doesn't exist
  • m

    mysterious-car-3675

    02/21/2023, 8:10 PM
    i mean it just depends... sqlite is famous for not taking PRs and its just dicussions and requests and they decide. That model has been wonderful for them. If that's what you are going for then the current way is totally fine. The bus factor is pretty bad though
  • e

    echoing-dress-67727

    02/21/2023, 8:10 PM
    Very true
  • m

    mysterious-toddler-20573

    02/21/2023, 8:12 PM
    i am sorry to report that I learned how to program by reading this
  • m

    mysterious-toddler-20573

    02/21/2023, 8:12 PM
    this situation is, indeed, dire
  • m

    mysterious-car-3675

    02/21/2023, 8:13 PM
    press X to doubt, you programmed before eckel
  • m

    mysterious-toddler-20573

    02/21/2023, 8:13 PM
    🙂 I mean I learned how to program-program
  • m

    mysterious-car-3675

    02/21/2023, 8:14 PM
    I too read that out of a trailer turned library in WY, its a decent book but you are better than that
1...103210331034...1146Latest