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

    tall-dinner-62086

    02/21/2023, 1:34 PM
    Are you using that with vite? I was having trouble yesterday getting hyperscript to load with it
  • s

    stocky-dentist-80693

    02/21/2023, 1:35 PM
    No, previously webpack but now with esbuild.
  • t

    tall-dinner-62086

    02/21/2023, 1:35 PM
    Ah. Gonna have to dive into it further tomorrow then
  • s

    stocky-dentist-80693

    02/21/2023, 1:41 PM
    @ me if you get stuck and I'll share my file.
  • t

    tall-dinner-62086

    02/21/2023, 1:42 PM
    I described my issue here but didn't have a ton of time to dig much into it https://discord.com/channels/725789699527933952/796428329531605032/1077280505705275402
  • s

    stocky-dentist-80693

    02/21/2023, 1:44 PM
    I've replied with a thread 👍
  • t

    tall-dinner-62086

    02/21/2023, 1:45 PM
    Thanks. Might just be a quirk of the vite dev server. I'll definitely have time to look into it tomorrow.
  • m

    mysterious-car-3675

    02/21/2023, 2:20 PM
    dev serve / better tests (vitest) / ability to dev/build in typescript easily. You want better testing imo static eval in TS means you write better and less JS. All I'm saying is the tooling has gotten being solid. Just don't want to see it get thrown out with the bath water of SPAs.
  • m

    mysterious-toddler-20573

    02/21/2023, 2:28 PM
    \> mfw looking at javascript build tools & packaging
  • m

    mysterious-car-3675

    02/21/2023, 2:32 PM
    Me like vite cause it make build happen, webpack too fragile for grug club. Me say run dev, it run. Me say build all types of build, it do. Me test, me test fast.
  • w

    white-rocket-20067

    02/21/2023, 2:44 PM
    Since we don't have a #perl-htmx (yet?) I thought I'd share my solution for template fragments when using Mojolicious here. https://blog.htbaa.com/programming/template-fragments-with-mojolicious
  • m

    mysterious-toddler-20573

    02/21/2023, 2:47 PM
    👑 u are now king of #1077602409313996810
  • m

    mysterious-toddler-20573

    02/21/2023, 2:49 PM
    but i don't WANT to learn a new javascript built system
  • s

    some-airline-73512

    02/21/2023, 2:51 PM
    I don't need anything of that. No problems being solved with that
  • m

    mysterious-car-3675

    02/21/2023, 2:56 PM
    well then stay exactly where you are. htmx is not a huge project and is serviceable as is, but it can be better. as on outsider it feels like the "we don't need generics in Go" stuff that I was hearing for years. It's all just tools... but webpack vs vite is apples vs bricks is what you get. If you've used both and don't see the value, cool. But if its bad cause its newer than webpack... i don't know man.
  • m

    mysterious-car-3675

    02/21/2023, 2:58 PM
    honestly @mysterious-toddler-20573 if its something you'd actually want I'd be happy to take a stab at a vite/ts PR. but its really only if you want it or see issues with your current workflow and handling PRs
  • r

    refined-waiter-90422

    02/21/2023, 3:04 PM
    build system + typescript PR's come in fairly often. feature contributions are great but I can't help but feel this sort of meta-contribution becomes a dumping ground for "personal learning" at everyone elses expense. tons of fluff.
  • r

    refined-waiter-90422

    02/21/2023, 3:10 PM
    if there was a solid benefit to tech debt ratio, it would already be in htmx because it doesn't take long to add types and fiddle with whitespace.
  • m

    mysterious-car-3675

    02/21/2023, 3:20 PM
    i totally get that. I guess the benefits in my mind are 1. Enforced API, right you use are using @param to document instead of static analysis. Means a lot of assumptions have to be made if you are new to the codebase. If you want to limit outside dev then this is mostly a no-issue but you are keeping certain info out of the actual code and that's bad. 2. Built in dev server. A fast way to say, "want to run your self?
    pnpm i  && pnpm dev
    done and up in milliseconds. 3. Tests. Right now htmx is low on test and if it works who cares. But if you want more extensions know you integrated correctly has major benefit. 4. It just works, compared to webpack its so much simpler. Plus you have very easy dev mode with server and library mode to output UMD/ESM/CJS etc with sourcemaps, .d.ts in all the combinations. Again if the team is tight the don't consider, if you are moving to plugin/extension model its a logical progression. I think the real problem is its a sea change. Either you do it or you don't. For me its not really a tech debt but a let the tools do the work it's good at. I generally see vite+ts make projects smaller and simplier, not more complicated. I deal in legacy DoD world so see some pretty crazy browserify/grunt/gulp/webpack stuff.
  • r

    ripe-action-67367

    02/21/2023, 3:30 PM
    My humble opinion - unless htmx switches to TS, I don't personally see much value in a bundler.
    npm run dev
    is neat, but with htmx as it is you can just include it on the page in a script tag and it will work. Now, whether htmx should switch to TS is a very different question. I am, personally, not opposed to this change, as there were bugs that could be caught by the type checker, but there are many opinions in this regard. Respectfully, I disagree with point 3. htmx has quite extensive test suite, and I'm not sure what do you mean by "low on test".
  • m

    mysterious-car-3675

    02/21/2023, 3:32 PM
    lol, i was looking at src/htmx.test.ts
  • r

    ripe-action-67367

    02/21/2023, 3:32 PM
    I certainly don't see TS happening in 1.0, but 2.0? I think it's not off the table yet
  • e

    enough-petabyte-50314

    02/21/2023, 3:32 PM
    vite+ts is simpler than crazy browserify/grunt/gulp/webpack stuff... but that doesn't mean it will simplify this project
  • e

    enough-petabyte-50314

    02/21/2023, 3:33 PM
    i.e. it doesn't get much simpler than
    Copy code
    "dist": "cp -r src/* dist/ && npm run-script uglify && gzip -9 -k -f dist/htmx.min.js > dist/htmx.min.js.gz && exit",
  • m

    mysterious-car-3675

    02/21/2023, 3:35 PM
    Yes, I agree its a 2.0 thing. @enough-petabyte-50314 not sure what you mean. I'm fairly confident it will simplify dev of htmx and creating extensions. Feel like that's focusing on the simplest part. dev with ts + HMR + vitest is just a different level of productivity for working on features/bugs
  • m

    mysterious-car-3675

    02/21/2023, 3:36 PM
    @ripe-action-67367 I revise 3. Your right there are test, and that wouldn't change much other than having them auto run as you dev becomes very easy and fast
  • m

    mysterious-car-3675

    02/21/2023, 3:39 PM
    is there a 2.0 branch? or is it mostly talk at this point?
  • e

    enough-petabyte-50314

    02/21/2023, 3:40 PM
    what I mean is that the PR replaces a single "dist" npm command which simply copies, uglifies, and zips files with an entire "build process"
  • r

    ripe-action-67367

    02/21/2023, 3:41 PM
    There is #1046573806547910677
  • m

    mysterious-car-3675

    02/21/2023, 3:42 PM
    well it there is a desire to move to something like vite+ts i'm happy to try but if its not wanted or seen as a nuisance then back to normal usage as is.
1...102710281029...1146Latest